Expand description
LLM client — hybrid provider with trait-based adapter.
LlmProvider trait with multiple implementations:
OllamaProvider— local Ollama serverOpenAiProvider— OpenAI compatible APIs
Structs§
- Message
- A message in the conversation.
- Ollama
Provider - Ollama LLM provider.
- Open
AiProvider - OpenAI-compatible provider (works with OpenAI, OpenRouter, etc.)
- Proposed
Tool Call - A tool call the model proposed in its response. Awareness ≠ permission: a proposed call is not executed here — the caller resolves it to a route and runs it through the consent/audit path.
- Provider
Config - Configuration for LLM provider selection.
- Response
- Complete LLM response.
- Response
Chunk - LLM response chunk (for streaming).
- ToolDef
- A tool the model may call, in the provider-agnostic shape the kernel
hands down the tools channel.
parametersis a JSON Schema object describing the call arguments (the sameinput_schemaaintent::ToolDescriptorcarries). Producers route any untrusteddescriptionthroughintent::sanitizationbefore it reaches a provider. - Usage
- Token usage statistics.
Enums§
Traits§
- LlmProvider
- Trait for LLM providers.
Functions§
- build_
failover_ chain - Build a failover chain from all configured providers.
- create_
provider - Create an LLM provider from configuration.
- extract_
json_ from_ response - Extract a JSON object from an LLM response string.
- select_
provider - Probe every configured provider, pick the first reachable one whose
preferred_modelsintersects the live model list, and return it.