A production-grade open-source framework for evaluating GPT-4, Claude, Gemini, Mistral and Llama on accuracy, latency, cost, hallucination rate, and reasoning quality — side by side, in one command.
From raw benchmarks to dashboards, REST APIs, PDF reports, and a CLI — batteries included.
Evaluate hundreds of samples in parallel with configurable concurrency. Automatic timeout handling and retry built in.
asyncio5-page interactive dashboard with radar charts, latency histograms, cost vs quality scatter plots, and one-click PDF export.
streamlit + plotlyRun the same prompts on up to 5 models simultaneously and compare every metric on the same leaderboard.
parallel eval12 endpoints with full OpenAPI docs at /docs. File upload, PDF generation, CSV/JSON export — all over HTTP.
7 subcommands (run, compare, results, export, report, serve, dashboard) with rich terminal output and progress bars.
click + richAuto-generate professional evaluation reports with cover page, summary table, and per-model sections using ReportLab.
reportlabMulti-stage Dockerfile with separate API and Dashboard targets. docker-compose up and you are running.
Auto-loads MMLU and TruthfulQA from HF Hub with local caching. Dataset also published on HuggingFace for easy reuse.
datasets libraryPricing table for 15+ model variants. Track total spend, cost per 1K tokens, and estimate run costs before executing.
cost calculatorAll results saved automatically. Query, filter, export to CSV or JSON, and build comparison charts over time.
sqlite3Full pytest suite covering all modules. No API keys needed. GitHub Actions CI runs across Python 3.10, 3.11, and 3.12.
pytest · 95% coverageUpload your own CSV or JSON dataset from the dashboard, API, or CLI. Provide prompt + expected columns.
Every metric is computed per sample, fully async, with statistical aggregation and percentile breakdowns.
From configuration to results in under 2 minutes.
Select any LiteLLM-compatible model and a benchmark (MMLU, TruthfulQA, or custom CSV). Set sample count and concurrency.
The engine fires all API calls concurrently using asyncio.Semaphore. Each call has configurable timeout and retry logic.
For each response: accuracy check, latency record, token count and cost, hallucination score, reasoning quality — all computed in parallel.
Results are aggregated into a full EvaluationResult with percentile statistics and persisted to SQLite automatically.
Install, configure, and run your first evaluation in minutes.
# Install pip install llm-evaluation-framework # Clone from source git clone https://github.com/vignesh2027/LLM-Evaluation-Framework.git cd LLM-Evaluation-Framework && pip install -e . # Configure API keys cp .env.example .env # add OPENAI_API_KEY, ANTHROPIC_API_KEY, etc. # Verify llm-eval --version llm-eval, version 1.0.0
# Evaluate a single model llm-eval run --model gpt-4o-mini --benchmark mmlu --samples 100 ╭──────────────────────────────────────╮ │ Evaluation: gpt-4o-mini │ ├──────────────────┬───────────────────┤ │ Accuracy │ 78.00% │ │ Avg Latency │ 432 ms │ │ P95 Latency │ 1240 ms │ │ Total Cost │ $0.0023 │ │ Hallucination │ 2.40% │ │ Reasoning Score │ 7.2 / 10 │ ╰──────────────────┴───────────────────╯ # Compare 3 models llm-eval compare \ --models gpt-4o-mini \ --models claude-3-haiku-20240307 \ --models gemini/gemini-1.5-flash \ --benchmark mmlu --samples 50 # Export results llm-eval export --format csv --output results.csv # Generate PDF report llm-eval report --run-ids a3f92c1b --output ./reports/ # Start dashboard llm-eval dashboard --port 8501
import asyncio from llm_eval.core.evaluator import LLMEvaluator, EvaluationConfig from llm_eval.benchmarks.mmlu import MMLUBenchmark async def main(): evaluator = LLMEvaluator() samples = MMLUBenchmark().load(num_samples=100) config = EvaluationConfig( model="gpt-4o-mini", benchmark="mmlu", num_samples=100, temperature=0.0, concurrency=10, ) result = await evaluator.evaluate(config, samples) print(f"Accuracy: {result.accuracy:.2%}") print(f"P95 Latency:{result.p95_latency_ms:.0f}ms") print(f"Total Cost: ${result.total_cost_usd:.4f}") print(f"Hallucin.: {result.hallucination_rate:.2%}") print(f"Reasoning: {result.avg_reasoning_score:.1f}/10") asyncio.run(main())
import asyncio from llm_eval.core.evaluator import LLMEvaluator, EvaluationConfig from llm_eval.benchmarks.mmlu import MMLUBenchmark async def compare(): evaluator = LLMEvaluator() samples = MMLUBenchmark().load(num_samples=50) configs = [ EvaluationConfig(model="gpt-4o-mini", benchmark="mmlu", num_samples=50), EvaluationConfig(model="claude-3-haiku-20240307", benchmark="mmlu", num_samples=50), EvaluationConfig(model="gemini/gemini-1.5-flash",benchmark="mmlu", num_samples=50), ] results = await evaluator.evaluate_multiple(configs, samples) for r in sorted(results, key=lambda x: x.accuracy, reverse=True): print(f"{r.model:<35} {r.accuracy:>7.1%} {r.avg_latency_ms:>7.0f}ms ${r.cost_per_1k_tokens:.4f}") asyncio.run(compare())
# Start server uvicorn llm_eval.api.main:app --reload --port 8000 # Evaluate curl -X POST http://localhost:8000/evaluate \ -H "Content-Type: application/json" \ -d '{"model":"gpt-4o-mini","benchmark":"mmlu","num_samples":50}' { "run_id": "a3f92c1b", "accuracy": 0.78, "avg_latency_ms": 432.1, "p95_latency_ms": 1240.0, "total_cost_usd": 0.0012, "hallucination_rate": 0.024, "avg_reasoning_score": 7.2 } # Generate PDF report curl -X POST http://localhost:8000/report \ -d '{"run_ids":["a3f92c1b"]}' -o report.pdf
# Clone and configure git clone https://github.com/vignesh2027/LLM-Evaluation-Framework.git cd LLM-Evaluation-Framework && cp .env.example .env # Start API + Dashboard docker-compose up -d # API: http://localhost:8000/docs # Dashboard: http://localhost:8501 # View logs docker-compose logs -f
MMLU and TruthfulQA loaded automatically from HuggingFace Hub. Or upload any CSV or JSON file.
| Benchmark | Samples | Format | Subjects | Use Case | Source |
|---|---|---|---|---|---|
| MMLU | ~14,000 test | 4-choice MC | 57 academic subjects | General knowledge & reasoning | HuggingFace Hub |
| TruthfulQA | 817 questions | 4-choice MC | Health, law, history, myths | Factual truthfulness | HuggingFace Hub |
| Custom CSV | Any | prompt + expected | User-defined | Domain-specific evaluation | File Upload |
| Custom JSON | Any | Array of objects | User-defined | Programmatic benchmarks | File Upload |
Representative runs. Your results will vary by API region and sample set.
| Model | Accuracy | Avg Latency | P95 Latency | Cost / 1K Tokens | Hallucination | Reasoning |
|---|---|---|---|---|---|---|
| GPT-4o | 88.2% | 892 ms | 2,140 ms | $0.0080 | 1.8% | 8.4 / 10 |
| Claude 3.5 Sonnet | 87.6% | 1,240 ms | 2,890 ms | $0.0090 | 2.1% | 8.6 / 10 |
| GPT-4o-mini | 78.4% | 432 ms | 1,100 ms | $0.0003 | 3.2% | 7.2 / 10 |
| Gemini 1.5 Flash | 76.8% | 380 ms | 910 ms | $0.0001 | 4.1% | 6.8 / 10 |
| Claude 3 Haiku | 74.2% | 410 ms | 980 ms | $0.0010 | 4.8% | 6.5 / 10 |
| Mistral Small | 71.0% | 520 ms | 1,320 ms | $0.0010 | 5.6% | 6.2 / 10 |
Note: Sample results for illustration only. Run with real API keys for actual benchmarks.
Try the framework instantly on HuggingFace Spaces, or load the benchmark dataset directly in Python.
Run live LLM evaluations directly in your browser — no installation required. Enter any prompt, pick a benchmark sample, and see accuracy, hallucination score, and reasoning quality computed in real time. Built with Gradio on HuggingFace Spaces.
Swap the benchmark loader, DB backend, or metrics engine without touching the rest.
Start with uvicorn llm_eval.api.main:app --reload then open /docs for interactive Swagger UI.
Any LiteLLM-compatible model works. Pricing is pre-loaded for the most common variants.
The framework is used and contributed to by researchers, ML engineers, and startups. Here is where to find us.
Source code, issues, pull requests, and releases. Star the repo to follow updates and help others discover it.
github.com/vignesh2027 →Demo Space and benchmark dataset both live on HuggingFace. Load the dataset in one line, try the demo with no setup.
huggingface.co/vigneshwar234 →Follow for benchmark results, new model comparisons, and updates as the framework evolves. Benchmark discussions welcome.
linkedin.com/in/vigneshwar-s-27 →Found a bug or want a feature? Open an issue. Contributions are welcome — see the contributing guide in the README.
Open an Issue →Connects with LangChain, LlamaIndex, RAGAS, and DeepEval ecosystems. The Python API is composable with most ML pipelines.
Contributing Guide →Watch the GitHub repository for release notifications. Changelog is maintained in the repo with semantic versioning.
View Releases →pip, source, Docker, or HuggingFace — whichever fits your workflow.
pip install llm-evaluation-framework # With dashboard pip install "llm-evaluation-framework[dashboard]" # Full install pip install "llm-evaluation-framework[dashboard,reports,dev]"
git clone https://github.com/vignesh2027/LLM-Evaluation-Framework.git cd LLM-Evaluation-Framework python -m venv .venv && source .venv/bin/activate pip install -e ".[dashboard,reports,dev]" cp .env.example .env
git clone https://github.com/vignesh2027/LLM-Evaluation-Framework.git cd LLM-Evaluation-Framework cp .env.example .env docker-compose up -d # API :8000 Dashboard :8501
from datasets import load_dataset ds = load_dataset("vigneshwar234/llm-eval-benchmark") # 1,200 samples: train / validation / test # MMLU + TruthfulQA subjects mixed # Science, math, CS, history, law
Answers to the most common questions from the community.
.env and the rest are ignored.ollama/llama3 or hosted_vllm/meta-llama/Llama-3-8b — and set the custom API base URL in .env.prompt column and an optional expected column via the dashboard, the /evaluate/custom API endpoint, or the Python API with CustomBenchmark.from_file("data.csv").evaluate_multiple method loads the same sample list once and passes it to each model configuration. All evaluations run in parallel with asyncio.gather, so comparing 4 models takes the same wall-clock time as comparing 1 — and every model sees identical prompts.Database class abstracts the layer — switching to Postgres is a one-file change if your team needs it.Free, open-source, production-grade. Star the repo to help other engineers find it.