PAI Knowledge OS
Local AI used to be hard. Now it is a button.
I have spent a long time on local AI. Getting a strong model to run on my own machine was the easy part; making it actually useful was not. Which server, which quantization, which port, how to keep it alive, how to send it only the work it can do, and how to fall back to the cloud when it cannot. Every piece worked on its own and none of them worked together.
PAI is what came out of that, and I am giving it to the community. A MacBook can already run a serious model: on mine, Strata serves Qwen3.8-Flash-Next in its compact Gyro-M quantization, and PAI turns that into a worker like any other. Start it from the cockpit, and PAI routes worker jobs to it automatically, shows its speed and cache live, and hands a job to the cloud only when it needs a wider context or deeper reasoning than the local model has. You stop thinking about local AI. It just takes its share of the work.
An AI chat is one vendor, one model, one budget and no memory. PAI turns it into a team: it remembers, it routes every job to the right model, cloud or local, and it shows you all of it live.
You burn your premium tokens on work a local model could do. You hit the weekly limit on a Tuesday. Every new session starts from zero. PAI fixes all three:
- Not bound to Anthropic. Claude Code is only the front end you type into; the model behind it is your choice. Run a whole session on GLM, Kimi, any other provider you add, or a model on your own machine, with no Anthropic model involved at all. Or mix them: switch on the fly with
/model, in the middle of a session, without losing your place.
- Model routing, cloud and local. When one provider's budget runs out, the next one takes over by itself, and every request is accounted per provider and per session.
- A hierarchy that spends tokens where they matter. Three tiers:
t0 the session you talk to, t1 the orchestrator that plans and reviews, t2 the workers that implement. Workers go local first, because local tokens are free. Cloud comes first only where it earns its price: wide context and real reasoning. And all of it is yours to set: each tier is an ordered list of models, the first available one serves, and you change the order as your default (pai worker route set t2 local,glm/glm-5.3-flash, or from the cockpit) or just for one session (--session <name>), without touching the others. Every worker runs in its own visible pane and git worktree; you review the diff, PAI merges it.
- A live cockpit. One page shows your token budget per provider, cache hits, every model and local server with start and stop buttons, running workers, routing per tier, and memory and embedding progress. Drag the cards into the layout you want.
- Memory underneath it all. Every session writes its own notes in the background, searchable across sessions, projects and your notes vault, by keyword, meaning or both. Everything stays on your machine.
What's inside
Everything PAI does: docs/features.md
pai starts or resumes a session in the current project. pai pause and pai end save your place. Memory works on its own; the router, workers and cockpit join when you want them. Terms are explained in the glossary.
Install it in one sentence: tell Claude Code "Clone https://github.com/mnott/PAI and set it up for me". Jump to install.







The router cockpit (http://127.0.0.1:8790/cockpit). See the cockpit page.
How it fits together
Source: docs/images/architecture.drawio, editable in draw.io.
Install
Prerequisites: Claude Code and Node.js 20 or newer. Docker is only needed for the optional PostgreSQL storage (semantic search); the default sqlite needs nothing.
The easy way: tell Claude Code
Clone https://github.com/mnott/PAI and set it up for me
Claude reads this repository, finds the setup skill and walks you through it: it checks each phase first, does only what is missing, and ends with a pass/fail list of its checks.
Or install it as a plugin, then say "set up PAI":
/plugin marketplace add mnott/PAI
/plugin install pai@pai
Setup also installs AIBroker, a separate project that is PAI's messaging layer: messages between sessions, worker reports to the session that started them, terminal tab names, and WhatsApp, Telegram and PAILot all go through it. PAI starts without it, but none of that works until it is there. To install it by hand:
npm install -g aibroker@^0.62.4
aibroker setup
aibroker doctor
Without the plugin, from a clone, or for a one-session plugin load: docs/install/index.md. Memory works as soon as setup is done; workers are optional (First workers).
Where to go next
Install
Install · First workers
Concepts
Workers · delegation tiers · panes · providers, and the rest in docs/README.md.
Cockpit
The cockpit page: sections, aliases, layout.
Reference
Configuration · Config defaults · Commands (generated from the CLI: pai help, pai more, pai help <command>)
The full index, including memory, search and developer docs, is docs/README.md.
Daily use
pai
pai NAME
pai ls
pai more
pai help <command>
pai pause saves your place before you leave a session and pai end finishes it.
Acknowledgments
Inspired by Daniel Miessler's Personal AI Infrastructure, claude-mem, Cognee and PageIndex. Full credit and links: docs/README.md.
License
MIT