Expand description
LLM client abstraction layer
Provides a unified interface for interacting with LLM providers (Anthropic Claude, OpenAI, Zhipu AI GLM, and OpenAI-compatible providers).
Re-exports§
pub use anthropic::AnthropicClient;pub use codex_login::CodexLoginClient;pub use factory::create_client_with_config;pub use factory::LlmConfig;pub use http::clear_http_metrics_callback;pub use http::default_http_client;pub use http::set_http_metrics_callback;pub use http::HttpClient;pub use http::HttpClientError;pub use http::HttpMetricsCallback;pub use http::HttpMetricsRecord;pub use http::HttpResponse;pub use http::StreamingHttpResponse;pub use openai::OpenAiClient;pub use zhipu::ZhipuClient;
Modules§
- anthropic
- Anthropic Claude LLM client
- codex_
login - factory
- LLM client factory
- http
- HTTP utilities and abstraction for LLM API calls
- openai
- OpenAI-compatible LLM client
- structured
- Structured object generation from LLM output.
- zhipu
- Zhipu AI (GLM) LLM client
Structs§
- Attachment
- Image attachment for multi-modal messages.
- Image
Source - Image source for the
ContentBlock::Imagevariant. - LlmResponse
- LlmResponse
Meta - LLM response
- Message
- Message in conversation
- Model
Generation Admission - Shared admission gate derived from a typed provider concurrency contract.
- Model
Generation Concurrency - Bounded active model-generation capacity reported by an
LlmClient. - Model
Generation Permit - Owned capacity for one active model-generation transaction.
- Model
Generation Pool - Digest-only provider/model capacity metadata.
- Model
Generation Pool Health Snapshot - Read-only, secret-free configuration and occupancy evidence for one model generation pool.
- NonRetryable
LlmError - Retry
Config - Configuration for API retry behavior
- Retry
Exhausted Error - A retry loop that exhausted a typed HTTP response status.
- Secret
String - A string wrapper that redacts its value in Debug and Display output. Prevents API keys from leaking into logs and error messages.
- Token
LogProb - Token-level log probability emitted by an OpenAI-compatible backend.
- Token
Usage - Token usage statistics
- Tool
Call - Tool call from LLM
- Tool
Definition - Tool definition for LLM
- TopToken
LogProb
Enums§
- Content
Block - Message content types
- Model
Generation Admission Error - Model
Generation Pool Error - Errors returned while deriving a provider/model capacity pool identity.
- Stream
Event - Streaming event from LLM
- Tool
Result Content - Content within a tool result — either text or an image.
- Tool
Result Content Field - The
contentfield of aToolResultblock. - Tool
Result Trust V1 - Typed trust label for tool-result content at the value boundary (KRN-5).
Constants§
- MAX_
ATTACHMENT_ BYTES - Maximum bytes loaded by
Attachment::from_file. - MAX_
RETRIES - Hard upper bound for provider retries accepted by the Core loop.
Traits§
- LlmClient
- LLM client trait