Building Maya OS: A Local-First AI OS for Developers
· 3 min read
Building Maya OS: A Local-First AI OS for Developers
I built Maya OS because I was tired of gluing together five different tools every time I wanted to run agents against local models. It's a local-first AI operating system for developers: one command boots a model gateway, coding-agent orchestration, an agent message bus, and a dashboard. It's tuned for Apple Silicon — every M-series chip from M1 onward.
The package ships on npm as maya-os, the CLI binary is maya, and it's MIT licensed.
Why I made it
The pieces already existed — you can run GGUF models with llama.cpp, you can drive coding agents like Claude Code or Codex, you can wire up a message bus — but nobody had put them behind a single, coherent boot sequence. Every project started with the same yak-shaving.
So the design goal for Maya was simple: npx maya-os and you have a working environment. No manual gateway config, no separate dashboard server, no bespoke agent plumbing.
The quality bar I set for myself was deliberately strict:
- Never crash the host Mac.
- Degrade before refusing — if something can't run at full fidelity, do less rather than error out.
- No shortcuts in the parts that matter.
How it's put together
Maya is a monorepo split into clear layers, each its own package. The ones I lean on most:
- Model runtime (
packages/model-runtime) — runs GGUF models via llama.cpp/Metal, with MLX planned later, plus guardrails so a bad prompt doesn't take the machine down. - Gateway (
packages/gateway) — an OpenAI- and Anthropic-compatible endpoint that routes between cloud and local models. Because it speaks both wire formats, existing tools point at it without changes. - Agent runtime (
packages/agent-runtime) — adapters for Claude Code, Codex, OpenCode, and more, so different coding agents are interchangeable behind one interface. - Message bus (
packages/bus) — Maya's own walkie-talkie-style protocol for agents talking to each other. - Orchestrator (
packages/orchestrator) — teams plus a Loop Agent, a persistent interim team lead that keeps a run coordinated. - Core (
packages/core) — shared contracts, config, and SQLite. The contracts live inpackages/core/src/contracts/and are the source of truth every other layer builds against.
On top of that sit the CLI (apps/cli) and the dashboard (apps/dashboard).
What I learned building it
A few things stood out while putting Maya together:
- A compatibility layer is worth its weight. Making the gateway speak both the OpenAI and Anthropic formats meant I didn't have to fork every tool I wanted to use — they just worked against local models.
- Contracts first. Keeping the shared interfaces in one package (
core) let the layers evolve independently without constant breakage. - The host machine is a hard constraint, not an afterthought. "Never crash the Mac" forced better resource decisions in the model runtime than any performance goal would have.
Maya is still early and evolving layer by layer, but the core idea — one command to a full local-first agent environment — already changes how I start projects.
If you want to look at the code, here it is: Maya OS on GitHub. The site lives at maya.himansh.in.