Meta
Use Meta Llama models with Agno agents.
Use the native Llama adapter to call Meta's Llama API.
These examples require access to the Meta Llama API, an API key, and the chosen model enabled for your account. Check the model catalog while signed in, and replace the example ID if your account offers a different compatible model. Installing llama-api-client alone does not grant API access.
Installation
uv pip install -U llama-api-client agnoAuthentication
Set your LLAMA_API_KEY environment variable:
export LLAMA_API_KEY="YOUR_API_KEY"Example
Use Llama with your Agent:
from agno.agent import Agent
from agno.models.meta import Llama
agent = Agent(
model=Llama(id="Llama-4-Maverick-17B-128E-Instruct-FP8"),
markdown=True
)
agent.print_response("Share a 2 sentence horror story.")
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
id | str | "Llama-4-Maverick-17B-128E-Instruct-FP8" | The id of the Meta model to use |
name | str | "Llama" | The name of the model |
provider | str | "Llama" | The provider of the model |
api_key | Optional[str] | None | The API key for the Llama API (defaults to LLAMA_API_KEY env var) |
base_url | Optional[Union[str, httpx.URL]] | None | The base URL for the Llama API (defaults to the Llama SDK default) |
OpenAI-compatible adapter
LlamaOpenAI targets https://api.llama.com/compat/v1/ through the openai package and inherits OpenAI Like parameters.
The current Agno implementation has a message-formatting signature mismatch in LlamaOpenAI: runs fail locally before an HTTP request is sent. Use the native Llama adapter shown above until that framework issue is fixed.