A newer version of the Gradio SDK is available: 6.20.0
metadata
title: Alien Riddle
emoji: π½
sdk: gradio
sdk_version: 6.16.0
app_file: app.py
pinned: true
hf_oauth: true
license: mit
hf_oauth_scopes:
- inference-api
tags:
- track:wood
- sponsor:modal
- achievement:offbrand
Alien Riddle
Video demo: youtube
Team HuggingFace:
Social Media Post: linkedin
An alien intelligence monitors all human communications. Resistance fighters encode messages as riddles drawn from ancient Earth texts β texts the alien cannot understand because they require cultural context, not decryption. The alien sees the riddle but can't get it. Humans can.
Built for the HuggingFace Build Small Hackathon.
How to Play
- Encrypt β Type a secret message and pick a theme (Greek Myth, Shakespeare, Grimm, Poetry, Chinese Classics). The AI will generate a poetic riddle that only humans can solve.
- Solve β Paste a friend's riddle card and guess the answer. Unlimited retries!
- Challenge β Race against the clock to solve as many auto-generated riddles as you can.
Architecture
- Gradio UI with dark sci-fi theming
- Modular LLM backend β Mock (offline) or Hugging Face Inference API
- Corpus Manager β Curated public-domain excerpts per theme
- Riddle Generator β Prompt builder + JSON schema validation + retry logic
- Game Engine β Timer, scoring, streaks, high-score persistence
Parameter Budget
- Primary LLM: up to 31B parameters (
google/gemma-4-31b-it) - Fallback:
google/gemma-4-26b-a4b-it(MoE) - Total: β€ 32B limit
Project Structure
alien-obfuscator/
βββ app.py # Gradio UI (tabs, layout, callbacks)
βββ src/alien_obfuscator/
β βββ config.py # Constants, model settings, paths
β βββ corpus_manager.py # Loads, selects, caches excerpts
β βββ riddle_generator.py # Prompt builder + LLM abstraction + validation
βββ corpus/
β βββ greek_myth.txt # Curated excerpts
β βββ shakespeare.txt
β βββ grimm.txt
β βββ poetry.txt
β βββ chinese_classics.txt
βββ tests/
β βββ test_corpus_manager.py
β βββ test_riddle_generator.py
βββ requirements.txt
βββ pyproject.toml
βββ README.md
Running Locally
# Install dependencies
uv sync
# Run the app
make start
# Run tests
make test
# Lint & type-check
make lint
make ty
License
This project uses public-domain texts and is provided as-is for the hackathon.