The Default Model
By default, Marvin uses OpenAI’s GPT-4o model. To use this default configuration, you only need to set your OpenAI API key:Configuring Models
Using String Identifiers
The simplest way to specify a model is with a string identifier in the formatprovider:model_name
:
Model Settings
You can customize model behavior using themodel_settings
parameter when creating an agent:
Changing the Default Model
You can change the default model for all agents in your application:Environment Variables
You can also configure the default model and other settings using environment variables:Model Providers
Marvin supports any model provider that is compatible with Pydantic AI. Common providers include:- OpenAI
- Anthropic
- Azure OpenAI
Passing Configuration to Models
For more control, you may passpydantic-ai
models when creating an agent.
For example, to use Anthropic’s Claude 3.5 Sonnet model with a custom httpx
client: