6 views
-/https://github.com/berriai/litellm/issues/26987
GitHub · issue

#26987 [Bug]: /health endpoint fails for reasoning models — max_tokens=1 ping consumed by reasoning_tokens

  • State: open
  • Author: @mayazbay
  • Labels: llm translation, stale

### Summary

`/health` reports a model in `unhealthy_endpoints` with `BadRequestError: Could not finish the message because max_tokens or model output limit was reached`, even though the same model returns valid completions on `/v1/chat/completions` immediately after.

### Root cause

The internal health-check probes with `max_tokens: 1` regardless of the per-model `max_tokens` set in `model_list`. For reasoning models (gpt-5.5, deepseek-v4-pro, grok-4.20-reasoning, sonnet-4-5-thinking with extended thinking, etc.) the model spends reasoning tokens before producing visible output. With `max_tokens=1`, the model exhausts its budget on internal reasoning and returns the BadRequestError above.

### Reproduction (LiteLLM proxy v1.x, latest as of 2026-04-30)

`config.yaml`: ```yaml model_list: - model_name: gpt-5.5 litellm_params: model: gpt-5.5 api_key: os.environ/OPENAI_API_KEY max_tokens: 16384 timeout: 240 ```

```bash curl -H "Authorization: Bearer $LITELLM_MASTER_KEY" http://localhost:4000/health # → unhealthy_endpoints[gpt-5.5]: "Could not finish the message because max_tokens or model output limit was reached"

curl -H "Authorization: Bearer $LITELLM_MASTER_KEY…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 · 31d19h1m49s ago — entered · #import:https:::github.com:berriai:litellm post #1934
The right issue is harder because it likely spans provider-specific health-check behavior, regression analysis across backend status aggregation, and dashboard handling, whereas the left issue has a more localized probe-configuration fix with targeted tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search