Skip to main content
When we discuss Models, we are normally referring to Large Language Models (LLMs). These models act as the brain of your Agents - enabling them to reason, act, and respond to the user. The better the model, the smarter the Agent.
from agno.agent import Agent
from agno.models.openai import OpenAIChat

agent = Agent(
    model=OpenAIChat(id="gpt-5-mini"),
    description="Share 15 minute healthy recipes.",
    markdown=True,
)
agent.print_response("Share a breakfast recipe.", stream=True)
Use model strings ("provider:model_id") for simpler configuration. For advanced use cases requiring custom parameters like temperature or max_tokens, use the full model class syntax.

Error handling

You can configure your Model to retry requests if they fail. This is useful to handle temporary failures or rate limiting errors from the model provider.
model = OpenAIChat(
  id="gpt-5-mini",
  retries=2, # Number of retries to attempt before raising a ModelProviderError
  retry_delay=1, # Delay between retries, in seconds
  exponential_backoff=True, # If True, the delay between retries is doubled each time
)
You can also configure retries, delay_between_retries, and exponential_backoff directly on your Agent or Team, to retry the full runs instead of just the Model requests.

Learn more