Arize Experiment

Arize Experiment

Guides an agent to create, run and analyze Arize experiments with the ax CLI, comparing model performance, exporting runs and attaching evaluations.

Skill files3 files

references/

SKILL.md415 lines
1
---
2
name: arize-experiment
3
description: Creates, runs, and analyzes Arize experiments for evaluating and comparing model performance. Covers experiment CRUD, exporting runs, comparing results, and evaluation workflows using the ax CLI. Use when the user mentions create experiment, run experiment, compare models, model performance, evaluate AI, experiment results, benchmark, A/B test models, or measure accuracy.
4
metadata:
5
author: arize
6
version: "1.0"
7
compatibility: Requires the ax CLI and a configured Arize profile.
8
---
9
10
# Arize Experiment Skill
11
12
> **`SPACE`** — All `--space` flags and the `ARIZE_SPACE` env var accept a space **name** (e.g., `my-workspace`) or a base64 space **ID** (e.g., `U3BhY2U6...`). Find yours with `ax spaces list`.
13
14
## Concepts
15
16
- **Experiment** = a named evaluation run against a specific dataset version, containing one run per example
17
- **Experiment Run** = the result of processing one dataset example -- includes the model output, optional evaluations, and optional metadata
18
- **Dataset** = a versioned collection of examples; every experiment is tied to a dataset and a specific dataset version
19
- **Evaluation** = a named metric attached to a run (e.g., `correctness`, `relevance`), with optional label, score, and explanation
20
21
The typical flow: export a dataset → process each example → collect outputs and evaluations → create an experiment with the runs.
22
23
## Prerequisites
24
25
Proceed directly with the task — run the `ax` command you need. Do NOT check versions, env vars, or profiles upfront.
26
27
If an `ax` command fails, troubleshoot based on the error:
28
- `command not found` or version error → see references/ax-setup.md
29
- `401 Unauthorized` / missing API key → run `ax profiles show` to inspect the current profile. If the profile is missing or the API key is wrong, follow references/ax-profiles.md to create/update it. If the user doesn't have their key, direct them to https://app.arize.com/admin > API Keys
30
- Space unknown → run `ax spaces list` to pick by name, or ask the user
31
- Project unclear → ask the user, or run `ax projects list -o json --limit 100` and present as selectable options
32
- **Security:** Never read `.env` files or search the filesystem for credentials. Use `ax profiles` for Arize credentials and `ax ai-integrations` for LLM provider keys. If credentials are not available through these channels, ask the user.
33
- **CRITICAL — Never fabricate outputs:** When running an experiment, you MUST call the real model API specified by the user for every dataset example. Never fabricate, simulate, or hardcode model outputs, latencies, or evaluation scores. If you cannot call the API (missing SDK, missing credentials, network error), stop and tell the user what is needed before proceeding.
34
35
## List Experiments: `ax experiments list`
36
37
Browse experiments, optionally filtered by dataset. Output goes to stdout.
38
39
```bash
40
ax experiments list
41
ax experiments list --dataset DATASET_NAME --space SPACE --limit 20 # DATASET_NAME: name or ID (name preferred)
42
ax experiments list --cursor CURSOR_TOKEN
43
ax experiments list -o json
44
```
45
46
### Flags
47
48
| Flag | Type | Default | Description |
49
|------|------|---------|-------------|
50
| `--dataset` | string | none | Filter by dataset |
51
| `--limit, -l` | int | 15 | Max results (1-100) |
52
| `--cursor` | string | none | Pagination cursor from previous response |
53
| `-o, --output` | string | table | Output format: table, json, csv, parquet, or file path |
54
| `-p, --profile` | string | default | Configuration profile |
55
56
## Get Experiment: `ax experiments get`
57
58
Quick metadata lookup -- returns experiment name, linked dataset/version, and timestamps.
59
60
```bash
61
ax experiments get NAME_OR_ID
62
ax experiments get NAME_OR_ID -o json
63
ax experiments get NAME_OR_ID --dataset DATASET_NAME --space SPACE # required when using experiment name instead of ID
64
```
65
66
### Flags
67
68
| Flag | Type | Default | Description |
69
|------|------|---------|-------------|
70
| `NAME_OR_ID` | string | required | Experiment name or ID (positional) |
71
| `--dataset` | string | none | Dataset name or ID (required if using experiment name instead of ID) |
72
| `--space` | string | none | Space name or ID (required if using dataset name instead of ID) |
73
| `-o, --output` | string | table | Output format |
74
| `-p, --profile` | string | default | Configuration profile |
75
76
### Response fields
77
78
| Field | Type | Description |
79
|-------|------|-------------|
80
| `id` | string | Experiment ID |
81
| `name` | string | Experiment name |
82
| `dataset_id` | string | Linked dataset ID |
83
| `dataset_version_id` | string | Specific dataset version used |
84
| `experiment_traces_project_id` | string | Project where experiment traces are stored |
85
| `created_at` | datetime | When the experiment was created |
86
| `updated_at` | datetime | Last modification time |
87
88
## Export Experiment: `ax experiments export`
89
90
Download all runs to a file. By default uses the REST API; pass `--all` to use Arrow Flight for bulk transfer.
91
92
```bash
93
# EXPERIMENT_NAME, DATASET_NAME: name or ID (name preferred)
94
ax experiments export EXPERIMENT_NAME --dataset DATASET_NAME --space SPACE
95
# -> experiment_abc123_20260305_141500/runs.json
96
97
ax experiments export EXPERIMENT_NAME --dataset DATASET_NAME --space SPACE --all
98
ax experiments export EXPERIMENT_NAME --dataset DATASET_NAME --space SPACE --output-dir ./results
99
ax experiments export EXPERIMENT_NAME --dataset DATASET_NAME --space SPACE --stdout
100
ax experiments export EXPERIMENT_NAME --dataset DATASET_NAME --space SPACE --stdout | jq '.[0]'
101
```
102
103
### Flags
104
105
| Flag | Type | Default | Description |
106
|------|------|---------|-------------|
107
| `NAME_OR_ID` | string | required | Experiment name or ID (positional) |
108
| `--dataset` | string | none | Dataset name or ID (required if using experiment name instead of ID) |
109
| `--space` | string | none | Space name or ID (required if using dataset name instead of ID) |
110
| `--all` | bool | false | Use Arrow Flight for bulk export (see below) |
111
| `--output-dir` | string | `.` | Output directory |
112
| `--stdout` | bool | false | Print JSON to stdout instead of file |
113
| `-p, --profile` | string | default | Configuration profile |
114
115
### REST vs Flight (`--all`)
116
117
- **REST** (default): Lower friction -- no Arrow/Flight dependency, standard HTTPS ports, works through any corporate proxy or firewall. Limited to 500 runs per page.
118
- **Flight** (`--all`): Required for experiments with more than 500 runs. Uses gRPC+TLS on a separate host/port (`flight.arize.com:443`) which some corporate networks may block.
119
120
**Agent auto-escalation rule:** If a REST export returns exactly 500 runs, the result is likely truncated. Re-run with `--all` to get the full dataset.
121
122
Output is a JSON array of run objects:
123
124
```json
125
[
126
{
127
"id": "run_001",
128
"example_id": "ex_001",
129
"output": "The answer is 4.",
130
"evaluations": {
131
"correctness": { "label": "correct", "score": 1.0 },
132
"relevance": { "score": 0.95, "explanation": "Directly answers the question" }
133
},
134
"metadata": { "model": "gpt-4o", "latency_ms": 1234 }
135
}
136
]
137
```
138
139
## Create Experiment: `ax experiments create`
140
141
Create a new experiment with runs from a data file.
142
143
```bash
144
ax experiments create --name "gpt-4o-baseline" --dataset DATASET_NAME --space SPACE --file runs.json
145
ax experiments create --name "claude-test" --dataset DATASET_NAME --space SPACE --file runs.csv
146
```
147
148
### Flags
149
150
| Flag | Type | Required | Description |
151
|------|------|----------|-------------|
152
| `--name, -n` | string | yes | Experiment name |
153
| `--dataset` | string | yes | Dataset to run the experiment against |
154
| `--space, -s` | string | no | Space name or ID (required if using dataset name instead of ID) |
155
| `--file, -f` | path | yes | Data file with runs: CSV, JSON, JSONL, or Parquet |
156
| `-o, --output` | string | no | Output format |
157
| `-p, --profile` | string | no | Configuration profile |
158
159
### Passing data via stdin
160
161
Use `--file -` to pipe data directly — no temp file needed:
162
163
```bash
164
echo '[{"example_id": "ex_001", "output": "Paris"}]' | ax experiments create --name "my-experiment" --dataset DATASET_NAME --space SPACE --file -
165
166
# Or with a heredoc
167
ax experiments create --name "my-experiment" --dataset DATASET_NAME --space SPACE --file - << 'EOF'
168
[{"example_id": "ex_001", "output": "Paris"}]
169
EOF
170
```
171
172
### Required columns in the runs file
173
174
| Column | Type | Required | Description |
175
|--------|------|----------|-------------|
176
| `example_id` | string | yes | ID of the dataset example this run corresponds to |
177
| `output` | string | yes | The model/system output for this example |
178
179
Additional columns are passed through as `additionalProperties` on the run.
180
181
## Delete Experiment: `ax experiments delete`
182
183
```bash
184
ax experiments delete NAME_OR_ID
185
ax experiments delete NAME_OR_ID --dataset DATASET_NAME --space SPACE # required when using experiment name instead of ID
186
ax experiments delete NAME_OR_ID --force # skip confirmation prompt
187
```
188
189
### Flags
190
191
| Flag | Type | Default | Description |
192
|------|------|---------|-------------|
193
| `NAME_OR_ID` | string | required | Experiment name or ID (positional) |
194
| `--dataset` | string | none | Dataset name or ID (required if using experiment name instead of ID) |
195
| `--space` | string | none | Space name or ID (required if using dataset name instead of ID) |
196
| `--force, -f` | bool | false | Skip confirmation prompt |
197
| `-p, --profile` | string | default | Configuration profile |
198
199
## Experiment Run Schema
200
201
Each run corresponds to one dataset example:
202
203
```json
204
{
205
"example_id": "required -- links to dataset example",
206
"output": "required -- the model/system output for this example",
207
"evaluations": {
208
"metric_name": {
209
"label": "optional string label (e.g., 'correct', 'incorrect')",
210
"score": "optional numeric score (e.g., 0.95)",
211
"explanation": "optional freeform text"
212
}
213
},
214
"metadata": {
215
"model": "gpt-4o",
216
"temperature": 0.7,
217
"latency_ms": 1234
218
}
219
}
220
```
221
222
### Evaluation fields
223
224
| Field | Type | Required | Description |
225
|-------|------|----------|-------------|
226
| `label` | string | no | Categorical classification (e.g., `correct`, `incorrect`, `partial`) |
227
| `score` | number | no | Numeric quality score (e.g., 0.0 - 1.0) |
228
| `explanation` | string | no | Freeform reasoning for the evaluation |
229
230
At least one of `label`, `score`, or `explanation` should be present per evaluation.
231
232
## Workflows
233
234
### Run an experiment against a dataset
235
236
1. Find or create a dataset:
237
```bash
238
ax datasets list --space SPACE
239
ax datasets export DATASET_NAME --space SPACE --stdout | jq 'length'
240
```
241
2. Export the dataset examples:
242
```bash
243
ax datasets export DATASET_NAME --space SPACE
244
```
245
3. Call the real model API for each example and collect outputs. Use `ax datasets export --stdout` to pipe examples directly into an inference script:
246
247
```bash
248
ax datasets export DATASET_NAME --space SPACE --stdout | python3 infer.py > runs.json
249
```
250
251
Write `infer.py` to read examples from stdin, call the target model, and write runs JSON to stdout. The script below is a template — first inspect the exported dataset JSON to find the correct input field name, then uncomment the provider block the user wants:
252
253
```python
254
import json, sys, time
255
256
examples = json.load(sys.stdin)
257
runs = []
258
259
for ex in examples:
260
# Inspect the exported JSON to find the right field (e.g. "input", "question", "prompt")
261
user_input = ex.get("input") or ex.get("question") or ex.get("prompt") or str(ex)
262
263
start = time.time()
264
265
# === CALL THE REAL MODEL API HERE — never fabricate or simulate ===
266
# Uncomment and adapt the provider block the user requested:
267
#
268
# OpenAI (pip install openai — uses OPENAI_API_KEY env var):
269
# from openai import OpenAI
270
# resp = OpenAI().chat.completions.create(
271
# model="gpt-4o",
272
# messages=[{"role": "user", "content": user_input}]
273
# )
274
# output_text = resp.choices[0].message.content
275
#
276
# Anthropic (pip install anthropic — uses ANTHROPIC_API_KEY env var):
277
# import anthropic
278
# resp = anthropic.Anthropic().messages.create(
279
# model="claude-sonnet-4-6", max_tokens=1024,
280
# messages=[{"role": "user", "content": user_input}]
281
# )
282
# output_text = resp.content[0].text
283
#
284
# Google Gemini (pip install google-genai — uses GOOGLE_API_KEY env var):
285
# from google import genai
286
# resp = genai.Client().models.generate_content(
287
# model="gemini-2.5-pro", contents=user_input
288
# )
289
# output_text = resp.text
290
#
291
# Custom / OpenAI-compatible proxy (pip install openai — uses CUSTOM_BASE_URL + CUSTOM_API_KEY env vars):
292
# Use this for Azure OpenAI, NVIDIA NIM, local Ollama, or any OpenAI-compatible endpoint,
293
# including a test integration proxy. Matches the `custom` provider in `ax ai-integrations create`.
294
# import os
295
# from openai import OpenAI
296
# resp = OpenAI(
297
# base_url=os.environ["CUSTOM_BASE_URL"], # e.g. https://my-proxy.example.com/v1
298
# api_key=os.environ.get("CUSTOM_API_KEY", "none"),
299
# ).chat.completions.create(
300
# model=os.environ.get("CUSTOM_MODEL", "default"),
301
# messages=[{"role": "user", "content": user_input}]
302
# )
303
# output_text = resp.choices[0].message.content
304
305
latency_ms = round((time.time() - start) * 1000)
306
runs.append({
307
"example_id": ex["id"],
308
"output": output_text,
309
"metadata": {"model": "MODEL_NAME", "latency_ms": latency_ms}
310
})
311
print(f" {ex['id']}: {latency_ms}ms", file=sys.stderr)
312
313
json.dump(runs, sys.stdout, indent=2)
314
```
315
316
**Before running:** install the provider SDK (`pip install openai` / `anthropic` / `google-genai`) and ensure the API key is set as an environment variable in your shell. If you cannot access the API, stop and tell the user what is needed.
317
318
4. Verify the runs file:
319
```bash
320
python3 -c "import json; runs=json.load(open('runs.json')); print(f'{len(runs)} runs'); print(json.dumps(runs[0], indent=2))"
321
```
322
Each run must have `example_id` and `output`. Optional fields: `evaluations`, `metadata`.
323
5. Create the experiment:
324
```bash
325
ax experiments create --name "gpt-4o-baseline" --dataset DATASET_NAME --space SPACE --file runs.json
326
```
327
6. Verify: `ax experiments get "gpt-4o-baseline" --dataset DATASET_NAME --space SPACE`
328
329
### Compare two experiments
330
331
1. Export both experiments:
332
```bash
333
ax experiments export "experiment-a" --dataset DATASET_NAME --space SPACE --stdout > a.json
334
ax experiments export "experiment-b" --dataset DATASET_NAME --space SPACE --stdout > b.json
335
```
336
2. Compare evaluation scores by `example_id`:
337
```bash
338
# Average correctness score for experiment A
339
jq '[.[] | .evaluations.correctness.score] | add / length' a.json
340
341
# Same for experiment B
342
jq '[.[] | .evaluations.correctness.score] | add / length' b.json
343
```
344
3. Find examples where results differ:
345
```bash
346
jq -s '.[0] as $a | .[1][] | . as $run |
347
{
348
example_id: $run.example_id,
349
b_score: $run.evaluations.correctness.score,
350
a_score: ($a[] | select(.example_id == $run.example_id) | .evaluations.correctness.score)
351
}' a.json b.json
352
```
353
4. Score distribution per evaluator (pass/fail/partial counts):
354
```bash
355
# Count by label for experiment A
356
jq '[.[] | .evaluations.correctness.label] | group_by(.) | map({label: .[0], count: length})' a.json
357
```
358
5. Find regressions (examples that passed in A but fail in B):
359
```bash
360
jq -s '
361
[.[0][] | select(.evaluations.correctness.label == "correct")] as $passed_a |
362
[.[1][] | select(.evaluations.correctness.label != "correct") |
363
select(.example_id as $id | $passed_a | any(.example_id == $id))
364
]
365
' a.json b.json
366
```
367
368
**Statistical significance note:** Score comparisons are most reliable with ≥ 30 examples per evaluator. With fewer examples, treat the delta as directional only — a 5% difference on n=10 may be noise. Report sample size alongside scores: `jq 'length' a.json`.
369
370
### Download experiment results for analysis
371
372
1. `ax experiments list --dataset DATASET_NAME --space SPACE` -- find experiments
373
2. `ax experiments export EXPERIMENT_NAME --dataset DATASET_NAME --space SPACE` -- download to file
374
3. Parse: `jq '.[] | {example_id, score: .evaluations.correctness.score}' experiment_*/runs.json`
375
376
### Pipe export to other tools
377
378
```bash
379
# Count runs
380
ax experiments export EXPERIMENT_NAME --dataset DATASET_NAME --space SPACE --stdout | jq 'length'
381
382
# Extract all outputs
383
ax experiments export EXPERIMENT_NAME --dataset DATASET_NAME --space SPACE --stdout | jq '.[].output'
384
385
# Get runs with low scores
386
ax experiments export EXPERIMENT_NAME --dataset DATASET_NAME --space SPACE --stdout | jq '[.[] | select(.evaluations.correctness.score < 0.5)]'
387
388
# Convert to CSV
389
ax experiments export EXPERIMENT_NAME --dataset DATASET_NAME --space SPACE --stdout | jq -r '.[] | [.example_id, .output, .evaluations.correctness.score] | @csv'
390
```
391
392
## Related Skills
393
394
- **arize-dataset**: Create or export the dataset this experiment runs against → use `arize-dataset` first
395
- **arize-prompt-optimization**: Use experiment results to improve prompts → next step is `arize-prompt-optimization`
396
- **arize-trace**: Inspect individual span traces for failing experiment runs → use `arize-trace`
397
- **arize-link**: Generate clickable UI links to traces from experiment runs → use `arize-link`
398
399
## Troubleshooting
400
401
| Problem | Solution |
402
|---------|----------|
403
| `ax: command not found` | See references/ax-setup.md |
404
| `401 Unauthorized` | API key is wrong, expired, or doesn't have access to this space. Fix the profile using references/ax-profiles.md. |
405
| `No profile found` | No profile is configured. See references/ax-profiles.md to create one. |
406
| `Experiment not found` | Verify experiment name with `ax experiments list --space SPACE` |
407
| `Invalid runs file` | Each run must have `example_id` and `output` fields |
408
| `example_id mismatch` | Ensure `example_id` values match IDs from the dataset (export dataset to verify) |
409
| `No runs found` | Export returned empty -- verify experiment has runs via `ax experiments get` |
410
| `Dataset not found` | The linked dataset may have been deleted; check with `ax datasets list` |
411
412
## Save Credentials for Future Use
413
414
See references/ax-profiles.md § Save Credentials for Future Use.
415

© arize · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 13,413 prompts

More by @OpenSourceBuffGuy

See all
Butterfly on Wheat at Golden Sunrise prompt image

Butterfly on Wheat at Golden Sunrise

Paints a classical oil painting of a butterfly resting on a golden wheat stalk in misty backlit sunrise light with dewdrop bokeh.

image-prompt, oil-painting, painting, classical-art, animals, flowers, landscape, golden-hour, bokeh, dramatic-lighting, soft-lighting, vertical-format, macro, dreamy, impressionism, fine-art, vibrant-colors, spring, for-artists, gpt-image, wallpaper, quick

Chibi character 16 frame dance reference sheet prompt image

Chibi character 16 frame dance reference sheet

Creates a square 4x4 sheet of sixteen consecutive dance keyframes of an uploaded character, following numbered choreography steps with identity locked and secondary motion on hair and cloth.

image-prompt, character-sheet, multi-panel, dance, chibi, reference-image, character-consistency, character-design, full-body, white-background, illustration, structured-output, square-format, negative-prompt, gpt-image, for-artists, for-designers, game-assets, long-form, advanced

Running Man Pulled Back by Semi Chibi Double prompt image

Running Man Pulled Back by Semi Chibi Double

Makes a bright studio editorial photo of a running person from a reference photo, with a 3D semi-chibi double tugging their clothes back and realistic fabric tension.

image-prompt, gpt-image, reference-image, face-reference, negative-prompt, photorealistic, editorial, chibi, 3d-render, studio-lighting, white-background, fashion, portrait, full-body, motion-blur, whimsical, vertical-format, character-consistency, action-figure, fashion-shoot, pixar-style, soft-lighting, for-photographers, for-artists, humorous

Reviews

Loading reviews…

Discussion

Loading comments…