Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
zhaoyu6
sglang
Commits
51ae4030
"Makefile" did not exist on "a805e5947e6a41b9978e426f1ebf0eaf6c1c29fe"
Unverified
Commit
51ae4030
authored
Jul 08, 2025
by
Shuaiyi Zhang
Committed by
GitHub
Jul 08, 2025
Browse files
[router] forward stream_options in request (#7860)
parent
653b873b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
+21
-0
sgl-router/benches/request_processing.rs
sgl-router/benches/request_processing.rs
+3
-0
sgl-router/src/openai_api_types.rs
sgl-router/src/openai_api_types.rs
+14
-0
sgl-router/tests/benchmark_integration.rs
sgl-router/tests/benchmark_integration.rs
+4
-0
No files found.
sgl-router/benches/request_processing.rs
View file @
51ae4030
...
...
@@ -59,6 +59,7 @@ fn create_sample_chat_completion_request() -> ChatCompletionRequest {
top_p
:
Some
(
1.0
),
n
:
Some
(
1
),
stream
:
false
,
stream_options
:
None
,
stop
:
None
,
presence_penalty
:
Some
(
0.0
),
frequency_penalty
:
Some
(
0.0
),
...
...
@@ -86,6 +87,7 @@ fn create_sample_completion_request() -> CompletionRequest {
top_p
:
Some
(
1.0
),
n
:
Some
(
1
),
stream
:
false
,
stream_options
:
None
,
logprobs
:
None
,
echo
:
false
,
stop
:
None
,
...
...
@@ -130,6 +132,7 @@ fn create_large_chat_completion_request() -> ChatCompletionRequest {
top_p
:
Some
(
0.95
),
n
:
Some
(
1
),
stream
:
false
,
stream_options
:
None
,
stop
:
None
,
presence_penalty
:
Some
(
0.1
),
frequency_penalty
:
Some
(
0.1
),
...
...
sgl-router/src/openai_api_types.rs
View file @
51ae4030
...
...
@@ -52,6 +52,10 @@ pub struct CompletionRequest {
#[serde(default)]
pub
stream
:
bool
,
/// Options for streaming response
#[serde(skip_serializing_if
=
"Option::is_none"
)]
pub
stream_options
:
Option
<
StreamOptions
>
,
/// Include the log probabilities on the logprobs most likely tokens
#[serde(skip_serializing_if
=
"Option::is_none"
)]
pub
logprobs
:
Option
<
u32
>
,
...
...
@@ -132,6 +136,10 @@ pub struct ChatCompletionRequest {
#[serde(default)]
pub
stream
:
bool
,
/// Options for streaming response
#[serde(skip_serializing_if
=
"Option::is_none"
)]
pub
stream_options
:
Option
<
StreamOptions
>
,
/// Up to 4 sequences where the API will stop generating further tokens
#[serde(skip_serializing_if
=
"Option::is_none"
)]
pub
stop
:
Option
<
StringOrArray
>
,
...
...
@@ -258,6 +266,12 @@ pub struct ImageUrl {
pub
detail
:
Option
<
String
>
,
// "auto", "low", or "high"
}
#[derive(Debug,
Clone,
Deserialize,
Serialize)]
pub
struct
StreamOptions
{
#[serde(skip_serializing_if
=
"Option::is_none"
)]
pub
include_usage
:
Option
<
bool
>
,
}
#[derive(Debug,
Clone,
Deserialize,
Serialize)]
#[serde(tag
=
"type"
)]
pub
enum
ResponseFormat
{
...
...
sgl-router/tests/benchmark_integration.rs
View file @
51ae4030
...
...
@@ -50,6 +50,7 @@ fn test_benchmark_request_creation() {
top_p
:
Some
(
1.0
),
n
:
Some
(
1
),
stream
:
false
,
stream_options
:
None
,
stop
:
None
,
presence_penalty
:
Some
(
0.0
),
frequency_penalty
:
Some
(
0.0
),
...
...
@@ -75,6 +76,7 @@ fn test_benchmark_request_creation() {
top_p
:
Some
(
1.0
),
n
:
Some
(
1
),
stream
:
false
,
stream_options
:
None
,
logprobs
:
None
,
echo
:
false
,
stop
:
None
,
...
...
@@ -143,6 +145,7 @@ fn test_benchmark_request_adaptation() {
top_p
:
Some
(
1.0
),
n
:
Some
(
1
),
stream
:
false
,
stream_options
:
None
,
stop
:
None
,
presence_penalty
:
Some
(
0.0
),
frequency_penalty
:
Some
(
0.0
),
...
...
@@ -168,6 +171,7 @@ fn test_benchmark_request_adaptation() {
top_p
:
Some
(
1.0
),
n
:
Some
(
1
),
stream
:
false
,
stream_options
:
None
,
logprobs
:
None
,
echo
:
false
,
stop
:
None
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment