fix(profiles): gate DeepSeek thinking-off default on reasoning-hint compatibility - #122
Conversation
…ompatibility
apply_deepseek_overrides() unconditionally injects the vLLM-only
chat_template_kwargs.enable_thinking=false hint for any target whose
model id contains "deepseek-v4". OpenAI-compatible providers with
strict request validation reject the unknown field with HTTP 400
("Extra inputs are not permitted"), which breaks every routed call
for deepseek-v4 tiers served outside the NVIDIA benchmark gateway
(observed on Fireworks AI serverless).
Gate the body default on model_accepts_reasoning_hint(), the same
model-id compatibility check the LLM classifier already applies before
sending the hint on its own calls. The provider-neutral
X-Inference-Priority header default is unchanged, and explicitly
provided extra_body still wins as before.
Signed-off-by: Hiroshi Morishige <hiroshi.morishige@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
WalkthroughDeepSeek v4 thinking-disabled overrides are now gated by model compatibility with reasoning hints, and a regression test covers incompatible model IDs while preserving batch-priority routing. ChangesDeepSeek override compatibility
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
| default_body = ( | ||
| {"chat_template_kwargs": {"enable_thinking": False}} | ||
| if "deepseek-v4" in target.model | ||
| if "deepseek-v4" in target.model and model_accepts_reasoning_hint(target.model) |
There was a problem hiding this comment.
Nice — gating the tier default on model_accepts_reasoning_hint matches what the classifier already does, so both paths now agree on when to send enable_thinking=false. (For context: apply_deepseek_overrides sets default request options for DeepSeek tier calls, and this hint is one of them.)
One thing to flag for later: both the tier default (this function) and the classifier default now depend on that one check being complete. The check works by looking for provider names inside the model id, so a new backend that rejects the hint will still receive it until someone remembers to add its name to _NO_REASONING_HINT_TAGS. That is easy to forget, and the failure shows up as a hard 400 in production.
Concrete suggestion: consider deciding this on the target/endpoint config rather than the model name. For example, add an optional accepts_reasoning_hint flag to the target (LlmTarget in llm_target.py), default it from model_accepts_reasoning_hint(model) when the config doesn't set it, and have both apply_deepseek_overrides and the classifier presets read that flag. Then a strict backend can be marked incompatible in its own config, with no code change and no name list to keep in sync.
Fixes the tier-call half of #121.
What
apply_deepseek_overrides()unconditionally injects the vLLM-onlychat_template_kwargs.enable_thinking=falsehint for any target whose model id containsdeepseek-v4. Providers with strict request validation (observed: Fireworks AI serverless) reject the unknown field with HTTP 400Extra inputs are not permitted, breaking every routed call for such tiers.This PR gates the body default on
model_accepts_reasoning_hint()— the same model-id compatibility checkLLMClassifierConfig.disable_reasoningauto-detect already applies before sending the identical hint on classifier calls. The provider-neutralX-Inference-Priorityheader default is unchanged, and explicitly providedextra_bodystill wins as before.Pairs with #123 (adds
fireworksto the deny list); together they stop the 400 for Fireworks-served deepseek-v4 targets.Validation
extra_bodyuntouched while still receiving the batch-priority header; existingTestDeepSeekOverridescases unchanged and passing.tests/test_deterministic_routing_profile.py+tests/test_reasoning_hint.py: 47 passed. Two failures (TestProfileStructure::test_shared_stats_accumulator,test_overflow_reroutes_to_custom_strong_id_through_full_profile) are pre-existing on unmodifiedmainin my environment (same class of stale-build failure noted in feat(serve): route-log per-request routing stats for profile-config serve #118's validation notes).Summary by CodeRabbit
Bug Fixes
Tests