fix(llm): drop falsy logprobs from payloads for strict providers - #827
fix(llm): drop falsy logprobs from payloads for strict providers#827paultranvan wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughVLLM request construction now removes falsy ChangesVLLM logprob payload handling
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/unit/services/inference/test_vllm_client.py (1)
279-291: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCover truthy logprobs on
generate.The new completion-path normalization is only tested with
logprobs=False; add agenerate(..., logprobs=True, top_logprobs=5)assertion to catch future divergence from the chat path.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/unit/services/inference/test_vllm_client.py` around lines 279 - 291, Add coverage for the completion path by extending the relevant inference client tests around the existing falsey logprobs normalization test. Invoke generate with logprobs=True and top_logprobs=5, capture the request payload, and assert those values remain unchanged, matching test_truthy_logprobs_forwarded without altering the chat-path test.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/unit/services/inference/test_vllm_client.py`:
- Around line 279-291: Add coverage for the completion path by extending the
relevant inference client tests around the existing falsey logprobs
normalization test. Invoke generate with logprobs=True and top_logprobs=5,
capture the request payload, and assert those values remain unchanged, matching
test_truthy_logprobs_forwarded without altering the chat-path test.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 88770b89-fe8e-4beb-a52a-4d0bb6ad438c
📒 Files selected for processing (2)
openrag/services/inference/vllm_client.pytests/unit/services/inference/test_vllm_client.py
Falsy logprobs were making 400 when using /chat/completions with external LLM providers such as Gemini
Summary by CodeRabbit
Bug Fixes
Tests