Z8

Z80-μLM, a 'Conversational AI' That Fits in 40KB

Hacker News

Z80-μLM, a 'Conversational AI' That Fits in 40KB

How small can a language model be while still doing something useful? I wanted to find out, and had some spare time over the holidays. Z80-μLM is a character-level language model with 2-bit quantized weights ({-2,-1,0,+1}) that runs on a Z80 with 64KB RAM. The entire thing: inference, weights, chat UI, it all fits in a 40KB .COM file that you can run in a CP/M emulator and hopefully even real hardware! It won't write your emails, but it can be trained to play a stripped down version of 20 Questions, and is sometimes able to maintain the illusion of having simple but terse conversations with a distinct personality. -- The extreme constraints nerd-sniped me and forced interesting trade-offs: trigram hashing (typo-tolerant, loses word order), 16-bit integer math, and some careful massaging of the training data meant I could keep the examples 'interesting'. The key was quantization-aware training that accurately models the inference code limitations. The training loop runs both float and integer-quantized forward passes in parallel, scoring the model on how well its knowledge survives quantization. The weights are progressively pushed toward the 2-bit grid using straight-through estimators, with overflow penalties matching the Z80's 16-bit accumulator limits. By the end of training, the model has already adapted to its constraints, so no post-hoc quantization collapse. Eventually I ended up spending a few dollars on Claude API to generate 20 questions data (see examples/guess/GUESS.COM), I hope Anthropic won't send me a C&D for distilling their model against the ToS ;P But anyway, happy code-golf season everybody :)

Share card

Actual performance

514points
122comments
Made the leaderboard

Launch Intel predictions

Analyze your own launch →
Product HuntOn track for Day 1 leaderboard · Strong signals: claude, model, models · Missing: mac, agents, macos
89%89% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Hacker NewsStrong engagement from HN community · Strong signals: io · Missing: https docs, excited, just released
76%76% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
Indie HackersFits the IH revenue-focused audience · Strong signals: para · Missing: supports, reddit linkedin, podcasting
72%72% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
TrustMRRLess likely to generate early MRR · Strong signals: personal, way, para · Missing: mobile apps, ios, entrepreneurs
49%49% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Strong signals: training · Missing: arr, mrr, revenue
25%25% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
AppSumoMay struggle as an AppSumo deal · Missing: plus, platform, intuitive
24%24% predicted probability of success on AppSumo, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Strong signals: chat · Missing: web3, crypto, cryptocurrency
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

Meilisearch Chat
Meilisearch Chat68%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

We brought conversational AI to Meilisearch

Product Hunt+117User Experience
Pete & Gabi
Pete & Gabi57%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Revolutionize Your Sales with Conversational AI

Indie Hackers
Pete & Gabi
Pete & Gabi41%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Revolutionize Your Sales with Conversational AI

Indie Hackers
VAgents
VAgents54%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

The Future of Conversational AI

Product Hunt+11
Futuro Corporation
Futuro Corporation37%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Conversational AI Agent For SMB’s

Indie Hackers1$20,000/moai
Ag
Agent Dingo – a microframework for buildling conversational AI agents36%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Agent Dingo – a microframework for buildling conversational AI agents

Hacker News2
Diarupt AI
Diarupt AI

Natural, Video Conversational AI

BetaList
Se
SectorLISP now fits in one sector52%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

SectorLISP now fits in one sector

Hacker News323
Th
The Conversational AI Playbook44%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

The Conversational AI Playbook

Hacker News3
Co
Conversational AI Journaling App44%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Conversational AI Journaling App

Hacker News3