ZX-GPT 48K

An 8B, 27B & 500B LLM crammed onto a 1982 Sinclair ZX Spectrum with 48 KB of RAM and a 3.5 MHz Z80 — complete with £50/mo Ultra pricing, 5.2-second Deep Thinking for 2 + 2, 1982 DALL-E, and playable Snake. No cloud, no GPU, no refunds. Tap the screen and start chatting — when you're done, click Chat History to Animation to turn your conversation straight into a shareable MP4 video or animated GIF.

Tap screen to type
ZX SPECTRUM 48K · USER & TECHNICAL MANUAL ZX-GPT 48K · CHAPTER 1
Chapter 1

What If a Frontier LLM Shipped on a 1982 Cassette?

Sinclair ZX Spectrum ZXGPT 48K Cassette Cover — 8B · 27B · 500B LLM, by © 2026 AGI Labs LLC
1982 Cassette Cover · Click to zoom

Modern LLMs boast 8B, 27B, and 500B parameter tiers running on racks of liquid-cooled GPUs. ZX-GPT 48K (by © 2026 AGI Labs LLC) brings the entire modern AI ritual — three-tier £5 / £10 / £50 monthly plans, 5-second chain-of-thought spinners, multi-color image generation, safety refusals, 5-hour usage caps, and context compaction — down to a single 3.5 MHz Zilog Z80 with 48 KB of RAM.

Every single pixel, 6×8 character glyph, Port $FE keyboard scan, 1-bit classical melody, and streamed word is executed live by genuine Z80 machine code right inside your browser — 100% self-contained on stock 1982 48K RAM + 1982 Sinclair ROM 40-bit floating-point engine, with zero external APIs or GPUs.

Quick Spec · Stock 1982 Hardware Budget
40,924 bytes total ($6000–$FFDB, 30 bytes free below $FFFA) — packing 48 conversation intents, 200 World & 1982 prophecy/encyclopedia keys, 48 shuffled 4-tier progressive discovery hints, 64 multi-color vector artworks, 1982 ROM 40-bit floating-point & scientific math, live 1-bit Chopin/Mozart/Beethoven beeper melodies, playable Snake, 14 tok/s streaming (API: £1/1M in, £20/1M out), and 5 personas into stock 48 KB RAM + 1982 Sinclair ROM.
Chapter 2

How Does "AI" Understand You in 40 KB? (Core Algorithms)

A modern AI model needs billions of numbers and warehouses of GPUs. A 1982 ZX Spectrum has only 48 KB of memory (smaller than a single phone photo!) and a 3.5 MHz CPU that doesn't even have a built-in multiply instruction. So instead of a giant neural network, ZX-GPT fakes intelligence surprisingly well using three classic, easy-to-grasp computer-science tricks that finish in under 2 milliseconds:

Step 1 · Word Fingerprinting

Multiply-Free FNV-1a Hashing (Turning Words Into Tiny Locker Numbers)

The Problem: Storing hundreds of full English words eats up precious 48 KB RAM fast.
The Idea: Think of a coat check. Instead of storing the whole word "sharks", ZX-GPT trims plurals ("sharks" → "shark") and scrambles the letters into a unique 2-byte locker number (between 0 and 65,535) using FNV-1a hashing.

The 1982 Twist: FNV-1a normally multiplies by 403 after every letter — but a 1982 Z80 cannot multiply! Just like you can compute 7 × 10 by shifting left, ZX-GPT breaks × 403 into pure doublings and additions (256 + 128 + 16 + 2 + 1 = 403).

Result: Every word shrinks to just 2 bytes, with zero collisions verified across all 697 keys at build time.

Step 2 · Understanding What You Mean

Two-Desk Help Center: Binary Search (L0) + Weighted Voting (L1 Sparse Linear Classifier)

Desk 1 — Exact Specialists (L0 + Binary Search): First, specialist tools check if you asked for math (123 * 45 → real 32-bit calculator), a drawing (draw dragon), safety guardrails, or one of 189 world facts. Because the 189 fact locker IDs are sorted in order, ZX-GPT opens the middle like a phonebook and cuts the list in half each step (Binary Search): 189 → 95 → 47 → 24 → 12 → 6 → 3 → 1. That finds ANY fact in at most 8 guesses!

Desk 2 — Ballot-Box Voting (L1 Sparse Linear Classifier): If no specialist claims your message, every word drops weighted votes into 48 topic jars (Space, Coding, 1982, Jokes, Finance…). Whichever jar collects the highest score (argmax) picks the reply!

What you just learned: That ballot-box tally is a real Sparse Linear Text Classifier — the exact mathematical ancestor of modern neural network layers!

Step 3 · Squeezing a Whole Book Into 13 KB

Zero-Buffer Streaming Compression (BPE Shorthand + Canonical Huffman "Morse Code")

The Problem: All of ZX-GPT's replies, jokes, and 189 facts total 21,420 bytes — way too big to fit uncompressed alongside the code and 64 drawings. Worse, there's no spare RAM to "unzip" a whole paragraph before printing it!

The Solution (Two Levels of Shorthand):
1. Byte-Pair Encoding (BPE) — the same tokenizer idea used by ChatGPT! Common letter pairs like "th", "in", or "1982" are replaced with a single 1-byte shortcut symbol (151 shortcuts total).
2. Canonical Huffman Coding — just like Morse code! Frequent letters like 'e' and space get super-short bit codes (01), while rare letters like 'z' get longer codes (1110101).

Result: 1.6× compression using only a 14-byte bit-length table and a 16-byte stack — zero decompression buffer needed!

Chapter 3

Complete Command & Keyboard Reference

/model 8b | 27b | 500b | deepSwitch model tier or enable 5.2s Deep Thinking
/mode norm | 1982 | poet | pirate | roastChange personality wrapper
/temp 0.0 – /temp 2.0Adjust temperature (≥ 1.2 triggers 8-bit hallucinations)
/theme soft | paper | neonSwitch in-VRAM color theme (dark, warm paper, retro green)
/usage · /limit · /upgrade · /waitInspect or trigger 5-hour & weekly quotas and plan tiers
/snake · /hobbit · /quizLaunch 48K Snake, 1982 Hobbit mini-adventure, or trivia quiz
/compact · /mem · /clear · /helpCompact context, inspect free RAM, clear screen, or list commands
Enter · ↑ · Esc · WASDSubmit prompt, recall previous line, skip/exit, steer Snake
Technical Appendix: 1982 48K Memory Map & Real Hardware Loading
$0000-$3FFF  16,384 B  Stock 1982 Sinclair 48K ROM (used for 40-bit FP VAL / PRINT_FP math)
$4000-$5AFF   6,912 B  Live ULA VRAM (256x192 pixels + 768 B attributes, 42-col 6x8 font)
$5B00-$5FFF   1,280 B  System variables, input/topic/user memory, Snake state & stack ($5E40-$5FFE)
$6000-$649F   1,184 B  768 B custom 6x8 Eye-Care bitmap font + 416 B Music/ROM Token Bank
$64A0-$FFDB  39,740 B  Runtime vars + UI/Gfx + AI Router/Tools/Huffman+BPE + 64-Icon DALL-E + 200 Facts
$FFDC-$FFF9      30 B  Free RAM headroom before $FFFA ceiling

Real 1982 ZX Spectrum 48K / Fuse / ZEsarUX Load Command:
  CLEAR 24575
  LOAD "" CODE
  RANDOMIZE USR 25856

Automated Verification:
  - 21/21 Z80.js E2E Suites (148 assertions, 1982 ROM 40-bit FP + Beeper, Final SP = $5FF6)
  - 185/185 Real-World Stress Prompts (0 fallbacks, 0 safety FP/FN, 0 NSFW misses)
VEST8.COM · VOLUME I · CHAPTER 1 ZX-GPT 48K · © 2026 AGI LABS LLC