0xPlaygrounds /rig
⚙️🦀 Build modular and scalable LLM Applications in Rust
★ 9,154⑂ 1,020👁 57⑃ 2,265● 976▤ 638
+7
日增长
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
#1439feat: Add a "Code Mode" tool to Rig12 comments · 2026-02-25#391feat: Support exposing Agents via A2A protocol12 comments · 2025-04-10#1201feat: Use gRPC APIs for Gemini + xAI8 comments · 2025-12-30#1906feat: host-facing ToolRegistry with typed native and MCP catalog entries7 comments · 2026-06-15#330feat: OpenAI realtime API support7 comments · 2025-03-03#1244feat: Add unified batch processing API6 comments · 2026-01-13#647feat: Better typing for JSON Schema6 comments · 2025-07-31#2884Add a Document variant to `ToolResultContent`3 comments · 2026-10-23
Discussions
#3319Dollar caps and request dedup for rig agents (BudgetHook, OrchestratedTransport)0 comments · 2026-11-15#3318Expand DeepSeek Support for Its API Styles and Tools APIs0 comments · 2026-11-14#2968Rig v0.46.0 released!1 comments · 2026-10-31#2936How do I create and deploy my own open-source model?0 comments · 2026-10-28#2867Rig v0.45.0 released!0 comments · 2026-10-20#2786why api change so fast??1 comments · 2026-10-12#2759Rig v0.44.0 released!0 comments · 2026-10-07#2641Rig v0.43.0 Released !!!3 comments · 2026-09-30
Latest release
rig-v0.46.0 v0.46.0 2026-10-31Added
- (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