Documentation
Technical guide for the Forge Lab Brain ecosystem. Orchestrate AI agents, manage deployments, and understand our token-based economy.
Getting Started
Forge Lab Brain is a hybrid AI development platform that merges Large Language Models (LLMs) with a live, in-browser execution environment. For JavaScript/TypeScript/React/Vue and other Node.js-based projects, code runs directly via WebContainers. For Python, Java, Go, Rust, Ruby and 30+ other languages, code executes instantly via the built-in Judge0 engine — no setup, no local install, no limits.
Cross-Origin-Embedder-Policy headers.
Instant Environment
No localhost setup. The terminal runs entirely within your browser tab via WebAssembly.
Multi-Agent Architecture
Complex tasks are broken down and distributed to specialized agents (Coding, Debugging, Planning).
How Brain Mode Works
Brain Mode is the orchestration layer of Forge Lab. When you submit a request, it is not sent directly to a coding model. Instead, it passes through our cognitive pipeline:
// 1. User Input
"Create a React dashboard with Supabase auth"
// 2. Conductor Agent (routes via OpenRouter)
analyzeRequest() -> "Complex Task detected"
createPlan() -> ["Scaffold Vite", "Install Dependencies", "Setup Auth"]
// 3. Execution (Senior Dev Agent)
await executeStep("Scaffold Vite")
// 4. Auto-Fix (Bug Hunter Agent)
if (terminal.error) {
fixError(terminal.logs)
}
Agent Roles
Depending on your subscription tier, different models power these agents.
🚦 Conductor
Role: Project Manager
Decides how to solve the problem. It does not write code but directs other agents.
💻 Senior Dev
Role: Implementation
Writes high-quality, typed code across 37+ languages — React, Vue, Python, Go, Rust, Java, Kotlin, Swift and more.
🐛 Bug Hunter
Role: QA & Fixer
Automatically reads terminal output. If a build fails, it intervenes without user prompt.
Multi-AI, Multi-Task
ForgeLab Brain does not send your request to a single AI model. Instead, it orchestrates multiple specialized agents running in parallel — each with a distinct role, working on different parts of your project simultaneously.
// Parallel execution — all at the same time
parallel {
Senior Dev Agent → writes src/App.jsx
Senior Dev Agent → writes src/components/Header.jsx
Bug Hunter Agent → validates completed files
Conductor Agent → plans next phase
}
Conductor
Breaks your request into a structured plan, assigns tasks to agents, and manages phase progression. Does not write code — thinks and delegates.
Senior Dev (×N)
Multiple instances can run in parallel, each generating a separate file. File locking prevents conflicts between agents writing to the same file.
Bug Hunter
Continuously validates completed files for import errors, syntax issues, and broken references. Auto-fixes what it can — escalates the rest.
Integrity Check
Final gate before the dev server starts. Validates every file, checks Vue/React plugin presence, detects truncated files, and runs stack-aware linting.
Languages & In-Browser Execution
ForgeLab supports 37+ programming languages across two execution backends depending on the stack type.
WebContainer (Node.js-based)
These run natively in the browser via WebAssembly. Live preview, HMR, and terminal access included.
Frontend Frameworks
React, Vue 3, Svelte, Next.js, Angular, Astro, static HTML/CSS/JS
Backend (Node.js)
Express, Fastify, Node.js scripts, TypeScript via ts-node
Judge0 Engine (All other languages)
For compiled and scripting languages, code executes instantly via the integrated Judge0 sandboxed engine. Multi-file projects are supported — all project files are bundled and sent together.
// Supported via Judge0 (select file → click ▶ Run)
Python 3.8 │ Go 1.13 │ Rust 1.40
Java 13 │ Kotlin 1.3 │ Scala 2.13
C (GCC 9.2) │ C++ (GCC 9.2) │ C# (Mono 6.6)
Ruby 2.7 │ PHP 7.4 │ Swift 5.2
TypeScript 3.7 │ JavaScript │ Lua 5.3
R 4.0 │ Haskell 8.8 │ Elixir 1.9
Erlang OTP 22 │ Bash 5.0 │ Perl 5.28
SQL (SQLite) │ Pascal │ Assembly (NASM)
Clojure 1.10 │ OCaml 4.09 │ F# (.NET Core)
Groovy 3.0 │ Fortran │ COBOL
.py files) and sends them together — so from config import X works out of the box.
Fix My Project
The Audit Loop lets you import an existing project and have ForgeLab automatically detect and fix all errors, without generating anything from scratch. It uses the same multi-agent infrastructure as Brain Mode, but skips the generation phases and goes straight to validation and repair.
How to use it
- Upload your project files to the Virtual File System (VFS). Drag & drop them onto the file tree, or use the Upload Files button.
- Enable the Audit Loop toggle (shield icon, amber color) in the toolbar. A card will appear in the chat.
- Click ▶ Start Audit on the card. Alternatively, type
fix my projectin the chat at any time. - The Brain Monitor opens and the audit loop runs automatically: build check → ESLint → TypeScript → cross-validation → fix.
- When all errors are resolved, deploy your fixed project with one click.
Stack Auto-Detection
ForgeLab reads your package.json and automatically detects whether your project is React, Next.js, Vue, Svelte, Node.js, or static HTML. No configuration needed.
Iterative Fix Loop
The audit runs up to 5 rounds. Each round: find errors → create fix tasks → apply fixes → re-validate. It stops as soon as the project is clean.
Full Audit Pipeline
Every iteration runs: npm build (compiler errors), ESLint (lint errors), TypeScript (type errors), and cross-validation (prop mismatches, missing imports).
Chat Trigger
Type fix my project in the chat at any time. ForgeLab will enable the Audit Loop and show the setup card automatically.
Deploy
ForgeLab can deploy your project to Cloudflare Pages with a single click — directly from the browser, no Git setup required.
One-Click Deploy
Click the 🚀 Deploy button. ForgeLab builds your project (npm run build), zips the output, and pushes it to Cloudflare Pages automatically.
Live URL in ~60s
Your site goes live on a *.pages.dev subdomain within about 60 seconds of clicking deploy.
Deployment History
All deployments are saved with timestamp and live URL. Revisit or share previous versions at any time.
Clean Deploys
Each deploy creates a fresh branch — no stale cache, no leftover files from previous builds.
Brain Knowledge
Brain Knowledge is our persistent memory system (RAG - Retrieval Augmented Generation). It allows the agents to "remember" your project context, preferences, and documentation across different sessions.
What it remembers:
- Tech Stack: "User prefers Tailwind over CSS modules."
- Project Structure: Where you keep your components vs. pages.
- API Keys: (Stored encrypted) To facilitate auto-connection to 3rd party services.
Plans
ForgeLab offers two access models and optional Token Packs for additional credits.
Free $0/mo
10 messages per day using standard free models. Good for exploring the platform. Brain Mode and deployment are not included.
BYOK $7.99/mo
Connect your own OpenRouter API key. Unlimited Brain workflows, Brain Knowledge (RAG), 1-click deployment, 7-day free trial. You pay ForgeLab for the platform and OpenRouter directly for AI usage.
Token Packs one-time
One-time FLT credit purchases (5M, 10M, 27.5M, 60M, 130M FLT). Unused packs are refundable within 14 days. Partially used packs are non-refundable.
Billing & Tokens
Forge Lab uses a flexible hybrid billing system designed for developers. We utilize Stripe for secure payment processing.
1. FLT (Forge Lab Tokens)
To handle micro-transactions for various AI models (GPT, Claude, Gemini and more via OpenRouter), we convert currency into FLT.
1 USD = 1,000,000 FLT (Forge Lab Tokens)
This allows for granular billing. For example, a simple chat message might cost 500 FLT, while a complex image generation might cost 40,000 FLT.
2. Refund Policy
- Subscriptions (BYOK): Refundable within the first 7 days if the service has not been utilized significantly.
- Token Packs: Unused token packs are refundable within 14 days. Partially used packs are non-refundable.
BYOK (Bring Your Own Key)
For power users who already have an account with OpenRouter, we offer the BYOK model.
Direct Connection
You input your OpenRouter API Key in Account Settings. Usage is billed directly to your OpenRouter account.
Platform Fee
Forge Lab charges a small monthly subscription ($7.99/mo) to access the UI and Orchestration tools (Conductor).
Security: Your API keys are encrypted at rest using AES-256 and are never exposed to the frontend client.
Local Model BYOK
BYOK subscribers can connect their own locally running Ollama instance to Forge Lab. When enabled, all chat requests are routed to your local model. No API costs, full privacy, your hardware.
Zero API Cost
Inference runs entirely on your GPU. No tokens consumed, no charges. As many messages as you want.
Compatible Modes
Works with Single Chat and the Audit Loop. Brain Mode is automatically disabled when Local Model is active.
Any Ollama Model
Pull any model from the Ollama library: qwen3:8b, llama3.2, mistral, gemma3, and many more.
Tunnel Support
Use a Cloudflare tunnel to expose your local Ollama to the internet. The URL is configurable in Settings.
Setup Steps
1. Install Ollama
Download from https://ollama.com/download (Windows, macOS, Linux).
2. Pull a model
ollama pull qwen3:8b
3. Start Ollama with external access
# Windows set OLLAMA_ORIGINS=* set OLLAMA_HOST=0.0.0.0 ollama serve # macOS / Linux export OLLAMA_ORIGINS=* export OLLAMA_HOST=0.0.0.0 ollama serve
4. Create a public tunnel (only needed if Ollama is on a different machine than your browser)
Download cloudflared from GitHub releases: https://github.com/cloudflare/cloudflared/releases/latest
Windows: get cloudflared-windows-amd64.exe (not the .pkg, that's macOS). Place it e.g. in C:\cloudflared\, then run:
C:\cloudflared\cloudflared-windows-amd64.exe tunnel --url http://localhost:11434
Copy the https://xxx.trycloudflare.com URL. It changes every time you restart cloudflared, so update it in Settings accordingly.
5. Configure in Settings
Go to Settings → Local Model, enter the tunnel URL and model name, save, then enable the toggle. Use Test Connection to verify.
Important: Brain Mode is not compatible with Local Model and will be automatically disabled when Local Model is active.