From ab29944b6621d39a9d961463d582147a52d58158 Mon Sep 17 00:00:00 2001 From: Hiroshi Morishige Date: Thu, 23 Jul 2026 19:06:31 +0900 Subject: [PATCH] fix(processors): treat Fireworks model ids as reasoning-hint incompatible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fireworks AI's OpenAI-compatible API validates request bodies strictly and rejects the vLLM chat_template_kwargs hint with HTTP 400 ("Extra inputs are not permitted, field: 'chat_template_kwargs'"). Fireworks model ids always carry the provider namespace (accounts/fireworks/models/...), so extend the deny list used by model_accepts_reasoning_hint() to match them. This stops the LLM classifier's disable_reasoning auto-detect from injecting the hint at Fireworks-served classifier models, and — once the DeepSeek tier overrides consult the same check — deterministic tier calls as well. Signed-off-by: Hiroshi Morishige --- switchyard/lib/processors/reasoning_hint.py | 15 ++++++++++----- tests/test_reasoning_hint.py | 3 +++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/switchyard/lib/processors/reasoning_hint.py b/switchyard/lib/processors/reasoning_hint.py index 66c35882..aa2b3f29 100644 --- a/switchyard/lib/processors/reasoning_hint.py +++ b/switchyard/lib/processors/reasoning_hint.py @@ -5,16 +5,21 @@ from __future__ import annotations -# Anthropic-served (Claude) ids reject the vLLM ``chat_template_kwargs`` field; -# vLLM-served reasoning models that need the hint never carry these tokens. -_NO_REASONING_HINT_TAGS = ("anthropic", "bedrock", "claude") +# Anthropic-served (Claude) ids reject the vLLM ``chat_template_kwargs`` +# field, and Fireworks AI's OpenAI-compatible API validates request bodies +# strictly and 400s on it as well ("Extra inputs are not permitted"); +# Fireworks ids always carry the provider namespace +# (``accounts/fireworks/models/...``). vLLM-served reasoning models that +# need the hint never carry these tokens. +_NO_REASONING_HINT_TAGS = ("anthropic", "bedrock", "claude", "fireworks") def model_accepts_reasoning_hint(model: str) -> bool: """Whether ``model`` tolerates the vLLM ``enable_thinking=False`` hint. - ``False`` for Anthropic/Bedrock/Claude ids (they 400 on it), else ``True`` - — usable directly as a classifier ``disable_reasoning`` default. + ``False`` for Anthropic/Bedrock/Claude and Fireworks-served ids (they + 400 on it), else ``True`` — usable directly as a classifier + ``disable_reasoning`` default. """ lowered = model.lower() return not any(tag in lowered for tag in _NO_REASONING_HINT_TAGS) diff --git a/tests/test_reasoning_hint.py b/tests/test_reasoning_hint.py index 0c0c5ec1..d389285d 100644 --- a/tests/test_reasoning_hint.py +++ b/tests/test_reasoning_hint.py @@ -18,6 +18,9 @@ "azure/anthropic/claude-opus-4-6", "anthropic/claude-3-5-sonnet", "Bedrock-Claude-Whatever", # case-insensitive + "accounts/fireworks/models/deepseek-v4-flash", + "accounts/fireworks/models/deepseek-v4-pro", + "accounts/fireworks/models/glm-5p2", ], ) def test_claude_family_rejects_hint(model: str) -> None: