Skip to content

Improve handling of new model releases #129

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

Closed
RPate97 opened this issue Jan 12, 2025 · 2 comments
Closed

Improve handling of new model releases #129

RPate97 opened this issue Jan 12, 2025 · 2 comments

Comments

@RPate97
Copy link
Contributor

RPate97 commented Jan 12, 2025

Problem

The token.js package currently maintains a complete list of all models available from each supported provider. This provides the following benefits:

  • Full type support when specifying model names
  • Improved UX when a given model does not support a specific feature. For example, if a model does not support JSON output and the user specifies JSON output, then token.js will throw a more consistent error earlier in the process instead of waiting for the underlying API to error out.

However, it also has the following drawbacks:

  • New model releases are not immediately supported. An update to token.js is required to enable any new model.
  • Non-public models are not supported (fine tuned models mainly)

Solution

We should provide some method for bypassing the model name checks, so that users are able to use new models immediately upon release. token.js should make a best effort to continue to maintain a comprehensive list of models and their supported features to provide good UX, but it should not prevent the user from accessing models that are not explicitly supported.

Community Feedback

I'm opening this ticket to solicit community feedback on the best UX for resolving this problem. Currently, we have a PR open from @shadokan87 #127 which resolves this issue by allowing the user to call a new function tokenjs.extendModelList to extend the list of supported models. It also allows the user to define supported features for their self defined models which seems like a great feature to me. After some consideration, this implementation seems pretty solid to me but I'm hoping we can get some input from other token.js users before moving forward with it. If you have thoughts on how to resolve this problem, please leave a comment on this issue.

@RPate97 RPate97 changed the title Better handle new model releases Improve handling of new model releases Jan 12, 2025
@shadokan87
Copy link

@RPate97 #127 is ready, I ran pnpm lint and docs:update, added error handling for a custom model name that conflict with a pre-defined one

@RPate97
Copy link
Contributor Author

RPate97 commented Jan 15, 2025

@shadokan87 Thank you! I will get it reviewed in the next couple of days.

@RPate97 RPate97 closed this as completed Jan 22, 2025
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

No branches or pull requests

2 participants