Meta

Configure Llama, Agno's model class for Meta's Llama API.

The Meta model provides access to Meta's language models.

Parameters

ParameterTypeDefaultDescription
idstr"Llama-4-Maverick-17B-128E-Instruct-FP8"The id of the Llama model to use
namestr"Llama"The name of the model
providerstr"Llama"The provider of the model
max_completion_tokensOptional[int]NoneMaximum number of tokens to generate
repetition_penaltyOptional[float]NonePenalty for repeating tokens (higher values reduce repetition)
temperatureOptional[float]NoneControls randomness in the model's output
top_pOptional[float]NoneControls diversity via nucleus sampling
top_kOptional[int]NoneControls diversity via top-k sampling
extra_headersOptional[Any]NoneAdditional headers for the request
extra_queryOptional[Any]NoneAdditional query parameters for the request
extra_bodyOptional[Any]NoneAdditional body fields for the request
request_paramsOptional[Dict[str, Any]]NoneCurrently adds an unsupported nested request_params keyword to the SDK call. Leave None; use declared fields or extra_body for supported additional JSON.
api_keyOptional[str]NoneThe API key for the Llama API (defaults to LLAMA_API_KEY env var)
base_urlOptional[Union[str, httpx.URL]]NoneThe base URL for the Llama API
timeoutOptional[float]NoneRequest timeout in seconds
max_retriesOptional[int]NoneMaximum number of client retries for failed requests
default_headersOptional[Any]NoneDefault headers for client requests
default_queryOptional[Any]NoneDefault query parameters for client requests
http_clientOptional[Union[httpx.Client, httpx.AsyncClient]]NoneCustom HTTP client for requests
client_paramsOptional[Dict[str, Any]]NoneAdditional parameters for client configuration
clientOptional[LlamaAPIClient]NonePre-configured Llama API client
async_clientOptional[AsyncLlamaAPIClient]NonePre-configured async Llama API client
model_typeModelTypeModelType.MODELFunctional role of this model (e.g. MODEL, OUTPUT_MODEL, PARSER_MODEL). Set by the agent
supports_native_structured_outputsboolFalseWhether the model supports structured outputs natively
supports_json_schema_outputsboolTrueWhether the model uses JSON schema for structured outputs
system_promptOptional[str]NoneSystem prompt from the model added to the agent
instructionsOptional[List[str]]NoneInstructions from the model added to the agent
tool_message_rolestr"tool"Role of tool messages
assistant_message_rolestr"assistant"Role of assistant messages
cache_responseboolFalseCache model responses to avoid redundant API calls during development
cache_ttlOptional[int]NoneTime-to-live for cached responses, in seconds
cache_dirOptional[str]NoneDirectory for the response cache. Defaults to ~/.agno/cache/model_responses
retriesint0Number of retries to attempt before raising a ModelProviderError
delay_between_retriesint1Delay between retries, in seconds
exponential_backoffboolFalseIf True, the delay between retries is doubled each time
retry_with_guidanceboolTrueRetry a failed model invocation once with a guidance message appended
retry_with_guidance_limitint1Number of times to retry the model invocation with guidance
This limitation affects the current Llama API client. A nonempty request_params mapping is both merged and forwarded under its own name, so it fails before a request is sent.