LLM FActuality Cross-EvaluaTion System β An open-source, privacy-preserving evaluation framework with a browser-accessible interface and a plugin architecture, designed to help practitioners make informed, transparent decisions about LLM quality.
LLM-FACETS structures evaluation around three practitioner profiles β Technical Experts, Domain Experts, and Compliance Officers β inspired by the stakeholder categories identified in the EU AI Act (Art. 14) and the NIST AI Risk Management Framework as responsible for human oversight of AI systems.
- Privacy-Preserving Architecture: Deterministic metrics run entirely within the self-hosted server β no evaluation data leaves your infrastructure. LLM-judge metrics contact external APIs explicitly, with full user control.
- BYOK (Bring Your Own Key): API keys are stored exclusively in the browser via IndexedDB with origin isolation. Keys are transmitted per-request and never persisted server-side.
- PII Anonymization Pipeline: Configurable anonymization (local NER via compromise.js, self-hosted Presidio, or model-based NER) redacts sensitive entities before any outbound API call.
- 10 LLM Providers: Unified support for OpenAI, Gemini, Anthropic, DeepSeek, Groq, Mistral, xAI, MiniMax, ZAI, and Devana.
- 18 Metric Variants: BLEU, ROUGE (6 variants), METEOR, BERTScore (P/R/F1), LogProbs, G-Eval, Jury, Evaluation Topologies, and RAG Triad (Faithfulness, Answer Relevance, Context Relevance).
- LogProbs Visualization: Token-by-token confidence analysis with 5-tier color coding for hallucination detection (native support for OpenAI, DeepSeek, xAI).
- Dataset Management: High-performance dataset import and querying via DuckDB and Parquet β all queries execute in-process with no external transmission.
- LLM-as-a-Judge: Qualitative evaluation with G-Eval, multi-judge Jury (multi-provider consensus with bias mitigation), and evaluation topologies (pointwise, pairwise with position-bias mitigation, debate).
- RAG Triad: End-to-end evaluation for RAG systems (Faithfulness, Answer Relevance, Context Relevance) with per-claim breakdowns and reasoning chains.
- Statistical Analysis Dashboard: Radar charts, box plots, correlation heatmaps, hallucination histograms, per-sample deep dive, multi-run comparison (up to 5 runs).
- Benchmark Mode: Batch evaluation of datasets across all metrics with exportable JSON/CSV audit trails.
- Cross-Validated Implementations: All deterministic metrics verified against canonical Python reference libraries (NLTK, HuggingFace
evaluate) with absolute error < 10β»β΅ across 267 test cases. - Internationalization: English, French, German, and Italian.
- BLEU β N-gram precision matching (machine translation).
- ROUGE β 6 variants (ROUGE-1, ROUGE-2, ROUGE-L, ROUGE-W, ROUGE-S, ROUGE-SU) for recall-oriented evaluation (summarization).
- METEOR β Semantic alignment with stemming and synonym support.
- BERTScore β Contextual embedding similarity powered by Transformers.js (
all-MiniLM-L6-v2), running as a server-side singleton within the Next.js process. No text or embeddings are transmitted externally. - Log Probabilities (LogProbs):
- Token-level confidence scores with 5-tier color coding (Very High β₯ 0.8, High β₯ 0.6, Medium β₯ 0.4, Low β₯ 0.2, Very Low < 0.2).
- Hover to reveal exact log-probability and top-k alternative tokens.
- Native support for OpenAI, DeepSeek, and xAI.
- G-Eval β Multi-criteria evaluation (Coherence, Fluency, etc.) with Chain-of-Thought and probabilistic scoring.
- Jury (Multi-Judges) β Consensus across multiple models with 5 aggregation strategies: mean, median, trimmed mean, weighted, majority vote.
- Evaluation Topologies:
- Pointwise β Absolute scoring (O(N)).
- Pairwise β A/B comparison and ranking.
- Debate β Argumentative judge consensus.
- Faithfulness β Verifies each atomic statement in the answer against the source context.
- Answer Relevance β Measures the alignment between the answer and the original question.
- Context Relevance β Evaluates the signal-to-noise ratio in the retrieved context.
The application integrates a high-performance dataset manager:
- DuckDB & Parquet β In-process analytical database engine. All queries (schema introspection, random sampling, SQL filtering) execute within the Next.js server process β never transmitted externally.
- HuggingFace β Automatic download of standard datasets.
- SQuAD v2.0 β Reading-comprehension Question Answering benchmark.
- PsiloQA β Multilingual QA with complexity levels and hallucination labels.
- SelfAware β Knowledge-boundary and refusal evaluation (1,047 samples).
- HaluEval β Faithfulness and correctness evaluation with explicit hallucination labels (12,322 samples).
- Explorer β Web UI to visualize, sample, and query datasets (Settings β Manage Datasets).
- Custom Datasets β Upload CSV/Parquet files for proprietary evaluation corpora.
- Bun 1.0+ (recommended) or Node.js 18+
# Install dependencies
bun install
# Configure environment
cp .env.example .env.localYou can configure API keys in two ways:
- Environment Variables: Edit
.env.localfor server-side defaults. - User Interface: Click the Settings icon in the app to add your personal API keys (stored securely in your browser via IndexedDB).
# OpenAI
OPENAI_API_KEY=sk-...
# Google Gemini
GEMINI_API_KEY=...
# Anthropic (Claude)
ANTHROPIC_API_KEY=sk-ant-...
# Groq
GROQ_API_KEY=...
# Mistral
MISTRAL_API_KEY=...
# Other Supported Providers
DEEPSEEK_API_KEY=...
XAI_API_KEY=...
MINIMAX_API_KEY=...
ZAI_API_KEY=...
DEVANA_API_KEY=...# Development server
bun run dev
# Build for production
bun run build
bun run startOpen http://localhost:3000 to access the application.
| Route | Description |
|---|---|
/ |
Home β interactive metrics playground |
/metrics |
Metrics category overview |
/metrics/bleu |
BLEU interactive demo |
/metrics/rouge |
ROUGE interactive demo |
/metrics/bertscore |
BERTScore interactive demo |
/metrics/logprobs |
LogProbs visualization |
/metrics/llm-judge |
LLM-as-a-Judge (Faithfulness, Relevance, G-Eval, Jury) |
/benchmark |
Batch dataset evaluation |
All routes are prefixed with a language segment (e.g. /en/, /fr/, /de/, /it/).
| Method | Route | Description |
|---|---|---|
POST |
/api/evaluate |
Batch evaluation (BLEU, ROUGE, METEOR, BERTScore) |
POST |
/api/generate |
LLM text generation |
POST |
/api/bleu |
BLEU score |
POST |
/api/rouge |
ROUGE variants |
POST |
/api/bertscore |
BERTScore |
POST |
/api/logprobs |
Token-level log probabilities |
POST |
/api/geval |
G-Eval with Chain-of-Thought |
POST |
/api/faithfulness |
Faithfulness evaluation |
POST |
/api/answer-relevance |
Answer relevance |
POST |
/api/context-relevance |
Context relevance |
POST |
/api/rag/evaluate |
Unified RAG Triad |
POST |
/api/evaluation/pointwise |
Pointwise scoring |
POST |
/api/evaluation/pairwise |
Pairwise A/B comparison |
POST |
/api/evaluation/rank |
Multi-option ranking |
POST |
/api/evaluation/jury |
Multi-judge consensus |
GET |
/api/models |
List all models by provider (cached 1 h) |
DELETE |
/api/models?provider=<name> |
Clear provider model cache |
GET |
/api/providers/status |
Provider health status |
GET |
/api/logprobs/providers |
Providers supporting logprobs |
GET |
/api/datasets |
List available datasets |
GET |
/api/datasets/status |
Dataset download status |
GET |
/api/datasets/query |
Query dataset samples |
LLM-FACETS enforces a clear data sovereignty boundary:
| Metric Category | Execution Location | Outbound Data? |
|---|---|---|
| BLEU, ROUGE, METEOR | Next.js server-local (pure computation) | β None |
| BERTScore | Next.js server-local (Transformers.js singleton) | β None |
| LogProbs | External LLM API (provider-native) | β Query text |
| G-Eval, Eval Topologies | External LLM API | β Evaluation text |
| Jury | External LLM APIs (one call per judge) | β Evaluation text |
| Faithfulness, AR, CR | External LLM API (RAG chain) | β Evaluation text |
For LLM-judge metrics that require external API calls, the anonymization pipeline can redact PII before transmission.
Beyond per-sample evaluation, LLM-FACETS includes a multi-tab analysis dashboard:
- Overview: Radar chart (9 primary metrics), box plots (quartile distributions), hallucination risk histogram (bins below 0.7 flagged).
- Correlation: Pearson correlation heatmap, pairwise RAG scatter plots, jury agreement histogram.
- Deep Dive: Per-sample heatmap (30/page), BERTScore precision-vs-recall scatter, execution timeline (up to 5 metrics).
- Multi-Run Comparison: Comparative radar chart and grouped bar chart overlaying up to 5 benchmark runs.
All visualizations are generated client-side from IndexedDB-stored results with no server-side data transmission.
- Framework: Next.js 16 (App Router)
- Language: TypeScript
- Machine Learning: Transformers.js (server-side singleton inference)
- Database: DuckDB (in-process, for datasets)
- Styling: Tailwind CSS 4
- Privacy: BYOK model, IndexedDB key storage, configurable PII anonymization
- API: Unified architecture for LLM providers, server-side model cache (TTL 1h)
src/
βββ app/ # Next.js routes and API endpoints
βββ components/ # React components (Visualizers, Demos)
βββ hooks/ # Custom hooks (useModels, useDatasets)
βββ lib/
β βββ datasets/ # DuckDB handles and Dataset Services
β βββ llm_api/ # Unified clients for LLM providers
β βββ metrics/ # Evaluation metrics implementation
βββ types/ # TypeScript definitions
βββ i18n/ # Multilingual configuration
Want to contribute? Here is how to extend the application.
The architecture is modular and centralized. Follow these steps to add a provider (e.g., MyAI):
- Create Provider Class: Create
src/lib/llm_api/myai.tsby extendingLLMProvider.- Implement
call()for text generation and logprobs. - Implement
getAvailableModels()to list models.
- Implement
- Register Provider:
- Add the type to
ProviderName(src/lib/llm_api/factory.ts). - Register the constructor in
providerConstructors(src/lib/llm_api/factory.ts).
- Add the type to
- Update Models API: Add provider initialization in
src/app/api/models/route.tsso it appears in the selector. - Configuration: Add the API key (
MYAI_API_KEY) to.env.local.
- Business Logic: Implement the calculation algorithm in
src/lib/metrics/mymetric.ts. - API Endpoint: Create
src/app/api/mymetric/route.tsto expose the calculation via a standardized API. - User Interface:
- Create a component
src/components/MyMetricDemo.tsx. - Use existing UI components (
MetricCard,InputSection, etc.) for visual consistency. - Add the component to the main grid (
src/app/page.tsxorsrc/components/home/EvaluationMetricsGrid.tsx).
- Create a component
- 267 validation cases covering all deterministic metrics.
- Deterministic metrics (BLEU, ROUGE, METEOR, BERTScore) match Python reference implementations (NLTK, HuggingFace
evaluate) with absolute error < 10β»β΅. - LLM-based metrics (RAG Triad, G-Eval, Jury) maintain Ο < 0.05 across repeated runs (n=5, gpt-4o-mini).
- Performance benchmark: 13,369 samples processed in 24.7s total β text generation: 1.3 ms/sample, metric computation: 0.5 ms/sample/metric.
If you use LLM-FACETS in your research, please cite:
@article{llmfacets2026,
title={LLM-FACETS: A Privacy-Preserving Framework for Evaluating LLM Transparency and Accountability},
journal={},
year={}
}