litellm/cookbook/capability_map_poc
Joshua Valluru d884bd73e5 feat(cookbook): label feedback per whole conversation in the capability map POC
Stage 4a now labels every user turn of a conversation in one call with a forced JSON schema,
counts every NEG_1-3 label as a correction, retries a conversation once when the turn numbers
do not match, and keeps one gold label per sparse turn

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 14:37:51 -08:00
..
tests feat(cookbook): label feedback per whole conversation in the capability map POC 2026-11-11 14:37:51 -08:00
__init__.py feat(cookbook): capability map POC stage 1 split and stage 4a feedback labeler 2026-11-10 11:39:34 -08:00
corrections.py feat(cookbook): label feedback per whole conversation in the capability map POC 2026-11-11 14:37:51 -08:00
eval_feedback.py feat(cookbook): label feedback per whole conversation in the capability map POC 2026-11-11 14:37:51 -08:00
evaluate.py feat(cookbook): label feedback per whole conversation in the capability map POC 2026-11-11 14:37:51 -08:00
labeler.py feat(cookbook): label feedback per whole conversation in the capability map POC 2026-11-11 14:37:51 -08:00
README.md feat(cookbook): capability map POC stage 1 split and stage 4a feedback labeler 2026-11-10 11:39:34 -08:00
schemas.py feat(cookbook): label feedback per whole conversation in the capability map POC 2026-11-11 14:37:51 -08:00
sources.py feat(cookbook): label feedback per whole conversation in the capability map POC 2026-11-11 14:37:51 -08:00
split.py feat(cookbook): capability map POC stage 1 split and stage 4a feedback labeler 2026-11-10 11:39:34 -08:00

Capability map POC

Experiment code for learning a model x task capability matrix from tau2-bench telecom traffic. Not used by the proxy

Run every command from cookbook/ with Python 3.12 and pydantic, openai, datasets, pytest installed

python -m pytest capability_map_poc/tests

# Stage 1: freeze tau2's official telecom train/test split
python -m capability_map_poc.split --split-file "$TAU2_DATA_DIR/tau2/domains/telecom/split_tasks.json" --out-dir out/stage1

# Stage 4a: check the correction labeler against the EMNLP 2025 human labels, through the LiteLLM gateway
LITELLM_PROXY_BASE_URL=http://127.0.0.1:4000 LITELLM_PROXY_KEY=sk-... \
  python -m capability_map_poc.eval_feedback --out-dir out/stage4a --model claude-sonnet-5-5

Stage 4a appends every label to labels_<split>.jsonl as it arrives and reuses them on the next run, so a rerun only pays for turns that are missing or failed