In Opik 2.0, datasets and experiments are project-scoped. Make sure to specify a project_name when creating datasets and running experiments so they are associated with the correct project.
The Opik Agent Optimizer uses LiteLLM under the hood, giving you access to 100+ LLM providers with a unified interface. This guide shows you how to configure different providers for both your ChatPrompt (the model that runs your prompt) and the Optimizer (the model that improves your prompt).
When using the Opik Optimizer, there are two distinct models to configure:
All models use the LiteLLM format: provider/model-name
Environment Variable:
Available Models:
openai/gpt-4o - Most capable modelopenai/gpt-4o-mini - Fast and cost-effectiveopenai/gpt-4-turbo - Previous generationopenai/o1 - Reasoning modelopenai/o3-mini - Efficient reasoning modelExample:
You can pass additional parameters to control model behavior:
You can use different providers for the ChatPrompt and Optimizer:
Recommendation: Use a capable model like gpt-4o or claude-3-5-sonnet for the optimizer, even if your production application uses a smaller model. The optimizer only runs during development, so the cost is minimal compared to the quality improvements you’ll achieve.
Ensure your API key is correctly set in the environment:
Verify the model name follows the LiteLLM format provider/model-name:
If you encounter rate limits, try:
n_threads in the optimizerFor a complete list of supported providers and models, see the LiteLLM documentation.