rs-ai is a Rust port of @earendil-works/pi-ai for applications that need provider switching, streaming and tool calls without a separate integration for each API. It also includes image generation and classifier operations.
Development has stopped. The main branch retains the v1.0.1 runtime; unfinished v1.1.0 work is preserved on the release branch. Use the v1.0.1 Git tag for the released code; the crate is not published to crates.io.
A model registry selects the provider and request settings. Provider implementations send HTTP, SSE or WebSocket requests and translate responses into a shared Rust event stream for text, reasoning, tools, usage and completion.
Common helpers handle OAuth, retries, prompt-cache metadata, streamed tool-argument JSON and context limits. Dropping the returned stream cancels the work. Images and classifiers have separate APIs; Bedrock uses the AWS SDK and can be excluded by disabling default features.
Provider-neutral messages, tools, usage and events, with JSON-compatible types for cross-language transcript hand-off.
stream and complete entry points, JSON Schema tools, reasoning events and partial argument parsing.
HTTP/SSE clients, Codex WebSocket support and optional Bedrock AWS SDK integration.
Image generation plus classifier operations for TypeSafe System One, Cloudflare Workers AI and llama.cpp.
Provider login flows, retry/proxy handling, request/response hooks and cancellation by dropping the stream.
v1.0.1 is the retained runtime. The paused v1.1.0 branch is incomplete and is not a published upgrade.