litellm - 💡(How to fix) Fix [Bug]: Proxy drops message.reasoning_content for Mistral reasoning models (SDK returns it)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

litellm_settings: drop_params: true is set (this is documented as input-param dropping; flagging only in case it is implicated in response serialization). The model is the version-pinned mistral/mistral-medium-3-5 — note mistral/mistral-medium-latest currently resolves to a non-reasoning snapshot (mistral-medium-2508) that rejects reasoning_effort entirely (error 3051), which is a separate gotcha but worth a docs note.

Code Example

import litellm
r = litellm.completion(
    model="mistral/mistral-medium-3-5",
    messages=[{"role": "user", "content": "If a train travels 60 km in 45 minutes, what is its speed in km/h?"}],
    reasoning_effort="high",
    allowed_openai_params=["reasoning_effort"],
    max_tokens=2000,
)
m = r.choices[0].message
print(len(m.reasoning_content or ""))  # -> 1046
print(len(m.content or ""))            # -> 305

---

model_list:
  - model_name: mistral-medium-3-5
    litellm_params:
      model: mistral/mistral-medium-3-5
      api_key: os.environ/MISTRAL_API_KEY

---

curl -s $PROXY/v1/chat/completions \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"model":"mistral-medium-3-5",
       "messages":[{"role":"user","content":"If a train travels 60 km in 45 minutes, what is its speed in km/h?"}],
       "reasoning_effort":"high","max_tokens":2000}'
# response message has `content` but no `reasoning_content` field
RAW_BUFFERClick to expand / collapse

What happened?

Calling a Mistral reasoning model (mistral-medium-3-5 with reasoning_effort="high") through the litellm proxy (POST /v1/chat/completions) returns a response whose message has no reasoning_content — the thinking trace is dropped. The identical call via the litellm.completion() SDK (in-process) returns reasoning_content correctly.

Mistral returns reasoning as a typed block inside content ([{"type":"thinking",...},{"type":"text",...}]). The SDK's Mistral transformer maps the thinking block to message.reasoning_content; the proxy's HTTP serialization does not include it. This breaks parity with how the proxy exposes reasoning for Anthropic thinking / DeepSeek / Magistral.

How to reproduce

(A) SDK, in-process — reasoning_content IS present:

import litellm
r = litellm.completion(
    model="mistral/mistral-medium-3-5",
    messages=[{"role": "user", "content": "If a train travels 60 km in 45 minutes, what is its speed in km/h?"}],
    reasoning_effort="high",
    allowed_openai_params=["reasoning_effort"],
    max_tokens=2000,
)
m = r.choices[0].message
print(len(m.reasoning_content or ""))  # -> 1046
print(len(m.content or ""))            # -> 305

(B) Proxy — reasoning_content is MISSING.

config.yaml:

model_list:
  - model_name: mistral-medium-3-5
    litellm_params:
      model: mistral/mistral-medium-3-5
      api_key: os.environ/MISTRAL_API_KEY

request:

curl -s $PROXY/v1/chat/completions \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"model":"mistral-medium-3-5",
       "messages":[{"role":"user","content":"If a train travels 60 km in 45 minutes, what is its speed in km/h?"}],
       "reasoning_effort":"high","max_tokens":2000}'
# response message has `content` but no `reasoning_content` field

Same result with "stream": true: only content deltas arrive, no reasoning_content / reasoning deltas.

Expected

The proxy HTTP response (and streaming deltas) should include message.reasoning_content for Mistral reasoning models, matching the SDK and the proxy's existing behavior for other reasoning providers.

Version

litellm v1.86.0 (proxy, Docker ghcr.io/berriai/litellm:main-stable). Checked the v1.86.1 / v1.86.2 release notes — no related entry.

Notes / config

litellm_settings: drop_params: true is set (this is documented as input-param dropping; flagging only in case it is implicated in response serialization). The model is the version-pinned mistral/mistral-medium-3-5 — note mistral/mistral-medium-latest currently resolves to a non-reasoning snapshot (mistral-medium-2508) that rejects reasoning_effort entirely (error 3051), which is a separate gotcha but worth a docs note.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING