Expand description
Model registry and metadata.
This module provides model cards with metadata including:
- Abbreviations for compression
- Tokenizer encoding types
- Default parameter values
- Context window sizes
§Example
use m2m::models::{ModelRegistry, Encoding, Provider};
// Create a registry
let registry = ModelRegistry::new();
// Lookup a model
let card = registry.get("openai/gpt-4o").unwrap();
assert_eq!(card.abbrev, "og4o");
assert_eq!(card.provider, Provider::OpenAI);
assert_eq!(card.encoding, Encoding::O200kBase);
// Abbreviate and expand
assert_eq!(registry.abbreviate("openai/gpt-4o"), "og4o");
assert_eq!(registry.expand("og4o"), Some("openai/gpt-4o".to_string()));Structs§
- Model
Card - Model metadata card
- Model
Registry - Model registry with embedded + dynamic models
- Pricing
- Token pricing information (USD per token)
Enums§
Statics§
- EMBEDDED_
MODELS - All embedded model definitions
Functions§
- get_
embedded_ by_ abbrev - Get embedded model by abbreviation
- get_
embedded_ by_ id - Get embedded model by ID
- get_
embedded_ models - Get all embedded models as ModelCard instances
- get_
pricing - Get pricing for popular models (per million tokens, USD)