Skip to main content

Module models

Module models 

Source
Expand description

Model definitions for LLM providers.

This module provides type-safe model identifiers for Anthropic Claude, Google Gemini, and OpenAI models. Using enums prevents typos and ensures only valid model names are used.

§Design Philosophy

  • Type Safety: Enums prevent invalid model names at compile time
  • Flexibility: Custom variant allows new models without code changes
  • Validation: Custom models are validated by prefix on conversion
  • Dual Names: Both API IDs and CLI shorthand names are supported

§Future Direction

This module will evolve to support capability-based model selection:

Model::query()
    .provider(Provider::Any)
    .tier(Tier::Fast)
    .with_capability(Cap::Vision)
    .max_budget_per_1k(0.01)
    .select()

Enums§

ClaudeModel
Anthropic Claude model identifiers.
GeminiModel
Google Gemini model identifiers.
Model
Provider-agnostic model identifier.
ModelError
Error type for model-related operations.
OpenAIModel
OpenAI model identifiers.