Skip to main content

Introduction

Agno provides a convenient string syntax for specifying models using the provider:model_id format. This approach reduces code verbosity by eliminating the need to import model classes while maintaining full functionality. Both the traditional object syntax and the string syntax are equally valid and work identically. Choose the approach that best fits your coding style and requirements.

Format

The string format follows this pattern:
"provider:model_id"
  • provider: The model provider name (case-insensitive)
  • model_id: The specific model identifier
Examples:
  • "openai:gpt-4o"
  • "anthropic:claude-sonnet-4-20250514"
  • "google:gemini-2.0-flash-exp"
  • "groq:llama-3.3-70b-versatile"

Basic Usage

Agent with String Syntax

from agno.agent import Agent

agent = Agent(
    model="openai:gpt-4o",
    instructions="You are a helpful assistant.",
    markdown=True,
)

agent.print_response("Share a 2 sentence horror story.")

Teams with String Syntax

Use model strings with Teams for coordinated multi-agent workflows:
from agno.agent import Agent
from agno.team import Team
from agno.tools.duckduckgo import DuckDuckGoTools

web_agent = Agent(
    name="Web Agent",
    role="Search the web for information",
    model="openai:gpt-4o",
    tools=[DuckDuckGoTools()],
)

finance_agent = Agent(
    name="Finance Agent",
    role="Analyze financial data",
    model="openai:gpt-4o-mini",
)

agent_team = Team(
    members=[web_agent, finance_agent],
    model="openai:gpt-4o",
    instructions="Coordinate research and provide comprehensive reports.",
)

agent_team.print_response("Research Tesla's latest developments")

Multiple Model Types

Agents support different models for various purposes:
from agno.agent import Agent

agent = Agent(
    # Main model for general responses
    model="openai:gpt-4o",
    # Reasoning model for complex thinking
    reasoning_model="anthropic:claude-sonnet-4-20250514",
    # Parser model for structured outputs
    parser_model="openai:gpt-4o-mini",
    # Output model for final formatting
    output_model="openai:gpt-4o",
)
T## Common Providers
ProviderString FormatExample
OpenAIopenai:model_id"openai:gpt-4o"
Anthropicanthropic:model_id"anthropic:claude-sonnet-4-20250514"
Googlegoogle:model_id"google:gemini-2.0-flash-exp"
Groqgroq:model_id"groq:llama-3.3-70b-versatile"
Ollamaollama:model_id"ollama:llama3.2"
Azure AI Foundryazure-ai-foundry:model_id"azure-ai-foundry:gpt-4o"
Mistralmistral:model_id"mistral:mistral-large-latest"
LiteLLMlitellm:model_id"litellm:gpt-4o"
OpenRouteropenrouter:model_id"openrouter:anthropic/claude-3.5-sonnet"
Togethertogether:model_id"together:meta-llama/Llama-3-70b-chat-hf"
For the complete list and provider-specific documentation, see the Models Overview.