Auto-discover models from provider /v1/models endpoint#220
Open
djgpp6 wants to merge 1 commit into
Open
Conversation
When setting up a custom model, query the provider's models endpoint after entering an endpoint and API key. Populate the model field from the response and auto-select when only one model is available. Fixes boldsoftware#204
|
We require contributors to sign our Contributor License Agreement, and we don't have you on file. In order for us to review and merge your code, please contact @crawshaw at david@bold.dev to get yourself added. |
Author
i think i did sign the CLA @philz |
Contributor
|
@djgpp6 We can't seem to find your CLA (or maybe are having trouble associating usernames). E-mail philip@bold.dev and david@bold.dev and we'll get it sorted out? |
Author
|
yea mayhaps it's because i changed my username (previous one was |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #204
What
Adding a custom model in Shelley currently means typing the model name by hand. A lot of providers (and proxies) only expose one model, or have a small set you can list via
/v1/models. This wires that up so the model field fills itself.Changes
POST /api/custom-models-discoverto fetch models from the remote provider (OpenAI-style/v1/models, Anthropic/v1/models, Gemini/v1beta/models)Testing
go test ./server/... -run 'TestModelsListURL|TestDiscover|TestHandleDiscover'