Pi Agent · Soyuz — in-browser coding agent running llama.cpp via WebGPU
  • TypeScript 74.4%
  • Python 11.8%
  • JavaScript 9.4%
  • Shell 2%
  • CSS 1.2%
  • Other 1.2%
Find a file
2026-08-11 16:30:31 +01:00
.github/workflows ci: stop baking keenable key into public bundle 2026-05-28 11:45:36 +02:00
autoresearch-duel autoresearch duel: SIQ-1 vs GLM-5.2 vs Opus 4.8 on parameter-golf 2026-06-17 13:36:18 +02:00
bench Agent: native tool calls end to end, web/publish/screenshot tools, leaner context 2026-08-06 13:00:05 +01:00
public GitHub repos + Linux VM in the browser: import, real bash, commit & push 2026-07-09 02:56:25 +00:00
railway-models Mirror local model shards on Railway 2026-08-11 16:30:31 +01:00
results-duel autoresearch duel: SIQ-1 vs GLM-5.2 vs Opus 4.8 on parameter-golf 2026-06-17 13:36:18 +02:00
scripts webui-test: capture in-browser tok/s from the TopBar readout 2026-07-27 17:55:19 +01:00
server Ship browser-native app builder with fresh WebGPU runtime 2026-08-10 22:25:45 +01:00
space_hermes Fix streaming jank: throttle deltas, memo bubbles, drop backdrop blur, suspend idle VM 2026-07-10 06:32:06 +00:00
src Mirror local model shards on Railway 2026-08-11 16:30:31 +01:00
vendor Ship browser-native app builder with fresh WebGPU runtime 2026-08-10 22:25:45 +01:00
.gitignore Add WebUI e2e tester: drive the real app headlessly and collect artifacts 2026-07-27 10:15:31 +01:00
CLAUDE.md Agent: native tool calls end to end, web/publish/screenshot tools, leaner context 2026-08-06 13:00:05 +01:00
harness.html Vibecoding scaffold v2, agent hardening, and bench-verified per-model configs 2026-07-24 14:29:02 +01:00
index.html Max CPU tps: cross-origin isolation via coi-serviceworker + full thread count 2026-07-02 13:53:16 +02:00
package-lock.json Ship browser-native app builder with fresh WebGPU runtime 2026-08-10 22:25:45 +01:00
package.json Ship browser-native app builder with fresh WebGPU runtime 2026-08-10 22:25:45 +01:00
README.md Ship browser-native app builder with fresh WebGPU runtime 2026-08-10 22:25:45 +01:00
siq1-web.md Pi Agent: in-browser Soyuz + selectable SIQ-1 cloud model 2026-06-18 20:06:33 +02:00
tsconfig.json Pi Agent: in-browser Soyuz + selectable SIQ-1 cloud model 2026-06-18 20:06:33 +02:00
vite.config.ts Vibecoding scaffold v2, agent hardening, and bench-verified per-model configs 2026-07-24 14:29:02 +01:00
vmspike.html GitHub repos + Linux VM in the browser: import, real bash, commit & push 2026-07-09 02:56:25 +00:00

Pi Agent Web — browser-native app builder

Pi Agent Web turns a plain-language request into a working React application. The agent, project filesystem, package installation, dev server, preview, browser inspection, checkpoints, and GitHub deployment all run in the user's browser. Only model inference is remote by default.

Product flow

  1. Describe the product you want in chat.
  2. The agent creates or edits a React + Vite + TypeScript project in OPFS.
  3. A WebContainer installs packages and serves the app in the preview pane with hot reload.
  4. The agent inspects and interacts with that preview, fixes runtime errors, and runs the build.
  5. Undo restores a local checkpoint. Publish pushes source to main and the built site to gh-pages, then enables GitHub Pages.

Large or ambiguous requests enter plan mode first. Small edits execute directly. The agent runtime is based on Pi's tool loop and persistent sessions; it is model-agnostic rather than tied to Grok or any other provider.

Models and privacy

  • Managed cloud model: the default preset calls the same-origin /api/llm proxy. Configure the server with LLM_BASE_URL, LLM_API_KEY, and LLM_MODEL.
  • Bring your own model: OpenRouter and compatible remote presets remain available. Browser-held API keys are stored in sessionStorage, so they disappear when the tab session ends.
  • Optional local inference: the existing WebGPU GGUF path remains available for capable devices.

Project files, chat history, Pi sessions, and checkpoints are stored locally in OPFS/IndexedDB. Source code is sent to the selected model only as part of the agent context. GitHub credentials are also session-scoped and sent directly to GitHub's API.

Run locally

npm install
npm run dev          # http://localhost:5050
npm test -- --run
npm run build

WebContainers require cross-origin isolation. Vite supplies the required COOP/COEP headers during development. A production host must provide equivalent headers (the included service-worker fallback supports static hosts such as GitHub Pages).

To run the optional API server:

LLM_BASE_URL=https://provider.example/v1 \
LLM_API_KEY=... \
LLM_MODEL=your-model \
node server/index.js

The server preserves the provider's OpenAI-compatible streaming response, keeps the provider key off the client, forces the configured model, and applies per-IP rate limiting.

Architecture

Chat UI -> Pi agent loop -> OPFS workspace <-> WebContainer (npm + Vite)
                |                                  |
                |                                  +-> sandboxed live preview
                +-> file, shell, browser, plan, checkpoint and publish tools

Cloud preset -> same-origin model proxy -> OpenAI-compatible provider
BYO preset   -> provider API directly from the browser
Publish      -> GitHub Data/Pages APIs

Core implementation lives in src/pi, the browser project runtime in src/runtime, local durable state in src/lib/localProjectStore.ts, and the model proxy in server/index.js.