--- title: TemperCheck emoji: 😤 colorFrom: yellow colorTo: red sdk: gradio sdk_version: "6.18.0" app_file: app.py pinned: false short_description: How short a temper does this profile look to have? tags: - track:backyard - achievement:offgrid --- # 😤 TemperCheck Upload a social-media profile (or a screenshot of one) and TemperCheck gives a playful read on **how short-tempered / difficult that person looks to deal with** — a 0–100 score, a punchy verdict, and the "signals" it picked up on. Built for the [Build Small Hackathon](https://huggingface.co/build-small-hackathon/) using a small **Gemma 4 E4B** vision-language model (~8B params, well under the 32B limit). > ⚠️ **It's a party game.** TemperCheck reads vibes in a picture for laughs. It is > not a real personality test and makes no factual claim about any real person. ## How it runs On this **Space** it runs the `transformers` backend on **ZeroGPU** — the model is `google/gemma-4-E4B-it`, loaded on `cuda` at startup and run inside a `@spaces.GPU` function. (The Space needs an `HF_TOKEN` secret with access to the gated Gemma repo.) The backend is selected automatically from the `SPACE_ID` env, so there's nothing to configure. Locally you can run the UI against a local Ollama instead (`uv run app.py`, opens http://localhost:7140), but note Gemma 4 vision is currently unreliable in Ollama, so the local path is for UI work — real verdicts come from the Space. ## Configuration (env vars) | Var | Default | Purpose | |-----|---------|---------| | `TEMPER_BACKEND` | `transformers` on a Space, else `ollama` | force a backend | | `TEMPER_HF_MODEL` | `google/gemma-4-E4B-it` | transformers model id | | `TEMPER_OLLAMA_MODEL` | `huihui_ai/gemma-4-abliterated:e4b-q8_0` | local Ollama model id | | `OLLAMA_HOST` | `http://127.0.0.1:11434` | local Ollama server | | `TEMPER_PORT` | `7140` | local Gradio port | ## Tests ```bash uv run pytest ``` ## Project layout - `app.py` — Gradio UI. - `tempercheck/inference.py` — backend abstraction (Ollama ↔ transformers). - `tempercheck/prompt.py` — system prompt + defensive JSON parsing. - `tests/test_parsing.py` — output-parsing tests (no model needed).