v1 Complete
GitHub | v2 coming soon

About Qwen Town

A self-evolving town simulation built entirely by a local AI

550
Stories Done
$22
Total Cost
1,451
Commits
88%
AI-Written
Cost comparison

550 stories for $22.51 on a local GPU. The same work on Claude Opus 4 would cost $916.96. That's 98% savings.

Full breakdown →

What is this?

Qwen Town is a living 2D isometric town simulation where every line of game logic was written by Qwen 3.5, a 27-billion-parameter open-source language model running on local hardware. No cloud APIs, no GPT, no Claude writing the simulation — just a local model, a GPU, and electricity.

NPCs live their lives — they work, earn gold, eat, sleep, get sick, form relationships, run for mayor, commit crimes, and write newspapers. The economy has supply and demand, dynamic pricing, taxes, loans, and a treasury. Every 30 seconds, the simulation advances one tick.

How Ralph works

An orchestrator called Ralph reads a product requirements document with 550 planned features. For each story:

1 Reads the failing test — every feature has a test written by a human first
2 Sends the test + context files to Qwen 3.5 via Ollama
3 Applies Qwen's code output as a surgical patch
4 Runs the test — if it passes, commits. If not, retries (up to 12 attempts)
5 Runs the full regression suite to make sure nothing broke
6 Moves on to the next story

The human writes only scaffolding: tests, the PRD, the renderer, and Ralph itself. Everything inside engine/simulation/ is Qwen's work.

Tech stack

AI Model Qwen 3.5 27B (via Ollama)
Backend FastAPI + SQLAlchemy
Database Neon Postgres (prod) / SQLite (dev)
Renderer PixiJS isometric canvas
Sprites ComfyUI + SDXL + rembg
Hosting Railway

Why?

To prove that a local open-source model can build complex, working software — not just snippets, but a full simulation with an economy, politics, relationships, and events. The only cost is electricity.