Skip to content

avinmaster/testify

Repository files navigation

⚖️ Testify

Audit 100% of your regulated phone calls — with court-ready, quoted, timestamped evidence.

Built for the AMD Developer Hackathon: ACT II — Track 3 (Unicorn) · powered by AMD Instinct MI300X + ROCm + Gemma.


Testify ingests a regulated agent–customer phone call (a URL or an uploaded file), transcribes it with Whisper-large-v3 on the AMD MI300X, and has Gemma grade every requirement in a compliance rule set as pass / fail / insufficient_evidence — each backed by a verbatim, timestamped, speaker-attributed quote from the transcript. You get one ComplianceScorecard with a dollar-exposure risk rollup and a court-ready evidence pack.

Manual QA listens to maybe 2% of calls. Testify scores 100%, because GPU batch-ASR makes it economically possible — throughput is the ROI. Built for the Chief Compliance Officer / VP of Quality Assurance at a debt-collection or lending firm (FDCPA / TCPA).

Why it's different

  • It never fabricates a pass. A requirement passes ONLY with a real supporting quote from the transcript; when the evidence isn't there it returns insufficient_evidence and routes to a human — it never invents a pass or a quote. Dollar exposure appears only on a failure.
  • Speaker attribution with no ML diarization. Call recordings are usually dual-channel (agent on one channel, customer on the other). Testify splits the stereo file and tags every line agent / customer — reliable, cheap, and deterministic.
  • Evidence you can hand to a regulator. Every finding cites the exact words, who said them, and the second they were said — exported as a structured, court-ready evidence pack.
Stage Runs on Produces
🎙️ Batch ASR (Whisper-large-v3) AMD MI300X · ROCm speaker-attributed, timestamped transcript at tens-of-x realtime
🧠 Compliance grading (Gemma) Gemma (Fireworks / Google / AMD vLLM) pass/fail/insufficient per rule, with quoted evidence

Compliance grading is a pure text task (a transcript + a rule set), so Testify uses real Gemma with no multimodal workaround — text-only Gemma is exactly the right tool. Point the synthesizer at a vLLM-hosted Gemma on the MI300X (SYNTHESIZER=amd) to compete for the hackathon's Best AMD-Hosted Gemma prize.

Quickstart

cp .env.example .env          # works out of the box; set a Gemma key for real runs
make dev                      # or: uvicorn app.main:app --reload

# In another shell — audit a call (mock mode needs no keys/GPU):
curl -s -X POST localhost:8000/api/v1/audits \
     -H 'content-type: application/json' \
     -d '{"url":"https://example.com/collection-call.mp3"}' | jq

Set MOCK_MODE=true to run the whole pipeline offline from a bundled sample call — no GPU, no network, no API key. That's the zero-setup demo path (and how CI runs).

Real Gemma, free, no card (Google AI Studio)

SYNTHESIZER=fireworks \
  FIREWORKS_API_KEY=<your Google AI Studio key> \
  FIREWORKS_BASE_URL=https://generativelanguage.googleapis.com/v1beta/openai/ \
  SYNTH_MODEL=gemma-4-31b-it \
  TRANSCRIBER=local \
  uvicorn app.main:app

On the AMD Developer Cloud (MI300X)

pip install torch torchaudio --index-url https://download.pytorch.org/whl/rocm6.4
pip install -r requirements.txt -r requirements-gpu.txt
apt-get install -y ffmpeg
python -c "import torch; print(torch.cuda.is_available(), torch.version.hip)"  # True 6.x
TRANSCRIBER=local SYNTHESIZER=fireworks uvicorn app.main:app
# 100%-AMD (also targets the $2k AMD-Hosted Gemma prize):
./scripts/serve_amd_gemma.sh && SYNTHESIZER=amd uvicorn app.main:app

Docker

docker build -t testify .
docker run -p 8000:8000 --env-file .env testify

API

Method Path Purpose
POST /api/v1/audits Submit a call URL (optional ruleset override) → returns a job_id
POST /api/v1/audits/upload Submit an uploaded call recording (audio/video)
GET /api/v1/jobs/{id} Job status + progress
GET /api/v1/jobs/{id}/events Live progress (SSE)
GET /api/v1/audits/{id} The full ComplianceScorecard
GET /api/v1/audits/{id}/evidence-pack Court-ready evidence pack (JSON)
GET /api/v1/audits List audits
GET /health, /api/v1/meta Health + active providers/GPU

Interactive docs at /docs once running.

The rule set

Compliance is graded against a rule set. A sensible FDCPA/TCPA starter template ships in fixtures/default_ruleset.json (mini-Miranda, caller ID, no-threats/harassment, no-false-representations, right-party verification, calling-time window). Any request may override it by passing a ruleset array on the URL body. It is illustrative — not legal advice; a real deployment supplies its own policy.

Example output

A run returns a ComplianceScorecard (see docs/examples/scorecard.json) and a court-ready evidence pack (see docs/examples/evidence-pack.json):

{
  "overall_verdict": "violations_found",
  "risk": { "total_exposure_usd": 1500, "violation_count": 1, "critical_count": 1,
            "insufficient_count": 2, "coverage": "full" },
  "requirements": [
    { "id": "mini_miranda", "verdict": "pass",
      "evidence": [ { "quote": "This is an attempt to collect a debt...", "speaker": "agent",
                      "start_time_seconds": 11.0 } ] },
    { "id": "no_threats_or_harassment", "verdict": "fail", "severity": "critical",
      "statutory_exposure_usd": 1500,
      "evidence": [ { "quote": "we will have you arrested and garnish your wages.",
                      "speaker": "agent", "start_time_seconds": 53.0 } ] },   // ← quoted violation
    { "id": "right_party_verification", "verdict": "insufficient_evidence",
      "needs_human_review": true }                                            // ← never a fake pass
  ],
  "processing": { "transcriber": "whisper...", "synthesizer": "gemma...", "device": "cuda",
                  "gpu_name": "AMD Instinct MI300X", "realtime_factor": 61.5 }
}

Architecture

URL / file ─► ingest (yt-dlp / httpx) ─► ffmpeg 16 kHz WAV
                                          └─ dual-channel? → split ch0=agent, ch1=customer
                                                   │
        Whisper-large-v3 batch ASR  (MI300X / ROCm)  → speaker-attributed timestamped transcript
                                                   │
        grade vs. rule set ► Gemma (json_schema)  → ComplianceScorecard
                                                   │
        risk rollup + verdicts ► validate ► SQLite store ► REST + SSE API ► evidence pack

Every stage is a pluggable provider with a mock implementation and CPU fallback, so the service is always runnable. See docs/ARCHITECTURE.md and CLAUDE.md for the full design.

License

MIT © 2026 Oybek Odilov

About

Every regulated call, audited. Call recording → FDCPA/TCPA compliance scorecard with quoted, timestamped, speaker-attributed evidence + dollar-exposure rollup. Batch Whisper on AMD MI300X. AMD Developer Hackathon ACT II · Track 3.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors