← Back to all projects

Rig

Build agents in Rust, with tool arguments and model output checked by the compiler rather than at run time

MIT
Stars
9k
Forks
1k
Open issues
94
Last commit
30 Oct 2026

What is Rig?

Rig is the answer for teams whose service is already Rust and who do not want a Python sidecar just to call a model. Tools are Rust functions, and their argument definitions are generated from the types, so a mismatch is a compile error rather than a malformed call discovered in production. The same applies to output: an extractor asks the model for a value and hands back an ordinary Rust struct. Providers and vector stores sit behind traits, so swapping either is a configuration change. What you give up is the ecosystem — the evaluation, tracing and agent tooling that exists ten times over in Python often has no Rust equivalent, and you will write more of the surrounding machinery yourself.

What can you do with Rig?

  • Tool arguments checked at compile time — A tool is a Rust function, and the definition the model sees is derived from its types — so a wrong argument fails the build, not the run.
  • Get a struct back, not a string to parse — Extractors ask the model for a value shaped like a type you declared and hand back that type, with the parsing and validation already done.
  • Swap the provider without touching the agent — Every provider sits behind the same trait, so moving between hosted and self-hosted models is a change of client, not of code.
  • Attach a vector index for retrieval — A vector store can be wired in as a source of context that is looked up at prompt time, with a dozen backends already implemented.
  • Compose several agents into one call path — Pipelines route between agents, run them in parallel, and combine what they return, without a separate orchestration service.

Before you choose Rig

  • The surrounding ecosystem is Python's. Evaluation harnesses, tracing integrations and ready-made tool libraries that you would pick off the shelf elsewhere often have no Rust counterpart here.
  • The type safety that makes it appealing also makes exploration slower: changing what a tool returns means changing types across the call path, where a dynamic language would let you try it first.

Star history

27 Aug to 30 Oct · +611

8.4k9k

Frequently asked questions

Is Rig free for commercial use?

Rig is released under the MIT licence — OSI-approved open source, which permits commercial use.

How can Rig be deployed?

Rig is available as Self-hosted / Runs locally.