-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(openai): added support for o1 reasoning models #1618
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
+33
−1
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
|
this is cool - i had a crack at this a while ago ( #1540 (comment) ) at which point streaming wasn't supported so i had to do some extra messing around (i capture token usage too). |
Contributor
|
Hi! Thanks for the contrib. I made a couple changes:
Overall this looks great, tried it locally and it seems to work well. Will merge once the checks are done. 🚀 |
maksym-work
pushed a commit
to siilats/chat-ui
that referenced
this pull request
Jul 2, 2025
* fix(openai): systemRoleSupported model configuration for openai endpoints * feat(openai): max_completion_tokens now used over max_tokens for chat_completeions endpoint. * fix: lint * feat(docs): add o1 example * fix: make parameter default to false and fix type checks --------- Co-authored-by: Nathan Sarrazin <[email protected]>
Matsenas
pushed a commit
to Matsenas/chat-ui
that referenced
this pull request
Jul 4, 2025
* fix(openai): systemRoleSupported model configuration for openai endpoints * feat(openai): max_completion_tokens now used over max_tokens for chat_completeions endpoint. * fix: lint * feat(docs): add o1 example * fix: make parameter default to false and fix type checks --------- Co-authored-by: Nathan Sarrazin <[email protected]>
Matsenas
pushed a commit
to Matsenas/chat-ui
that referenced
this pull request
Jul 4, 2025
* fix(openai): systemRoleSupported model configuration for openai endpoints * feat(openai): max_completion_tokens now used over max_tokens for chat_completeions endpoint. * fix: lint * feat(docs): add o1 example * fix: make parameter default to false and fix type checks --------- Co-authored-by: Nathan Sarrazin <[email protected]>
gary149
pushed a commit
to gary149/chat-ui
that referenced
this pull request
Aug 29, 2025
* fix(openai): systemRoleSupported model configuration for openai endpoints * feat(openai): max_completion_tokens now used over max_tokens for chat_completeions endpoint. * fix: lint * feat(docs): add o1 example * fix: make parameter default to false and fix type checks --------- Co-authored-by: Nathan Sarrazin <[email protected]>
gary149
pushed a commit
to gary149/chat-ui
that referenced
this pull request
Aug 29, 2025
* fix(openai): systemRoleSupported model configuration for openai endpoints * feat(openai): max_completion_tokens now used over max_tokens for chat_completeions endpoint. * fix: lint * feat(docs): add o1 example * fix: make parameter default to false and fix type checks --------- Co-authored-by: Nathan Sarrazin <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
back
This issue is related to the Svelte backend or the DB
enhancement
New feature or request
models
This issue is related to model performance/reliability
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
systemRoleSupportedfor the OpenAI endpoint.max_completion_tokensovermax_tokenswhen queryingchat_completionsendpoint.The bugfix is necessary as
o1-previewando1-minimodels do not support "system" message types.The token configuration change was necessary as
o1-previewando1-minino longer support the, now deprecated,max_tokensfield.Considerations
I added a new endpoint configuration field called
useCompletionTokensand defaulted it totrue.This would have the effect of changing the default
chat_completionscall to usemax_completion_tokensovermax_tokens.There may be unintended consequences for users, as this could increase their overall token usage per query (as the default would change).
It may be prudent to start with this field set to
false, and later switch totrueas part of a planned deprecate ofmax_tokensall together.Another consideration is that my change for system messages will leave a
"role": "user", "content": ""entry. One thing we may want is to drop the system message entirely if content is blank and system messages are not supported.Reference
For those wanting to introduce o1 reasoning models based on this PR (future readers), here is an example implementation of
o1-mini:{ "name": "o1-mini", "displayName": "o1 mini test", "multimodal": false, "description": "ChatGPT o1-mini", "systemRoleSupported": false, "parameters": { "max_new_tokens": 2048, }, "endpoints" : [{ "type": "openai", }] }