rai-bench / README.md
rohanjaggi
fix: hf spaces docker build
b463b98
|
Raw
History Blame Contribute Delete
2.48 kB
metadata
title: RAI Bench
emoji: 🛡️
colorFrom: blue
colorTo: purple
sdk: docker
pinned: false

Responsible AI Bench

Independent evaluation dashboard for large language models and safety guardrails on localised content safety, RAG knowledge robustness, and demographic fairness, benchmarked for Singapore deployment contexts.

Built by the AI Testing & Evaluation team at GovTech Singapore.

Benchmarks

# Benchmark Metric Direction
01 Localised Undesired Content (RabakBench) Refusal Rate Higher is better
02 RAG Out-of-Knowledge-Base Robustness Abstention Rate Higher is better
03 Demographic Fairness Disparity Score Lower is better

Tech Stack

  • Next.js 16 (App Router)
  • React 19, TypeScript
  • Inline styles + CSS variables (no CSS modules)
  • Static data from CSV files in public/

Getting Started

npm install
npm run dev

Open http://localhost:3000.

Project Structure

src/
  app/
    page.tsx          # Server component, loads data
    globals.css       # Design tokens + component styles
    layout.tsx        # Root layout with font config
  components/
    Nav.tsx           # Fixed nav bar with scroll-triggered title
    Hero.tsx          # Banner with title + stats
    BenchmarkExplainer.tsx  # Mode toggle + criteria cards
    EvaluationShell.tsx     # Tab orchestration (models/guardrails)
    LeaderboardTable.tsx    # Models leaderboard with expandable rows
    GuardrailsTable.tsx     # Guardrails leaderboard
    AboutSection.tsx        # Methodology panels + taxonomy mappings
    InsightsSection.tsx     # Data visualisations
    ScoreDistribution.tsx   # Dot plot (models)
    GuardrailDistribution.tsx  # Dot plot (guardrails)
    GuardrailBarChart.tsx   # Bar chart (guardrails)
  lib/
    parseData.ts      # Model CSV parsing + stats
    parseGuardrails.ts # Guardrail CSV parsing + thresholds
    types.ts          # Shared TypeScript interfaces
    utils.ts          # Formatting + colour helpers
public/
  models_data.csv       # Model evaluation results
  guardrails_data.csv   # Guardrail evaluation results

Data

Evaluation results live in public/*.csv. To update scores, replace the CSV files and redeploy. The dashboard computes tercile thresholds at build time from the data.

Deployment

npm run build
npm start

Compatible with any Node.js hosting (Vercel, Cloud Run, etc).