Expand description
Flow strings through language models.
Provider-agnostic LLM client supporting multiple wire formats:
- OpenAI Chat Completions (
/v1/chat/completions) - OpenAI Responses (
/v1/responses) - Anthropic Messages (
/v1/messages)
A provider is just a base URL + wire format + auth config.
§Module structure
wire_formats/— request/response types and parsing per formatproviders/— provider configurations (llama, openai, anthropic, etc.)client— HTTP client (chat, streaming, health checks)
Re-exports§
pub use providers::AuthConfig;pub use providers::ProviderConfig;
Modules§
- providers
- Provider configurations.
Structs§
- Chat
Message - A chat message (role + content), shared across all wire formats
- Health
Response - Health check response from /health
Enums§
- Error
- Stream
Event - A streaming event from a chat response
- Wire
Format - Wire format for LLM API requests
Functions§
- chat
- Send a blocking chat request. Retries on transient errors with exponential backoff + jitter.
- chat_
async - Send an async chat request. Retries on transient errors with exponential backoff + jitter.
- chat_
stream - Send an async streaming chat request. Returns a stream of events.
- health_
check - Send an async health check
- health_
check_ blocking - Send a blocking health check