Skip to main content
TrustifAI is distributed as a Python package on PyPI and supports Python 3.10 and later. You can install the base package, opt in to tracing support via MLflow, or clone the repository to run from source. After installation, you configure your LLM provider by setting API keys in a .env file and pointing TrustifAI at a config_file.yaml that controls model selection, metric thresholds, and score weights.
TrustifAI requires Python 3.10 or later. It is tested against Python 3.10, 3.11, 3.12, and 3.13.

Install the package

The trace extra adds MLflow for experiment tracking. The test extra adds pytest, langchain-core, and llama-index for running the test suite.

Install from source

If you want to run the latest unreleased code or contribute to TrustifAI, clone the repository and install dependencies directly:

Set up environment variables

TrustifAI uses LiteLLM under the hood, which means it works with any provider that LiteLLM supports — OpenAI, Anthropic, Gemini, Azure, Mistral, Groq, Ollama, OpenRouter, Cohere, and more. You configure access by setting the appropriate API keys as environment variables. Create a .env file in your project root (or export the keys in your shell):
.env
You only need keys for the providers you actually use. TrustifAI also accepts an env_file path directly in config_file.yaml if you want to keep credentials in a separate file:
config_file.yaml

Configure your models and metrics

TrustifAI is driven by a YAML configuration file. By default it looks for config_file.yaml in the working directory, but you can pass any path to the Trustifai constructor:
A complete configuration file covers the LLM, embedding model, reranker, metric thresholds, and score weights:
config_file.yaml
Any metric can be disabled by setting enabled: false. Disabled metrics are excluded from the weighted aggregation entirely. Weights do not need to be renormalized manually — TrustifAI only initializes metrics that have a non-zero weight configured under score_weights.

Verify your installation

Run the following snippet to confirm TrustifAI is installed and importable:
If you see no errors, you’re ready to score your first response. Head to the Quickstart to run a complete example.

Next steps

Quickstart

Score a RAG response and visualize the reasoning graph in under five minutes.

Configuration

Learn how to tune thresholds, swap providers, and enable MLflow tracing.