Skip to main content

Module provider

Module provider 

Source
Expand description

Provider components for pluggable LLM backends.

A provider is split into narrow capabilities: configured state, request transport, failure classification, and model policy. ProviderHandle owns those components and is the executable handle installed by the host for a running session.

ProviderSpec is only a host/config-file data shape. Runtime persistence records provider identity separately and never rebuilds a ProviderHandle from disk.

Structs§

DefaultProviderFailureClassifier
EmptyProviderResolver
LlmTimeouts
MapProviderResolver
ProviderBinding
ProviderComponents
Component bundle returned by provider factories.
ProviderHandle
Owning handle to provider components. This is an executable transport handle supplied by the host, not a persistence format.
ProviderOptions
ProviderRateLimitPermit
ProviderRateLimitPolicy
ProviderRateLimiter
ProviderReliability
ProviderRetryPolicy
ProviderSpec
Serialised form of a provider’s host-owned configuration. Runtime persistence stores only provider ids; this type is for app/user config files that need credentials.
ResolvedGenerationPolicy
SingleProviderResolver
StaticModelPolicy
UnconfiguredProvider
Placeholder provider used when SessionPolicy::default() is constructed without an explicit provider. Every transport-level method errors; calling code MUST replace this before executing a turn. It exists solely so ..Default::default() shorthand keeps working in host code that always overrides the provider field.

Enums§

CacheRetention
Prompt-cache lifetime hint. Providers translate this into their own wire dialect (Anthropic cache_control TTL, OpenRouter-Claude cache_control markers via Chat Completions, OpenAI Responses prompt_cache_key / prompt_cache_retention). Providers without a cache-control concept (Google, Codex) read the value but emit nothing for it.
ProviderResolutionError
RequestTimeout

Constants§

DEFAULT_CHUNK_TIMEOUT_MS
DEFAULT_REQUEST_TIMEOUT_MS

Traits§

Provider
A configured LLM backend: its identity, host-config serialization, its generation options, and the request transport.
ProviderFactory
ProviderFailureClassifier
ProviderModelPolicy
RuntimeProviderResolver

Functions§

is_context_overflow_text
resolve_generation_policy