Expand description
camel-component-llm — LLM integration component for rust-camel.
Provides chat (streaming + materialized), embeddings, tool calling, and multi-turn conversations through multiple LLM providers (OpenAI, Ollama, Mock). Features include response caching with single-flight, cost observability (config-driven pricing tables), retry with per-attempt delay override (ADR-0021), and concurrency control via producer semaphore.
Uses a project-owned LlmProvider trait with strict adapter boundary
isolating the siumai SDK to exactly two production files (ADR-0020).
Re-exports§
pub use bundle::LlmBundle;pub use config::LlmEndpointConfig;pub use config::LlmGlobalConfig;pub use config::LlmOperation;pub use config::LlmProviderConfig;pub use config::MockProviderConfig;pub use config::OllamaProviderConfig;pub use config::OpenaiProviderConfig;pub use cost::PricingTable;pub use error::LlmError;pub use provider::ChatEvent;pub use provider::ChatMessage;pub use provider::ChatRequest;pub use provider::ChatRole;pub use provider::EmbedRequest;pub use provider::EmbedResponse;pub use provider::EmittedToolCall;pub use provider::FinishReason;pub use provider::LlmProvider;pub use provider::LlmUsage;pub use provider::ToolChoice;pub use provider::ToolDefinition;
Modules§
- bundle
- config
- cost
- Pricing configuration for LLM cost tracking.
- endpoint
- error
- headers
- Header constants for the LLM component.
- producer
- producer_
cache - Producer-level response cache with single-flight coalescing.
- provider
- LlmProvider trait and request/response types.
- provider_
factory