1
---
2
name: arize-evaluator
3
description: Handles LLM-as-judge evaluation workflows on Arize including creating/updating evaluators, running evaluations on spans or experiments, managing tasks, trigger-run operations, column mapping, and continuous monitoring. Use when the user mentions create evaluator, LLM judge, hallucination, faithfulness, correctness, relevance, run eval, score spans, score experiment, trigger-run, column mapping, continuous monitoring, or improve evaluator prompt.
4
metadata:
5
author: arize
6
version: "1.0"
7
compatibility: Requires the ax CLI and a configured Arize profile with an AI integration.
8
---
9
10
# Arize Evaluator 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
This skill covers designing, creating, and running **LLM-as-judge evaluators** on Arize. An evaluator defines the judge; a **task** is how you run it against real data.
15
16
---
17
18
## Prerequisites
19
20
Proceed directly with the task — run the `ax` command you need. Do NOT check versions, env vars, or profiles upfront.
21
22
If an `ax` command fails, troubleshoot based on the error:
23
- `command not found` or version error → see references/ax-setup.md
24
- `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
25
- Space unknown → run `ax spaces list` to pick by name, or ask the user
26
- LLM provider call fails (missing OPENAI_API_KEY / ANTHROPIC_API_KEY) → run `ax ai-integrations list --space SPACE` to check for platform-managed credentials. If none exist, ask the user to provide the key or create an integration via the **arize-ai-provider-integration** skill
27
- **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.
28
- **CRITICAL — Never fabricate evaluation results:** If an evaluation task fails, is cancelled, or produces no scores, report the failure clearly and explain what went wrong. Do NOT perform a "manual evaluation," invent quality scores, estimate percentages, or present any agent-generated analysis as if it came from the Arize evaluation system. Instead suggest: (1) fix the identified issue and retry, (2) try running from the Arize UI, (3) verify integration credentials with `ax ai-integrations list`, (4) contact support at https://arize.com/support
29
30
---
31
32
## Concepts
33
34
### What is an Evaluator?
35
36
An **evaluator** is an LLM-as-judge definition. It contains:
37
38
| Field | Description |
39
|-------|-------------|
40
| **Template** | The judge prompt. Uses `{variable}` placeholders (e.g. `{input}`, `{output}`, `{context}`) that get filled in at run time via a task's column mappings. |
41
| **Classification choices** | The set of allowed output labels (e.g. `factual` / `hallucinated`). Binary is the default and most common. Each choice can optionally carry a numeric score. |
42
| **AI Integration** | Stored LLM provider credentials (OpenAI, Anthropic, Bedrock, etc.) the evaluator uses to call the judge model. |
43
| **Model** | The specific judge model (e.g. `gpt-4o`, `claude-sonnet-4-5`). |
44
| **Invocation params** | Optional JSON of model settings like `{"temperature": 0}`. Low temperature is recommended for reproducibility. |
45
| **Optimization direction** | Whether higher scores are better (`maximize`) or worse (`minimize`). Sets how the UI renders trends. |
46
| **Data granularity** | Whether the evaluator runs at the **span**, **trace**, or **session** level. Most evaluators run at the span level. |
47
48
Evaluators are **versioned** — every prompt or model change creates a new immutable version. The most recent version is active.
49
50
### What is a Task?
51
52
A **task** is how you run one or more evaluators against real data. Tasks are attached to a **project** (live traces/spans) or a **dataset** (experiment runs). A task contains:
53
54
| Field | Description |
55
|-------|-------------|
56
| **Evaluators** | List of evaluators to run. You can run multiple in one task. |
57
| **Column mappings** | Maps each evaluator's template variables to actual field paths on spans or experiment runs (e.g. `"input" → "attributes.input.value"`). This is what makes evaluators portable across projects and experiments. |
58
| **Query filter** | SQL-style expression to select which spans/runs to evaluate (e.g. `"span_kind = 'LLM'"`). Optional but important for precision. |
59
| **Continuous** | For project tasks: whether to automatically score new spans as they arrive. |
60
| **Sampling rate** | For continuous project tasks: fraction of new spans to evaluate (0–1). |
61
62
---
63
64
## Data Granularity
65
66
The `--data-granularity` flag controls what unit of data the evaluator scores. It defaults to `span` and only applies to **project tasks** (not dataset/experiment tasks — those evaluate experiment runs directly).
67
68
| Level | What it evaluates | Use for | Result column prefix |
69
|-------|-------------------|---------|---------------------|
70
| `span` (default) | Individual spans | Q&A correctness, hallucination, relevance | `eval.{name}.label` / `.score` / `.explanation` |
71
| `trace` | All spans in a trace, grouped by `context.trace_id` | Agent trajectory, task correctness — anything that needs the full call chain | `trace_eval.{name}.label` / `.score` / `.explanation` |
72
| `session` | All traces in a session, grouped by `attributes.session.id` and ordered by start time | Multi-turn coherence, overall tone, conversation quality | `session_eval.{name}.label` / `.score` / `.explanation` |
73
74
### How trace and session aggregation works
75
76
For **trace** granularity, spans sharing the same `context.trace_id` are grouped together. Column values used by the evaluator template are comma-joined into a single string (each value truncated to 100K characters) before being passed to the judge model.
77
78
For **session** granularity, the same trace-level grouping happens first, then traces are ordered by `start_time` and grouped by `attributes.session.id`. Session-level values are capped at 100K characters total.
79
80
### The `{conversation}` template variable
81
82
At session granularity, `{conversation}` is a special template variable that renders as a JSON array of `{input, output}` turns across all traces in the session, built from `attributes.input.value` / `attributes.llm.input_messages` (input side) and `attributes.output.value` / `attributes.llm.output_messages` (output side).
83
84
At span or trace granularity, `{conversation}` is treated as a regular template variable and resolved via column mappings like any other.
85
86
### Multi-evaluator tasks
87
88
A task can contain evaluators at different granularities. At runtime the system uses the **highest** granularity (session > trace > span) for data fetching and automatically **splits into one child run per evaluator**. Per-evaluator `query_filter` in the task's evaluators JSON further narrows which spans are included (e.g., only tool-call spans within a session).
89
90
---
91
92
## Basic CRUD
93
94
### AI Integrations
95
96
AI integrations store the LLM provider credentials the evaluator uses. For full CRUD — listing, creating for all providers (OpenAI, Anthropic, Azure, Bedrock, Vertex, Gemini, NVIDIA NIM, custom), updating, and deleting — use the **arize-ai-provider-integration** skill.
97
98
Quick reference for the common case (OpenAI):
99
100
```bash
101
# Check for an existing integration first
102
ax ai-integrations list --space SPACE
103
104
# Create if none exists
105
ax ai-integrations create \
106
--name "My OpenAI Integration" \
107
--provider openAI \
108
--api-key $OPENAI_API_KEY
109
```
110
111
Copy the returned integration ID — it is required for `ax evaluators create --ai-integration-id`.
112
113
### Evaluators
114
115
```bash
116
# List / Get
117
ax evaluators list --space SPACE
118
ax evaluators get ID # accepts name or ID
119
ax evaluators get NAME --space SPACE # required when using name instead of ID
120
ax evaluators list-versions NAME_OR_ID
121
ax evaluators get-version VERSION_ID
122
123
# Create (creates the evaluator and its first version)
124
ax evaluators create \
125
--name "Answer Correctness" \
126
--space SPACE \
127
--description "Judges if the model answer is correct" \
128
--template-name "correctness" \
129
--commit-message "Initial version" \
130
--ai-integration-id INT_ID \
131
--model-name "gpt-4o" \
132
--include-explanations \
133
--use-function-calling \
134
--classification-choices '{"correct": 1, "incorrect": 0}' \
135
--template 'You are an evaluator. Given the user question and the model response, decide if the response correctly answers the question.
136
137
User question: {input}
138
139
Model response: {output}
140
141
Respond with exactly one of these labels: correct, incorrect'
142
143
# Create a new version (for prompt or model changes — versions are immutable)
144
ax evaluators create-version NAME_OR_ID \
145
--commit-message "Added context grounding" \
146
--template-name "correctness" \
147
--ai-integration-id INT_ID \
148
--model-name "gpt-4o" \
149
--include-explanations \
150
--classification-choices '{"correct": 1, "incorrect": 0}' \
151
--template 'Updated prompt...
152
153
{input} / {output} / {context}'
154
155
# Update metadata only (name, description — not prompt)
156
ax evaluators update NAME_OR_ID \
157
--name "New Name" \
158
--description "Updated description"
159
160
# Delete (permanent — removes all versions)
161
ax evaluators delete NAME_OR_ID
162
```
163
164
**Key flags for `create`:**
165
166
| Flag | Required | Description |
167
|------|----------|-------------|
168
| `--name` | yes | Evaluator name (unique within space) |
169
| `--space` | yes | Space name or ID to create in |
170
| `--template-name` | yes | Eval column name — alphanumeric, spaces, hyphens, underscores |
171
| `--commit-message` | yes | Description of this version |
172
| `--ai-integration-id` | yes | AI integration ID (from above) |
173
| `--model-name` | yes | Judge model (e.g. `gpt-4o`) |
174
| `--template` | yes | Prompt with `{variable}` placeholders (single-quoted in bash) |
175
| `--classification-choices` | yes | JSON object mapping choice labels to numeric scores e.g. `'{"correct": 1, "incorrect": 0}'` |
176
| `--description` | no | Human-readable description |
177
| `--include-explanations` | no | Include reasoning alongside the label |
178
| `--use-function-calling` | no | Prefer structured function-call output |
179
| `--invocation-params` | no | JSON of model params e.g. `'{"temperature": 0}'` |
180
| `--data-granularity` | no | `span` (default), `trace`, or `session`. Only relevant for project tasks, not dataset/experiment tasks. See Data Granularity section. |
181
| `--direction` | no | Optimization direction: `maximize` or `minimize`. Sets how the UI renders trends. |
182
| `--provider-params` | no | JSON object of provider-specific parameters |
183
184
### Tasks
185
186
> `PROJECT_NAME`, `DATASET_NAME`, and `evaluator_id` all accept a name or base64 ID.
187
188
```bash
189
# List / Get
190
ax tasks list --space SPACE
191
ax tasks list --project PROJECT_NAME
192
ax tasks list --dataset DATASET_NAME --space SPACE
193
ax tasks get TASK_ID
194
195
# Create (project — continuous)
196
ax tasks create \
197
--name "Correctness Monitor" \
198
--task-type template_evaluation \
199
--project PROJECT_NAME \
200
--evaluators '[{"evaluator_id": "EVAL_ID", "column_mappings": {"input": "attributes.input.value", "output": "attributes.output.value"}}]' \
201
--is-continuous \
202
--sampling-rate 0.1
203
204
# Create (project — one-time / backfill)
205
ax tasks create \
206
--name "Correctness Backfill" \
207
--task-type template_evaluation \
208
--project PROJECT_NAME \
209
--evaluators '[{"evaluator_id": "EVAL_ID", "column_mappings": {"input": "attributes.input.value", "output": "attributes.output.value"}}]' \
210
--no-continuous
211
212
# Create (experiment / dataset)
213
ax tasks create \
214
--name "Experiment Scoring" \
215
--task-type template_evaluation \
216
--dataset DATASET_NAME --space SPACE \
217
--experiment-ids "EXP_ID_1,EXP_ID_2" \ # base64 IDs from `ax experiments list --space SPACE -o json`
218
--evaluators '[{"evaluator_id": "EVAL_ID", "column_mappings": {"output": "output"}}]' \
219
--no-continuous
220
221
# Trigger a run (project task — use data window)
222
ax tasks trigger-run TASK_ID \
223
--data-start-time "2026-03-20T00:00:00" \
224
--data-end-time "2026-03-21T23:59:59" \
225
--wait
226
227
# Trigger a run (experiment task — use experiment IDs)
228
ax tasks trigger-run TASK_ID \
229
--experiment-ids "EXP_ID_1" \ # base64 ID from `ax experiments list --space SPACE -o json`
230
--wait
231
232
# Monitor
233
ax tasks list-runs TASK_ID
234
ax tasks get-run RUN_ID
235
ax tasks wait-for-run RUN_ID --timeout 300
236
ax tasks cancel-run RUN_ID --force
237
```
238
239
**Time format for trigger-run:** `2026-03-21T09:00:00` — no trailing `Z`.
240
241
**Additional trigger-run flags:**
242
243
| Flag | Description |
244
|------|-------------|
245
| `--max-spans` | Cap processed spans (default 10,000) |
246
| `--override-evaluations` | Re-score spans that already have labels |
247
| `--wait` / `-w` | Block until the run finishes |
248
| `--timeout` | Seconds to wait with `--wait` (default 600) |
249
| `--poll-interval` | Poll interval in seconds when waiting (default 5) |
250
251
**Run status guide:**
252
253
| Status | Meaning |
254
|--------|---------|
255
| `completed`, 0 spans | The eval index lags 1–2 hours — spans ingested recently may not be indexed yet. Shift the window to data at least 2 hours old, or widen the time range to cover more historical data. |
256
| `cancelled` ~1s | Integration credentials invalid |
257
| `cancelled` ~3min | Found spans but LLM call failed — check model name or key |
258
| `completed`, N > 0 | Success — check scores in UI |
259
260
---
261
262
## Workflow A: Create an evaluator for a project
263
264
Use this when the user says something like *"create an evaluator for my Playground Traces project"*.
265
266
### Step 1: Confirm the project name
267
268
`ax spans export` accepts a project name directly — no ID lookup needed. If you don't know the project name, list available projects:
269
270
```bash
271
ax projects list --space SPACE -o json
272
```
273
274
Find the entry whose `"name"` matches (case-insensitive) and use that name as `PROJECT` in subsequent commands. If you later hit a validation error with a name, fall back to using the project's `"id"` (a base64 string) instead.
275
276
### Step 2: Understand what to evaluate
277
278
If the user specified the evaluator type (hallucination, correctness, relevance, etc.) → skip to Step 3.
279
280
If not, sample recent spans to base the evaluator on actual data:
281
282
```bash
283
ax spans export PROJECT --space SPACE -l 10 --days 30 --stdout
284
```
285
286
Inspect `attributes.input`, `attributes.output`, span kinds, and any existing annotations. Identify failure modes (e.g. hallucinated facts, off-topic answers, missing context) and propose **1–3 concrete evaluator ideas**. Let the user pick.
287
288
Each suggestion must include: the evaluator name (bold), a one-sentence description of what it judges, and the binary label pair in parentheses. Format each like:
289
290
1. **Name** — Description of what is being judged. (`label_a` / `label_b`)
291
292
Example:
293
1. **Response Correctness** — Does the agent's response correctly address the user's financial query? (`correct` / `incorrect`)
294
2. **Hallucination** — Does the response fabricate facts not grounded in retrieved context? (`factual` / `hallucinated`)
295
296
### Step 3: Confirm or create an AI integration
297
298
```bash
299
ax ai-integrations list --space SPACE -o json
300
```
301
302
If a suitable integration exists, note its ID. If not, create one using the **arize-ai-provider-integration** skill. Ask the user which provider/model they want for the judge.
303
304
### Step 4: Create the evaluator
305
306
Use the template design best practices below. Keep the evaluator name and variables **generic** — the task (Step 6) handles project-specific wiring via `column_mappings`.
307
308
```bash
309
ax evaluators create \
310
--name "Hallucination" \
311
--space SPACE \
312
--template-name "hallucination" \
313
--commit-message "Initial version" \
314
--ai-integration-id INT_ID \
315
--model-name "gpt-4o" \
316
--include-explanations \
317
--use-function-calling \
318
--classification-choices '{"factual": 1, "hallucinated": 0}' \
319
--template 'You are an evaluator. Given the user question and the model response, decide if the response is factual or contains unsupported claims.
320
321
User question: {input}
322
323
Model response: {output}
324
325
Respond with exactly one of these labels: hallucinated, factual'
326
```
327
328
### Step 5: Ask — backfill, continuous, or both?
329
330
**Recommended approach:** Always start with a small backfill (~100 historical spans) to validate the evaluator before turning on continuous monitoring. This lets you catch column mapping errors, wrong span kinds, and template issues on known data before scoring all future production spans. Only enable continuous after a backfill confirms correct scoring.
331
332
Before creating the task, ask:
333
334
> "Would you like to:
335
> (a) Run a **backfill** on historical spans (one-time)?
336
> (b) Set up **continuous** evaluation on new spans going forward?
337
> (c) **Both** — backfill first to validate, then keep scoring new spans automatically? (recommended)"
338
339
### Step 6: Determine column mappings from real span data
340
341
Do not guess paths. Pull a sample and inspect what fields are actually present:
342
343
```bash
344
ax spans export PROJECT --space SPACE -l 5 --days 7 --stdout
345
```
346
347
For each template variable (`{input}`, `{output}`, `{context}`), find the matching JSON path. Common starting points — **always verify on your actual data before using**:
348
349
| Template var | LLM span | CHAIN span |
350
|---|---|---|
351
| `input` | `attributes.input.value` | `attributes.input.value` |
352
| `output` | `attributes.llm.output_messages.0.message.content` | `attributes.output.value` |
353
| `context` | `attributes.retrieval.documents.contents` | — |
354
| `tool_output` | `attributes.input.value` (fallback) | `attributes.output.value` |
355
356
**Validate span kind alignment:** If the evaluator prompt assumes LLM final text but the task targets CHAIN spans (or vice versa), runs can cancel or score the wrong text. Make sure the `query_filter` on the task matches the span kind you mapped.
357
358
**`query_filter` only works on indexed attributes:** The `query_filter` in the evaluators JSON is evaluated against the eval index, not the raw span store. Attributes under `attributes.metadata.*` or custom keys may not be indexed and will silently match nothing. Use well-known indexed attributes like `span_kind` or `attributes.llm.model_name` for filtering. If a filter returns 0 spans despite data existing, try removing the filter as a diagnostic step.
359
360
**Full example `--evaluators` JSON:**
361
362
```json
363
[
364
{
365
"evaluator_id": "EVAL_ID",
366
"query_filter": "span_kind = 'LLM'",
367
"column_mappings": {
368
"input": "attributes.input.value",
369
"output": "attributes.llm.output_messages.0.message.content",
370
"context": "attributes.retrieval.documents.contents"
371
}
372
}
373
]
374
```
375
376
Include a mapping for **every** variable the template references. Omitting one causes runs to produce no valid scores.
377
378
### Step 7: Create the task
379
380
**Backfill only (a):**
381
```bash
382
ax tasks create \
383
--name "Hallucination Backfill" \
384
--task-type template_evaluation \
385
--project PROJECT \
386
--evaluators '[{"evaluator_id": "EVAL_ID", "column_mappings": {"input": "attributes.input.value", "output": "attributes.output.value"}}]' \
387
--no-continuous
388
```
389
390
**Continuous only (b):**
391
```bash
392
ax tasks create \
393
--name "Hallucination Monitor" \
394
--task-type template_evaluation \
395
--project PROJECT \
396
--evaluators '[{"evaluator_id": "EVAL_ID", "column_mappings": {"input": "attributes.input.value", "output": "attributes.output.value"}}]' \
397
--is-continuous \
398
--sampling-rate 0.1
399
```
400
401
**Both (c):** Use `--is-continuous` on create, then also trigger a backfill run in Step 8.
402
403
### Step 8: Trigger a backfill run (if requested)
404
405
> **Eval index lag:** The eval index is built asynchronously from the primary trace store and can lag **1–2 hours**. For your first test run, use a time window ending at least 2 hours in the past. If you set `--data-end-time` to "now" on spans ingested in the last hour, the run will complete successfully but score 0 spans.
406
407
First find what time range has data:
408
```bash
409
ax spans export PROJECT --space SPACE -l 100 --days 1 --stdout # try last 24h first
410
ax spans export PROJECT --space SPACE -l 100 --days 7 --stdout # widen if empty
411
```
412
413
Use the `start_time` / `end_time` fields from real spans to set the window. For the first validation run, cap `--max-spans` at ~100 to get quick feedback:
414
415
```bash
416
ax tasks trigger-run TASK_ID \
417
--data-start-time "2026-03-20T00:00:00" \
418
--data-end-time "2026-03-21T23:59:59" \
419
--max-spans 100 \
420
--wait
421
```
422
423
Review scores and explanations before widening to the full backfill or enabling continuous.
424
425
---
426
427
## Workflow B: Create an evaluator for an experiment
428
429
Use this when the user says something like *"create an evaluator for my experiment"* or *"evaluate my dataset runs"*.
430
431
**If the user says "dataset" but doesn't have an experiment:** A task must target an experiment (not a bare dataset). Ask:
432
> "Evaluation tasks run against experiment runs, not datasets directly. Would you like help creating an experiment on that dataset first?"
433
434
If yes, use the **arize-experiment** skill to create one, then return here.
435
436
### Step 1: Find the dataset and experiment names
437
438
```bash
439
ax datasets list --space SPACE
440
ax experiments list --dataset DATASET_NAME --space SPACE -o json
441
```
442
443
Note the dataset name and the experiment name(s) to score. These accept names or IDs in subsequent commands — names are preferred.
444
445
### Step 2: Understand what to evaluate
446
447
If the user specified the evaluator type → skip to Step 3.
448
449
If not, inspect a recent experiment run to base the evaluator on actual data:
450
451
```bash
452
ax experiments export EXPERIMENT_NAME --dataset DATASET_NAME --space SPACE --stdout | python3 -c "import sys,json; runs=json.load(sys.stdin); print(json.dumps(runs[0], indent=2))"
453
```
454
455
Look at the `output`, `input`, `evaluations`, and `metadata` fields. Identify gaps (metrics the user cares about but doesn't have yet) and propose **1–3 evaluator ideas**. Each suggestion must include: the evaluator name (bold), a one-sentence description, and the binary label pair in parentheses — same format as Workflow A, Step 2.
456
457
### Step 3: Confirm or create an AI integration
458
459
Same as Workflow A, Step 3.
460
461
### Step 4: Create the evaluator
462
463
Same as Workflow A, Step 4. Keep variables generic.
464
465
### Step 5: Determine column mappings from real run data
466
467
Run data shape differs from span data. Inspect:
468
469
```bash
470
ax experiments export EXPERIMENT_NAME --dataset DATASET_NAME --space SPACE --stdout | python3 -c "import sys,json; runs=json.load(sys.stdin); print(json.dumps(runs[0], indent=2))"
471
```
472
473
Common mapping for experiment runs:
474
- `output` → `"output"` (top-level field on each run)
475
- `input` → check if it's on the run or embedded in the linked dataset examples
476
477
If `input` is not on the run JSON, export dataset examples to find the path:
478
```bash
479
ax datasets export DATASET_NAME --space SPACE --stdout | python3 -c "import sys,json; ex=json.load(sys.stdin); print(json.dumps(ex[0], indent=2))"
480
```
481
482
### Step 6: Create the task
483
484
```bash
485
ax tasks create \
486
--name "Experiment Correctness" \
487
--task-type template_evaluation \
488
--dataset DATASET_NAME --space SPACE \
489
--experiment-ids "EXP_ID" \ # base64 ID from `ax experiments list --space SPACE -o json`
490
--evaluators '[{"evaluator_id": "EVAL_ID", "column_mappings": {"output": "output"}}]' \
491
--no-continuous
492
```
493
494
### Step 7: Trigger and monitor
495
496
```bash
497
ax tasks trigger-run TASK_ID \
498
--experiment-ids "EXP_ID" \ # base64 ID from `ax experiments list --space SPACE -o json`
499
--wait
500
501
ax tasks list-runs TASK_ID
502
ax tasks get-run RUN_ID
503
```
504
505
---
506
507
## Best Practices for Template Design
508
509
### 1. Use generic, portable variable names
510
511
Use `{input}`, `{output}`, and `{context}` — not names tied to a specific project or span attribute (e.g. do not use `{attributes_input_value}`). The evaluator itself stays abstract; the **task's `column_mappings`** is where you wire it to the actual fields in a specific project or experiment. This lets the same evaluator run across multiple projects and experiments without modification.
512
513
### 2. Default to binary labels
514
515
Use exactly two clear string labels (e.g. `hallucinated` / `factual`, `correct` / `incorrect`, `pass` / `fail`). Binary labels are:
516
- Easiest for the judge model to produce consistently
517
- Most common in the industry
518
- Simplest to interpret in dashboards
519
520
If the user insists on more than two choices, that's fine — but recommend binary first and explain the tradeoff (more labels → more ambiguity → lower inter-rater reliability).
521
522
### 3. Be explicit about what the model must return
523
524
The template must tell the judge model to respond with **only** the label string — nothing else. The label strings in the prompt must **exactly match** the labels in `--classification-choices` (same spelling, same casing).
525
526
Good:
527
```
528
Respond with exactly one of these labels: hallucinated, factual
529
```
530
531
Bad (too open-ended):
532
```
533
Is this hallucinated? Answer yes or no.
534
```
535
536
### 4. Keep temperature low
537
538
Pass `--invocation-params '{"temperature": 0}'` for reproducible scoring. Higher temperatures introduce noise into evaluation results.
539
540
### 5. Use `--include-explanations` for debugging
541
542
During initial setup, always include explanations so you can verify the judge is reasoning correctly before trusting the labels at scale.
543
544
### 6. Pass the template in single quotes in bash
545
546
Single quotes prevent the shell from interpolating `{variable}` placeholders. Double quotes will cause issues:
547
548
```bash
549
# Correct
550
--template 'Judge this: {input} → {output}'
551
552
# Wrong — shell may interpret { } or fail
553
--template "Judge this: {input} → {output}"
554
```
555
556
### 7. Always set `--classification-choices` to match your template labels
557
558
The labels in `--classification-choices` must exactly match the labels referenced in `--template` (same spelling, same casing). Omitting `--classification-choices` causes task runs to fail with "missing rails and classification choices."
559
560
---
561
562
## Troubleshooting
563
564
| Problem | Solution |
565
|---------|----------|
566
| `ax: command not found` | See references/ax-setup.md |
567
| `401 Unauthorized` | API key may not have access to this space. Verify at https://app.arize.com/admin > API Keys |
568
| `Evaluator not found` | `ax evaluators list --space SPACE` |
569
| `Integration not found` | `ax ai-integrations list --space SPACE` |
570
| `Task not found` | `ax tasks list --space SPACE` |
571
| `project and dataset-id are mutually exclusive` | Use only one when creating a task |
572
| `experiment-ids required for dataset tasks` | Add `--experiment-ids` to `create` and `trigger-run` |
573
| `sampling-rate only valid for project tasks` | Remove `--sampling-rate` from dataset tasks |
574
| Validation error on `ax spans export` | Project name usually works; if you still get a validation error, look up the base64 project ID via `ax projects list --space SPACE -o json` and use the `id` field instead |
575
| Template validation errors | Use single-quoted `--template '...'` in bash; single braces `{var}`, not double `{{var}}` |
576
| Run stuck in `pending` | `ax tasks get-run RUN_ID`; then `ax tasks cancel-run RUN_ID` |
577
| Run `cancelled` ~1s | Integration credentials invalid — check AI integration |
578
| Run `cancelled` ~3min | Found spans but LLM call failed — wrong model name or bad key |
579
| Run `completed`, 0 spans | Widen time window; eval index may not cover older data |
580
| No scores in UI | Fix `column_mappings` to match real paths on your spans/runs |
581
| Scores look wrong | Add `--include-explanations` and inspect judge reasoning on a few samples |
582
| Evaluator cancels on wrong span kind | Match `query_filter` and `column_mappings` to LLM vs CHAIN spans |
583
| Time format error on `trigger-run` | Use `2026-03-21T09:00:00` — no trailing `Z` |
584
| Run failed: "missing rails and classification choices" | Add `--classification-choices '{"label_a": 1, "label_b": 0}'` to `ax evaluators create` — labels must match the template |
585
| Run `completed`, all spans skipped | Query filter matched spans but column mappings are wrong or template variables don't resolve — export a sample span and verify paths |
586
| `query_filter` set but 0 spans scored | The filter attribute may not be indexed in the eval index. `attributes.metadata.*` and custom attributes are often not indexed. Use `span_kind` or `attributes.llm.model_name` instead, or remove the filter to confirm spans exist in the window. |
587
588
### Diagnosing cancelled runs
589
590
When a task run is cancelled (status `cancelled`), follow this checklist in order:
591
592
**1. Check integration credentials**
593
```bash
594
ax ai-integrations list --space SPACE -o json
595
```
596
Verify the integration ID used by the evaluator exists and has valid credentials. If the integration was deleted or the API key expired, the run cancels within ~1 second.
597
598
**2. Verify the model name**
599
```bash
600
ax evaluators get EVALUATOR_NAME --space SPACE -o json
601
```
602
Check the `model_name` field. A typo or deprecated model causes the LLM call to fail and the run to cancel after ~3 minutes.
603
604
**3. Export a sample span/run and compare paths to column_mappings**
605
606
For project tasks:
607
```bash
608
ax spans export PROJECT --space SPACE -l 1 --days 7 --stdout | python3 -m json.tool
609
```
610
611
For experiment tasks:
612
```bash
613
ax experiments export EXPERIMENT_NAME --dataset DATASET_NAME --space SPACE --stdout | python3 -c "import sys,json; runs=json.load(sys.stdin); print(json.dumps(runs[0], indent=2)) if runs else print('No runs')"
614
```
615
616
Compare the exported JSON paths against the task's `column_mappings`. For each template variable, confirm the mapped path actually exists. Common mismatches:
617
- Mapping `output` to `attributes.output.value` on an experiment run (should be just `output`)
618
- Mapping `input` to `attributes.input.value` on a CHAIN span when the actual path is `attributes.llm.input_messages`
619
- Mapping `context` to a path that doesn't exist on the span kind being filtered
620
621
**4. Check that `data_start_time` is not epoch**
622
623
If `trigger-run` used a start time of `0`, `1970-01-01`, or an empty string, the time window is invalid. Always derive from real span timestamps:
624
```bash
625
ax spans export PROJECT --space SPACE -l 5 --days 30 --stdout | python3 -c "
626
import sys, json
627
spans = json.load(sys.stdin)
628
for s in spans:
629
print(s.get('start_time', 'N/A'), s.get('end_time', 'N/A'))
630
"
631
```
632
633
**5. Verify span kind matches evaluator scope**
634
635
If the evaluator was created with `--data-granularity trace` but the task's `query_filter` is `span_kind = 'LLM'`, the run may find no qualifying data and cancel. Ensure the granularity and filter are consistent.
636
637
**6. Check that all template variables resolve**
638
639
Every `{variable}` in the evaluator template must have a corresponding `column_mappings` entry that resolves to a non-null value. Test resolution against a real span:
640
```bash
641
ax spans export PROJECT --space SPACE -l 3 --days 7 --stdout | python3 -c "
642
import sys, json
643
spans = json.load(sys.stdin)
644
# Replace these paths with your actual column_mappings values
645
mappings = {'input': 'attributes.input.value', 'output': 'attributes.output.value'}
646
for i, span in enumerate(spans):
647
print(f'--- Span {i} ---')
648
for var, path in mappings.items():
649
parts = path.split('.')
650
val = span
651
for p in parts:
652
val = val.get(p) if isinstance(val, dict) else None
653
status = 'FOUND' if val else 'MISSING'
654
print(f' {var} ({path}): {status} — {str(val)[:80] if val else \"null\"}')
655
"
656
```
657
If any variable shows MISSING on all spans, fix the column mapping or adjust `query_filter` to target a different span kind.
658
659
---
660
661
## Related Skills
662
663
- **arize-ai-provider-integration**: Full CRUD for LLM provider integrations (create, update, delete credentials)
664
- **arize-trace**: Export spans to discover column paths and time ranges
665
- **arize-experiment**: Create experiments and export runs for experiment column mappings
666
- **arize-dataset**: Export dataset examples to find input fields when runs omit them
667
- **arize-link**: Deep links to evaluators and tasks in the Arize UI
668
669
---
670
671
## Save Credentials for Future Use
672
673
See references/ax-profiles.md § Save Credentials for Future Use.
674