Expand description
LLM driver traits and implementations.
This module provides protocol-agnostic abstractions for interacting with Large Language Models via the liter-llm universal client library.
§Overview
The LlmDriver trait defines the core streaming interface that all
LLM implementations must support. The Orchestrator builds on top
of drivers to provide tool loop execution.
§Driver
LiterLlmDriver: Universal driver using liter-llm for 142+ providers
Re-exports§
pub use catalog::ModelCatalog;pub use external_driver::ExternalDriverHandler;pub use external_driver::ExternalDriverStream;pub use external_driver::ExternalLlmDriver;pub use health::ProviderHealthMonitor;pub use health::ProviderHealthSnapshot;pub use liter_driver::LiterLlmDriver;pub use orchestrator::DestinationRequestPreparation;pub use orchestrator::DestinationRequestPreparations;pub use orchestrator::Orchestrator;pub use orchestrator::ProtectedContinuity;pub use orchestrator::ToolApprovalGate;pub use orchestrator::ToolApprovalResult;pub use provider_error::ProviderError;pub use provider_error::ProviderErrorKind;pub use registry::ProviderConfig;pub use registry::ProviderRegistry;pub use router::ModelRouter;
Modules§
- anthropic_
cache - Prompt caching strategy for the Anthropic Messages API.
- anthropic_
driver - Native Anthropic Messages API driver.
- anthropic_
streaming - SSE decoder state machine for Anthropic Messages API streaming.
- anthropic_
types - Anthropic Messages API wire protocol types.
- benchmarks
- Capability-benchmark registry (CH-09 capability-registry-benchmarks).
- capability_
registry - Model capability registry for determining tool call strategy per model.
- catalog
- Compile-time model catalog hydrated from
models.dev+liter-llmprovider registry. - external_
driver - External LLM driver adapter.
- health
- Provider health tracking for failover-aware routing (CH-03).
- liter_
driver - LLM driver implementation backed by [
liter_llm::DefaultClient]. - local_
only - Egress restriction for local-only inference (ADR-010 §1a, clauses b and c).
- mock_
driver - Mock LLM driver for deterministic integration tests.
- orchestrator
- LLM orchestrator with tool loop execution.
- prompt_
dialect - Per-model prompt dialect engine (uar-next-fable §2.1).
- provider_
error - Typed provider failures used by retry and failover policy.
- registry
- Provider registry for multi-provider LLM management.
- router
- Catalog-driven model routing.
- tool_
extractor - Streaming tool call extractor for instruction-tuned models.
- tool_
normalizer - Tool normalization driver wrapper.
- xml_
tool_ injector - XML tool definition injection for instruction-tuned models.
Structs§
- Endpoint
Request Profile - Exact, versioned endpoint settings contract selected by the trusted host.
- Image
Url - Image URL configuration for multimodal content.
- LlmRequest
- Request to an LLM driver.
- Message
- A message in a conversation.
- Profiled
Wire Receipt - Redacted proof of the exact profiled serialization validated before dispatch.
- Tool
Call - A tool call made by the assistant.
- Tool
Call Function - Function details in a tool call.
Enums§
- Content
Part - A content part for multimodal messages.
- Endpoint
Request Transform - Provider transform applied after Liter serializes the common chat request.
- Message
Content - Message content - either simple text or multimodal parts.
- Message
Role - Role of a message author.
Traits§
- LlmDriver
- Trait for LLM streaming drivers.
Functions§
- anthropic_
native_ driver_ enabled - Check if the native Anthropic driver is enabled (default: true).
- detect_
provider - Extract the provider name from a “provider/model” string.