Skip to main content

llmkit_core/
lib.rs

1//! Core traits, types, and errors shared by every `llmkit` crate.
2//!
3//! This crate has no I/O and no async runtime dependency. Provider adapters
4//! ([`llmkit-openai`], [`llmkit-anthropic`], [`llmkit-ollama`]) implement
5//! [`LlmProvider`] against these types; middleware and the facade crate build on
6//! top of them.
7//!
8//! [`llmkit-openai`]: https://docs.rs/llmkit-openai
9//! [`llmkit-anthropic`]: https://docs.rs/llmkit-anthropic
10//! [`llmkit-ollama`]: https://docs.rs/llmkit-ollama
11
12#![forbid(unsafe_code)]
13#![deny(missing_docs)]
14
15pub mod error;
16pub mod provider;
17pub mod stream;
18pub mod tools;
19pub mod types;
20pub mod usage;
21
22pub use error::{LlmError, LlmResult};
23pub use provider::LlmProvider;
24pub use stream::{ChatStream, StreamDelta};
25pub use tools::{Tool, ToolCall, ToolChoice, ToolResult, ToolSchema};
26pub use types::{
27    ChatRequest, ChatRequestBuilder, ChatResponse, ContentPart, EmbedRequest, EmbedResponse,
28    FinishReason, Message, MessageContent, Role,
29};
30pub use usage::{pricing, CostEstimate, ModelPricing, TokenUsage};