Meta
Use Meta Llama models with Kern agents.
Meta offers a suite of powerful multi-modal language models known for their strong performance across a wide range of tasks, including superior text understanding and visual intelligence.
We recommend experimenting to find the best-suited model for your use-case. Here are some general recommendations:
Llama-4-Scout-17B: Excellent performance for most general tasks, including multi-modal scenarios.Llama-3.3-70B: Powerful instruction-following model for complex reasoning tasks.
Explore all the models here.
Authentication
Set your LLAMA_API_KEY environment variable:
bash Mac export LLAMA_API_KEY=YOUR_API_KEY bash Windows setx LLAMA_API_KEY YOUR_API_KEY
Example
Use Llama with your Agent:
1from kern.agent import Agent2from kern.models.meta import Llama34agent = Agent(5 model=Llama(id="Llama-4-Maverick-17B-128E-Instruct-FP8"),6 markdown=True7)89agent.print_response("Share a 2 sentence horror story.")Note View more examples here.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
id | str | "meta-llama/Meta-Llama-3.1-405B-Instruct" | The id of the Meta model to use |
name | str | "MetaLlama" | The name of the model |
provider | str | "Meta" | The provider of the model |
api_key | Optional[str] | None | The API key for Meta (defaults to META_API_KEY env var) |
base_url | str | "https://api.llama-api.com" | The base URL for the Meta API |
OpenAI-like Parameters
LlamaOpenAI supports all parameters from OpenAI Like.
Resources