Skip to main content


This function serves two purposes in Predibase:

  • to instantiate an LLM prior to deployment OR
  • fetch an LLM deployment you've already created.
pc.LLM(uri="some Huggingface URI")

This signature allows you to pick and instantiate an open source LLM from Hugging Face by specifying the model name.

pc.LLM(uri="some Predibase deployment URI")

This method allows you to get a reference to an existing Predibase deployment. See the format of this URI on the deployment page.


uri: str

This is either a path from HuggingFace following the structure: hf://{Organization}/{Model Name} (e.g. hf://meta-llama/Llama-2-7b), or a path to a Predibase deployment (see deployment page)


If uri was a HuggingFace URI, then a a HuggingFaceLLM object that holds a reference to the specified LLM. If it was a Predibase deployment URI, then a LLMDeployment object is returned instead.

Example Usage:

Creates a reference to an LLM with the name llama-2-13b-hf.

llm = pc.LLM("hf://meta-llama/Llama-2-13b-hf")

Fetches a pre-existing deployment with the name llama-2-13b

llm = pc.LLM("pb://deployments/llama-2-13b")