Skip to content

Support o1 model on Azure #4980

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

Merged
merged 28 commits into from
Apr 21, 2025
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
640d7eb
add o1 example
ChuyueSun Feb 7, 2025
d50b93f
add o1 example
ChuyueSun Feb 7, 2025
5a5ec9d
add support for o1
ChuyueSun Feb 7, 2025
1c0cf24
format
ChuyueSun Feb 7, 2025
44a5efd
Merge branch 'main' into main
ChuyueSun Feb 7, 2025
e8c9053
o3 also does not have max_tokens
ChuyueSun Feb 7, 2025
c333e34
address review
ChuyueSun Feb 10, 2025
3ed82f4
clean
ChuyueSun Feb 10, 2025
ad29bd1
Merge branch 'main' into main
shanyu-sys Feb 13, 2025
73a968c
lint
ChuyueSun Feb 13, 2025
342ef19
Merge branch 'main' into main
shanyu-sys Feb 13, 2025
1b1640c
fix
ChuyueSun Feb 13, 2025
f52cc94
Merge branch 'main' of github.com:ChuyueSun/sglang
ChuyueSun Feb 13, 2025
4a971f2
lint
ChuyueSun Feb 13, 2025
bc85bd5
Merge branch 'main' into main
ChuyueSun Feb 13, 2025
f08a7d6
Merge branch 'main' into main
ChuyueSun Feb 14, 2025
a513b5b
Merge branch 'sgl-project:main' into main
ChuyueSun Feb 14, 2025
2ab23b3
Merge branch 'sgl-project:main' into main
ChuyueSun Feb 27, 2025
92c133e
Merge remote-tracking branch 'upstream/main'
ChuyueSun Mar 5, 2025
a45a7d1
Merge branch 'sgl-project:main' into main
ChuyueSun Mar 7, 2025
f0d409c
Merge branch 'sgl-project:main' into main
ChuyueSun Mar 26, 2025
bfa58ac
Merge branch 'main' of github.com:ChuyueSun/sglang
ChuyueSun Mar 26, 2025
9ba53e9
Merge branch 'sgl-project:main' into azure_o1
ChuyueSun Apr 2, 2025
caf017a
azure o1
ChuyueSun Apr 2, 2025
f169cbf
lint
ChuyueSun Apr 2, 2025
88286ec
Merge branch 'main' into azure_o1
shanyu-sys Apr 2, 2025
4a6bc2d
Merge branch 'sgl-project:main' into azure_o1
ChuyueSun Apr 4, 2025
794c054
Merge branch 'sgl-project:main' into azure_o1
ChuyueSun Apr 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion python/sglang/lang/backend/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@ def generate(
prompt = s.text_

kwargs = sampling_params.to_openai_kwargs()
if self.model_name.startswith("o1") or self.model_name.startswith("o3"):
if (
self.model_name.startswith("o1")
or self.model_name.startswith("o3")
or "o1" in self.model_name
):
kwargs.pop("max_tokens", None)
else:
kwargs.pop("max_completion_tokens", None)
Expand Down
Loading