Skip to main content

Module llm

Module llm 

Source
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

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-llm provider 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§

EndpointRequestProfile
Exact, versioned endpoint settings contract selected by the trusted host.
ImageUrl
Image URL configuration for multimodal content.
LlmRequest
Request to an LLM driver.
Message
A message in a conversation.
ProfiledWireReceipt
Redacted proof of the exact profiled serialization validated before dispatch.
ToolCall
A tool call made by the assistant.
ToolCallFunction
Function details in a tool call.

Enums§

ContentPart
A content part for multimodal messages.
EndpointRequestTransform
Provider transform applied after Liter serializes the common chat request.
MessageContent
Message content - either simple text or multimodal parts.
MessageRole
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.