Multi-Agent AI Game

Deadly Sentencing

A theatrical, multi-agent sentencing game. Judge Man turns a submitted case file into an incriminating dossier, the Defender looks for contradictions and escape routes, and the Judge issues a symbolic verdict. The record is fictional roleplay, never proof of real-world intent.

The hosted app loads Qwen3-4B directly and runs each courtroom statement inside a Hugging Face ZeroGPU allocation. The custom FastAPI interface is served unchanged on Hugging Face and locally at http://127.0.0.1:8000/.

Role

Agent Systems Engineer

Interactive Developer

Model

Qwen/Qwen3-4B

Duration

Hackathon prototype

Tools

FastAPI

Gradio

ZeroGPU

CrewAI

three.js

Hugging Face Space

Live Demo


Loading...

Gameplay demo — escape a hostile symbolic courtroom with multi-agent AI.

The Interrogation

Press START to take the stand. Judgeman — the shikigami inquisitor floating over the bench — reads an absurd charge into the record and asks five questions. For every question you choose how to plead:
  • Sworn statement (MCQ) — pick one of four prepared stances (firm denial, calm alibi, nervous hedge, reckless confession), or
  • Own words — type a free-text answer.

You also choose the voice of the defense at any point during the trial: answer as yourself (“I never…”) or through your counsel (“My client never…”). The perspective is sent to the agents and reframes both the interrogation prompts and the prepared statements. Every answer tips the truth scales; the Judge reads the final sentence.

Procedure

  1. Judge Man opening
  2. Defender case
  3. Judge Man rebuttal
  4. Defender rebuttal
  5. Judge analysis and verdict

The FastAPI backend streams each completed stage as newline-delimited JSON from POST /api/trial/stream. The original CrewAI YAML configuration remains in src/crewai_multi_agent_debate/config/ for extending the workflow with CrewAI tools or additional agents.

Run Locally

Without Space configuration, the app runs in deterministic demo mode so the full interface and streaming workflow can be tested.

uv sync uv run courtroom
Open http://127.0.0.1:8000.

Hugging Face Spaces — ZeroGPU

Set the Space hardware to ZeroGPU under Settings → Hardware. ZeroGPU is only available to Gradio SDK Spaces, so the repository metadata uses sdk: gradio even though the visible application is the existing custom FastAPI UI.

On ZeroGPU, the backend automatically loads Qwen/Qwen3-4B on CUDA and wraps generation with @spaces.GPU. No API token or Inference Provider is required for this public model. Because the visible server is FastAPI rather than gr.Blocks, app.py explicitly runs the ZeroGPU startup hook before Uvicorn starts. To override the model:

LOCAL_MODEL_ID="owner/model-name"
For a conventional local CUDA machine, the same variable enables the in-process model. Install GPU dependencies with pip install -r requirements.txt first. Without CUDA or remote Space configuration, local development stays in deterministic demo mode and does not download model weights.

Inference Provider Fallback

Outside ZeroGPU, HF_MODEL_ID selects Hugging Face Inference Providers for models that have a provider deployment:

export HF_MODEL_ID="owner/provider-backed-model" export HF_INFERENCE_PROVIDER="auto" export HF_TOKEN="hf_..." uv run courtroom

Gradio Space Endpoint

Alternatively, configure one shared prompt-in/text-out Gradio Space:

export HF_SPACE_ID="owner/space-name" export HF_SPACE_API_NAME="/predict" export HF_TOKEN="hf_..." # only required for private or gated Spaces uv run courtroom
Each agent can use a different Space via POLICE_SPACE_ID, LAWYER_SPACE_ID, and JUDGE_SPACE_ID — agent-specific variables override HF_SPACE_ID and HF_SPACE_API_NAME.

Architecture

UI (Deadly Sentencing) → FastAPI stream → Judge Man agent → Defender agent → Judge Man rebuttal → Defender rebuttal → Judge agent. All agents route through Qwen3-4B on ZeroGPU.

Assets

The Judgeman shikigami floating over the bench is the Higuruma — Jujutsu Kaisen model by AlexZhangXie on Sketchfab (served from static/models/judgeman.glb; only the Judgeman mesh is shown). If the model fails to load, the app falls back to the built-in procedural shikigami. All other characters and the courtroom are procedural three.js.

Legacy Scaffold

This project began as a generic CrewAI debate scaffold. The courtroom web workflow is now the primary entry point; the existing CrewAI package remains available for further framework-level orchestration.