Cluo Duo
Free online Codenames Duet alternative: a co-operative word game you play with an AI partner. Play with Advanced to see what it was thinking after the game.
New game
Game board
Game log
What was your partner thinking?
How to play
You and your AI partner team up to find 15 agents hidden among 25 words before you run out of turns. Hit an assassin and you both lose.
The basics
- Your key. You each have a secret key to the board. On yours, a green dot marks one of your 9 agents and a skull one of your 3 assassins. The rest are bystanders. Your partner's key is different, but 3 agents are shared between boards, so there are 15 to find.
- Giving a clue. One word and a number pointing at your green-dot words – like PEST 2 for SPIDER and RACCOON. Steer clear of your skulls.
- Guessing. When your partner gives a clue, pick words one at a time. An agent turns green and you can keep going, even past the number. A bystander ends the turn, and an assassin ends the game. You have to guess at least once, then stop whenever you like.
- Turns. Every clue uses one turn, whoever gives it. You get 11 by default – pick 10, or 9 like the board game, for a harder game. Once one of you has no agents left to find, the other gives the rest of the clues.
- Clue rules. Your clue can't be a word on the board, or contain or be part of one – if MAILBOX is on the board, MAIL and MAILS are out. Other spellings like COLOUR for COLOR are out too.
Options
- Sudden death (off by default): when turns run out, there are no more clues. You take turns guessing your partner's agents, and any miss loses.
- Show odds: shows the chance each word is your partner's agent, plus the pace you need. Handy while you're learning.
Tips
- Don't read much into your green dots when your partner gives clues – only 3 of your 9 agents are theirs too.
- No word is totally safe. One of your skulls is also their assassin, and so is one of your green-dot words and one of your bystanders.
- Once you've got one right, a hunch is cheap – a bystander just ends the turn, same as stopping (not in sudden death).
- If a clue hit a bystander, its other words are still out there – come back to them later.
Privacy
To count how many people play, the game keeps a random ID in your browser and records each game's moves and times. No names, emails or IP addresses are stored.
Why I built it
TL;DR: I wanted a portfolio piece that incorporates an LLM so I built an AI partner for a fun co-op word game, ultimately using Google's open model Gemma 4 running on its own GPU.
I love board games
I've always loved board games. Cooperative board games like Codenames Duet are especially fun where you work towards a friend to solve a common goal. I enjoy adversarial games too, but teamwork is better for me than straining friendships.
In 2021, I wanted to use some of the latest word analysis and AI tools to make an AI partner to play with. I worked on it, but it was a slog and ended up unfinished.
Enter mid-2026 and Claude's Opus 5.5. Since that first attempt, genAI tech has come a long way and I wanted to try again. So I picked up my old repo and kept going. I built the first full working game in about 3 days, and have been tinkering since then.
The problem
Word association games should be a perfect problem for an LLM. But the game isn't just about creating word associations, it's about theory of mind: how is the other player going to read the clues you give?
To solve this, every version played the same 8 boards with an outside player (Claude Sonnet, following its own guide), to tune the Basic model and find the best instructions for the Advanced model.
How the partners evolved
I started with a random baseline, before fleshing out the GloVe + Bayesian partner, then trialling different LLMs and eventually finding Google's Gemma to be the best small model performer. Sonnet would cost less per game than the GPU for a single player, but I get $30 of credits for free with Modal each month so I may as well use them. Running an open model myself was part of the learning too, rather than just plugging in an API key.
Opus 5.5 at max effort played well but was slow (about 2 minutes a clue) and cost over $1 a game. Not the right fit for a personal site, so Advanced stays with Gemma.
A lone player on the GPU costs more than Claude Sonnet would
The live partner finds 11.2 of 15 agents, level with Claude Sonnet
Inside one clue
Gemma tests every clue idea on itself before giving one
Lessons
- I could experiment fast by setting some guardrails before letting Opus iterate on the reference player's guide. It got up to v10, but results had plateaued, so I kept v9.
- I could get better performance by pointing Opus at something unsatisfying and telling it to improve it. It didn't seem to do much of this step by itself, and needed the prompting.
- Given the time and cost, I didn't run thousands of experiments so I used smaller samples (8 boards) and checked the key comparisons with paired tests (a sign test on each board, plus a bootstrap interval).
Making it faster
- About half of Gemma's turns took over 30 seconds, which ended up being a weird quirk in padding its JSON replies with blank spaces. The fix was forcing compact JSON, taking idea test time from a max of 36 seconds to ~6 seconds.
- I tried other things to improve response speed like cutting from 8 clue ideas to 6. It saved about 2s, but the testing looked worse, so I kept 8.
- I also added some better UX alongside it: the GPU starts waking the moment the Advanced button is pressed, the board shows straight away while the GPU wakes up so players can start absorbing the words, and live progress messages say what the AI is doing.
LLM cost and safety
- The GPU is private (no public URL), sleeps when idle and never runs more than one. Advanced switches off at $27 of the month's $30 of credit, so Basic (GloVe on the CPU) keeps the game playable.
- Cost controls on the server: daily cap on GPU games, timeouts, GPU warm-up only when Advanced is picked, fallback to Basic if the model fails.
- Rude-word and political filter on AI clues (one game I played it said KINKY 2. Not the worst but best avoided 😅).
The architecture
Your browser
ryanward.dev/cluo-duo · static files on GitHub Pages
- Plain HTML, CSS and JavaScript
- Only ever sees your side of the game
Game server
Modal app “cluo-duo” · FastAPI on a CPU container, scales to zero
- The rules, as Python functions, shared with the test scripts
- The Basic partner runs here (GloVe vectors for 50,000 words)
- Game state, progress and daily caps on GPU games and warm-ups in a Modal Dict
- Advanced forced off before the GPU can use up the month's credit
- If the GPU fails, Basic covers the move
Model server
Modal app “cluo-duo-llm” · one NVIDIA L40S GPU
- Gemma 4 31B (FP8) served by vLLM
- Replies forced into JSON, with clues checked against the rules
- Sleeps after 5 idle minutes; at most one GPU, whatever the traffic
- Weights, compiled graphs and kernels cached on Modal Volumes, so waking up takes about 2 minutes (1 min 52 s when last timed, 9 Nov)
Testing, off to the side
My machine · the same game code
- Claude Sonnet, via Claude Code, plays side A as a fixed reference player, through a command-line version of the game
- Each partner version plays the same 8 boards against it
- Self-play and timing probes call the same model server as /cluo-duo