⚙️🦀 Build modular and scalable LLM Applications in Rust

★ 9,154⑂ 1,020👁 57⑃ 2,265● 976▤ 638
RustMITCreated 2024-06-05rig.rs
Download: rig-v0.46.0rig-v0.46.0 ↓0.46.02026-10-31
+7
Daily
9,154
stars
1,020
forks
57
watchers
2,265
prs
976
issues
638
releases

README

 
  

 

 



 

 





 




📑 Docs
  •  
🌐 Website
  •  
🤝 Contribute
  •  
✍🏽 Blogs
  •  




Rig is a Rust library for building LLM applications, and rig, a terminal
coding agent built on it that you extend with Bevy plugins.

 The coding agent

rig-cli is not on crates.io yet. Until the next release, install the last
release, 0.46.0, whose rig crate carries the launcher:

bash
cargo install rig


This README describes main. 0.46.0 keeps its plugin list in
plugins.toml, and its guide
is on its tag. Or install main from a checkout (--force replaces a rig installed by
another crate):

bash
git clone https://github.com/0xPlaygrounds/rig && cd rig
cargo install --locked --force --path crates/rig-cli


Then:

1. rig builds the agent, which takes several minutes the first time, and opens it.
2. /login signs in with a ChatGPT plan or saves a provider's API key. Or
   export a key, such as OPENAI_API_KEY, before starting rig.
3. /model picks a model. A local Ollama or llama.cpp server is listed once
   OLLAMA_API_BASE_URL or LLAMACPP_API_BASE_URL names it, or its key
   variable is set.
4. Type a prompt and press Enter. /help lists the commands.
5. rig -p "fix the failing test" answers one prompt without the terminal view.

rig update updates rig (how). The agent guide also says what is
per home and what is per project.

- Everything is a plugin. The agent is a Bevy app; its
  tools, commands, sessions, sign-in and terminal view are each a plugin, turned
  on or off in settings.toml, so any of them can be removed, replaced or
  added to.
- It rebuilds itself. /reload rebuilds the agent with your plugin
  crates and restarts it in the same session, and keeps the old build running
  if the new one does not compile. rig update reinstalls rig with cargo;
  /update does it from the agent and restarts on it. Both arrive with the
  next release: 0.46.0 updates by installing again.
- Scriptable. rig -p --json and rig --json drive it over pipes;
  rig help-agents is the protocol.
- More when you want it. Subagents are an optional plugin, and the tools
  work on remote hosts over ssh or any command.

The agent guide covers the keys, sessions, compaction,
plugins and files, and the plugin guide shows
how to write a tool, command or panel. The agent needs Rust 1.97.1 or newer
and runs on Linux and macOS.

 The library

bash
cargo add rig


rust
use rig::prelude::;
use rig::providers::openai::{self, OpenAI};

[tokio::main]
async fn main() - Result {
    // The client reads OPENAI_API_KEY and builds the models it serves.
    let model = OpenAI::from_env()?.completion(openai::GPT_6_1_SOL);
    let comedian = AgentBuilder::new(model)
        .preamble("You are a comedian here to entertain the user using humour and jokes.")
        .build();

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

Top issues

Discussions

Latest release

rig-v0.46.0 v0.46.0 2026-10-31
Added

- (rig-mcp-client) new plugin crate rig-mcp-client (rig_mcp_client::McpPlugin), listed off in the default plugins.toml: MCP servers' tools (stdio and streamable HTTP) as __, from $RIG_HOME/mcp.json and /.rig/mcp.json. A project's server starts only once approved as written (/mcp approve, /mcp deny); /mcp add and /mcp remove edit the right file. McpCorePlugin and AddMcpServer let a front add its client's servers for one run. The mcpServers format with type, disabled and ${VAR} expansion, with other fields refused by name for that server only, and [mcp] connect_timeout_secs (30). A sessio

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON