File tree Expand file tree Collapse file tree 3 files changed +4
-14
lines changed
Expand file tree Collapse file tree 3 files changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ rullm --system "You are a helpful assistant." "Summarize this text"
6666# List available models (shows only chat models, with your aliases)
6767rullm models list
6868
69- # Update model list from models.dev (no API keys required)
69+ # Update model list
7070rullm models update
7171
7272# Manage aliases
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ impl ModelsArgs {
6666 }
6767 }
6868 ModelsAction :: Update => {
69- let supported: Vec < & str > = Provider :: iter ( ) . map ( |p| p. models_dev_id ( ) ) . collect ( ) ;
69+ let supported: Vec < String > = Provider :: iter ( ) . map ( |p| p. to_string ( ) ) . collect ( ) ;
7070
7171 crate :: output:: progress ( "Fetching models from models.dev..." , output_level) ;
7272
@@ -240,15 +240,15 @@ struct ModelsDevModel {
240240 id : Option < String > ,
241241}
242242
243- async fn fetch_models_from_models_dev ( supported_providers : & [ & str ] ) -> Result < Vec < String > > {
243+ async fn fetch_models_from_models_dev ( supported_providers : & [ String ] ) -> Result < Vec < String > > {
244244 let response = reqwest:: get ( "https://models.dev/api.json" )
245245 . await ?
246246 . error_for_status ( ) ?;
247247 let providers: HashMap < String , ModelsDevProvider > = response. json ( ) . await ?;
248248
249249 let mut all_models = Vec :: new ( ) ;
250250 for provider_id in supported_providers {
251- if let Some ( provider) = providers. get ( * provider_id) {
251+ if let Some ( provider) = providers. get ( provider_id) {
252252 for ( model_id, model) in & provider. models {
253253 let id = model. id . as_deref ( ) . unwrap_or ( model_id) ;
254254 all_models. push ( format ! ( "{provider_id}:{id}" ) ) ;
Original file line number Diff line number Diff line change @@ -90,14 +90,4 @@ impl Provider {
9090 Provider :: Google => "GOOGLE_AI_API_KEY" ,
9191 }
9292 }
93-
94- pub fn models_dev_id ( & self ) -> & ' static str {
95- match self {
96- Provider :: OpenAI => "openai" ,
97- Provider :: Groq => "groq" ,
98- Provider :: OpenRouter => "openrouter" ,
99- Provider :: Anthropic => "anthropic" ,
100- Provider :: Google => "google" ,
101- }
102- }
10393}
You can’t perform that action at this time.
0 commit comments