Skip to content

Added support for reasoning models #23

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

suddenlyAstral
Copy link

Because reasoning models a la o1-mini don't return all generated tokens the variable max_tokens was renamed in the official API to max_completion_tokens. max_tokens is consifered deprecated for chat models but remains supported in older models and is the only supported option for (non-chat) completion API.

When using reasoning models set temperature: None, top_p: None. The API supports only those values (and temp=1.0 which is equivalent)

This PR:

  1. renames max_tokens -> max_completion_tokens in ChatBody to support reasoning models
  2. added reasoning model test
  3. deals with 0.1.9 non-compatibility with reasoning API in the narrowest way possible

This PR is not:

  1. Backward compatible. Updating to this version requires swapping max_tokens -> max_completion_tokens in every existing use
  2. providing a clear error message if you set temperature and top_p to an illegal value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant