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 Agent
2from kern.models.meta import Llama
3
4agent = Agent(
5 model=Llama(id="Llama-4-Maverick-17B-128E-Instruct-FP8"),
6 markdown=True
7)
8
9agent.print_response("Share a 2 sentence horror story.")
Note View more examples here.

Parameters

ParameterTypeDefaultDescription
idstr"meta-llama/Meta-Llama-3.1-405B-Instruct"The id of the Meta model to use
namestr"MetaLlama"The name of the model
providerstr"Meta"The provider of the model
api_keyOptional[str]NoneThe API key for Meta (defaults to META_API_KEY env var)
base_urlstr"https://api.llama-api.com"The base URL for the Meta API

OpenAI-like Parameters

LlamaOpenAI supports all parameters from OpenAI Like.

Resources