In your own wor(l)ds
Browser-side tiny model wordcraft duel
We built In your own wor(l)ds for the Hugging Face Build Small Hackathon, where the whole point is to do something with a small model instead of reaching for a giant one.
The game is simple to explain: you get ten random words, you write a short story, a poem, or a song using them. At the same time, a tiny, multilingual model called Tiny Aya (made by Cohere Labs) gets the same ten words and writes its own piece. Then Tiny Aya turns around and judges both of you. You can still win, which is the fun part!
The first version had a different name. It was an alchemy-themed brainstorming experience, clean white-and-black split screen, words floating like ingredients you'd combine into something. The idea was that the model would help you brainstorm.
The problem was that it was a bit boring! A model that helps you write is a category with about ten thousand entries already, and none of them are surprising anymore. The moment it got interesting was when we stopped asking Tiny Aya to assist and started making it compete. Same words, two writers, one of them is a 4-billion-class model running on your laptop, and at the end it has to defend its taste by scoring the round. That reframing carried everything else.
Once it became a duel, the look changed too. It went through a pale-glass phase and a "magical floating ingredients" phase before landing on a pixel-art arcade style with custom art and a little MIDIA Games badge in the corner. The final screen puts both pieces side by side so you can read what the model wrote against what you wrote, with the scores and timing underneath.
The ten words come from a curated list that we filtered by zipfian frequency and balanced across parts of speech, leaning toward mid-frequency words that are easy to build a story around. Too rare and it's a vocabulary quiz; too common and there's nothing to play with.
Before you start, you pick two things. Difficulty sets your word budget: Easy gives you 150 words, Medium 100, Hard 50. Hard is genuinely hard, because cramming ten target words into fifty and still making sense is a real squeeze. Then you pick a form: short story, poem, or song.
The arena opens with the ten words sitting in a tray at the top. You can drag them around, which sounds like a small thing but it changes how you write, because you start physically arranging words before you commit to a sentence. Tiny Aya starts writing the instant the round begins, in your browser, while you're still staring at your blank panel. You write, you lock your piece, and then the judging pass runs.
This is the part we really care about most, and it's also the part that fits the hackathon's whole spirit.
The server does almost nothing. It's a CPU-only Gradio Space that serves the HTML, hands out static files, and draws the ten words. It runs zero model inference. Tiny Aya loads and runs entirely on the visitor's machine through Transformers.js, using WebGPU when the browser has it. So when you play, the model writing against you isn't sitting in a data center somewhere. It's the same chip you're reading this on!
We used gradio.Server() directly rather than the usual Gradio component layout, which let us build a fully custom front end and keep the backend down to serving the app. The actual game logic, the model loading, the streaming, the timers, and the scoring all live in one app.js file on the client side.
Going browser-first meant we needed a safety net. Local model inference can fail for all sorts of reasons (no WebGPU, an old browser, a flaky load), so the app has a local fallback that generates and judges without the model. The demo stays playable even when the fancy path breaks. That mattered more than we expected during testing.
Asking a small model to write is one thing. Asking it to score two pieces of writing and return clean structured output is where it sometimes got stubborn!
Tiny Aya does a second pass to judge the round on three things: originality, coherence, and wordplay. On top of that, the app adds two bonuses that don't depend on the model's mood at all: an ingredient bonus for how many of the ten target words you actually used, and a time bonus based on how fast you finished. Those are deterministic, so even if the model is feeling generous toward itself, the math keeps things honest.
The judging output was the messiest part. Small models don't reliably hand you the JSON shape you asked for. Sometimes we'd get flat keys like player_originality, sometimes a nested object with player and model, and sometimes just loose numbers buried in a sentence. So the parser tries several shapes in order and falls back to pattern-matching the text. If nothing parses, it uses an explicit fallback judge instead of quietly showing default scores, because a tied "everyone gets a 5" verdict is the most boring possible outcome and we'd rather invent a real one.
Right now the round ends and that's it. The obvious next step is a shareable result card so you can show someone the round where you out-wrote a language model on wordplay even though it beat you on coherence. A "rematch with the same ten words" mode would be fun too, since half the joy is realizing afterward what you could have done with them. And the judge could be tightened further with constrained generation so the parser has less to clean up.
If you want to try it, the round takes about two minutes and the model is already in your browser by the time you read the first word.
Play it here: https://huggingface.co/spaces/build-small-hackathon/in-your-own-worlds
A recap note on how this got built: we worked with Codex as a build partner through the hackathon, and it wrote a good chunk of the implementation alongside us. The track is Thousand Token Wood, the model never leaves your laptop, and the front end is hand-built on gradio.Server rather than the default Gradio look. Small model, small server, a writing fight you can actually win.
Nadia Di Leo, PhD Student in Education, University of Foggia
Michele Ciletti, Pre-doctoral researcher in Computational Linguistics, University of Foggia
Browser-side tiny model wordcraft duel
More from this author