Who it is forA Rust developer building an agent into their own app who needs repeatable tests that never touch the network.
The problemAgent tests that call a live model are slow, flaky, and cost money to run.
The outcomeThe agent loop runs end to end with fixed output and no credentials, so tests pass the same way on every run.
What you need first
- Rust 1.78 or later, for installing from crates.io
- An ANTHROPIC_API_KEY or OPENAI_API_KEY, or a ~/.rpi/agent/models.json file, for live model calls
- Git, to clone the repository for the offline examples
Steps
- Run
git clone https://github.com/bigfish1913/pi-rust.git - Change into the folder with
cd pi-rust - Run
cargo run -p minimal - Read examples/minimal/src/main.rs and reuse its AgentBuilder setup in your own test
Prompt for your agent
Clone bigfish1913/pi-rust, run `cargo run -p minimal`, and then write a Rust test in <target-crate> that builds an agent with the faux provider and asserts the reply. Expected output: the minimal example prints 2 messages after run and the assistant reply. Verify that the test passes with no network access and no API key set.
Caveat. The faux provider covers the paths your test scripts, so live provider behavior still needs its own checks against the real HTTP providers behind the providers feature flag.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for bigfish1913/pi-rust and "Test an embedded agent offline with no API key"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer