Skip to content

Conversation

@katzdave
Copy link
Collaborator

@katzdave katzdave commented Nov 12, 2025

Build core canonical model implementation

Two scripts

  • build_canonical_model -> pulls all models from openrouter and loads them into our json file
  • canonical_model_checker -> produces the full mappings from our providers as to which (provider, models) are being mapped into which canonical models.

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.

Copilot AI review requested due to automatic review settings November 12, 2025 06:56
Copilot finished reviewing on behalf of katzdave November 12, 2025 06:57
Copy link
Contributor

Copilot AI left a 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

@katzdave katzdave marked this pull request as draft November 12, 2025 07:13
@katzdave katzdave marked this pull request as ready for review November 14, 2025 06:58
@katzdave katzdave requested review from DOsinga and Copilot November 14, 2025 06:58
Copilot finished reviewing on behalf of katzdave November 14, 2025 06:59
Copy link
Contributor

Copilot AI left a 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.

@katzdave katzdave changed the title WIP: Canonical model Canonical model Nov 14, 2025
@katzdave katzdave changed the title Canonical model Canonical models for Providers Nov 14, 2025
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

Successfully merging this pull request may close these issues.

2 participants