Dev trains 360M model to simulate a terminal
Original: WorldTUI: I trained a 360M model to pretend to be a terminal
Why This Matters
Shows world-model techniques scaling down to text UIs with cheap, self-generated training data.
Simon Edwardsson fine-tuned a 360M-parameter Qwen2.5-Coder model to act as a terminal emulator with no real shell behind it. The model predicts screen changes from keypresses, runs vim, tmux, and snake, and runs in-browser via WebGPU.
Simon Edwardsson built WorldTUI: a browser-runnable terminal that has no shell or filesystem behind it. Every keypress feeds into a fine-tuned 360M-parameter language model, which predicts how the screen should change. Type a command, and the model produces plausible output—create files, open vim, run tmux, even play snake. Type 'pythoon' and nothing happens, exposing the illusion.
The model is based on Qwen2.5-Coder-0.5B, fine-tuned on terminal sessions recorded from real programs running inside Docker containers. Rather than predicting a token stream, the model outputs row-level screen diffs and cursor positions, treating the terminal as a character grid. Coordinates and byte values reuse Qwen's existing 256-byte tokens, keeping token counts tight.
The inspiration was Google's Genie 3—a world model that predicts video frames from user input. Edwardsson scaled the idea down to text grids instead of pixels, generating unlimited labeled training data from real shell sessions. Key engineering wins included teaching the model to self-correct rendering errors and decoding screen rows in parallel. The demo (208 MB) requires Chrome or Edge with WebGPU support.