fix(chat_template): accept reasoning_effort="high" (Claude Code default) via alias to "xhigh"

#147

Why

vLLM's Anthropic-compatible endpoint (/v1/messages, vLLM 0.27.1) forwards the request's output_config.effort verbatim as reasoning_effort. Claude Code (2.1.235) sends effort: "high" by default for effort-capable models, so every request fails with HTTP 500:

jinja2.exceptions.TemplateError: Unexpected reasoning effort high. Supported types are xhigh (default), medium, and low.

Minimal reproduction without any server:

tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True, reasoning_effort="high")   # raises on current template

Verification

Rendered with transformers 5.15.0 / jinja2 3.1.6 (as bundled in vllm/vllm-openai:v0.27.1) against the current template:

  • high → byte-identical to the current template's xhigh output
  • xhigh / medium / low / omitted → unchanged
  • unknown values (e.g. max, bogus) → still raise exactly as before (validation is not loosened)

medium is already the neutral baseline (no reasoning instruction) and low / xhigh add prompt modifiers, so the alias is a pure template-compatibility change — no weights or serving logic involved. If maintainers prefer a different target for high, happy to adjust.

Full write-up (three-layer reproduction: template / vLLM curl / Claude Code, logs, environment): https://github.com/QwenLM/Qwen3.8/issues/217

This would be useful.

Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment