feat: generate the model catalog from live API data
Add a hidden --generate-models flag that rebuilds models.yaml from models.dev and OpenRouter merged with the hand-owned quirks overlay, regenerate the committed catalog with it (393 -> 1090 models), and retire the Python updater. GitHub becomes fully quirks-owned since upstream only tracks Copilot ids, legacy ids upstream dropped are preserved as hand-owned quirks entries, and non-chat model families (image/tts/audio/realtime) are excluded from generation.
This commit is contained in:
8 files changed
+10276
-3058
No files matched your search
+6
-1
@@ -20,7 +20,7 @@ extern crate log;
|
||||
|
||||
use crate::cli::Cli;
|
||||
use crate::client::{
|
||||
ModelType, call_chat_completions, call_chat_completions_streaming, list_models, oauth,
|
||||
ModelType, call_chat_completions, call_chat_completions_streaming, catalog, list_models, oauth,
|
||||
};
|
||||
use crate::config::instructions::WORKSPACE_INSTRUCTIONS_FILE_NAME;
|
||||
use crate::config::{
|
||||
@@ -101,6 +101,7 @@ async fn main() -> Result<()> {
|
||||
|
||||
let info_flag = cli.info
|
||||
|| cli.sync_models
|
||||
|| cli.generate_models.is_some()
|
||||
|| cli.list_models
|
||||
|| cli.list_roles
|
||||
|| cli.list_agents
|
||||
@@ -295,6 +296,10 @@ async fn run(
|
||||
return sync_models(&url, abort_signal.clone()).await;
|
||||
}
|
||||
|
||||
if let Some(path) = &cli.generate_models {
|
||||
return catalog::generate_models_file(path).await;
|
||||
}
|
||||
|
||||
if cli.list_models {
|
||||
for model in list_models(ctx.app.config.as_ref(), ModelType::Chat) {
|
||||
println!("{}", model.id());
|
||||
|
||||
Reference in new issue
Block a user