Installation
Fair Forge uses a modular dependency system, allowing you to install only the components you need.Requirements
- Python 3.10 or higher
- uv (recommended) or pip
Basic Installation
Optional Dependencies
Fair Forge provides optional dependency groups for each metric and feature:Metrics
| Extra | Description | Dependencies |
|---|---|---|
toxicity | Toxicity metric with clustering | sentence-transformers, hdbscan, umap-learn |
bias | Bias metric with guardian models | openai, transformers |
context | Context metric with LLM judge | langchain-core |
conversational | Conversational metric | langchain-core |
humanity | Humanity metric with NRC lexicon | (included in core) |
bestof | BestOf tournament metric | langchain-core |
Features
| Extra | Description | Dependencies |
|---|---|---|
generators | Synthetic dataset generation | langchain-core, transformers |
generators-alquimia | Generators with Alquimia support | langchain-core, transformers |
runners | Test execution runners | httpx, asyncio |
cloud | Cloud storage backends | lakefs-sdk |
Combined Extras
| Extra | Description |
|---|---|
all | All metrics and features |
dev | Development dependencies (pytest, ruff, mypy) |
Installation Examples
LLM Provider Dependencies
Several metrics require LangChain-compatible chat models. Install your preferred provider:Development Installation
For contributing to Fair Forge:Verifying Installation
Troubleshooting
ImportError: No module named 'sentence_transformers'
ImportError: No module named 'sentence_transformers'
Install the toxicity extras:
ImportError: No module named 'langchain_groq'
ImportError: No module named 'langchain_groq'
Install your preferred LLM provider:
CUDA/GPU issues with sentence-transformers
CUDA/GPU issues with sentence-transformers
For CPU-only installation:
Python version incompatibility
Python version incompatibility
Ensure you’re using Python 3.10+: