← Blog

Zero-Backend AI Apps: The App Is the Tool, You Bring the Brain

Claude in the desktop app has written a Piwi path about stocks or ETFs and opened it in its built-in browser at the first scene

Claude, in its desktop app, has just written a Piwi path about “Individual stocks or ETF?” and opened it in its built-in browser. Piwi has no server; Claude did the thinking.

I built an AI app with no server, no database, no accounts and no AI bill. It costs the same to run for ten people as for ten million. The trick is to stop thinking of the AI as something the app owns.

The usual AI app looks like this. A frontend sends your text to a backend. The backend adds a system prompt, calls a model with the developer’s API key, stores the conversation in a database and sends the answer back. Every message costs the developer money, every user needs an account, and every conversation sits on someone else’s server.

There is another way to build it. The page becomes a set of tools. The user brings their own AI, which they already pay for, and that AI uses the tools. The data never leaves the user’s browser. I call this a zero-backend AI app.


What a zero-backend AI app is

A zero-backend AI app is static files on a CDN that use the user’s own AI and keep the user’s own data in the browser. The developer runs no code anywhere at request time.

Usual AI appZero-backend AI app
Where the code runsFrontend and a backend serverOnly the browser
Where the data livesThe developer’s databaseThe user’s browser (IndexedDB)
Who pays for the modelThe developer, per callThe user, through a plan they already have, or nobody for an on-device model
AccountsNeeded to tie data and billing to a personNone
Running costGrows with every userA domain and static hosting
What can leakEveryone’s conversationsNothing on the developer’s side

The user brings two things: the data and the intelligence. The app brings the rest: the interface, the rules, the checks and the knowledge of its own domain.

The names that already exist

No single word covers this yet, but it is the meeting of two ideas that already have names: local-first and bring your own AI.

  • Local-first software. The 2019 essay from Ink & Switch argued that your data should live on your device first, with the cloud as an optional helper. A zero-backend app is local-first with no cloud at all.
  • Bring your own AI (BYOAI), key (BYOK) or model (BYOM). The user supplies the model, by pasting a key, choosing a local model or pointing their own assistant at the app. The developer never pays for inference.
  • Static apps, and the older unhosted web apps movement. Unhosted, from the early 2010s, asked for web apps that do not host their users’ data. It had the right idea before anyone had an assistant to bring.

Two words that sound right are wrong:

  • Stateless is a server term. This kind of app has plenty of state; it just keeps it in the browser.
  • Backendless is already the name of a backend-as-a-service product, so it means the opposite to many developers.

So my working name is long but accurate: a local-first, bring-your-own-AI app. For a headline, zero-backend AI app.

The example: Piwi

Piwi is a small game that helps you think through a big choice: change career, rent or buy, go freelance, individual stocks or an ETF. You walk a path of short scenes from your possible futures, answer each with no, maybe or yes, and at the end you see which road your answers reach and why.

It ships 24 ready-made paths that need no AI at all. The AI comes in when you want a path about your own question, or a mentor to talk to about your goals. Then Piwi uses whatever AI you already have:

Your AIHow it connectsWho pays
ChatGPT or Claude desktop appOne click opens the app with a ready message. Its built-in browser opens Piwi and calls the page tools.Your existing plan
An agent in your browserIt finds the tools through WebMCP, or on window.piwi.Whoever runs the agent
A model on your devicePiwi downloads Qwen3.5 2B or Gemma 4 E2B once and runs it on your GPU with WebLLM.Nobody: your own hardware

Here is the Claude route end to end. I type “Individual stocks or ETF?” on Piwi’s own-question page and press Claude. The Claude desktop app opens with a message in the chat box that tells it to open Piwi, read the instructions, write a path and save it. I press send. Claude opens piwi.ai in its built-in browser, calls the tools through a page script, fixes what the checks flag, and leaves me on the first scene of a brand-new path: “First of the month. Would you be fine not looking at what you own for a whole year?” That is the screenshot at the top of this post: the message on the left, the new path on the right.

The path is saved in that browser. No account was made, no key was pasted, and Piwi’s server did nothing, because there isn’t one.

How it works: the page is the API

Piwi has no server API, so the page itself is the API. When the app starts, it registers 14 tools: 3 for making paths and 11 for the mentor, such as get_your_things, add_goal and mentor_says. Each tool is written once and offered in two ways.

WebMCP. This is the emerging browser standard for page tools. If the browser has document.modelContext, each tool goes to registerTool() with a name, a description, a JSON Schema for its arguments and a hint that says whether it only reads. A browser agent then sees the tools like any other MCP server’s.

window.piwi. Few browsers have WebMCP yet, so every page also puts the same tools on a plain object. Any agent that can run JavaScript in the page can use them:

window.piwi.help();        // a short guide that lists every tool
window.piwi.tools;         // names, descriptions, JSON Schemas
await window.piwi.call("create_path", { game });

That second door is the one Claude used in the demo. A /llms.txt file tells agents both doors exist before they open the page.

One detail mattered more than I expected: the tools never throw. Chrome hides a thrown error’s message from the agent, so a crash teaches it nothing. Every failure comes back as plain text that names the field, such as “The field roads[1].destination is missing.” An agent can fix what it can read.

The AI writes, the code checks

In a zero-backend app you can’t control which model shows up, so the app must not trust it. Piwi splits the work: the AI does what it is good at, writing, and code does what it is good at, checking.

A path is one JSON object: 3 to 5 roads, 4 to 6 values the roads differ on, a score for how well each road serves each value, and 8 to 30 short scenes, each nudging one or two values up or down. The agent writes the whole thing and calls create_path. Piwi then runs four checks, cheapest first:

  1. Size. Under 200 KB.
  2. Shape. A zod schema, with every failure turned into a sentence that names the field.
  3. Links. Every road, value and scene a path refers to must exist.
  4. Simulation. 2,000 made-up walkers with random hidden values walk the path. It passes only if every road wins for some of them, no single answer decides too much, walks average 9 scenes or fewer, and answering yes to everything doesn’t tilt any value.

If anything fails, the agent gets the whole list back, fixes it and sends the whole path again. When it passes, Piwi saves it to IndexedDB and answers with its address.

The create_path loop: your AI writes the whole path, create_path runs four checks, failures go back as sentences, and only a passing path is saved in IndexedDB

The AI can loop as often as it needs; only a path that passes all four checks reaches the user’s browser.

The simulation is the part I’d copy into any app like this. It turns “is this good?”, which a model can argue about, into numbers it can’t. A failure reads, for example: “Almost nobody reaches the road Stay: 6% of the walks, where an even share is 33%.” It uses a fixed random seed, so the same path always gets the same verdict, whichever model wrote it.

What it costs you instead

Zero backend isn’t free of trade-offs. It moves them from your bill to the user’s experience.

Trade-offWhat happensWhat Piwi does about it
Data lives in one browserA path Claude made lives in Claude’s built-in browser, not in your Chrome. Clear site data and it is gone.Nothing yet. Export and import of paths is the obvious next step.
Few agents speak WebMCPIt is an origin trial in Chrome and Edge, and most assistants can’t call page tools yet.The same tools on window.piwi, plus /llms.txt so agents find them.
Quality depends on the user’s AIA small on-device model writes worse paths than a frontier model.Every path passes the same checks, whoever wrote it.
On-device models are heavyA 1 to 3 GB download, and it needs a recent GPU.Offered as an option, never the default.
No usage dataNo server means no analytics on what people do.Accepted. It is the point.
Not quite zero costYou still pay for a domain, and hosting is free only up to a point.Static hosting on a free tier. Nothing grows with users.

When to build this way

Build zero-backend when the value is in your rules and your interface, not in data you collect. Personal tools, games, calculators, planners, journals and learning apps fit well. Anything that needs several people to share live data, or that must hold data the user can’t lose, still needs a backend.

If you try it, this is what made the difference for me:

  • Expose tools, not prompts. Give every action a name, a description and a JSON Schema, and put them where any agent can reach them: WebMCP, plus a plain window object.
  • Answer in text, never throw. Each failure is a sentence that says what to fix.
  • Check everything the AI makes. Use a schema for shape, then a test for meaning. A simulation with a fixed seed is cheap and fair.
  • Make the AI optional. Piwi’s ready-made paths work with no AI at all, so nobody hits a wall.
  • Write /llms.txt. Agents read it before they open your page.

The app is the tool; the user brings the brain. Try it at piwi.ai. The code is open under the MIT license on GitHub.