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
change
sglang
Commits
68a54e06
Unverified
Commit
68a54e06
authored
Aug 27, 2025
by
Xinyuan Tong
Committed by
GitHub
Aug 27, 2025
Browse files
Sets default model name in request classes (#9683)
Signed-off-by:
Xinyuan Tong
<
xinyuantong.cs@gmail.com
>
parent
fd18995c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
python/sglang/srt/entrypoints/openai/protocol.py
python/sglang/srt/entrypoints/openai/protocol.py
+6
-4
No files found.
python/sglang/srt/entrypoints/openai/protocol.py
View file @
68a54e06
...
...
@@ -35,6 +35,8 @@ from pydantic import (
)
from
typing_extensions
import
Literal
DEFAULT_MODEL_NAME
=
"default"
class
ModelCard
(
BaseModel
):
"""Model cards."""
...
...
@@ -183,7 +185,7 @@ class BatchResponse(BaseModel):
class
CompletionRequest
(
BaseModel
):
# Ordered by official OpenAI API documentation
# https://platform.openai.com/docs/api-reference/completions/create
model
:
str
model
:
str
=
DEFAULT_MODEL_NAME
prompt
:
Union
[
List
[
int
],
List
[
List
[
int
]],
str
,
List
[
str
]]
best_of
:
Optional
[
int
]
=
None
echo
:
bool
=
False
...
...
@@ -410,7 +412,7 @@ class ChatCompletionRequest(BaseModel):
# Ordered by official OpenAI API documentation
# https://platform.openai.com/docs/api-reference/chat/create
messages
:
List
[
ChatCompletionMessageParam
]
model
:
str
model
:
str
=
DEFAULT_MODEL_NAME
frequency_penalty
:
float
=
0.0
logit_bias
:
Optional
[
Dict
[
str
,
float
]]
=
None
logprobs
:
bool
=
False
...
...
@@ -572,7 +574,7 @@ class EmbeddingRequest(BaseModel):
# Ordered by official OpenAI API documentation
# https://platform.openai.com/docs/api-reference/embeddings/create
input
:
EmbeddingInput
model
:
str
model
:
str
=
DEFAULT_MODEL_NAME
encoding_format
:
str
=
"float"
dimensions
:
Optional
[
int
]
=
None
user
:
Optional
[
str
]
=
None
...
...
@@ -606,7 +608,7 @@ class ScoringRequest(BaseModel):
)
apply_softmax
:
bool
=
False
item_first
:
bool
=
False
model
:
str
model
:
str
=
DEFAULT_MODEL_NAME
class
ScoringResponse
(
BaseModel
):
...
...
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