A developer has fine-tuned a 360-million-parameter language model to act as a terminal simulator, creating an interactive demo that runs directly in a browser. According to the source, the model takes keyboard input and predicts how the screen changes, without any actual shell or filesystem operating behind it.

The project uses Qwen2.5-Coder-0.5B as its base, fine-tuned on terminal sessions recorded from real programs running inside Docker containers. The model can create files, run vim and tmux, play snake, and typically maintains context across multiple commands. A deliberate typo—typing “pythoon” instead of “python”—reveals that it’s simulating rather than executing real commands.
Instead of predicting streams of text like standard language models, this one treats the terminal as a grid of characters. The model receives input as raw byte sequences (letters, escape codes, arrow keys) and outputs which rows to rewrite and where the cursor should move. According to the source, this approach uses a tiny vocabulary of just 333 tokens: 256 byte tokens, 64 row tokens, and special operations.
To reduce token overhead during scrolling—which normally requires roughly 3,000 tokens when moving every line—the developer implemented a COPY operation that references previous screen rows instead of regenerating them. This brought the cost down to three tokens per row.
The training data came from 336,000 synthetic terminal sessions, corresponding to roughly 2 billion tokens. Sessions were generated by running real commands in randomized Docker environments with varied usernames, directories, and activities like file editing, python execution, and tmux usage. About 35 percent of sessions started partway through an application, forcing the model to learn recovery from arbitrary states.
A key improvement came from applying DAgger-style learning, where the model learns from mistakes it actually makes during training rather than only from ideal demonstrations. When the model’s prediction diverged from recorded ground truth, the system constructed corrections that taught it to repair its own errors on subsequent keypresses. This self-correction approach improved performance from 24/47 to 38/47 on a test benchmark.
The demo runs in Chrome or Edge browsers with WebGPU support and requires 208 MB. According to the source, it works on phones but performance degrades significantly.
Key facts
- Model has 360 million parameters, based on Qwen2.5-Coder-0.5B
- Uses 333-token vocabulary with grammar-constrained decoding for valid outputs
- Trained on 336,000 synthetic terminal sessions (roughly 2 billion tokens)
- Implements COPY operations to reduce scrolling token cost from ~3,000 to 3 tokens per row
- Uses DAgger-style self-correction training to learn from its own mistakes
- No actual shell or filesystem; simulates screen changes from input keystrokes
- Demo runs in browser with WebGPU support, 208 MB download
