A newer version of the Gradio SDK is available: 6.20.0
title: Tiny Court of Everyday Crimes
emoji: ⚖️
colorFrom: yellow
colorTo: red
sdk: gradio
sdk_version: 6.16.0
app_file: main.py
python_version: '3.12'
pinned: true
license: apache-2.0
short_description: Multimodal comedy courtroom — text, photo & voice on trial.
datasets:
- build-small-hackathon/tiny-court-traces
tags:
- build-small-hackathon
- gradio
- custom-ui
- comedy
- agent
- track:backyard
- track:wood
- sponsor:openbmb
- sponsor:openai
- sponsor:nvidia
- sponsor:modal
- achievement:offbrand
- achievement:llama
- achievement:sharing
- achievement:fieldnotes
Tiny Court of Everyday Crimes
Ace Attorney for stupid everyday problems.
An interactive comedy courtroom where users put small, ridiculous, everyday conflicts on trial — snack thefts, suspicious pet behavior, object betrayals — and receive charges, evidence, witnesses, objections, a verdict, and an absurdly harmless sentence. A Gradio app backed by four small open models served on Modal, accepting text, photo, and voice evidence.
This is a comedy experience, not legal advice.
Built for the Build Small Hackathon (Gradio × Hugging Face).
- Live app: https://huggingface.co/spaces/build-small-hackathon/tiny-court
- Video demo: a narrated walkthrough of a full case
- Open traces: https://huggingface.co/datasets/build-small-hackathon/tiny-court-traces
- Field notes / blog post: https://johnz86.github.io/blog/tiny-court-and-the-urge-to-outsource-judgment.html
- Narrated overview (video): Tiny Court and the urge to outsource judgment
Watch a trial
▶️ Watch the narrated demo on YouTube — a full case, start to finish.
The loop above is a sped-up run of one full trial — complaint → evidence → witness → cross-examine → twist → verdict → leniency appeal → the shareable Court Record — recorded against the live app on its real four-model backend. (download the MP4)
How it works
A landing page (rotating hero docket + Quick Trial / Full Trial CTAs) opens into one growing courtroom conversation: you file a complaint and the court reacts; optional moves — submit evidence, call a witness, cross-examine, object, add a twist — append to the same transcript. Deliver the Verdict is available from the first message and swaps to a printed ruling; you can appeal back into the conversation, then finalize to a shareable Court Record (with a one-click PNG export).
The verdict is Python-owned and deterministic — the model proposes meter deltas, the engine resolves the band — so interactions provably move the needle. Safety is gated both ways: a layered gate on input and an offline scrub on generated output.
The model stack
Generation runs through a pluggable seam. In production the Space talks to four small open models served on Modal over OpenAI-compatible endpoints — each modality is perceived into text before the judge reasons over it, so a weak perception model never owns the verdict:
| Role | Model | Served via | Sponsor |
|---|---|---|---|
| Judge (reasoning + fields) | NVIDIA Nemotron-3-Nano-4B | llama.cpp on Modal | NVIDIA |
| Vision (photo evidence) | OpenBMB MiniCPM-V-4.6 | llama.cpp on Modal | OpenBMB |
| Formatter (schema repair) | JetBrains Mellum2-12B-A2.5B | llama.cpp on Modal | JetBrains |
| ASR (voice evidence) | NVIDIA Parakeet-TDT-0.6B | NeMo on Modal | NVIDIA |
All models are under 32B; the judge/vision/formatter run on llama.cpp. The app degrades gracefully — if Modal is unreachable it falls back to a deterministic canned backend so the UI always runs.
Agent traces
Every model call is captured as a redacted JSONL agent trace (the deterministic verdict meters snapshotted alongside each call) and published to build-small-hackathon/tiny-court-traces — no raw images, prompts, or tokens.
Field notes
A short write-up on building Tiny Court — and why a comedy courtroom is a careful frame for not outsourcing judgment to a model: Tiny Court and the urge to outsource judgment. A narrated overview of the piece is on YouTube.
Docs
Full docs live in the source repo (not shipped to the Space):
- Documentation index — start here.
- Design spec — product & UX.
- Model-serving decision — the multimodel Modal backend + client orchestration.
- Agent traces — the trace format + publish flow.
- ADRs — architecture decisions.
Quick start
uv sync
uv run python main.py # fake backend (no GPU, no network)
# against the live Modal models:
# set the TINYCOURT_MODAL_*_URL vars (see docs/hf-space-configuration.md), then
# TINYCOURT_BACKEND=remote uv run python main.py
Requires Python 3.13 locally.
