You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(litellm): pass api_base and enable_thinking for bool THINKING #1206
`LiteLLMBackend` has two bugs in its `ModelOption.THINKING` handling that were discovered during live smoke testing against vLLM endpoints (Qwen3.6-27B and Gemma-4-31B-it).
First, `self._base_url` is stored in `init` but never passed as `api_base` to `litellm.acompletion()`. Any `LiteLLMBackend` constructed with a custom `base_url` silently connects to the wrong endpoint — the backend works only because `ollama_chat/` models happen to route to `localhost:11434` automatically via LiteLLM's prefix handling.
Second, when `THINKING=True` or `THINKING=False` (bool), `chat_template_kwargs.enable_thinking` is never set in `extra_body`. For vLLM-served models that require this Jinja template toggle (Qwen3, Gemma 4, GLM-4.5, and others), `THINKING=True` has no effect. Live test confirmed: Gemma-4-31B-it on vLLM produces no reasoning trace when called via LiteLLM with only `reasoning_effort="medium"` — it requires `chat_template_kwargs.enable_thinking=True` explicitly. `THINKING=False` sends `reasoning_effort=False` (an invalid value) which is silently dropped by `drop_params=True`, so thinking cannot be disabled either.
Both fixes are straightforward: pass `api_base=self._base_url` to the `litellm.acompletion()` call, and add the same `extra_body.chat_template_kwargs.enable_thinking` logic that PR #1204 introduced in `OpenAIBackend`.
Relates to #1201 (thinking model support epic). Discovered during validation work for PR #1204.
Activity
fix(litellm): pass api_base and set enable_thinking for bool THINKING (…