litert_lm/lib.rs
1//! LiteRT-LM: A Rust library for LiteRT-LM model inference
2//!
3//! This library provides:
4//! - Model download and management
5//! - Process pool management for efficient inference
6//! - Streaming completions
7//! - MCP (Model Context Protocol) service
8//! - OpenAI-compatible API server
9//!
10//! # Example
11//!
12//! ```no_run
13//! use litert_lm::{LitManager, Result};
14//!
15//! #[tokio::main]
16//! async fn main() -> Result<()> {
17//! let manager = LitManager::new().await?;
18//!
19//! // Pull a model
20//! manager.pull("gemma-3n-E4B", None, None).await?;
21//!
22//! // Run completion
23//! let response = manager.run_completion("gemma-3n-E4B", "Hello!").await?;
24//! println!("{}", response);
25//!
26//! Ok(())
27//! }
28//! ```
29
30pub mod binary;
31pub mod manager;
32pub mod mcp;
33pub mod process;
34pub mod server;
35
36// Re-export main types for library users
37pub use manager::LitManager;
38pub use mcp::LiteRtMcpService;
39pub use process::{LitProcess, ProcessPool};
40pub use server::{AppState, ChatCompletionRequest, create_router};
41
42// Re-export common types
43pub type Result<T> = std::result::Result<T, anyhow::Error>;