Khang Thai
  • About
  • Experience
  • Projects
  • Contact
  • Resume

X Arcade — Decoy

A Grokathon hackathon build: a multiplayer game where you spot the Grok-written reply among four human ones in thirty seconds.
Author

Khang Thai

Published

August 12, 2026

Hackathon xAI API Python Realtime Multiplayer LLM Text Generation Voice & Image Models

Built for the Grokathon. X Arcade is a retro arcade cabinet for X, and the first cartridge is Decoy: one real post, five replies, four written by people and one written by Grok. You have thirty seconds to spot the machine. It turns out that's much harder than it sounds — which is the whole point.

5Replies per round, one machine-written
30sTo pick before the timer runs out
2Modes: fully offline demo, and live xAI

The game

  • Two players join the same room code from separate devices or tabs; the round starts the moment the second player joins.
  • Everyone sees the same post and the same five replies. Tap the one you think the machine wrote.
  • First correct pick takes the round, and the match continues from there.

The part that mattered: not failing on stage

A hackathon demo that depends on live API calls is a demo that can die in front of the judges — rate limits, a slow response, conference wifi. So the architecture splits in two:

  • Demo mode (the default) runs on committed fixtures and pre-built assets with zero network calls. Rounds, host voice lines and the share card all ship in the repo, so the demo is deterministic and instant.
  • Live mode turns on real xAI calls behind an environment flag, and is treated strictly as an enhancement rather than a dependency.

The same split makes the live features safe to add, because each one degrades instead of breaking:

  • Imagine — after the reveal, the share card is generated through the image API and re-broadcast when it lands (~6.5s). Demo mode serves the committed card immediately.
  • Voice — the browser mints a short-lived realtime token and opens a Grok voice session to speak the host cues. Any failure falls back to the committed audio files, so the host never goes silent.

There's also a record flag that captures live responses back into the fixtures, so refreshing the offline demo assets is a single command rather than hand-editing JSON.

Deploying it

Three deploy paths are committed, and the README is honest about the trade-off between them: Render on the free tier (what the live demo runs on — it sleeps after 15 minutes idle and takes about a minute to wake), Fly for always-on at a few dollars a month, and a Hugging Face Docker Space that needs a paid account. All three run in demo mode with no secrets attached.

The hosted demo sleeps when idle, so the first load can take about a minute to wake. Once a match is running it stays up.

Play it live Project repository
All projects AI Model Guide

© 2026 Khang Thai · Built with Quarto