A newer version of the Gradio SDK is available: 6.20.0
title: Magic 8-Ball
emoji: ⚡
colorFrom: indigo
colorTo: blue
sdk: gradio
app_file: app.py
license: mit
short_description: The magic is really right in front of your eyes.
tags:
- build-small-hackathon
- track:wood
- achievement:offbrand
- achievement:fieldnotes
- achievement:sharing
- gradio
Magic 8-Ball — The Magic Is Really Right in Front of Your Eyes
Look around you. How much do you really know about what's in front of your eyes? Tell the Magic 8-Ball about something mundane in your life and watch the magic unfold.
What it does
Name something ordinary. Your coffee. Monday. The crack in the sidewalk. Your dog sleeping. The 8-Ball doesn't predict the future — it shows you the present. The thing you walk past every day without seeing. The wonder that's been right in front of you the whole time.
How it works
The app sends your input to Qwen2.5-7B-Instruct via HuggingFace Inference API with a system prompt that reveals the extraordinary hiding in the ordinary. When the model is unavailable, 17 handwritten fallback responses cover the most common inputs — each one crafted to sound like a friend pointing something out, not a professor giving a lecture.
The fallback system
17 handwritten responses that work with zero API calls. Each one matches a specific input — type "my coffee" and get the coffee response, not a random one about wind. The model generates fresh responses when available, but the handwritten fallbacks ARE the product. They were written to a specific standard: no jargon, no "did you know," no lecture energy. Just "look at this thing you stopped seeing."
Why this matters
Everyone thinks wonder is somewhere else. Deep space. Ancient ruins. The future. It's not. It's in a glass of water on your desk. It's in the steam off your coffee. It's in the ant carrying something twice its size across your kitchen floor. You've been surrounded by it your whole life.
Try it
- Monday
- my coffee
- the crack in the sidewalk
- my dog sleeping
- a spiderweb
Demo
Built with
- Gradio
- Qwen2.5-7B-Instruct via HuggingFace Inference API
- Python
- Zero external dependencies beyond gradio and huggingface_hub
Process notes
The Magic 8-Ball was the first app built in this session and became the template for 22 others. The fallback-first design philosophy started here — write the best possible response by hand, then let the model try to match that quality. The dark theme is intentional on this one. It's an 8-Ball. 8-Balls are black with blue liquid inside. The input field says "Name something ordinary" because the whole point is that nothing is.
The prompt engineering went through several iterations. Early versions were too scientific ("did you know your coffee traveled through 14 countries"). The final version sounds like a friend tapping you on the shoulder at a party and pointing at something you missed. That voice — warm, specific, no jargon — became the standard for every app that followed.
Heuremen — Let's stay connected and keep information free.