-
Notifications
You must be signed in to change notification settings - Fork 2k
Canonical models for Providers #5694
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a canonical model system to standardize model metadata across different LLM providers (Anthropic, Google, OpenAI). The system is based on OpenRouter's model schema and includes automated fetching capabilities. Key additions include data structures for model metadata (pricing, variants, capabilities), a registry for managing canonical models, utilities for version suffix stripping, example scripts for fetching and validating model mappings, and a comprehensive JSON file with model definitions.
Reviewed Changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/goose/src/providers/mod.rs | Adds the canonical module to the providers module structure |
| crates/goose/src/providers/canonical/registry.rs | Implements the registry for loading, storing, and querying canonical models |
| crates/goose/src/providers/canonical/name_builder.rs | Provides utilities to strip version suffixes and build canonical model names |
| crates/goose/src/providers/canonical/model.rs | Defines core data structures for canonical models, pricing, and variants |
| crates/goose/src/providers/canonical/mod.rs | Exports public API for the canonical model system |
| crates/goose/src/providers/canonical/canonical_models.json | Contains 1620 lines of model definitions with pricing and metadata |
| crates/goose/src/providers/canonical/README.md | Documents the canonical model system architecture and usage |
| crates/goose/src/providers/base.rs | Adds trait method for providers to map their models to canonical models |
| crates/goose/src/providers/anthropic.rs | Fixes JSON field name from "models" to "data" |
| crates/goose/examples/fetch_canonical_models.rs | Example script to fetch and update canonical models from OpenRouter |
| crates/goose/examples/canonical_model_checker.rs | Example script to validate provider model mappings |
| canonical_mapping_report.json | Generated report showing unmapped models across providers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 11 out of 13 changed files in this pull request and generated no new comments.
Build core canonical model implementation
Two scripts
Providers can use map_to_canonical_model to lookup this info (if the model is mapped).
Once we're settled on this will further integrate it in providers and pull + add more information to these.