Skip to content
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

Add the ability to customize available models for OpenAI-compatible services #13276

Merged
merged 6 commits into from
Jun 25, 2024

Conversation

amtoaer
Copy link
Contributor

@amtoaer amtoaer commented Jun 19, 2024

Closes #11984, closes #11075.

Release Notes:

  • Added the ability to customize available models for OpenAI-compatible services (#11984) (#11075).

image

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jun 19, 2024
@christ-offer
Copy link

Very nice! :D

image

@amtoaer amtoaer changed the title Improve OpenAI-compatible services Add the ability to custom available models for OpenAI-compatible services Jun 22, 2024
@amtoaer amtoaer changed the title Add the ability to custom available models for OpenAI-compatible services Add the ability to customize available models for OpenAI-compatible services Jun 22, 2024
Copy link
Contributor

@rtfeldman rtfeldman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution - this is looking good overall! 😃

I have one requested design change, and then some questions about code structure.

@amtoaer
Copy link
Contributor Author

amtoaer commented Jun 25, 2024

Thank you. I've updated it. Please let me know if there are any other issues.

Copy link
Contributor

@rtfeldman rtfeldman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you @amtoaer! 🎉

@rtfeldman rtfeldman merged commit 922fcaf into zed-industries:main Jun 25, 2024
9 checks passed
@sa1
Copy link

sa1 commented Jul 4, 2024

Some central documentation for new features would be nice.

rtfeldman added a commit that referenced this pull request Jul 19, 2024
We will soon need `semantic_index` to be able to use
`CompletionProvider`. This is currently impossible due to a cyclic crate
dependency, because `CompletionProvider` lives in the `assistant` crate,
which depends on `semantic_index`.

This PR breaks the dependency cycle by extracting two crates out of
`assistant`: `language_model` and `completion`.

Only one piece of logic changed: [this
code](922fcaf#diff-3857b3707687a4d585f1200eec4c34a7a079eae8d303b4ce5b4fce46234ace9fR61-R69).
* As of #13276, whenever we
ask a given completion provider for its available models, OpenAI
providers would go and ask the global assistant settings whether the
user had configured an `available_models` setting, and if so, return
that.
* This PR changes it so that instead of eagerly asking the assistant
settings for this info (the new crate must not depend on `assistant`, or
else the dependency cycle would be back), OpenAI completion providers
now store the user-configured settings as part of their struct, and
whenever the settings change, we update the provider.

In theory, this change should not change user-visible behavior...but
since it's the only change in this large PR that's more than just moving
code around, I'm mentioning it here in case there's an unexpected
regression in practice! (cc @amtoaer in case you'd like to try out this
branch and verify that the feature is still working the way you expect.)

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Assistant] add custom_model parameter Implement Groq or OS models for Assistant Tab (settings.assistant)
4 participants