TrustifAI can log metric scores to MLflow as part of every evaluation. Offline metric scores (evidence coverage, epistemic consistency, semantic drift, source diversity) are logged under theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/TrustifAI/trustifai/llms.txt
Use this file to discover all available pages before exploring further.
offline/ prefix, and the online confidence score from Trustifai.generate() is logged under online/. Tracing is optional and disabled by default — your evaluation pipeline works identically with or without it.
Installation
MLflow tracing requires thetrace optional extra:
mlflow alongside the core TrustifAI package. Without it, the tracing code path is silently skipped even if enabled: true is set in your config.
Enabling tracing in config_file.yaml
Setenabled: true in the tracing section and point tracking_uri at your MLflow server:
tracking_uri is null or omitted, MLflow defaults to a local ./mlruns directory in your working directory — useful for local development without a running server.
| Field | Description |
|---|---|
enabled | true to activate MLflow logging, false (default) to disable |
tracking_uri | URI of your MLflow tracking server. null uses the local ./mlruns default |
experiment_name | Name of the MLflow experiment that runs are grouped under |
What gets logged
TrustifAI usesmlflow.set_tag to log metric data as run tags on the active MLflow run.
Offline metrics (get_trust_score)
When you callget_trust_score, TrustifAI logs each active metric score and the final decision as tags:
| MLflow tag | Value |
|---|---|
offline/<metric_name> | Float score for each active metric (e.g. offline/evidence_coverage) |
decision | Final label: RELIABLE, ACCEPTABLE (WITH CAUTION), or UNRELIABLE |
trust_score/final | Aggregated weighted trust score |
Online metrics (generate)
When you callTrustifai.generate(), the confidence score is logged as a tag:
| MLflow tag | Value |
|---|---|
online/confidence_score | Float confidence score derived from log probabilities |
Using tracing inside an MLflow run
TrustifAI logs to the currently active MLflow run. Start a run using the standardmlflow.start_run() context manager before calling get_trust_score or generate:
Batch evaluation with tracing
When runningevaluate_dataset, each evaluation is a separate Trustifai.get_trust_score call. To log each row to its own MLflow run, wrap the batch in a parent run and create child runs per item:
If no MLflow run is active when
get_trust_score is called, TrustifAI skips logging silently. You must start a run explicitly with mlflow.start_run() for metrics to appear in the UI.Starting a local MLflow server
For local development, start the MLflow tracking server with:tracking_uri: "http://localhost:5000" in your config. Open http://localhost:5000 in a browser to view experiments, compare runs, and inspect logged metrics.
Disabling tracing
Tracing is disabled by default. To disable it explicitly or to turn it off in an environment where MLflow is not available:tracing section entirely — TrustifAI treats a missing section as disabled.
Configuration
See the full config_file.yaml reference including the tracing section.
Batch evaluation
Run large-scale evaluations and log aggregate results to MLflow.