โ† Back to Projects

LLM Evaluation & Benchmarking Platform

An enterprise-grade, self-hosted benchmarking platform engineered for multi-model parallel inference, real-time WebSocket token streaming, non-blocking PyTorch BERTScore scoring, tripartite RAG evaluation, sentence-level NLI hallucination detection, and native FastMCP agent integration.

FastAPI Next.js 15 PyTorch FastMCP PostgreSQL Celery Redis LiteLLM Langfuse Docker

๐Ÿ’ก The Problem

Engineering teams deploying LLMs to production lack rigorous, automated benchmarking infrastructure to compare frontier models, track prompt regressions, and detect hallucinations before shipping. Manual qualitative testing is subjective, unscalable, and slow, while naive single-prompt evaluation fails to measure critical production failure modes such as semantic drift, context unfaithfulness in RAG pipelines, latency spikes, and cost-per-token efficiency.

๐ŸŽฏ The Solution

A self-hosted, full-stack LLM Evaluation & Benchmarking Platform. It orchestrates parallel inference across frontier models (Gemini 3.5/3.8 Flash, Groq, Qwen, Ollama) via LiteLLM with real-time WebSocket token dispatching to Next.js 15. The evaluation core executes asynchronous PyTorch BERTScore and ROUGE-L calculations, tripartite RAG scoring, sentence-level NLI hallucination detection, Gemini G-Eval rubrics, distributed Celery batch processing, and a native FastMCP server exposing tools directly to Cursor IDE and Claude Desktop.

โšก Key Features

โšก

Multi-Model Parallel Inference

Streams responses concurrently from multiple frontier models (Gemini, Groq, Ollama) using LiteLLM with sub-millisecond WebSocket streaming over a Redis pub/sub backbone.

๐Ÿง 

Non-Blocking PyTorch Scoring

Computes BERTScore F1 (bert-base-uncased / all-MiniLM) in dedicated async thread pools alongside ROUGE-L, latency tracking, token counts, and cost estimation.

๐ŸŽฏ

Tripartite RAG Framework

Automatically evaluates retrieval quality and generation fidelity across three dimensions: Context Relevance, Faithfulness (via NLI grounding), and Answer Relevance.

๐Ÿ›ก๏ธ

Sentence-Level NLI Hallucination Scorer

Decomposes generated answers into individual claims, verifies each claim against source context for contradictions or ungrounded facts, and applies penalizing winner weights.

๐Ÿ”Œ

Native FastMCP Server

Exposes 5 standardized Model Context Protocol tools over stdio and sse transports, enabling Cursor IDE and Claude Desktop agents to run evaluations and query model recommendations.

โš–๏ธ

LLM-as-a-Judge (G-Eval Rubrics)

Automated semantic grading powered by Gemini 3.5 Flash across 9 pre-configured domain rubrics (Code, Summarization, QA, Data Extraction, RAG) with custom weight balancing.

๐Ÿ—๏ธ System Architecture

๐Ÿ’ป Client & IDE Next.js 15 / Cursor MCP
โ†’
โšก FastAPI Core SlowAPI & Auth
โ†’
๐Ÿ”„ Inference & Queue LiteLLM + Celery
โ†’
๐Ÿง  Eval Engines PyTorch + NLI + Judge
โ†’
๐Ÿ—„๏ธ Storage Postgres & Langfuse

Backend & Evaluation Engines

  • backend/services/eval_runner.py โ€” Multi-model parallel inference orchestrator with LiteLLM gateway
  • backend/services/scoring.py โ€” PyTorch BERTScore F1, ROUGE-L, latency, and token cost estimators
  • backend/services/rag_eval.py โ€” Tripartite RAG metrics (Context Relevance, Faithfulness, Answer Relevance)
  • backend/services/hallucination.py โ€” Sentence-level NLI contradiction & claim ungroundedness scorer
  • backend/services/llm_judge.py โ€” Gemini G-Eval rubric evaluator with weighted multi-criteria grading
  • mcp/eval_server.py โ€” FastMCP server exposing 5 tools over stdio/sse for Cursor & Claude Desktop

Frontend, Async & Storage

  • frontend/app/ โ€” Next.js 15 App Router dashboard with React 19, Turbopack, and Tailwind CSS
  • backend/tasks/eval_tasks.py โ€” Celery distributed worker queues (eval_batch) for dataset benchmarking
  • backend/core/database.py โ€” Async PostgreSQL engine (SQLAlchemy 2.0 + AsyncPG) with Alembic
  • backend/services/visualizer.py โ€” Multi-dimensional projection (Semantic MDS) and similarity matrix
  • backend/services/report_service.py โ€” Jinja2 and WeasyPrint print-styled executive PDF/HTML report export
  • backend/tests/ โ€” Comprehensive test suite with 93%+ coverage across 120 automated tests

๐Ÿ› ๏ธ Tech Stack & Technologies

FastAPI & LiteLLM Gateway

Python 3.12, Pydantic v2, Uvicorn, SlowAPI rate limiting, unified gateway with retry backoff across frontier models.

Next.js 15 & FastMCP Server

App Router, React 19, Tailwind CSS, Recharts, plus Model Context Protocol tools over stdio & SSE for Cursor IDE.

PyTorch & Evaluation Core

Asynchronous BERTScore F1, ROUGE-L, sentence-level NLI claim verification, and Gemini G-Eval domain rubrics.

PostgreSQL, Redis & Celery

PostgreSQL 16 with AsyncPG & SQLAlchemy 2.0, Redis 7 Pub/Sub & caching, and Celery distributed batch queues.