rs-ai is a Rust port of @earendil-works/pi-ai, built around the same model registry, message types and streaming event protocol as the TypeScript original. It targets native Rust applications that need provider switching, tools and streaming without maintaining a separate integration for each API, but it remains an early port rather than full upstream parity.
It tracks the bounded pi-ai v0.84.0 release surface. Core types, providers, OAuth, deferred response lifecycle, telemetry and generated catalogues have deterministic parity evidence; transport and runtime differences remain explicit.
The registry resolves a model and provider, reads credentials from the process environment and selects the appropriate compatibility settings. Provider implementations issue HTTP, WebSocket or AWS SDK requests and convert their responses into a shared Rust event stream.
The common layer handles retries, diagnostics, prompt-cache metadata, message transformation, partial tool-call JSON and context-overflow checks. Dropping the returned stream cancels HTTP work; this differs from the upstream abort-signal model.
Messages, tools, usage, model metadata and stream events use a single provider-neutral type system.
Implemented paths include OpenAI, OpenAI Responses, Anthropic, Gemini, Mistral, Codex, Bedrock, Gemini CLI and Baseten.
Bedrock uses the AWS SDK; Codex supports WebSocket and SSE transports.
Includes a PKCE-based OAuth framework and the provider-specific paths needed by supported sign-in flows.
Retry handling, logging, diagnostics, session resources, validation, prompt-cache helpers and partial JSON parsing.
The release-pinned registry contains 1,153 text models across 38 providers and 42 image models. Rust cancels work by dropping the stream; provider transport differences remain documented.