You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Show & tell: local-decider guards pi's tool calls with a decision model on your own GPU
#12559
pi runs every tool call without asking. That's the point of pi, and I like it. But every so often
a model decides that rm -rf or a force-push is the quickest way to finish the job.
local-decider is a pi extension that puts a small decision model in front of pi's tool calls.
The model runs on your own GPU (or NPU, or CPU), not in the cloud.
pi install npm:@ziptie-soft/pi-local-decider
Why I built it
pi has had decision models for a while: models.classify() since 0.99, GPT-6 Luna through
OpenAI's Decisions API since 1.1, and as of 1.6.1 also Copilot's gpt-6-luna-decisions and
Radius. They're great for typed yes/no and pick-one questions.
I wanted the same thing for every single tool call, without sending my shell commands to a
provider and without paying per call. A 2B model on a local GPU answers in about half a second
once it's warm, and that's fast enough to sit in front of each call.
What it does
Guard mode (default). pi keeps running tools without asking. Clearly dangerous commands
(deleting your home dir or a .git, force-pushing to main, writing to a disk device) are
blocked before the model is even asked. Anything the model rates as risky gets a dialog.
If the gateway is down or slow, the call just runs, so it never gets in your way.
Approve mode (opt-in). pi asks before every call, the way Claude Code does, and the
local model auto-approves the routine ones. You get far fewer prompts than with "ask
everything", while still seeing anything unusual.
A local decision model for your scripts. It registers a local-decider/active classifier,
so models.classify() in codemode or ctx.modelRegistry.classify() in an extension can use
your local model like any other pi decision model. Bool, choice and score questions work.
No keys, no cloud. It runs on CUDA, ROCm, Apple MLX, Vulkan (llama.cpp), AMD NPUs
(FastFlowLM), or anything OpenAI-compatible such as LM Studio.
One gate for all your agents. The same gateway also serves Claude Code, Codex and Paseo,
so a command you've already judged in one harness counts in the others.
It stays out of the way. Read-only tools (read, grep, find, ls) aren't gated, and
the commands you type with ! aren't either.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
pi runs every tool call without asking. That's the point of pi, and I like it. But every so often
a model decides that
rm -rfor a force-push is the quickest way to finish the job.local-decider is a pi extension that puts a small decision model in front of pi's tool calls.
The model runs on your own GPU (or NPU, or CPU), not in the cloud.
Why I built it
pi has had decision models for a while:
models.classify()since 0.99, GPT-6 Luna throughOpenAI's Decisions API since 1.1, and as of 1.6.1 also Copilot's
gpt-6-luna-decisionsandRadius. They're great for typed yes/no and pick-one questions.
I wanted the same thing for every single tool call, without sending my shell commands to a
provider and without paying per call. A 2B model on a local GPU answers in about half a second
once it's warm, and that's fast enough to sit in front of each call.
What it does
(deleting your home dir or a
.git, force-pushing to main, writing to a disk device) areblocked before the model is even asked. Anything the model rates as risky gets a dialog.
If the gateway is down or slow, the call just runs, so it never gets in your way.
local model auto-approves the routine ones. You get far fewer prompts than with "ask
everything", while still seeing anything unusual.
local-decider/activeclassifier,so
models.classify()in codemode orctx.modelRegistry.classify()in an extension can useyour local model like any other pi decision model. Bool, choice and score questions work.
(FastFlowLM), or anything OpenAI-compatible such as LM Studio.
so a command you've already judged in one harness counts in the others.
read,grep,find,ls) aren't gated, andthe commands you type with
!aren't either.Try it
pi -e npm:@ziptie-soft/pi-local-deciderfor one run, orpi installitLOCAL_DECIDER_PI_MODE=approve piif you want the "ask first" behaviourWhat I'd love help with
It's new (1.0.0) and unofficial. I've tested it on Linux with pi 1.6. Things I'd really like to
hear about:
Repo, issues and PRs: https://github.com/ziptie-soft/local-decider
All reactions