feat(litellm): map reasoning_effort high/max -> xhigh for gen-reasoning

The gen-reasoning seat accepts only xhigh/medium/low and 400s on anything
else — including `high`, which is the default of several clients, so the
seat presented as broken rather than as one enum value out of step. The
DeepSeek Harness failed every request on its default setting, and the only
working client value was `low`: the seat's WEAKEST reasoning tier, while
its own default is xhigh.

conf/reasoning_effort_map.py is a pre-call hook in the same shape as the
existing strip_empty_tools hook. It is scoped to one model group, measured
rather than assumed: gen-reasoning rejects `high`; gen, sec,
char-rp-reasoning and summarizer all accept it and are left alone. Paid
passthroughs were not probed, because probing them spends vendor credits,
and are not mapped.

Verified after deploy: high and max now succeed on gen-reasoning, low and
xhigh still work, a request with no effort param still works, `gen` with
`high` still passes through unmapped, and the harness completes a real
file-edit task at full reasoning.

Needed a compose change as well as a conf push — callbacks are bind-mounted
per file, so the volume only attaches on container create. Recreated the
litellm service by name so the DB was not bounced with it.
This commit is contained in:
vh
2026-09-02 15:43:22 -07:00
parent e9605df6ff
commit 926fc2fb7a
4 changed files with 104 additions and 1 deletions
+3
View File
@@ -36,6 +36,9 @@ services:
# Must sit beside config.yaml — LiteLLM loads callbacks relative to the
# config file's directory, so this lands at /app/strip_empty_tools.py.
- /opt/docker/conf/litellm/strip_empty_tools.py:/app/strip_empty_tools.py:ro
# Second pre-call hook: per-model `reasoning_effort` translation. Same
# beside-the-config requirement as the hook above.
- /opt/docker/conf/litellm/reasoning_effort_map.py:/app/reasoning_effort_map.py:ro
environment:
# master_key gates the proxy + admin UI login. Must start with sk-.
- LITELLM_MASTER_KEY=${LITELLM_MASTER_KEY}