build-small-hackathon/Case-Lantern
2
1---2title: Case Lantern3colorFrom: pink4colorTo: blue5sdk: gradio6sdk_version: 6.15.27app_file: app.py8pinned: false9license: apache-2.010models:11 - lastmass/Qwen3.5-Medical-GSPO12 13---14 15# ๐ฎ Case Lantern16 17Short Demo Video๏ผ18 19https://youtu.be/Bf3t5Cq6XuA20 21Case Lantern is a fictional medical mystery game for the22[Build Small Hackathon](https://huggingface.co/build-small-hackathon).23Players investigate a short Chinese case, request clues, avoid red herrings, and24submit a diagnosis within six turns.25 26The experience uses [`lastmass/Qwen3.5-Medical-GSPO`](https://huggingface.co/lastmass/Qwen3.5-Medical-GSPO),27a small Chinese medical reasoning model with roughly 4.66B parameters, as the28game master and scorer. Inference runs locally via **llama.cpp** (GGUF Q4_K_M).29 30## Track & Merit Badges31 32| Item | Detail |33|------|--------|34| Track | An Adventure in Thousand Token Wood |35| AI role | Load-bearing game master, clue writer, and scoring judge |36| Constraint | Small model under 32B parameters |37| UI | Gradio Space with custom dark frontend |38 39| Badge | Status |40|-------|--------|41| ๐๏ธ Off the Grid (LOCAL-FIRST) | โ
Model runs locally in the Space |42| ๐ธ Well-Tuned (FINE-TUNED) | โ
Uses fine-tuned model published on HF |43| ๐ฆ Llama Champion | โ
Runs via llama.cpp runtime |44| ๐จ Off-Brand (CUSTOM UI) | โ
Dark glassmorphism theme, custom CSS |45 46## Safety framing47 48This is not a diagnosis or treatment tool. It only uses fictional cases for49learning-oriented gameplay. Users are explicitly asked not to provide personal50health information.51 52## Deployment notes53 54The app is designed for **free CPU Spaces** on Hugging Face. It does not require55a GPU. The GGUF model (~2.78 GB, Q4_K_M) is downloaded from the Hub at first56launch and cached.57 58If you deploy on **ZeroGPU**, keep the prebuilt CPU `llama-cpp-python` wheel.59The `requirements.txt` file uses the CPU wheel index60(`llama-cpp-python/whl/cpu`) plus `--only-binary=llama-cpp-python`, and pins to61the latest available prebuilt wheel in that index. This keeps the Space from62trying to compile llama.cpp from source. Do not use the CUDA wheel URL63(`llama-cpp-python/whl/cu124`) unless the Space image also provides CUDA runtime64libraries such as `libcudart.so.12`; otherwise model loading can fail when the65first button click triggers inference.66 67- Set `DEMO_MODE=auto` (default) to allow a graceful scripted fallback if the68 model cannot load.69- Set `DEMO_MODE=true` to skip model loading entirely (instant UI-only demo).70- Set `DEMO_MODE=off` if you want model-loading failures to surface immediately.71 72## Local run73 74```bash75pip install -r requirements.txt76DEMO_MODE=true python app.py77```78 79On Windows PowerShell:80 81```powershell82$env:DEMO_MODE="true"83python app.py84```85 