Skip to main content

Module llm

Module llm 

Source
Expand description

LLM clients for the openai and anthropic wire protocols.

Re-exports§

pub use crate::retry::RetryPolicy;
pub use crate::retry::Retryable;
pub use crate::retry::with_retry;

Structs§

AnthropicClient
Client for the anthropic protocol (/messages).
Completion
A parsed completion.
CompletionRequest
A single-turn completion request. The model is bound to the client.
OpenAiClient
Client for the openai protocol (/chat/completions, /embeddings).
Reasoning
Reasoning extracted from a response.
Usage
Token counts reported by the provider.

Enums§

LlmError
Errors from an LLM provider.
ProtocolClient
A client for one of the two wire protocols.
SetupError
Errors while building a client from the configuration.

Traits§

LlmClient
A chat model bound to one provider and one model ID.

Functions§

connect
Builds the client for role: resolves the provider’s API key (literal or Vault reference) and uses pipeline.request_timeout_secs as request timeout. A provider without api_key gets no auth header, which suits local servers.