feat: rust sglang server openai apis - #33103
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 06511cc44c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ng-text, handler tests
271ee8e to
b7dc477
Compare
| /// Unlike request streaming decode, this has no request registration or | ||
| /// incremental state. The oneshot carries only the reply; callers depend on | ||
| /// this service method rather than owning a concrete tokenizer. | ||
| pub async fn decode_once(&self, rid: &Rid, token_ids: TokenIds) -> Result<String, Error> { |
There was a problem hiding this comment.
In which case, there is token-id sequence?
There was a problem hiding this comment.
It's only needed for /v1/completions when the input prompt is a token-id sequence and echo is true.
|
/rerun-test test/registered/openai_server/basic/test_openai_completion_rust.py test/registered/openai_server/basic/test_openai_server.py test/registered/openai_server/function_call/test_openai_function_calling.py |
|
Results for 🚀 🚀 |
Co-authored-by: Rain Jiang <rain-jiang@outlook.com>
Co-authored-by: Rain Jiang <rain-jiang@outlook.com>
Co-authored-by: Rain Jiang <rain-jiang@outlook.com>
Co-authored-by: Rain Jiang <rain-jiang@outlook.com>
Motivation
Implemented the full OpenAI APIs for rust sglang server.
Modifications
Implemented APIs:
v1/modelsv1/completionsv1/chat/completionsSome design decisions
nfanout: Fan-out in HTTP layer — submitsnseparateGenerateRequests, each withn=1. Matches external API behavior, avoids nativen > 1rejection--api-keyBearer token gating on all OpenAI endpoints (default: open for no key configured)function_call/functions: Explicitly rejected with migration message (Python silently ignores)text_offset: SGLang emits[-1]sentinels; post-processed incompletion_response_valuesince Dynamo types it asu32system_fingerprint: Removed from responses (Python doesn't include it)reasoning_content: null: Serialized into every SSE delta chunk (Python compat)Accuracy Tests
TestOpenAIServer,TestOpenAIFunctionCalling,TestOpenAIResponsesclasses reused verbatim behindis_rust_server_built()guards via class attribute aliasingSpeed Tests and Profiling
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ⏳ Run #30788528554
Latest PR Test (Extra): ❌ Run #30788528388