Skip to content

kazum/browser-ai-coder

 
 

Repository files navigation

Browser AI Coder

An in-browser coding environment where an AI Agent writes and executes Python for you. powered by WebAssembly, WebLLM, and Pyodide.

Demo | Source

This project is a fork of wasi-fs-access by Google Chrome Labs. It extends the original WASI shell with an embedded Large Language Model and Python runtime, creating a fully local, privacy-centric AI coding assistant.

Features

  • AI Agent (coder): Integrated Qwen2.5-Coder model (via WebLLM) running entirely in your browser (WebGPU required).
  • Python Runtime: Execute Python 3.11 scripts directly in the shell (via Pyodide) with full access to mounted files.
  • Local Filesystem Access: Mount your local directories to the browser environment safely using the File System Access API.
  • Zero Server Dependency: No data is sent to the cloud. Your code and prompts stay on your device.

Usage

  1. Open the Demo.
  2. Mount a local directory:
    $ mount /work
    (Select a folder on your computer when prompted)
  3. Start the AI coder:
    $ coder
  4. Ask the AI to write code:
    (coder) > Create a python script to calculate Fibonacci numbers and save it to /work/fib.py
    
  5. Run the code:
    $ python /work/fib.py

Browser Support

Requires a modern browser with support for:

  • WebAssembly (WASI)
  • File System Access API (Chrome, Edge, Opera)
  • WebGPU (for AI features)
  • SharedArrayBuffer (for Python/AI performance)

Development

# Install dependencies
npm install

# Build the project
npm run build

# Run a local server (SharedArrayBuffer headers required)
# Recommended to use a server that supports COOP/COEP, or use the included coi-serviceworker hack.
npx serve .

Credits & License

Forked from GoogleChromeLabs/wasi-fs-access. Original code is Apache-2.0 Licensed. Modifications for AI/Python integration are also under Apache-2.0.

About

Run a privacy-first AI coding agent directly in your browser with Python and local filesystem access.

Resources

License

Contributing

Stars

Watchers

Forks

Languages

  • TypeScript 86.3%
  • C 11.8%
  • HTML 1.9%