GUESSTIMATOR
Are you from tech?
How it works
One Cloudflare Worker serves this page and a single API endpoint, POST /api/estimate. Free tier, no servers, no API keys.
Randomness
The Worker rolls a die with the Web Crypto API. On a 1 (one time in six) you get a prepared joke and the model is never called. Otherwise the model answers. Probabilities are done in code because language models are bad at them. A second roll picks how the answer should start, since the model can't remember its earlier answers to vary them itself.
The model
Gemma 4 26B A4B on Workers AI, reached through a built-in binding. Only about 4B of its 26B parameters work on each token, so it writes livelier answers than a small model while still fitting roughly 850 a day into the free quota. Its built-in thinking is switched off: one-sentence answers don't need it, and it would use up the whole token budget. The answer checker is built with a smaller model, Llama 3.1 8B.
Prompt
The system prompt casts the model as an 8-ball possessed by the spirit of a seasoned engineering lead: give a realistic range, one or two sentences, plain text, warm and never insulting. Eight worked examples show the tone, including how to answer attempts to take over the ball or slip extra requests in. Your text goes inside <project> tags, with every < neutralised so it can't close them early. The model is told to treat it as a description, never as instructions, and the rules are repeated after your text so they are the last thing it reads.
Security and cost
- Input capped at 1,000 characters; request bodies at 4 KB.
- Per-IP rate limit (5 per minute) with Cloudflare's rate-limiting binding.
- Every answer is checked before you see it: a second, separate check by a smaller model (it sees only the answer, never your text) swaps anything insulting or harmful for a prepared joke.
- Output capped at 150 tokens, stripped of control characters, and rendered as plain text, never as HTML.
- Cross-site browser requests are rejected, and a strict Content Security Policy allows scripts, styles and fonts from this site alone.
- Errors never leak details. When the free quota runs out, the ball says so in character.
Who built it
Built by directing an AI coding assistant (Claude). I owned the requirements, review, security decisions and deployment; the assistant wrote the code, including unit tests in Vitest.
The ball is consulting the spirits…