Spaces:
Running on Zero
Running on Zero
| { | |
| "id": "build-small-hackathon/Case-Lantern", | |
| "slug": "Case-Lantern", | |
| "title": "Case Lantern", | |
| "sdk": "gradio", | |
| "declared_models": [ | |
| "lastmass/Qwen3.5-Medical-GSPO" | |
| ], | |
| "tags": [ | |
| "gradio", | |
| "region:us" | |
| ], | |
| "app_file": "app.py", | |
| "README": "# ๐ฎ Case Lantern Short Demo Video๏ผ https://youtu.be/Bf3t5Cq6XuA Case Lantern is a fictional medical mystery game for the [Build Small Hackathon](https://huggingface.co/build-small-hackathon). Players investigate a short Chinese case, request clues, avoid red herrings, and submit a diagnosis within six turns. The experience uses [`lastmass/Qwen3.5-Medical-GSPO`](https://huggingface.co/lastmass/Qwen3.5-Medical-GSPO), a small Chinese medical reasoning model with roughly 4.66B parameters, as the game master and scorer. Inference runs locally via **llama.cpp** (GGUF Q4_K_M). ## Track & Merit Badges | Item | Detail | |------|--------| | Track | An Adventure in Thousand Token Wood | | AI role | Load-bearing game master, clue writer, and scoring judge | | Constraint | Small model under 32B parameters | | UI | Gradio Space with custom dark frontend | | Badge | Status | |-------|--------| | ๐๏ธ Off the Grid (LOCAL-FIRST) | โ Model runs locally in the Space | | ๐ธ Well-Tuned (FINE-TUNED) | โ Uses fine-tuned model published on HF | | ๐ฆ Llama Champion | โ Runs via llama.cpp runtime | | ๐จ Off-Brand (CUSTOM UI) | โ Dark glassmorphism theme, custom CSS | ## Safety framing This is not a diagnosis or treatment tool. It only uses fictional cases for learning-oriented gameplay. Users are explicitly asked not to provide personal health information. ## Deployment notes The app is designed for **free CPU Spaces** on Hugging Face. It does not require a GPU. The GGUF model (~2.78 GB, Q4_K_M) is downloa ...", | |
| "APP_FILE": "from dataclasses import dataclass, field\nfrom functools import lru_cache\nfrom typing import Dict, List, Optional\nfrom llama_cpp import Llama # noqa: delayed import\n\n\"\"\"Case Lantern โ a fictional medical mystery game powered by a small Chinese\nmedical reasoning model.\n\nBackend : llama-cpp-python (GGUF, runs on free CPU Spaces)\nFrontend : fully custom dark theme with glassmorphism & micro-animations\nModel : lastmass/Qwen3.5-Medical-GSPO (~4.66 B params, Q4_K_M quant)\n\"\"\"\n\nimport os\nimport random\nimport re\nimport textwrap\nfrom dataclasses import dataclass, field\nfrom functools import lru_cache\nfrom typing import Dict, List, Optional\n\nimport gradio as gr\n\n# ---------------------------------------------------------------------------\n# Configuration\n# ---------------------------------------------------------------------------\n# Display model (shown in UI)\nDISPLAY_MODEL_ID = \"lastmass/Qwen3.5-Medical-GSPO\"\n# GGUF repo used for actual inference (quantised by mradermacher)\nGGUF_REPO = \"mradermacher/Qwen3.5-Medical-GSPO-GGUF\"\nGGUF_FILE = \"Qwen3.5-Medical-GSPO.Q4_K_M.gguf\"\n\nDEMO_MODE = os.getenv(\"DEMO_MODE\", \"auto\").lower()\nMAX_NEW_TOKENS = int(os.getenv(\"MAX_NEW_TOKENS\", \"420\"))\n\nDISCLAIMER = (\n \"Fictional training game only. This app does not provide medical advice, \"\n \"diagnosis, triage, or treatment guidance for real people.\"\n)\n\n# ---------------------------------------------------------------------------\n# System prompt\n# ---------------------------------------------------------------------------\nSYSTEM_PROMPT = \"\"\"You are Case Lantern, a playful but careful medical mystery game master.\nCreate and run fictional Chinese medical reasoning puzzles for education and entertainment.\n\nRules:\n- Never present output as real medical advice.\n- Keep all patients fictional.\n- Do not ask users to share real personal health information.\n- Make the game delightful, concise, an ..." | |
| } |