Skip to content

Add /models endpoint to list available AI models#73

Open
vanshjohri09-collab wants to merge 1 commit intosugarlabs:mainfrom
vanshjohri09-collab:add-models-endpoint
Open

Add /models endpoint to list available AI models#73
vanshjohri09-collab wants to merge 1 commit intosugarlabs:mainfrom
vanshjohri09-collab:add-models-endpoint

Conversation

@vanshjohri09-collab
Copy link

Summary

Add a new API endpoint /models that 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 /models endpoint that:

  • Returns the list of available AI models
  • Returns the default model defined in the settings

This improves API discoverability and makes it easier for clients to dynamically select or display available models.

Changes

  • Added /models endpoint in app/routes/api.py
  • Endpoint returns available models and default model from configuration

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.
@amannaik247
Copy link
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.

@vanshjohri09-collab
Copy link
Author

My intention was to make it easier to see which model is currently configured in the API
I understand that Sugar-AI does not keep a fixed list of models and that developers can configure any model through the .env file I can update the endpoint so it only returns the currently configured model instead of a static list
Please let me know if that would be a better approach and I will update the code

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.

2 participants