Add /models endpoint to list available AI models#73
Open
vanshjohri09-collab wants to merge 1 commit intosugarlabs:mainfrom
Open
Add /models endpoint to list available AI models#73vanshjohri09-collab wants to merge 1 commit intosugarlabs:mainfrom
vanshjohri09-collab wants to merge 1 commit intosugarlabs:mainfrom
Conversation
Provide a GET /models endpoint that returns the list of available AI models and the default model configured in settings. This improves API discoverability and allows clients to know which models are available without inspecting the configuration.
Member
|
There are no 'available' models in sugar ai. Any developer right now can use whatever model they need using the hugging face library by directly updating the .env file variable. In your code you seem to have created an arbitrary list of model names? I don't understand the reason for that. |
Author
|
My intention was to make it easier to see which model is currently configured in the API |
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.
Summary
Add a new API endpoint
/modelsthat returns the list of available AI models and the default model configured in the application.Problem
Currently, clients using the API do not have a way to know which AI models are available or which model is set as default without inspecting the server configuration.
Solution
This pull request introduces a new GET
/modelsendpoint that:This improves API discoverability and makes it easier for clients to dynamically select or display available models.
Changes
/modelsendpoint inapp/routes/api.py