Skip to main content

Module resolver

Module resolver 

Source
Expand description

Model resolution — maps a ModelRef to a live Arc<dyn Llm>.

The ModelResolver trait abstracts over model construction so that the runtime can resolve any provider declaration into a callable model. DefaultModelResolver implements the standard resolution logic:

  • Shorthand names are mapped to providers by prefix (gemini-* → Gemini, gpt-* → OpenAI, claude-* → Anthropic, etc.)
  • Structured refs use the explicit provider field directly
  • OpenAI-compatible refs construct a client with the given base_url + api_key

Structs§

DefaultModelResolver
Default model resolver that uses prefix-based provider inference for shorthand names and explicit provider fields for structured refs.

Enums§

ResolverError
Errors that can occur during model resolution.

Traits§

ModelResolver
Resolves a ModelRef into a live Arc<dyn Llm>.

Functions§

infer_provider
Infers the Provider from a shorthand model name by prefix matching.

Type Aliases§

ResolverResult
Result alias for resolver operations.