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

PlatformLaunch
Google Colab (recommended)Open in Colab
GitHub CodespacesOpen in GitHub Codespaces
DeepnoteOpen in Deepnote

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

Installs opik, opik-optimizer, litellm, and any integration-specific extras.

Prompts for the Opik API key and any model provider tokens (OpenAI, Anthropic, etc.). Nothing is persisted outside the notebook session.

Demonstrates both client.get_or_create_dataset and uploading CSV/Parquet files stored in the repo.

Walks through defining ScoreResult metrics and composing them into MultiMetricObjective instances.

Runs MetaPrompt and Few-Shot Bayesian optimizers side-by-side so you can compare strategies.

Shows how to call result.display() and link out to the Opik dashboard run for deeper analysis.

Customize the notebook

1

Swap the dataset

Replace the provided HotPotQA subset with your own data by uploading a file or pointing to an existing Opik dataset name.

2

Change the optimizer or model

Update the optimizer class, LLM model, and model_parameters to mirror your production stack.

3

Export results

The final cells show how to save optimized prompts and metrics into JSON so you can check them into your repo.

Next steps