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

Feature Request: list method #65

Open
MadBomber opened this issue Aug 24, 2024 · 2 comments
Open

Feature Request: list method #65

MadBomber opened this issue Aug 24, 2024 · 2 comments

Comments

@MadBomber
Copy link

I'd like to see a list method defined in OmniAI::Client that would return a Hash keyed by model name whose values would be the key characteristics of the model.

I see that Google AI's API has a list end point. I do not believe that the others do. Hoping they will in the future. For those OmniAI::Example::Client that do not have an endpoint, just return an empty hash.

@ksylvest
Copy link
Owner

ksylvest commented Aug 26, 2024

Hi @MadBomber,

Thanks for submitting the request! A few clarifying questions:

Is this the API for Google you are wanting access into? https://ai.google.dev/api/models

If so, it appears to return back a payload structured as follows:

{
  "models": [
    { 
      "name": "...", 
      "version": "...",
      "inputTokenLimit": 1024,
     "outputTokenLimit": 1024,
    }
  ],
}

If that is the API, can you describe how it might be used?

@MadBomber
Copy link
Author

MadBomber commented Aug 26, 2024

I missed that endpoint when I went looking. What I've trying to do is in two parts: 1) simplify configuration knowedge down to just knowing the model name; and 2) avoid the need to update the code base with model <=- provider relationships.

We've talked about this from the point of view of using regex to define the relationship. I have an experiment ongoing at https://github.com/MadBomber/experiments/tree/master/OmniAI

In that experiment I'm using the model name with a generic MyClient class layered on top of OmniAI such that MyClient.new('some-model-name') instantiates the correct sub-client for the provider associated with the model. For those models where multiple providers might be associated I have MyClient.new('model name', provider: :ollama)

What I'm thinking about is:

models = Hash.new
models[:openai] = OmniAI.list(:openai)
models[:google] = OmniAI.list(:google)

or maybe instead of list the method is models

models = OmniAI.models :openai, :antropic, :google
# The models object is a Hash keyed by provider

If a provider has no endpoint that supports getting its list of models, then the collection returned for that provider would be empty.

I've also thought about this from the point of view as maybe a SaaS that keeps a list of models/providers which has an endpoint that could be hit from OmniAI.

Ollama has a website https://ollama.com/search which provides access to info for all models that it supports. I have not found an API that returns JSON for the data - have been think about a webpage scrape process.

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

No branches or pull requests

2 participants