-
Notifications
You must be signed in to change notification settings - Fork 737
fix: have frontend populate "stop" field in OpenAI request #4782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
copy from #4771 |
WalkthroughImplemented Stop extraction logic in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Poem
Pre-merge checks❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
lib/llm/src/protocols/openai/completions.rs (2)
240-245: Stop conditions correctly propagated from inner requestThe new
get_stopimplementation cleanly maps the optionalstopfield intoOption<Vec<String>>, handling both single-string and array forms and returningNonewhen unset. This matches the behavior used in chat completions and should allow the backend to honor OpenAIstopvalues as intended. As a minor future improvement, you could consider extracting a small shared helper for this mapping to avoid duplication with the chat completions implementation, but it's not required for this fix.
502-532: New stop tests look correct and cover key shapes
test_stopexercises the important cases: nostop, a single string, and multiple stops, and the expectations align with the newget_stopbehavior. This should guard against regressions in stop propagation. If you want slightly broader coverage later, you could add a case for an empty stop array, but it's not necessary for this PR.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
lib/llm/src/protocols/openai/completions.rs(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
lib/llm/src/protocols/openai/completions.rs (3)
lib/llm/src/protocols/openai/responses.rs (1)
get_stop(146-148)lib/llm/src/protocols/openai/chat_completions.rs (1)
get_stop(230-235)lib/llm/src/protocols/openai.rs (1)
get_stop(58-58)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (16)
- GitHub Check: trtllm (amd64)
- GitHub Check: trtllm (arm64)
- GitHub Check: sglang (amd64)
- GitHub Check: sglang (arm64)
- GitHub Check: operator (arm64)
- GitHub Check: operator (amd64)
- GitHub Check: vllm (arm64)
- GitHub Check: vllm (amd64)
- GitHub Check: Build and Test - dynamo
- GitHub Check: tests (launch/dynamo-run)
- GitHub Check: tests (lib/runtime/examples)
- GitHub Check: tests (.)
- GitHub Check: tests (lib/bindings/python)
- GitHub Check: clippy (lib/bindings/python)
- GitHub Check: clippy (launch/dynamo-run)
- GitHub Check: clippy (.)
24240a2 to
03b27a0
Compare
…quest fix: have frontend populate "stop" field when preprocessing OpenAI request
9c66fdd to
f168ff3
Compare
…#4782) Signed-off-by: Elijah Soba <[email protected]>
Overview:
Documented in #4755
When frontend receives an OpenAI request,
NvCreateCompletionRequest.inner.stophas itget_stopbecause of this, the
Preprocessoris not able to build therequestwith properstopfield. Therefore the backend cannot honor the OpenAI requeststop.This PR fixes that.
Details:
Update
get_stopfunction to return the values for the (backend) request builder.Testing
Summary by CodeRabbit
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.