A modular Rust library for building LLM-powered applications and agents with one unified API across 20+ model providers and vector stores.
At a Glance
About Rig
Rig is an open-source Rust library from Playgrounds for building LLM-powered applications and agents. It exposes one API over 20+ model providers and 10+ vector store integrations, with tools and structured output expressed as ordinary Rust types. The latest release listed on GitHub is v0.44.0, and the project is MIT licensed.
What It Is
Rig is a developer library installed with cargo add rig. An agent is a model plus a system prompt (a preamble) and, optionally, tools and context. Developers construct a provider client, build an agent, and prompt it. Because model, agent, and embedding types are shared across providers, switching backends means changing a client rather than application code.
How It Is Structured
The docs describe a portable core and an optional agent runtime. rig-core holds provider-neutral messages, completion models, tool contracts, memory and vector-store contracts, and built-in provider mappings. rig-agent adds the classic builder, prompt and streaming traits, typed hooks, a live tool registry, extraction, and a serializable AgentRun state machine. The root rig facade re-exports both and exposes companion crates behind one feature per integration. Developers can use the agent or call models directly and write their own loop.
Capabilities
- Completions and embeddings with typed generation options
- Multi-turn agentic workflows with streaming of text, reasoning, and tool-call arguments
- Retrieval-augmented generation over an in-memory store or vector databases such as LanceDB, Qdrant, MongoDB, PostgreSQL, SQLite, and Milvus
- Structured extraction of typed data from unstructured text
- Transcription, audio generation, and image generation model support
- Typed errors, token usage and cost accounting, OpenTelemetry GenAI semantic convention compatibility, recording and replay, and mock models for offline testing
Runtime and Platform Notes
Rig ships as a native Rust binary, or the portable core and classic runtime can be compiled to browser WebAssembly (wasm32-unknown-unknown). WASI is not supported, and MCP support via rig-rmcp is native-only. The README warns that upcoming releases will contain breaking changes, with migration paths annotated.
Community Discussions
Be the first to start a conversation about Rig
Share your experience with Rig, ask questions, or help others learn from your insights.
Pricing
Open Source (MIT)
Rig core Rust library for building LLM apps and agents, released under the MIT License.
- MIT Licensed
- 20+ model providers under one unified API
- 10+ vector store integrations
- Agentic workflows with multi-turn streaming and prompting
- Install with cargo add rig
Capabilities
Key Features
- Unified API across 20+ model providers
- 10+ vector store integrations
- Type-safe tools and structured output
- Agents with preambles, tools, dynamic context and conversation memory
- Retrieval-augmented generation
- Streaming of text, reasoning and tool-call arguments
- Structured extraction from unstructured text
- Embedding, transcription, audio and image generation support
- OpenTelemetry GenAI semantic convention compatibility
- Recording and replay with mock models for offline testing
- Serializable agent run state that can be stepped, paused and resumed
- Browser WebAssembly support for portable core and classic runtime
