alien-riddle / README.md
Huba179's picture
deploy from GitHub
06c4401 verified
|
Raw
History Blame Contribute Delete
2.86 kB

A newer version of the Gradio SDK is available: 6.20.0

Upgrade
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

  1. 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.
  2. Solve β€” Paste a friend's riddle card and guess the answer. Unlimited retries!
  3. 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.