pramana-api docs

Backend infrastructure + dashboard for LLM drift detection.

This is the server-side half of Pramana. It receives eval submissions from the CLI, stores them in R2, aggregates statistics, and serves a drift detection dashboard.

The Problem

LLM behavior changes silently. Provider updates, quantization changes, and infrastructure migrations alter model outputs without notice. Chen et al. (2023) documented significant accuracy drops in GPT-4 over a three-month period. How Is ChatGPT's Behavior Changing over Time? (Stanford/Berkeley).

Architecture

┌──────────┐ POST /api/submit ┌──────────────┐ R2 ┌─────────────┐ │ CLI │───────────────────────▸│ Hono API │────────▸│ buffer.csv │ │ (pramana)│ │ (CF Workers) │ │ user/*.json │ └──────────┘ └──────┬───────┘ └──────┬──────┘ │ cron │ ▼ ▼ ┌──────────────┐ ┌─────────────┐ │ compact │────────▸│ chart.json │ │ + aggregate │ │ archive/*.gz│ └──────────────┘ └──────┬──────┘ │ ┌──────────┐ GET /api/data/chart │ │ Dashboard│◂───────────────────────────────────────────────────────┘ │ (Vite) │ └──────────┘

Data Flow

  1. POST /api/submit — CLI sends eval results
  2. Append to gzip-compressed CSV buffer in R2
  3. Update per-user summary (real-time)
  4. Daily cron compacts buffer → archive, rebuilds aggregate chart data
  5. Dashboard reads pre-aggregated JSON (single R2 GET, <50ms)

Design Decisions

Stack

LayerTechnology
APIHono (Cloudflare Workers runtime)
DashboardVite SPA (React + react-router)
StorageCloudflare R2 (native bindings, no S3 SDK)
Authjose JWT + OAuth (GitHub, Google)
Drift DetectionSHA-256 output hashing, per-prompt consistency tracking

Pages

PageContent
Getting StartedInstall CLI, run evals, submit, authenticate
API ReferenceEndpoint schemas and response shapes
MethodologyHash-based drift detection methodology