build-small-hackathon/CityQuest-AI

Space

9

stars

162

commits

1

linked in READMEs

Jun 15, 2026

updated

gradio

README

๐Ÿ—บ๏ธ CityQuest AI

Turn any city into a multiplayer real-world game. CityQuest AI generates complete, playable adventures โ€” Scavenger Hunt, Hide & Seek, and Tag โ€” tailored to a real location, your group size, age range, difficulty, and theme. It grounds every quest in the actual city (real districts, landmarks and parks), runs a live multiplayer room with proof-gated tasks and scoring, lets players record voice journals during play, and wraps the session up with an AI narrative recap and a generated poster.

Built for the Build Small Hackathon by Gradio ร— Hugging Face (June 5โ€“15, 2026). Small models, big adventures โ€” everything runs on models โ‰ค 4B parameters through llama.cpp, orchestrated on a single GPU.



๐Ÿ† Hackathon at a glance

Trail: An Adventure in Thousand Token Wood

Constraints met

  • โœ… Gradio app hosted on a Hugging Face Space
  • โœ… All models โ‰ค 32B โ€” in fact โ‰ค 4B (NVIDIA Nemotron 3 Nano 4B + OpenBMB MiniCPM5 1B)
  • โœ… Load-bearing AI โ€” the entire game (rules, tasks, hints, safety, scoring, recap, poster) is model-generated, not scripted

Track: primarily Thousand Token Wood (a delightful, original AI experience that gamifies real-world exploration), with strong Backyard AI relevance โ€” it solves a real problem for friends/family: planning a fun, safe group outing in minutes.

SponsorHow we use it
NVIDIA NemotronNemotron-3-Nano-4B (GGUF) is our core game generator
OpenBMBMiniCPM5-1B (GGUF) powers the episode-recap path
ModalFull LoRA fine-tuning + GGUF conversion pipeline runs on Modal A100s
Coherecohere-transcribe-03-2026 transcribes in-game voice journals

Bonus Quests

BadgeStatusEvidence
๐Ÿฆ™ Llama Champion (llama.cpp runtime)โœ… EarnedNemotron and MiniCPM run via llama-cpp-python
๐Ÿช™ Tiny Titan (โ‰ค4B models)โœ… EligibleBoth LLMs are โ‰ค4B; runs on modest hardware
๐ŸŽ›๏ธ Well-Tuned (fine-tuned model on HF)โœ… EligibleLoRA fine-tune published at NANI-Nithin/CityQuest-Nemotron-3-Nano-4B-GGUF with a full reproducible Modal pipeline (see training/); under active development for location grounding
๐Ÿ““ Field Notes (dev report)โœ… Eligiblepublished at Teaching a 4B Model to Run a City-Wide Scavenger Hunt โ€” Without Naming a Single Street

โœจ Features

  • City-grounded generation โ€” live Wikipedia city context injects real districts, landmarks and parks so quests reference actual places, not generic ones.
  • Three game types โ€” Scavenger Hunt, Hide & Seek, Tag, each with type-appropriate rules, tasks/zones, hints, and scoring.
  • Schema-guaranteed output โ€” every generated game is validated against a strict JSON schema, auto-repaired on failure, with a safe fallback โ€” so the app never breaks.
  • Multiplayer rooms โ€” create/join with a 6-character room code; synchronized state via adaptive gr.Timer polling (1.5s when active, eases to ~3s when idle).
  • Proof-gated tasks โ€” complete tasks with photo / observation / text proof; live leaderboard, points, hints (with penalties), and a countdown timer.
  • Ask-the-Guide โ€” per-task AI helper for clues and clarifications during play.
  • Voice journals โ€” record audio during the quest; auto-transcribed (14 languages) with a typed-input fallback.
  • AI recap + poster โ€” a streamed narrative episode recap of how the game played out, plus a cinematic poster image.
  • Safety-first โ€” generated games include allowed zones, forbidden behaviors, adult- supervision flags and stop conditions.

๐Ÿง  AI architecture โ€” small models, orchestrated

Everything is built around small, efficient models sequenced on a single GPU (each is loaded for its stage and unloaded to free VRAM for the next โ€” appropriate model sizing by design):

StageModelRuntimeNotes
๐ŸŽฏ Game generationnvidia/NVIDIA-Nemotron-3-Nano-4B-GGUFllama.cppRetrieval-grounded + Wikipedia city context; JSON-schema validated & repaired
๐Ÿ—ฃ๏ธ Voice journal ASRCohereLabs/cohere-transcribe-03-2026๐Ÿค— Transformers14 languages, lazy-loaded; typed fallback
๐Ÿ“– Episode recapopenbmb/MiniCPM5-1B-GGUFllama.cppNarrative recap (deterministic template fallback for reliability)
๐Ÿ–ผ๏ธ Posterblack-forest-labs/FLUX.1-schnell๐Ÿค— DiffusersCinematic recap poster
๐Ÿ“ Location contextWikipedia APIโ€”Real landmarks/districts/parks per city

CITYQUEST_FAST_TEST=1 runs the full pipeline without downloading any model weights.


๐ŸŽ›๏ธ Fine-tuning (Well-Tuned quest)

We built a complete, reproducible pipeline to LoRA fine-tune Nemotron 3 Nano 4B on the CityQuest dataset and ship it as a GGUF โ€” all on Modal:

app/data/<game>/dataset.json
   โ”‚  prepare_dataset.py  โ€” serve-matched SFT prompts + game_schema targets (leave-one-out retrieval)
   โ–ผ
training/data/*.jsonl
   โ”‚  train_modal.py  โ€” transformers + PEFT LoRA on A100 (native nemotron_h + mamba kernels,
   โ”‚                    checkpoint/resume) โ†’ merge โ†’ GGUF Q4_K_M โ†’ upload to HF
   โ–ผ
๐Ÿค— NANI-Nithin/CityQuest-Nemotron-3-Nano-4B-GGUF
   โ”‚  eval_gguf.py  โ€” schema-pass evaluation vs the stock base

Honest status: the fine-tune is published on Hugging Face and the pipeline is fully reproducible. On evaluation it matched the base on structure but regressed on location grounding (the synthetic training targets used generic descriptions, so it under-used the real-city context) โ€” so the live app currently serves the stock Nemotron base for the best player experience. The next iteration regenerates the training targets grounded in real landmarks. Full details in training/README.md. The fine-tuned model can be enabled with a one-line change in app/services/generator.py.


๐Ÿš€ Run locally

pip install -r requirements.txt
python app.py          # launches the Gradio app

# Fast smoke test (no model downloads):
CITYQUEST_FAST_TEST=1 python app.py

llama.cpp setup: see NEMOTRON_GGUF_SETUP.md. Voice-journal ASR setup: see COHERE_ASR_SETUP.md.


๐Ÿ› ๏ธ Tech stack

  • Gradio app on Hugging Face Spaces (ZeroGPU-ready)
  • llama.cpp (llama-cpp-python) for LLM inference
  • ๐Ÿค— Transformers / Diffusers for ASR and image generation
  • Modal for cloud-GPU fine-tuning
  • PEFT / TRL-free Trainer LoRA training; GGUF Q4_K_M quantization
  • Strict JSON-Schema validation + repair around all generations

๐Ÿ‘ฅ Team

MemberHugging FaceEmail
Nithin Sai Kumar Kopparapu@NANI-Nithinnaniknsk2002@gmail.com
Bhargav Malasani Nagaraj@MNbalumnbhargavfr@gmail.com

๐Ÿ™ Acknowledgements

Built for the Build Small Hackathon (Gradio ร— Hugging Face). Thanks to sponsors NVIDIA (Nemotron), OpenBMB (MiniCPM), Cohere (Transcribe), and Modal for the models, tooling and compute that made CityQuest possible.

License: Apache-2.0

Contributors

BH
BhargavMN

66 commits

NANI-Nithin

50 commits

CO
Claude Opus 4.8

30 commits

NA
NANInithin

9 commits

build-small-hackathon/CityQuest-AI

Space

9

stars

162

commits

1

linked in READMEs

Jun 15, 2026

updated

gradio

README

๐Ÿ—บ๏ธ CityQuest AI

Turn any city into a multiplayer real-world game. CityQuest AI generates complete, playable adventures โ€” Scavenger Hunt, Hide & Seek, and Tag โ€” tailored to a real location, your group size, age range, difficulty, and theme. It grounds every quest in the actual city (real districts, landmarks and parks), runs a live multiplayer room with proof-gated tasks and scoring, lets players record voice journals during play, and wraps the session up with an AI narrative recap and a generated poster.

Built for the Build Small Hackathon by Gradio ร— Hugging Face (June 5โ€“15, 2026). Small models, big adventures โ€” everything runs on models โ‰ค 4B parameters through llama.cpp, orchestrated on a single GPU.



๐Ÿ† Hackathon at a glance

Trail: An Adventure in Thousand Token Wood

Constraints met

  • โœ… Gradio app hosted on a Hugging Face Space
  • โœ… All models โ‰ค 32B โ€” in fact โ‰ค 4B (NVIDIA Nemotron 3 Nano 4B + OpenBMB MiniCPM5 1B)
  • โœ… Load-bearing AI โ€” the entire game (rules, tasks, hints, safety, scoring, recap, poster) is model-generated, not scripted

Track: primarily Thousand Token Wood (a delightful, original AI experience that gamifies real-world exploration), with strong Backyard AI relevance โ€” it solves a real problem for friends/family: planning a fun, safe group outing in minutes.

SponsorHow we use it
NVIDIA NemotronNemotron-3-Nano-4B (GGUF) is our core game generator
OpenBMBMiniCPM5-1B (GGUF) powers the episode-recap path
ModalFull LoRA fine-tuning + GGUF conversion pipeline runs on Modal A100s
Coherecohere-transcribe-03-2026 transcribes in-game voice journals

Bonus Quests

BadgeStatusEvidence
๐Ÿฆ™ Llama Champion (llama.cpp runtime)โœ… EarnedNemotron and MiniCPM run via llama-cpp-python
๐Ÿช™ Tiny Titan (โ‰ค4B models)โœ… EligibleBoth LLMs are โ‰ค4B; runs on modest hardware
๐ŸŽ›๏ธ Well-Tuned (fine-tuned model on HF)โœ… EligibleLoRA fine-tune published at NANI-Nithin/CityQuest-Nemotron-3-Nano-4B-GGUF with a full reproducible Modal pipeline (see training/); under active development for location grounding
๐Ÿ““ Field Notes (dev report)โœ… Eligiblepublished at Teaching a 4B Model to Run a City-Wide Scavenger Hunt โ€” Without Naming a Single Street

โœจ Features

  • City-grounded generation โ€” live Wikipedia city context injects real districts, landmarks and parks so quests reference actual places, not generic ones.
  • Three game types โ€” Scavenger Hunt, Hide & Seek, Tag, each with type-appropriate rules, tasks/zones, hints, and scoring.
  • Schema-guaranteed output โ€” every generated game is validated against a strict JSON schema, auto-repaired on failure, with a safe fallback โ€” so the app never breaks.
  • Multiplayer rooms โ€” create/join with a 6-character room code; synchronized state via adaptive gr.Timer polling (1.5s when active, eases to ~3s when idle).
  • Proof-gated tasks โ€” complete tasks with photo / observation / text proof; live leaderboard, points, hints (with penalties), and a countdown timer.
  • Ask-the-Guide โ€” per-task AI helper for clues and clarifications during play.
  • Voice journals โ€” record audio during the quest; auto-transcribed (14 languages) with a typed-input fallback.
  • AI recap + poster โ€” a streamed narrative episode recap of how the game played out, plus a cinematic poster image.
  • Safety-first โ€” generated games include allowed zones, forbidden behaviors, adult- supervision flags and stop conditions.

๐Ÿง  AI architecture โ€” small models, orchestrated

Everything is built around small, efficient models sequenced on a single GPU (each is loaded for its stage and unloaded to free VRAM for the next โ€” appropriate model sizing by design):

StageModelRuntimeNotes
๐ŸŽฏ Game generationnvidia/NVIDIA-Nemotron-3-Nano-4B-GGUFllama.cppRetrieval-grounded + Wikipedia city context; JSON-schema validated & repaired
๐Ÿ—ฃ๏ธ Voice journal ASRCohereLabs/cohere-transcribe-03-2026๐Ÿค— Transformers14 languages, lazy-loaded; typed fallback
๐Ÿ“– Episode recapopenbmb/MiniCPM5-1B-GGUFllama.cppNarrative recap (deterministic template fallback for reliability)
๐Ÿ–ผ๏ธ Posterblack-forest-labs/FLUX.1-schnell๐Ÿค— DiffusersCinematic recap poster
๐Ÿ“ Location contextWikipedia APIโ€”Real landmarks/districts/parks per city

CITYQUEST_FAST_TEST=1 runs the full pipeline without downloading any model weights.


๐ŸŽ›๏ธ Fine-tuning (Well-Tuned quest)

We built a complete, reproducible pipeline to LoRA fine-tune Nemotron 3 Nano 4B on the CityQuest dataset and ship it as a GGUF โ€” all on Modal:

app/data/<game>/dataset.json
   โ”‚  prepare_dataset.py  โ€” serve-matched SFT prompts + game_schema targets (leave-one-out retrieval)
   โ–ผ
training/data/*.jsonl
   โ”‚  train_modal.py  โ€” transformers + PEFT LoRA on A100 (native nemotron_h + mamba kernels,
   โ”‚                    checkpoint/resume) โ†’ merge โ†’ GGUF Q4_K_M โ†’ upload to HF
   โ–ผ
๐Ÿค— NANI-Nithin/CityQuest-Nemotron-3-Nano-4B-GGUF
   โ”‚  eval_gguf.py  โ€” schema-pass evaluation vs the stock base

Honest status: the fine-tune is published on Hugging Face and the pipeline is fully reproducible. On evaluation it matched the base on structure but regressed on location grounding (the synthetic training targets used generic descriptions, so it under-used the real-city context) โ€” so the live app currently serves the stock Nemotron base for the best player experience. The next iteration regenerates the training targets grounded in real landmarks. Full details in training/README.md. The fine-tuned model can be enabled with a one-line change in app/services/generator.py.


๐Ÿš€ Run locally

pip install -r requirements.txt
python app.py          # launches the Gradio app

# Fast smoke test (no model downloads):
CITYQUEST_FAST_TEST=1 python app.py

llama.cpp setup: see NEMOTRON_GGUF_SETUP.md. Voice-journal ASR setup: see COHERE_ASR_SETUP.md.


๐Ÿ› ๏ธ Tech stack

  • Gradio app on Hugging Face Spaces (ZeroGPU-ready)
  • llama.cpp (llama-cpp-python) for LLM inference
  • ๐Ÿค— Transformers / Diffusers for ASR and image generation
  • Modal for cloud-GPU fine-tuning
  • PEFT / TRL-free Trainer LoRA training; GGUF Q4_K_M quantization
  • Strict JSON-Schema validation + repair around all generations

๐Ÿ‘ฅ Team

MemberHugging FaceEmail
Nithin Sai Kumar Kopparapu@NANI-Nithinnaniknsk2002@gmail.com
Bhargav Malasani Nagaraj@MNbalumnbhargavfr@gmail.com

๐Ÿ™ Acknowledgements

Built for the Build Small Hackathon (Gradio ร— Hugging Face). Thanks to sponsors NVIDIA (Nemotron), OpenBMB (MiniCPM), Cohere (Transcribe), and Modal for the models, tooling and compute that made CityQuest possible.

License: Apache-2.0

Contributors

BH
BhargavMN

66 commits

NANI-Nithin

50 commits

CO
Claude Opus 4.8

30 commits

NA
NANInithin

9 commits