Skip to content

Commit 4def564

Browse files
feat: add multimodal online-evaluation guide
Logs multimodal (text + image) traces and creates the online LLM-as-judge rule that scores them — both in the Opik UI (step-by-step) and with the SDK (rest_client.automation_rule_evaluators). The image is supplied as an image_url content part, not a text variable; the notebook uses env-var-only credentials with a DRY_RUN fallback. Verified against a live workspace: traces log and the SDK rule round-trips. Includes a README (4 sections + Colab badge) and root/guides index entries.
1 parent 821f62c commit 4def564

6 files changed

Lines changed: 410 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Task-oriented examples for specific Opik workflows and patterns.
3333
| | Description |
3434
|---|---|
3535
| [guides/annotation_queues_with_context](guides/annotation_queues_with_context/) | Structure RAG traces for Opik annotation queues — clean answer in output, context in metadata, full detail in child spans |
36+
| [guides/multimodal_online_evaluation](guides/multimodal_online_evaluation/) | Online LLM-as-judge evaluation over multimodal (text + image) traces, created both in the UI and via the SDK |
3637
| [guides/tracing_finetuned_models](guides/tracing_finetuned_models/) | Fine-tune a model, register it to the CometML Model Registry, then fetch and trace inference in Opik |
3738

3839
## Use Cases

guides/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Task-oriented examples for doing something specific with Opik — combining Opik
55
| Guide | Description |
66
|---|---|
77
| [annotation_queues_with_context/](./annotation_queues_with_context/) | Structure RAG traces for Opik annotation queues — clean answer in output, context in metadata, full detail in child spans |
8+
| [multimodal_online_evaluation/](./multimodal_online_evaluation/) | Run an online LLM-as-judge eval over multimodal (text + image) traces — create the rule in the UI and with the SDK |
89
| [tracing_finetuned_models/](./tracing_finetuned_models/) | Fine-tune a model, register it to the CometML Model Registry, then fetch and trace inference in Opik |
910

1011
[Contribute one](../CONTRIBUTING.md).
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.venv/
2+
uv.lock
3+
.ipynb_checkpoints/
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Multimodal Online Evaluation
2+
3+
Run an online LLM-as-judge evaluation over multimodal (text + image) traces in Opik, and create the scoring rule two ways — in the UI and with the SDK.
4+
5+
## What this does
6+
7+
Logs traces that carry an image plus text, then shows how to score them with an online LLM-as-judge rule. It documents the common footguns — add image variables with the **"Images +"** button (not by hand-typing `{{image_output}}`), use a vision-capable model, and remember that score definitions are independent of variable mapping — and creates the identical rule both in the UI and programmatically with the SDK.
8+
9+
## Prerequisites
10+
11+
```bash
12+
uv sync # or: pip install "opik>=2.0.74"
13+
```
14+
15+
| Variable | Description |
16+
|---|---|
17+
| `OPIK_API_KEY` | Opik API key |
18+
| `OPIK_WORKSPACE` | Opik workspace name |
19+
| `OPIK_URL_OVERRIDE` | Optional; defaults to `https://www.comet.com/opik/api` |
20+
21+
No LLM provider key is needed here — the judge runs inside Opik's online-evaluation rule, not in this notebook. Without credentials the notebook runs in dry-run and prints the payloads instead of sending them.
22+
23+
## Running it
24+
25+
```bash
26+
uv sync
27+
uv run --with jupyter jupyter lab
28+
```
29+
30+
Then open `multimodal_online_evaluation.ipynb`.
31+
32+
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/comet-ml/opik-examples/blob/main/guides/multimodal_online_evaluation/multimodal_online_evaluation.ipynb)
33+
34+
## How it works
35+
36+
The notebook logs two multimodal traces (one image as a public URL, one as a base64 data URI), then walks through creating the online-evaluation rule. The UI path is documented step by step with a copy-paste judge prompt; the SDK path creates the same rule via `client.rest_client.automation_rule_evaluators`, with the image supplied as an `image_url` content part rather than a text variable. The final section covers running the rule and reviewing the feedback scores.

0 commit comments

Comments
 (0)