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

feat: Add model listing #4948

Merged
merged 3 commits into from
Oct 11, 2024
Merged

feat: Add model listing #4948

merged 3 commits into from
Oct 11, 2024

Conversation

anticorrelator
Copy link
Contributor

@anticorrelator anticorrelator commented Oct 10, 2024

partially resolves #4858

Adds a model_providers query that lists available models given a specific provider as an input. This is currently incomplete, as I plan to add a DB-backed store for snapshotted models. I think it feels too bad to tie model definitions to the server version.

Hardcodes all models for now

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Oct 10, 2024
async def model_providers(
self, vendors: List[str], info: Info[Context, None]
) -> List[ModelProvider]:
all_vendors = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Pythony question is there any reason to define this constant inside of a function instead of statically somewhere?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah it could be hoisted. But probably needs a refactor anyway

) -> List[ModelProvider]:
all_vendors = {
"OpenAI": ModelProvider( # https://platform.openai.com/docs/models
name="OpenAI", # currently only models using the chat completions API
Copy link
Contributor

Choose a reason for hiding this comment

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

since this will have to be a graphql input param, it might make more sense to start with the vendor being a graphql enum

Copy link
Contributor

@mikeldking mikeldking left a comment

Choose a reason for hiding this comment

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

I think we will have to iterate on this so let's just merge and be open to things changing.

@anticorrelator anticorrelator merged commit 9d5b0a3 into playground Oct 11, 2024
30 checks passed
@anticorrelator anticorrelator deleted the dustin/add-model-listing branch October 11, 2024 19:10
mikeldking pushed a commit that referenced this pull request Oct 11, 2024
* Add query for model providers

* gql build

* Hardcode all models for now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants