Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions opik/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Opik Examples
This folder has been deprecated and is no longer maintained. Please instead use [opik-examples](https://github.com/comet-ml/opik-examples/tree/main).
86 changes: 1 addition & 85 deletions opik/otel_with_offline_eval_example/README.md
Original file line number Diff line number Diff line change
@@ -1,87 +1,3 @@
# OTel Tracing + Opik Offline Evaluation

Demonstrates how to use OpenTelemetry for application tracing **alongside**
Opik's offline evaluation workflow. These are complementary tools, not alternatives.

## Architecture

```
┌─────────────────────────────────────┐ ┌───────────────────────────────────────┐
│ llm_app.py │ │ evaluate.py │
│ (your application code) │ │ (offline evaluation script) │
│ │ │ │
│ - OTel for tracing │ │ - Opik Python SDK │
│ - Runs in production/dev │ │ - Runs separately (CI, scheduled) │
│ - Sends spans → Opik OTLP endpoint │ │ - Imports answer_question() from app │
│ │ │ - Runs task against a dataset │
│ │ │ - Creates an Experiment in Opik │
└─────────────────────────────────────┘ └───────────────────────────────────────┘
│ │
└──────────────────────┬───────────────────────┘
┌─────────────────────┐
│ Opik │
│ │
│ Traces (from OTel) │
│ Experiments (from │
│ evaluate()) │
└─────────────────────┘
```

## Key Insight

| | OTel tracing | `opik.evaluate()` |
|---|---|---|
| Purpose | Observe your app in real-time | Test quality offline against a dataset |
| When it runs | During application execution | In a separate evaluation script |
| What you get in Opik | Traces / Spans | Experiments with scored results |
| SDK | OTel SDK | Opik Python SDK (`pip install opik`) |

**There is no OTel-native way to run offline experiments.** The offline evaluation
workflow requires the Opik Python SDK because it needs to:
1. Read items from an Opik Dataset
2. Run your LLM task against each item
3. Score outputs with metrics
4. Record results as an Experiment in Opik

## Setup

```bash
pip install opentelemetry-sdk opentelemetry-exporter-otlp-proto-http opik
```

Environment variables for `llm_app.py`:
```bash
export OPIK_OTLP_ENDPOINT="https://your-opik-host/opik/api/v1/private/otel/v1/traces"
export OPIK_API_KEY="your-api-key"
export OPIK_WORKSPACE="your-workspace"
```

Environment variables for `evaluate.py`:
```bash
export OPIK_API_KEY="your-api-key"
export OPIK_WORKSPACE="your-workspace"
export OPIK_URL_OVERRIDE="https://your-opik-host/opik/api"
```

## Running

```bash
# Run your application normally (OTel tracing active)
python llm_app.py

# Run offline evaluation separately
python evaluate.py
```

## Notes for self-hosted Opik

The OTel OTLP endpoint for self-hosted Opik is:
```
https://<your-opik-host>/opik/api/v1/private/otel/v1/traces
```

The Opik SDK base URL override for self-hosted is:
```
https://<your-opik-host>/opik/api
```
This example has been moved to [opik-examples](https://github.com/comet-ml/opik-examples/tree/main/examples/otel_with_offline_eval_example).
65 changes: 0 additions & 65 deletions opik/otel_with_offline_eval_example/evaluate.py

This file was deleted.

79 changes: 0 additions & 79 deletions opik/otel_with_offline_eval_example/llm_app.py

This file was deleted.

11 changes: 0 additions & 11 deletions opik/streamlit/call-summarizer/.env.example

This file was deleted.

51 changes: 0 additions & 51 deletions opik/streamlit/call-summarizer/.gitignore

This file was deleted.

27 changes: 0 additions & 27 deletions opik/streamlit/call-summarizer/.pre-commit-config.yaml

This file was deleted.

Loading
Loading