.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
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
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 forconfig_file.yaml in the working directory, but you can pass any path to the Trustifai constructor:
config_file.yaml
Verify your installation
Run the following snippet to confirm TrustifAI is installed and importable: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.