Find your next open-source project

Search by name, purpose, or keyword — or paste a GitHub repository URL

0xPlaygrounds/rig

AI Engineering

A Rust library for building LLM agents over 20+ providers, plus a plugin-based terminal coding agent.

9,185
1,026
Rust
MIT
2 years old

What it is

Rig is a Rust library for building applications on large language models. It puts more than 20 model providers and a dozen vector stores behind a single interface and supports agents with tools, streaming, typed hooks, completion, embedding, transcription, and audio/image models. It follows the OpenTelemetry GenAI conventions, and rig-core and rig-agent compile for browser WASM.

The repository also ships rig, a terminal coding agent built on the library. Its tools, commands, sessions, sign-in, and terminal view are each a Bevy plugin, so they can be disabled, replaced, or extended. The project is aimed at Rust developers who want to embed LLM calls in their own applications, and at developers looking for a hackable coding agent.

Quick start: the library

Install the facade crate and an async runtime, then build a small agent:

cargo add rig anyhow
cargo add tokio --features macros,rt-multi-thread
use rig::prelude::*;
use rig::providers::openai::{self, OpenAI};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    // Reads OPENAI_API_KEY.
    let model = OpenAI::from_env()?.completion(openai::GPT_6_2_SOL);
    let agent = AgentBuilder::new(model)
        .preamble("You are a comedian.")
        .build();

    let response = agent.prompt("Entertain me!").await?;
    println!("{}", response.output());
    Ok(())
}

The example reads OPENAI_API_KEY from the environment. More samples live in the examples directory; full guides and the API reference are at rig.rs/docs and docs.rs.

Quick start: the coding agent

The agent requires Rust 1.97.1 or newer and runs on Linux and macOS. Install the launcher and start it:

cargo install rig
rig

The first run builds the agent, which takes several minutes, then opens the interface. Use /login to sign in or save an API key, or export a key such as OPENAI_API_KEY before starting. /model selects a model and /help lists commands. A single prompt can run non-interactively:

rig -p "fix the failing test"

/reload rebuilds the agent with local plugin changes while keeping the session. The agent guide covers updating, models, sessions, tools, settings, and scripting; the plugin guide explains plugin types with working examples. The published rig release is currently 0.46.0, whose guide is kept on that tag; the main-branch guide also documents installing from a checkout.

Features and crates

The rig crate re-exports rig-core. Default features add rig-agent, the derive macros, the reqwest HTTP client with rustls, and on native targets the rig launcher from rig-cli; default-features = false disables these. Individual crates are exposed as features named after them without the rig- prefix, for example:

cargo add rig --features memory,fastembed

Optional pieces include conversation memory (rig-memory), record and replay (rig-cassette), MCP tools (rig-rmcp), provider crates for Bedrock, Vertex AI, Gemini gRPC, TypeSafeAI, and local inference via rig-candle and rig-fastembed. Vector store integrations such as LanceDB, Qdrant, and PostgreSQL are companion crates behind features as well; the feature list on docs.rs enumerates them.

Constraints

Rig is pre-1.0 and releases break APIs; consult the changelog and migration notes when upgrading. The coding agent needs the current Rust toolchain and is only supported on Linux and macOS. Model access depends on the provider credentials you supply through environment variables or the /login flow. The project is MIT licensed.

HotRepo's take

On the Rust-language daily chart for 2026-11-19, the repository recorded 7 new stars and a best position of 8 in that language ranking. That single snapshot supports only the day's fact, not a trend. What stands out technically is the packaging: one crate family covering providers, vector stores, agents, and a coding agent whose behavior is assembled from replaceable Bevy plugins, which makes the agent as much a library surface as the LLM wrapper beside it.

Written by AI from the project's README, updated . The project's own docs are the source of truth.

Hacker News

Rig: Build modular LLM apps in Rust – 20 providers, one unified interface
▲ 5 · 1 comment · April 5, 2026
Rig – Agentic Workflows in Rust
▲ 4 · 0 comments · August 29, 2026

You might also like

  1. vercel/aiA TypeScript library for calling many LLM providers through one API and wiring models into UI frameworks and agents.TypeScript27,500
  2. jingyaogong/minimindAn open-source, from-scratch PyTorch LLM training pipeline with a ~64M model and full pretrain-to-RL stages for learners on a single GPU.Python65,623
  3. TencentQQGYLab/AppAgentLLM multimodal agent framework that controls Android apps by tapping and swiping via ADB, for GUI automation researchers.Python6,923
  4. phone-harness/phone-harnessA Python CLI that lets coding agents tap, type, scroll, and read real iPhones or Android phones.Python5,051
  5. spring-projects/spring-aiLets Java and Spring teams build LLM features with portable, typed APIs instead of hand-wiring each vendor's SDK.Java9,588