技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
phoenix-cli【数据与研究】Debug LLM applications using the Phoenix CLI. Fetch traces, analyze errors, review experiments, and inspect datasets. Use when debugging AI/LLM applications, analyzing trace data, working with Phoenix observability, or investigating LLM performance issues.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Debug and analyze LLM applications using the Phoenix CLI (px).
npm install -g @arizeai/phoenix-cli
# Or run directly with npx
npx @arizeai/phoenix-cli
Set environment variables before running commands:
export PHOENIX_HOST=http://localhost:6006
export PHOENIX_PROJECT=my-project
export PHOENIX_API_KEY=your-api-key # if authentication is enabled
CLI flags override environment variables when specified.
px traces --limit 10
px traces --limit 50 --format raw --no-progress | jq '.[] | select(.status == "ERROR")'
px trace <trace-id>
px trace <trace-id> --format raw | jq '.spans[] | select(.status_code != "OK")'
px traces --limit 20 --format raw --no-progress | jq 'sort_by(-.duration) | .[0:5]'
px trace <trace-id> --format raw | jq '.spans | sort_by(-.duration_ms) | .[0:5] | .[] | {name, duration_ms, span_kind}'
Extract models and token counts:
px traces --limit 50 --format raw --no-progress | \
jq -r '.[].spans[] | select(.span_kind == "LLM") | {model: .attributes["llm.model_name"], prompt_tokens: .attributes["llm.token_count.prompt"], completion_tokens: .attributes["llm.token_count.completion"]}'
px datasets
px experiments --dataset my-dataset
px experiment <experiment-id> --format raw --no-progress | \
jq '.[] | select(.error != null) | {input: .input, error}'
px experiment <experiment-id> --format raw --no-progress | \
jq '[.[].latency_ms] | add / length'
Fetch recent traces from a project.
px traces [directory] [options]
| Option | Description |
|---|---|
[directory] | Save traces as JSON files to directory |
-n, --limit <number> | Number of traces (default: 10) |
--last-n-minutes <number> | Filter by time window |
--since <timestamp> | Fetch since ISO timestamp |
--format <format> | pretty, json, or raw |
--include-annotations | Include span annotations |
Fetch a specific trace by ID.
px trace <trace-id> [options]
| Option | Description |
|---|---|
--file <path> | Save to file |
--format <format> | pretty, json, or raw |
--include-annotations | Include span annotations |
List all datasets.
px datasets [options]
Fetch examples from a dataset.
px dataset <dataset-name> [options]
| Option | Description |
|---|---|
--split <name> | Filter by split (repeatable) |
--version <id> | Specific dataset version |
--file <path> | Save to file |
List experiments for a dataset.
px experiments --dataset <name> [directory]
| Option | Description |
|---|---|
--dataset <name> | Dataset name or ID (required) |
[directory] | Export experiment JSON to directory |
Fetch a single experiment with run data.
px experiment <experiment-id> [options]
List all prompts.
px prompts [options]
Fetch a specific prompt.
px prompt <prompt-name> [options]
pretty (default): Human-readable tree viewjson: Formatted JSON with indentationraw: Compact JSON for piping to jq or other toolsUse --format raw --no-progress when piping output to other commands.
Traces contain spans with OpenInference semantic attributes:
{
"traceId": "abc123",
"spans": [{
"name": "chat_completion",
"span_kind": "LLM",
"status_code": "OK",
"attributes": {
"llm.model_name": "gpt-4",
"llm.token_count.prompt": 512,
"llm.token_count.completion": 256,
"input.value": "What is the weather?",
"output.value": "The weather is sunny..."
}
}],
"duration": 1250,
"status": "OK"
}
Key span kinds: LLM, CHAIN, TOOL, RETRIEVER, EMBEDDING, AGENT.
Key attributes for LLM spans:
llm.model_name: Model usedllm.provider: Provider name (e.g., "openai")llm.token_count.prompt / llm.token_count.completion: Token countsllm.input_messages.*: Input messages (indexed, with role and content)llm.output_messages.*: Output messages (indexed, with role and content)input.value / output.value: Raw input/output as textexception.message: Error message if failed