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
d5e2a374
Unverified
Commit
d5e2a374
authored
Sep 13, 2025
by
Muqi Li
Committed by
GitHub
Sep 12, 2025
Browse files
Benchmark: Support API_KEY without 'bearer' (#10380)
parent
366043db
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
python/sglang/bench_serving.py
python/sglang/bench_serving.py
+6
-3
No files found.
python/sglang/bench_serving.py
View file @
d5e2a374
...
@@ -105,10 +105,13 @@ def remove_suffix(text: str, suffix: str) -> str:
...
@@ -105,10 +105,13 @@ def remove_suffix(text: str, suffix: str) -> str:
def
get_auth_headers
()
->
Dict
[
str
,
str
]:
def
get_auth_headers
()
->
Dict
[
str
,
str
]:
api_key
=
os
.
environ
.
get
(
"OPENAI_API_KEY"
)
openai_
api_key
=
os
.
environ
.
get
(
"OPENAI_API_KEY"
)
if
api_key
:
if
openai_
api_key
:
return
{
"Authorization"
:
f
"Bearer
{
api_key
}
"
}
return
{
"Authorization"
:
f
"Bearer
{
openai_
api_key
}
"
}
else
:
else
:
api_key
=
os
.
environ
.
get
(
"API_KEY"
)
if
api_key
:
return
{
"Authorization"
:
f
"
{
api_key
}
"
}
return
{}
return
{}
...
...
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