Model as String

Configure Agent and Team model fields with the provider:model_id shorthand.

v2.2.6
from agno.agent import Agent

agent = Agent(
    model="openai:gpt-5.4",
    instructions="Answer in two sentences.",
)

agent.print_response("Why is the sky blue?")

Agno resolves "openai:gpt-5.4" to OpenAIResponses(id="gpt-5.4") when it initializes the Agent. The string form configures the provider class and model ID without a model-class import.

Install the provider integration and set its credentials as you would for the class form. For this example:

uv pip install "agno[openai]"
export OPENAI_API_KEY="your-api-key"

Format

provider:model_id
PartBehavior
providerSelects a registered provider class. Agno trims whitespace and matches this key case-insensitively.
model_idIs passed to the selected class after surrounding whitespace is removed. Its format and capitalization are provider-specific.

Agno splits the string at the first colon, so model IDs can contain colons. For example, "ollama:llama3.1:8b" selects the Ollama class with id="llama3.1:8b".

An empty provider, empty model ID, missing colon, or unsupported provider key raises ValueError during initialization.

Agno validates the provider key, then passes the model ID to that provider class. It does not validate the ID against a model catalog. An unavailable or misspelled ID fails when the provider handles the request.

Provider Keys and API Variants

The provider key selects a specific Agno class. Similar keys can use different provider APIs and support different features.

Provider keyModel classExample
openaiOpenAIResponses"openai:gpt-5.4"
openai-responsesOpenAIResponses"openai-responses:gpt-5.4"
openai-chatOpenAIChat"openai-chat:gpt-5.4-mini"
anthropicClaude"anthropic:claude-sonnet-4-5-20250929"
googleGemini"google:gemini-3.5-flash"
google-interactionsGeminiInteractions"google-interactions:gemini-3-flash-preview"
groqGroq"groq:openai/gpt-oss-120b"
ollamaOllama"ollama:llama3.1:8b"
ollama-responsesOllamaResponses"ollama-responses:gpt-oss:20b"
azure-ai-foundryAzureAIFoundry"azure-ai-foundry:Phi-4"
mistralMistralChat"mistral:mistral-small-latest"

This table covers common providers and API variants. Use the exact provider key for the class you need, then confirm the model ID in that provider's documentation. See all model providers for setup, authentication, and the complete canonical key catalog.

Use canonical keys when a provider has multiple implementations. For example, azure:model_id resolves to AzureOpenAI; azure-ai-foundry:model_id selects AzureAIFoundry.

Agno also accepts these compatibility aliases. Prefer the canonical keys in new configuration:

Compatibility aliasCanonical key
awsbedrockaws-bedrock
azureazure-openai
azurefoundryazure-foundry-claude
cerebrasopenaicerebras-openai
inceptionlabsinception
llamameta
llamacppllama-cpp
llamaopenaillama-openai
openresponsesopen-responses
tuning enginestuning-engines
vertexaivertexai-claude
xiaomi mimoxiaomi

Model capabilities depend on the resolved class and model ID. String syntax does not make unsupported features available. See Model Compatibility.

String or Model Class

ConfigurationWhat it setsUse it when
"provider:model_id"Provider class and idClass defaults and environment-based credentials are sufficient
Model class instanceAll constructor parametersYou need generation settings, retry settings, a custom endpoint, or a custom client
from agno.agent import Agent
from agno.models.openai import OpenAIResponses

agent = Agent(
    model=OpenAIResponses(
        id="gpt-5.4",
        retries=2,
        timeout=30,
    )
)

The string form has the same behavior as constructing its resolved class with only id. Additional model constructor parameters require a class instance.

Other Model Fields

Agents and Teams accept model strings for model, reasoning_model, parser_model, and output_model:

from agno.agent import Agent

agent = Agent(
    model="openai:gpt-5.4",
    reasoning=True,
    reasoning_model="openai:gpt-5.4",
    parser_model="openai:gpt-5.4-mini",
    output_model="openai:gpt-5.4-mini",
)

Teams

from agno.agent import Agent
from agno.team import Team

researcher = Agent(
    name="Researcher",
    model="openai:gpt-5.4-mini",
)

team = Team(
    members=[researcher],
    model="openai:gpt-5.4",
)

team.print_response("Explain how sleep supports memory.")

Developer Resources