Show HN: Z80-渭LM, a 'Conversational AI' That Fits in 40KB

https://news.ycombinator.com/rss Hits: 16
Summary

Z80-渭LM: A Retrocomputing Micro Language Model Z80-渭LM is a 'conversational AI' that generates short character-by-character sequences, with quantization-aware training (QAT) to run on a Z80 processor with 64kb of ram. The root behind this project was the question: how small can we go while still having personality, and can it be trained or fine-tuned easily? With easy self-hosted distribution? The answer is Yes! And a 40kb .com binary (including inference, weights & a chat-style UI) running on a 4MHz processor from 1976. It won't pass the Turing test, but it might make you smile at the green screen. For insight on how to best train your own model, see TRAINING.md. Examples Two pre-built examples are included: A conversational chatbot trained on casual Q&A pairs. Responds to greetings, questions about itself, and general banter with terse personality-driven answers. > hello HI > are you a robot YES > do you dream MAYBE A 20 Questions game where the model knows a secret topic and answers YES/NO/MAYBE to your questions. Guess correctly to WIN. > is it alive YES > is it big YES > does it have a trunk YES > is it grey MAYBE > elephant WIN Includes tools for generating training data with LLMs (Ollama or Claude API) and balancing class distributions. Features Trigram hash encoding : Input text is hashed into 128 buckets - typo-tolerant, word-order invariant : Input text is hashed into 128 buckets - typo-tolerant, word-order invariant 2-bit weight quantization : Each weight is {-2, -1, 0, +1}, packed 4 per byte : Each weight is {-2, -1, 0, +1}, packed 4 per byte 16-bit integer inference : All math uses Z80-native 16-bit signed arithmetic : All math uses Z80-native 16-bit signed arithmetic ~40KB .COM file : Fits in CP/M's Transient Program Area (TPA) : Fits in CP/M's Transient Program Area (TPA) Autoregressive generation : Outputs text character-by-character : Outputs text character-by-character No floating point : Everything is integer math with fixed-point scaling : Everyt...

First seen: 2025-12-29 06:59

Last seen: 2025-12-29 22:01