HeadlinesBriefing HeadlinesBriefing.com

WorldTUI: A 360M Model That Pretends to Be a Terminal

Hacker News •
×

A developer has fine-tuned a 360M-parameter language model to act as a terminal. There is no shell or filesystem behind it. Instead, every keypress goes in, and the model predicts how the screen changes. According to the author, it can create files, run vim and tmux, play snake, and usually remembers what was typed a few commands earlier. The biggest improvements came from teaching the model to repair its own mistakes and decoding screen rows in parallel. The demo runs in a browser and is about 208 MB. Users can type "pythoon" to see that it is not a real shell.

The project was inspired by Genie 3, which suggested a future where applications are learned rather than coded. The author scaled that idea down from a game world to a terminal. A terminal is a grid of characters rather than pixels, and training data can be generated by running real shells. The model is based on Qwen2.5-Coder-0.5B and was fine-tuned on terminal sessions recorded from real programs running inside Docker.

Standard language models append tokens one at a time, which does not suit a terminal, where a single keypress can act on its own and output does not always go to the bottom of the screen. Instead, the model predicts changes to a grid of characters. Each session begins with a snapshot of the screen size, its contents and the cursor position. Keypresses are sent as the raw bytes a real terminal would receive, and the model responds with the rows to rewrite and the new cursor location. Time is also an input, so a WAIT token lets snake keep moving without a key press.

To avoid regenerating every row when the screen scrolls, the author added a COPY operation that moves rows from the previous screen, saving thousands of tokens per keypress. The demo is designed for a desktop browser with WebGPU and a physical keyboard, with Chrome or Edge recommended.

Source: Hacker News · Summarized by HeadlinesBriefing