Skip to main content

Alquimia Fair Forge library - Performance measurement for AI models and assistants

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

Fair Forge

Performance-measurement library for evaluating AI models and assistants

CI PyPI Python Versions License

DocumentationGitHub

What is Fair Forge?

Fair Forge provides comprehensive metrics for evaluating AI systems:

  • Toxicity - Detect toxic language patterns with DIDT fairness framework
  • Bias - Analyze biases across protected attributes (gender, race, religion, etc.)
  • Context - Assess how well responses align with provided context
  • Conversational - Evaluate dialogue quality using Grice's maxims
  • Humanity - Measure how natural responses are through emotional analysis
  • BestOf - Tournament-style comparison to find the best response
  • Agentic - Evaluate autonomous agent behavior and tool usage

Quick Start

# Install with pip
pip install alquimia-fair-forge

# Or install specific modules
pip install "alquimia-fair-forge[toxicity]"
pip install "alquimia-fair-forge[bias]"
pip install "alquimia-fair-forge[all]"
from fair_forge import Retriever, Dataset
from fair_forge.metrics.toxicity import Toxicity

class MyRetriever(Retriever):
    def load_dataset(self) -> list[Dataset]:
        # Load your dataset here
        pass

metrics = Toxicity.run(MyRetriever, verbose=True)

Documentation

For complete documentation, guides, and API reference visit:

https://fairforge.alquimia.ai

Contributing

Setup

# Clone and install dependencies
git clone https://github.com/Alquimia-ai/fair-forge.git
cd fair-forge
uv sync

# Install pre-commit hooks (required)
uv run pre-commit install --hook-type pre-commit --hook-type commit-msg

Pre-commit Hooks

This project uses pre-commit to enforce code quality and commit conventions. The following hooks run automatically:

Hook Stage Purpose
trailing-whitespace pre-commit Remove trailing whitespace
end-of-file-fixer pre-commit Ensure files end with a newline
check-yaml / check-toml pre-commit Validate config files
check-added-large-files pre-commit Block files >1MB
detect-private-key pre-commit Prevent accidental secret commits
ruff pre-commit Lint and auto-fix Python code
ruff-format pre-commit Format Python code
commitizen commit-msg Enforce Conventional Commits format

Commit Convention

All commits must follow the Conventional Commits specification, enforced by commitizen:

type(scope): description

Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore

Scopes: metrics, runners, generators, storage, schemas, core, llm, guardians, deps

Examples:

feat(metrics): add agentic evaluation metric
fix(toxicity): handle empty batches
docs: update installation guide
test(runners): add integration tests

Claude Code Skills

This project includes Claude Code skills to automate common workflows. If you use Claude Code as your development tool, the following skills are available:

Skill Command Description
Commit /commit Analyzes staged changes and generates a properly formatted Conventional Commit message
Docs /docs [type] [name] Generates Mintlify MDX documentation for new modules (e.g., /docs metric agentic)
Lambda /fair-forge-lambda Scaffolds AWS Lambda deployment boilerplate for Fair-Forge modules

License

MIT License - see LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alquimia_fair_forge-3.0.0b2.tar.gz (791.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alquimia_fair_forge-3.0.0b2-py3-none-any.whl (824.3 kB view details)

Uploaded Python 3

File details

Details for the file alquimia_fair_forge-3.0.0b2.tar.gz.

File metadata

  • Download URL: alquimia_fair_forge-3.0.0b2.tar.gz
  • Upload date:
  • Size: 791.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for alquimia_fair_forge-3.0.0b2.tar.gz
Algorithm Hash digest
SHA256 9f18d2789ee136b2372d33aca59e2fa7d44f797e34f57cb2f17dc2aef0a92331
MD5 ccb8ecefe7f4c270c5eab4caa88d8c74
BLAKE2b-256 574c9fbae9b0a4efb7af6aad3c43ea2c27ad857b2136ed14fc8bec06b54b5bbc

See more details on using hashes here.

File details

Details for the file alquimia_fair_forge-3.0.0b2-py3-none-any.whl.

File metadata

  • Download URL: alquimia_fair_forge-3.0.0b2-py3-none-any.whl
  • Upload date:
  • Size: 824.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for alquimia_fair_forge-3.0.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 c12ccb25f4882cda82531dcc98aff4b58b6710f8ff75a186d82dc836ab0d1ea7
MD5 6033be449fa56520c4a3bc6b555c3c8a
BLAKE2b-256 dccc6f0774dea0a9252091ca247c5a02c2e28bd5208c67c81689f645f34096fb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page