+7
日增长
3,348
stars
240
forks
23
watchers
1,109
prs
34
issues
38
releases
README
uzu
A high-performance inference engine for AI models. It allows you to deploy AI directly in your app with zero latency, full data privacy, and no inference costs. Key features:
- Simple, high-level API
- Unified model configurations, making it easy to add support for new models
- Traceable computations to ensure correctness against the source-of-truth implementation
- Utilizes unified memory on Apple devices
- Broad model support
Quick Start
Rust
Add the dependency:
toml
[dependencies]
uzu = { git = "https://github.com/trymirai/uzu", branch = "main", package = "uzu" }
Run the code below:
rust
use std::io::{self, Write};
use uzu::{
engine::{Engine, EngineConfig},
types::session::chat::{ChatConfig, ChatMessage, ChatReplyConfig},
};
[tokio::main]
async fn main() - Result {
let engine_config = EngineConfig::default();
let engine = Engine::new(engine_config).await?;
let model = engine.model("alibaba:qwen3.5:0.8b:mirai:mirai-m:4".to_string()).await?.ok_or("Model not found")?;
let downloader = engine.download(&model).await?;
while let Some(update) = downloader.next().await {
print!("\r\u{001B}[2KDownload progress: {:.2}%", update.progress() 100.0);
io::stdout().flush()?;
}
println!();
let session = engine.chat(model, ChatConfig::default()).await?;
let messages = vec![
ChatMessage::system().with_text("You are a helpful assistant".to_string()),
ChatMessage::user().with_text("Tell me a short, funny story about a robot".to_string()),
];
let replies = session.reply(messages, ChatReplyConfig::default()).await?;
if let Some(reply) = replies.last() {
println!("Reasoning: {}", reply.message.reasoning().unwrap_or_default());
println!("Text: {}", reply.message.text().unwrap_or_default());
}
Ok(())
}
Python
Add the dependency:
bash
uv add uzu==0.6.17
Run the code below:
python
import asyncio
from uzu import ChatConfig, ChatMessage, ChatReplyConfig, Engine, EngineConfig
async def main() - None:
engine_config = EngineConfig.create()
engine = await Engine.create(engine_config)
model = await engine.model("alibaba:qwen3.5:0.8b:mirai:mirai-m:4")
if model is None:
return
async for update in (await engine.download(model)).iterator():
print(f"\rDownload progress: {update.progress:.2%}", end="", flush=True)
print()
session = await engine.chat(model, ChatConfig.create())
messages = [
ChatMessage.system().with_text("You are a helpful assistant"),
ChatMessage.user().with_text("Tell me a short, funny story about a robot"),
]
replies = await session.reply(messages, ChatReplyConfig.create())
if not replies:
return
message = replies[-1].message
print(f"Reasoning: {message.reasoning}")
print(f"Text: {message.text}")
if __name__ == "__main__":
asyncio.run(main())
Swift
Add the dependency:
swift
dependencies: [
.pacTop issues
#865QTIP-S (Qwen3.8-27B-S) outputs garbage on M4: race kernels assume the M5 MXU fragment layout3 comments · 2026-09-25#792Persist prefilled prompt state across sessions3 comments · 2026-09-02#1007Qwen 3.8 flash next2 comments · 2026-10-22#1003Request: Official support for Ubuntu headless deployment with NVIDIA 40/50 series GPUs2 comments · 2026-10-22#823Feature request: end-to-end vision/image input support (Qwen3.6-27B, OpenAI image_url)1 comments · 2026-09-12#791Experts Paging1 comments · 2026-09-02#1049Vulkan/Windows RTX 5060: native breakpoint during tiny synthetic decision-model load0 comments · 2026-11-01#824Feature request: per-request reasoning/thinking token budget with clean answer continuation0 comments · 2026-09-12