Quickstart notebook
Prefer running in the browser? This guide links to maintained notebooks plus the minimal steps needed to duplicate them in your workspace.
If you are looking for the general Opik tracing notebook, use the platform Quickstart notebook. The notebook on this page already includes the Agent Optimizer SDK and walks through datasets/metrics geared toward optimization.
Choose a platform
Every hosted environment still needs your Opik API key. The first notebook cell runs opik configure and stores the key only for that runtime session.
Notebook structure
1. Install dependencies
Installs opik, opik-optimizer, litellm, and any integration-specific extras.
2. Configure credentials
Prompts for the Opik API key and any model provider tokens (OpenAI, Anthropic, etc.). Nothing is persisted outside the notebook session.
3. Load datasets
Demonstrates both client.get_or_create_dataset and uploading CSV/Parquet files stored in the repo.
4. Define metrics
Walks through defining ScoreResult metrics and composing them into MultiMetricObjective instances.
5. Run optimizers
Runs MetaPrompt and Few-Shot Bayesian optimizers side-by-side so you can compare strategies.
6. Review results
Shows how to call result.display() and link out to the Opik dashboard run for deeper analysis.
Customize the notebook
Swap the dataset
Replace the provided HotPotQA subset with your own data by uploading a file or pointing to an existing Opik dataset name.
Next steps
- Need an offline, scriptable flow? Follow the Quickstart CLI guide.
- Ready to dive into dataset design? Read Define datasets.
- For integration-heavy workflows, jump to Optimize agents.