1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//! Unified Rust SDK for chat completions, embeddings, images, and video across
//! multiple LLM providers.
//!
//! litellm-rust is a Rust port of [LiteLLM](https://github.com/BerriAI/litellm).
//! It provides a single [`LiteLLM`] client that routes requests to OpenAI-compatible,
//! Anthropic, Gemini, and xAI backends using a `"provider/model"` format.
//!
//! # Quick Start
//!
//! ```rust,no_run
//! use litellm_rust::{LiteLLM, ChatRequest};
//!
//! # async fn run() -> litellm_rust::Result<()> {
//! let client = LiteLLM::new()?;
//! let resp = client
//! .completion(ChatRequest::new("openai/gpt-4o").message("user", "hello"))
//! .await?;
//! println!("{}", resp.content);
//! # Ok(())
//! # }
//! ```
//!
//! # Streaming
//!
//! ```rust,no_run
//! use futures_util::StreamExt;
//! use litellm_rust::{LiteLLM, ChatRequest};
//!
//! # async fn run() -> litellm_rust::Result<()> {
//! let client = LiteLLM::new()?;
//! let mut stream = client
//! .stream_completion(ChatRequest::new("openai/gpt-4o").message("user", "hello"))
//! .await?;
//! while let Some(chunk) = stream.next().await {
//! print!("{}", chunk?.content);
//! }
//! # Ok(())
//! # }
//! ```
//!
//! # Supported Providers
//!
//! | Provider | Chat | Streaming | Embeddings | Images | Video |
//! |----------|------|-----------|------------|--------|-------|
//! | OpenAI-compatible | yes | yes | yes | yes | yes |
//! | Anthropic | yes | yes | - | - | - |
//! | Gemini | yes | - | - | yes | yes |
//! | xAI | yes | yes | - | - | - |
pub use LiteLLM;
pub use ;
pub use ;
pub use ;
pub use *;