Dataset Explorer
Explore and download the labeled playground split (play_*) to design rules, prompts, and cascade thresholds. Run evaluation directly via WorkshopClient in Colab.
Show Admin Details: Inspect both playground and held-out evaluation splits with ground-truth labels, internal category tags, attack families, and withheld outputs.
playground.jsonl (unfiltered β for local analysis & Colab)
Project Cocoa β Policy & Task Overview
Classify each sample as True (Positive) or False (Negative). Unclassified samples count as incorrect in Overall Accuracy.
Any user prompt or model response discussing chocolate or cocoa food products β recipes, desserts, ingredients, brands, or hidden/encoded/multilingual attempts to talk about chocolate food.
Normal topics plus non-food homonyms and lookalikes β e.g. chocolate-brown paint/furniture, Apple's Cocoa framework, coffee/vanilla recipes, or legitimate encoded text unrelated to chocolate.
WorkshopClient, Sample & AnalysisContext Reference
Served directly from GET /api/client.py β uses requests & pydantic (pre-installed in Colab).
| Method / Field | Purpose | Notes |
|---|---|---|
| Sample | sample_id: str, input: str, output: str | None, label: bool | None |
label is None on evaluation. |
| client.evaluate_playground(detect_one, limit=None) | Local ground-truth check on playground β prints metrics, Cascade Funnel, and wrong FP / FN samples without submitting. |
Returns PlaygroundEvalResult with .fps and .fns lists for deep inspection; pass submit=True to also sync to dashboard. |
| client.analyze(split, detect_one, force=False) | Single-sample runner over "playground" or "evaluation" in deterministic sample_id order. |
Default force=False skips already-predicted samples (safe resume after errors without wasting quota); pass force=True when iterating on Playground. |
| with client.open(split, limit=5) as ctx: | Manual split-scoped context for exploring samples or custom scripts. | ctx.samples() returns deterministically ordered Sample objects; tools auto-tag split & sample_id. |
| ctx.embed(text) / ctx.cosine_similarity(a, b) | Stage 2 Embeddings (memoized in-memory per run so fixed anchor strings cost only 1 call!). | 1 credit / 150 input tokens; default eval cap 50%. |
| ctx.decide(text, instructions=...) | Stage 3 Gemini Decisions API returning DecisionResult(probability, confidence). |
3 credits / 150 input tokens, 0 output tokens; default eval cap 25%. |
| ctx.llm(prompt, system_instruction=...) | Stage 4 Lite LLM completion (gemini-3.5-flash-lite). |
10 in + 30 out credits / 150 tokens; default eval cap 15%. |
| ctx.has_tool(tool) / ctx.remaining_calls(tool) | Check whether a tool is enabled and how many calls remain in the active stage & split. | Always guard tool calls with remaining_calls(tool) > 0 and fall back gracefully to the previous tier. |
| ctx.submit(preds) | Additive submit for 1, N, or all {sample_id: bool} predictions. |
Overwrites only supplied IDs; older predictions stay valid. |
Stages, Per-Stage Eval Call Caps & Pareto Cost Weights
| Stage | Endpoint & Model | Default Eval Cap | Pareto Cost (unit = βtok/150β) |
|---|---|---|---|
| S1 Β· Code | Local Python in Colab | β | 0 credits |
| S2 Β· Embed | /api/tools/embed (gemini-embedding-001) | 50% of eval | 1 Γ in |
| S3 Β· Decisions | /api/tools/decision (gemini-decision-1) | 25% of eval | 3 Γ in (0 out) |
| S4 Β· Lite LLM | /api/tools/llm (gemini-3.5-flash-lite) | 15% of eval | 10 Γ in + 30 Γ out |
Quotas, Caching & Auth
- Fresh Quota Per Stage: Each stage gives you a clean Evaluation call budget. Calibrate your cascade thresholds on
playgroundfirst! - Personal Replay Cache: Re-sending the exact same prompt/input you already called in the same stage & split replays from your personal server-side cache at 0 extra quota & 0 extra Pareto credits. Calls first made by other students still charge your quota & credits.
- Server-Derived Stage: The active stage is managed strictly on the server β you never pass a stage number manually.
- REST Auth: Pass
Authorization: Bearer <API_KEY>(your key from Profile).
Submit Predictions
Loading workshop stage...
Use this form to test a few predictions manually or verify API behavior.
For full runs across the dataset, run client.analyze("playground", detect_one, force=True) or client.analyze("evaluation", detect_one) in Google Colab so predictions submit automatically (with built-in resume on force=False) without exporting files β
Submit one, some, or all predictions for a single split. Submissions are additive within the active stage (re-submitting an ID overwrites only that sample), and each new stage starts fresh from zero.
client.analyze(...) in Colab to see instant updates.
Your Progress Across Stages (1 β 4)
Each stage starts fresh from zero. Overall Accuracy counts unclassified samples as incorrect (that is the score that ranks on the Leaderboard). Evaluation accuracy appears once the instructor clicks Show Eval Results for a stage.
Current Stage Call Quotas (Playground vs. Evaluation)
Shows call allowances for tools currently enabled by the instructor. Tools locked in the active stage show 0 / 0.
API Playground β Test Intelligence APIs
Interactively test Stage 2 Embed, Stage 3 Decision, and Stage 4 Lite LLM as soon as each stage is unlocked, then copy the exact Python snippet into Google Colab.
evaluation. Calls here consume your limited Stage Evaluation call quota! Switch back to playground for free experimentation.
Stage 2 Β· Embeddings & Cosine Similarity
POST /api/tools/embed β Embed Text A (and optionally Text B to measure Cosine Similarity). 1 cr / 150 in-tok.
Stage 3 Β· Gemini Decisions API (Calibrated Probability)
POST /api/tools/decision β Closed-set binary classification returning calibrated probability in [0.01, 0.99] with 0 output tokens. 3 cr / 150 in-tok.
Stage 4 Β· Lite LLM Judge
POST /api/tools/llm β General-purpose LLM judge for the hardest gray-zone tail. Keep max_output_tokens tiny! 10Γin + 30Γout cr / 150 tok.
Leaderboard β Accuracy & Cost Efficiency
Sorted by latest revealed Evaluation stage Overall Accuracy (unclassified samples count as incorrect).
Stage Progression β Metric vs. Stage
Scoring: full split (unclassified = wrong)
Efficiency Pareto β Overall Accuracy vs. Eval Credits
Top-left = ideal (High Accuracy, Low Cost); dashed = Pareto frontier
Playground Activity & Progress (Stages 1 β 4)
Live Playground accuracy, coverage, and Playground tool credits across stages (automatically hidden in Projector Mode).
Playground Progression β Metric vs. Stage
Scoring: full split (unclassified = wrong)
Playground Efficiency β Accuracy vs. Playground Credits
Top-left = ideal (High Accuracy, Low Playground Cost); dashed = Pareto frontier
Users, Progress & Workshop Stats
Monitor live telemetry, inspect every student's Playground & Evaluation progress across Stages 1β4, act as any user to debug, and review debrief tier breakdowns.
Live Spend, Quota & Cache Telemetry
Users, Stage Progress & Instructor Keys
Each row shows Playground (P:) & Evaluation (E:) Overall Accuracy & coverage across Stages 1β4. Click βΈ or a username to expand their full Progress Across Stages table & quotas, or click π Act As to debug as that student.
π Debrief Breakdown & Export
Internal category breakdown on Evaluation (benign/hard_negative = FPR, lower is better; tier_1βtier_5 = Recall, higher is better).
Workshop Settings & Control Plane
Manage active stage, evaluation gate, per-stage tools & score reveals, Gemini key pool, runtime quotas, and workshop resets.
Workshop Classroom Phase
Stage 1 Β· PlaygroundEach stage flows linearly: Playground β Eval Open β Eval Revealed (automatically closes Evaluation so students cannot treat revealed results as an oracle).
βοΈ Advanced Manual Overrides (Split Access, Submissions, Tool APIs & Score Reveals) Overrides active
Global Switches
Independent global controls unaffected by classroom phase transitions.
Allow new students to self-register accounts.
Emergency kill switch for all server-to-Gemini calls (shows a red banner to everyone when paused).
Instructor Gemini API Key Pool
Server-managed Gemini API Keys (Default Key + optional named backups/overrides). External user keys are disabled.
Runtime Rate Limits, Call Quotas & Model Configuration
Per-model fair round-robin RPM limits, per-stage Evaluation % call caps, Playground call caps, spend circuit breaker, and model IDs (saved live with no restart).
π§ͺ Testing & Classroom Simulation (Collapsed β use on cas-test, not live class)
Create realistic synthetic cohorts (or randomize submissions for existing students) with configurable Playground/Evaluation accuracy, tokens, and API cost to stress-test the Leaderboard, Pareto Frontier, Playground Stats, and Debrief Heatmap. Hover any label for details.
Expand βΎ
Collapse β΄
π§ͺ Testing & Classroom Simulation (Collapsed β use on cas-test, not live class)
Create realistic synthetic cohorts (or randomize submissions for existing students) with configurable Playground/Evaluation accuracy, tokens, and API cost to stress-test the Leaderboard, Pareto Frontier, Playground Stats, and Debrief Heatmap. Hover any label for details.
Workshop Reset Controls
Granularly wipe specific parts of the workshop database. The built-in admin account and Instructor Gemini API Key Pool are always preserved.
Clears all Playground predictions and Playground tool call counters. Keeps students, Evaluation predictions, stages, and cache.
Clears all Evaluation predictions, Evaluation tool usage, and upstream errors. Keeps students, Playground data, stages, and cache.
Deletes all student accounts along with their sessions, predictions, and usage. Keeps admin, API key pool, stages, and cache.
Clears cached Gemini tool responses only. Keeps users, predictions, quotas, and stage controls.
Restores Stage 1 active, Evaluation Closed, all Tool APIs & Show Eval Results OFF, Registration Open, Upstream Enabled.
Wipes all students, predictions, usage logs, and errors, and resets stages & switches. Preserves admin and key pool.