rig
rig copied to clipboard
feat: List models
- [x] I have looked for existing issues (including closed) about this
Feature Request
I would like to dynamically list models provided by a provider. This could be a new Client trait, almost all providers have /models endpoint we can call to get that list.
Motivation
When working with customer providers like LiteLLM, the list of models is not static. It depends on what the user configured.
Proposal
pub trait ListModelsClient {
/// Verify the configuration.
fn models(&self) -> impl Future<Output = Result<Vec<Model>, VerifyError>> + WasmCompatSend;
}
Looks good to me, would be great to have this in Rig!
(apologies for random tag labelling, wasn't sure what we should use but I guess just commenting works for now since there aren't too many issues yet)
Great I will try to find the time to code this in the coming weeks!