Skip to content

feat(proxy): add health_check_reasoning_effort for model health checks - #27115

Merged
Sameerlite merged 2 commits into
BerriAI:litellm_internal_stagingfrom
Sameerlite:litellm_health_check_reasoning_effort
May 5, 2026
Merged

feat(proxy): add health_check_reasoning_effort for model health checks#27115
Sameerlite merged 2 commits into
BerriAI:litellm_internal_stagingfrom
Sameerlite:litellm_health_check_reasoning_effort

Conversation

@Sameerlite

@Sameerlite Sameerlite commented May 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds optional model_info.health_check_reasoning_effort so proxy health checks can set reasoning_effort (e.g. none) on chat-style probes only—useful for reasoning models where probes should minimize cost/latency.

Config

model_info:
  health_check_reasoning_effort: none

Applied when mode is unset (chat), chat, completion, skipped for all other modes for now

Tests

  • tests/test_litellm/proxy/test_health_check_max_tokens.py::test_update_litellm_params_health_check_reasoning_effort
image

Docs: BerriAI/litellm-docs#71


Note

Low Risk
Low risk: a small, gated parameter addition limited to health-check request construction, with unit tests covering supported/unsupported modes.

Overview
Adds optional model_info.health_check_reasoning_effort so proxy health checks can forward reasoning_effort on chat-style probe requests (mode None, chat, or completion), while skipping other modes.

Extends the health-check max-tokens test suite with coverage ensuring reasoning_effort is set when configured (including dict values) and omitted for unsupported modes or absent config.

Reviewed by Cursor Bugbot for commit 32a5e77. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-authored-by: Cursor <cursoragent@cursor.com>
@greptile-apps

greptile-apps Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds health_check_reasoning_effort to model_info, letting operators pass a reasoning_effort value (e.g. none) to chat-style health-check probes — useful for cost/latency reduction on reasoning models. The implementation is small and focused: a frozenset gate (None, "chat", "completion") in _update_litellm_params_for_health_check and a corresponding unit test.

Confidence Score: 5/5

Safe to merge — the change is additive, opt-in, and does not affect any request path unless health_check_reasoning_effort is explicitly configured.

No P0 or P1 findings. The only comment is a P2 test-coverage gap for mode="completion". Core logic is correct and well-guarded.

No files require special attention.

Important Files Changed

Filename Overview
litellm/proxy/health_check.py Adds _HEALTH_CHECK_MODES_SUPPORTING_REASONING_EFFORT frozenset and applies health_check_reasoning_effort from model_info to litellm params only for None/chat/completion modes; logic is clean and correct.
tests/test_litellm/proxy/test_health_check_max_tokens.py New test covers mode=None, mode=chat, dict value, excluded mode (embedding), and absent key — but mode="completion" (the third value in the frozenset) has no dedicated test case.

Reviews (4): Last reviewed commit: "feat(proxy): add health_check_reasoning_..." | Re-trigger Greptile

Comment thread litellm/proxy/health_check.py
@Sameerlite

Copy link
Copy Markdown
Contributor Author

@greptile-apps re review

@codecov

codecov Bot commented May 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Sameerlite
Sameerlite force-pushed the litellm_health_check_reasoning_effort branch from a060479 to 32a5e77 Compare May 4, 2026 11:54
@Sameerlite

Copy link
Copy Markdown
Contributor Author

@greptile-apps re review , my bad, I had added another code. Now it is only health check related code

@Sameerlite

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 32a5e77. Configure here.

@mateo-berri
mateo-berri self-requested a review May 5, 2026 01:26

@mateo-berri mateo-berri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but a small non blocking thought:

The only comment is a P2 test-coverage gap for mode="completion"

consider fixing Greptile's P2 test gap for mode="completion". Looking at the new test test_update_litellm_params_health_check_reasoning_effort in tests/test_litellm/proxy/test_health_check_max_tokens.py, the cases cover no mode key, mode="chat", no mode key -> dict value, mode="embedding", and empty model_info. mode="completion" is the third allowed value in the frozenset that you add to the gate, but never assert that the gate actually lets it through, so a regression that drops "completion" from the set wouldn't be caught. A quick assert would be nice to add

Co-authored-by: Cursor <cursoragent@cursor.com>
@Sameerlite

Copy link
Copy Markdown
Contributor Author

LGTM but a small non blocking thought:

The only comment is a P2 test-coverage gap for mode="completion"

consider fixing Greptile's P2 test gap for mode="completion". Looking at the new test test_update_litellm_params_health_check_reasoning_effort in tests/test_litellm/proxy/test_health_check_max_tokens.py, the cases cover no mode key, mode="chat", no mode key -> dict value, mode="embedding", and empty model_info. mode="completion" is the third allowed value in the frozenset that you add to the gate, but never assert that the gate actually lets it through, so a regression that drops "completion" from the set wouldn't be caught. A quick assert would be nice to add

Fixed it, thanks!

@Sameerlite
Sameerlite merged commit 4487d83 into BerriAI:litellm_internal_staging May 5, 2026
42 checks passed
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
…_reasoning_effort

feat(proxy): add health_check_reasoning_effort for model health checks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants