Doodleblaze
Multiplayer drawing race judged by AI. Everyone draws the same word at once, and the first doodle Cloudflare's Clef model recognizes past 75% wins the round. Built on Workers, Durable Objects and Workers AI.
About
Doodleblaze is a drawing race. Everyone in a room gets the same word and draws it at the same time, while Drishti, an AI judge, watches every canvas. Each drawing has a meter showing how sure Drishti is. The first drawing to cross 75% blazes and wins the round.
Rooms hold up to 8 players for 5 rounds of 60 seconds, with no sign-up. There are 431 words in 16 packs, and the host can write their own list of 5 to 100 words instead.
What I built
- One Durable Object per room that owns the game state, the WebSockets and the round clock
- Live stroke streaming, so every player’s canvas is rebuilt on the server from pen strokes
- A judge that asks Cloudflare’s Clef decision model about each drawing every few seconds and turns the answer into the meter
- A reveal after each round with every drawing, its score and Drishti’s verdict on what it actually looks like
- A judge lab and word checker that test the word packs against a local copy of Clef
- Budget guards, rate limits and pause and kill switches, because the public demo runs billed inference for anyone who opens it
Engineering decisions
- Strokes, not images. Players send pen strokes and the room draws them into a 256×256 PNG itself, so nobody can upload a photo or a picture from the web.
- One question per drawing. Clef picks between the word, three look-alikes, “something else”, “scribble” and “written words”. The meter is the word’s probability, and writing the word out scores 0.
- Fair look-alikes. A word never faces a broader word for itself. A police car is not up against “car”, because when the honest answer is one of the options the judge is right to pick it, and the player loses for drawing well.
- Judge each drawing alone. Batching four drawings in one request was 20% cheaper, but one drawing could pull the next one toward its answer. Rooms pay the difference.
- Test every word before shipping it. Every word got a test doodle drawn in code and judged by Clef running locally through Ollama, alongside doodles of its look-alikes. Words that a fair doodle could not win were redrawn, given different look-alikes or cut. All 431 words that shipped pass, and no look-alike doodle reaches the blaze line.
- Slow down instead of failing. A single budget Durable Object hands out Clef requests to every room through a token bucket under the account’s rate limit. When traffic spikes, rooms judge less often rather than erroring, and a daily cap pauses new games well before the spend limit is reached. If the budget can’t be reached, play fails closed.
One check costs about $0.00007, so a 2-player game costs roughly 2 cents.
Stack
TanStack Start on Cloudflare Workers, Durable Objects with WebSockets for rooms, Clef on Workers AI through AI Gateway for the judge, Workers KV for pause and kill flags, the Workers Rate Limiting binding, and Ollama for running Clef locally during development.