Rig

⚙️🦀 Build modular and scalable LLM Applications in Rust

Last verified:

Visit Rig

What is Rig?

Rig is a Rust library and toolkit for building modular, performant LLM-powered applications and full‑stack AI agents. It exposes ergonomic, high‑level abstractions (Agents, Pipelines, Tools) while providing low‑level primitives for completions, embeddings, streaming, image and audio generation, and telemetry. Rig unifies many model providers behind a consistent Client/Model API and integrates with multiple vector stores and companion crates so developers can assemble RAG systems, semantic search, or multi‑model workflows with minimal boilerplate. The project targets Rust developers and teams who need production‑grade, composable AI building blocks with strong type safety, WASM compatibility, and an emphasis on modularity and portability.

Rig pricing

Pricing model: Freemium

Rig is distributed as open source Rust crates; there is no pricing for the library itself on the website. Users pay only for third‑party model or vector store provider usage (for example OpenAI, Anthropic, Qdrant, etc.) and any hosted services they choose; additional companion crates are free open source dependencies. The site and documentation do not list paid tiers or hosted offerings for Rig itself.

Rig pros

  • Consistent provider‑agnostic Client/Model API across many LLM vendors
  • High‑level Agent abstraction for building simple to complex RAG systems
  • Pipeline API for composing multi‑step AI workflows with ops and telemetry
  • Broad provider integrations (OpenAI, Anthropic, Cohere, Gemini, Mistral, xAI, etc.)
  • Companion vector store crates for Qdrant, Milvus, LanceDB, SQLite, MongoDB, and more
  • Streaming completion support for low‑latency interactions
  • Built‑in abstractions for embeddings and semantic search
  • Audio (TTS) and image generation modules abstracting multiple providers
  • Tool macro and Tool types to convert functions into agent tools
  • WASM compatibility for running parts of pipelines in the browser or WASM runtimes
  • Telemetry and OpenTelemetry hooks to trace pipelines and agents
  • Extractor and structured‑data extraction utilities for parsing LLM outputs
  • Macro support (derive and attribute macros) to reduce boilerplate
  • Flexible vector store index trait enabling custom store implementations
  • Well documented crate surface with examples and runnable snippets

Rig cons

  • Requires Rust knowledge and async runtime setup (tokio) to use effectively
  • Not a hosted service — requires self‑hosting or provider API keys
  • No turnkey UI or application scaffolding included out of the box
  • Some integrations (vector stores/providers) are companion crates requiring extra dependencies
  • Learning curve for the pipeline/op/agent abstractions for new users
  • Runtime complexity for multi‑provider setups and telemetry configuration
  • Limited non‑Rust client ecosystems (native bindings must be written)
  • Feature surface can be large, leading to heavier builds unless features are pruned

Frequently asked questions about Rig

What is Rig and who should use it?

Rig is an open source Rust library for building LLM‑powered applications, agents, and pipelines; it is intended for Rust developers and teams who want modular, production‑grade building blocks for completions, embeddings, RAG, streaming, and provider integration without vendor lock‑in.

Which model providers does Rig support?

Rig provides integrations for many providers including OpenAI, Anthropic, Cohere, Gemini, Mistral, Hugging Face, xAI, Ollama, Perplexity and others; additional providers can be added by implementing the CompletionModel and EmbeddingModel traits.

Does Rig support embeddings and vector stores?

Yes — Rig has first‑class support for embeddings and a vector store index trait, and companion crates provide integrations for Qdrant, Milvus, LanceDB, MongoDB, SQLite, SurrealDB, ScyllaDB and S3Vectors among others.

Can I use Rig in WASM/browser environments?

Rig includes wasm_compat support and feature flags intended to enable parts of the library to run in WASM runtimes, but some providers or native vector store clients may not be WASM‑compatible without additional adaptation.

How do I build an agent or RAG system with Rig?

You create provider clients, build models (completion/embedding), then use the Agent abstraction and vector store indexes to combine semantic search, retrieval, and prompting; the docs contain examples showing agent construction and RAG pipelines.

Is streaming supported for low‑latency responses?

Yes — Rig provides streaming completion traits and types to work with streaming models so you can handle incremental responses and lower perceived latency in interactive applications.

What telemetry and observability does Rig provide?

Rig exposes telemetry hooks and integrations to emit traces (OpenTelemetry compatible) from pipelines and agents, enabling users to collect traces, metrics, and correlate AI operations across workflows.

Are there examples or templates to get started?

The project maintains example repositories and documentation pages with simple examples (prompting a model, building an agent, integrating a vector store) that show typical usage patterns and recommended feature flags.

How does Rig handle provider‑specific features or differences?

Rig abstracts common functionality behind traits and Client structs; provider‑specific options can be accessed through provider clients, but the high‑level API aims to provide consistent semantics so switching providers requires minimal code changes.

Do I need to pay to use Rig itself?

No — Rig is an open source set of crates with no direct licensing fees; however, using hosted LLMs, vector stores, or other third‑party services will incur their respective costs.

Categories

Use cases

Browse all AI tools on NeedAnAI