feat(proxy): add health_check_reasoning_effort for model health checks - #27115
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Greptile SummaryThis PR adds Confidence Score: 5/5Safe to merge — the change is additive, opt-in, and does not affect any request path unless No P0 or P1 findings. The only comment is a P2 test-coverage gap for No files require special attention.
|
| 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
|
@greptile-apps re review |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
a060479 to
32a5e77
Compare
|
@greptile-apps re review , my bad, I had added another code. Now it is only health check related code |
|
bugbot run |
There was a problem hiding this comment.
✅ 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
left a comment
There was a problem hiding this comment.
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>
Fixed it, thanks! |
…_reasoning_effort feat(proxy): add health_check_reasoning_effort for model health checks
Summary
Adds optional
model_info.health_check_reasoning_effortso proxy health checks can setreasoning_effort(e.g.none) on chat-style probes only—useful for reasoning models where probes should minimize cost/latency.Config
Applied when
modeis unset (chat),chat,completion, skipped for all other modes for nowTests
tests/test_litellm/proxy/test_health_check_max_tokens.py::test_update_litellm_params_health_check_reasoning_effortDocs: 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_effortso proxy health checks can forwardreasoning_efforton chat-style probe requests (modeNone,chat, orcompletion), while skipping other modes.Extends the health-check max-tokens test suite with coverage ensuring
reasoning_effortis 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.