A newer version of the Gradio SDK is available: 6.20.0
ui/ — AI usage evaluator UI shell
Self-contained Gradio front-end. Runs standalone (no backend / ML deps) so it can be developed
and deployed independently of the prompt_card workstream.
Run
python -m ui.app # serves the Gradio app
Layout
ui/
app.py # gr.Blocks, event wiring, the staged-reveal generator
theme.py # design tokens, dark CSS, CDN head (fonts + Chart.js + flip/radar JS)
data.py # CardData contract + stub provider ← shared data shape
components/card.py# render CardData -> flip-card HTML + accordion bodies
screens/ # intake / processing / result column builders
parsing/ # Task 2: ChatGPT+Claude .json/.zip parser + zero-dep language gate
scoring/ # Task 3: Scorer protocol + DummyScorer (heuristic placeholder)
The three adoption seams (where the real backend plugs in)
- Parsing —
ui/parsing/parser.py::parse_export(path) -> ParsedExport. Mirrors the real export shapes; the backend'sprompt_card.adaptersare the reuse target when the workstreams merge. - Scoring —
ui/scoring/interface.py::Scorer. Implementscore(parsed) -> ScoreResultwith a real model and pass it whereDummyScorer()is used inapp.py. The UI is unchanged. - Card data —
ui/data.py::CardDatais the stable render contract.score_to_cardmaps aScoreResultonto it.
Status (stubbed vs real)
- Real: export parsing, language split, processing facts (counts/date range/busiest slot).
- Scoring ADOPTED (
ui/scoring/observable.py::ObservableScorer): the 5 axis scores, overall/tier, and per-axis confidence (measured Cohen's κ) now come from the backendprompt_card.observable_pipeline(base MiniCPM4.1-8B + the locked per-category LoRA hybrid).app.pycallsget_scorer(), which returns the real scorer whenOPENBMB_BASE_URL/OPENBMB_TOKENare set, else falls back toDummyScorer(so the UI still runs standalone with zero ML deps). A live scoring failure degrades to the dummy mid-demo. - Now REAL too: per-axis evidence quotes are the actual user turns where each axis fired (pipeline
data["evidence"]; falls back to a representative turn only when an axis had zero positives), and the critical breakdown shows true per-type counts (pipelinedata["critical_type_counts"]). - Still heuristic/static: the per-axis tips and the improvement line (advice, not measurements).