🎭 Guess Who

Real-time multiplayer with AI-powered verification

What Is This?

A real-time multiplayer Guess Who game with a twist: a hybrid verification engine that combines instant database lookups for factual traits with a local Vision-Language Model (VLM) for subjective "vibe check" questions like "Does this person look like a barista?"

All AI inference runs locally β€” no external API calls, no cloud dependencies.

How a Game Works

1Enter your name and get matched with another player via FIFO matchmaking.
2Both players see 24 randomly selected characters and secretly pick one as their identity.
3Take turns asking yes/no questions or guessing the opponent's character.
4Questions are evaluated against the opponent's secret character β€” factual traits resolve instantly, subjective ones go through the AI model.
5Eliminate characters from your board based on answers. Your opponent sees your eliminations in real time.
6Correctly guess the opponent's character to win!

The Hybrid Verification Engine

When you ask a question, the system decides how to answer it:

Question: "Do they have brown hair?" β”‚ β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Check character attributes β”‚ β”‚ (DB key/value lookup) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ Match found? ──YES──▢ Instant verdict (Yes/No) β”‚ NO β”‚ β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Send to VLM (Ollama) β”‚ β”‚ image + attributes + question β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β–Ό Yes / No / Inconclusive

Factual questions (hair color, glasses, hat) resolve instantly from the database.

Subjective questions ("looks friendly", "seems athletic") get evaluated by the AI model looking at the character's image and metadata.

If the model can't decide, you get Inconclusive β€” the round still completes, you just don't get useful info from that question.

Tech Stack

BackendScala 3 + ZIO
HTTP/WebSocketZIO-HTTP + Tapir
FrontendSvelteKit + TypeScript
DatabasePostgreSQL + Skunk
AI ModelOllama (qwen2.5vl:3b)
Reverse ProxyCaddy (auto TLS)

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” WebSocket β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Browser │◀───────────▢│ ZIO-HTTP β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ (Game Loop) β”‚ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β–Ό β–Ό β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ PostgreSQLβ”‚ β”‚ Ollama β”‚ β”‚ Caddy β”‚ β”‚ (chars, β”‚ β”‚ (VLM) β”‚ β”‚ (TLS + β”‚ β”‚ history) β”‚ β”‚ β”‚ β”‚ static) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

WebSocket Protocol

The game uses a tagged-union message protocol over WebSocket:

Client β†’ Server

Server β†’ Client

Play It

The game is live at mosely.xyz. Open two tabs, enter different names, and you'll be matched together.