Introduction
Agno provides a convenient string syntax for specifying models using theprovider: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: The model provider name (case-insensitive)
- model_id: The specific model identifier
"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
Teams with String Syntax
Use model strings with Teams for coordinated multi-agent workflows:Multiple Model Types
Agents support different models for various purposes:| Provider | String Format | Example |
|---|---|---|
| OpenAI | openai:model_id | "openai:gpt-4o" |
| Anthropic | anthropic:model_id | "anthropic:claude-sonnet-4-20250514" |
google:model_id | "google:gemini-2.0-flash-exp" | |
| Groq | groq:model_id | "groq:llama-3.3-70b-versatile" |
| Ollama | ollama:model_id | "ollama:llama3.2" |
| Azure AI Foundry | azure-ai-foundry:model_id | "azure-ai-foundry:gpt-4o" |
| Mistral | mistral:model_id | "mistral:mistral-large-latest" |
| LiteLLM | litellm:model_id | "litellm:gpt-4o" |
| OpenRouter | openrouter:model_id | "openrouter:anthropic/claude-3.5-sonnet" |
| Together | together:model_id | "together:meta-llama/Llama-3-70b-chat-hf" |