skillfed

trulens

Library to systematically track and evaluate LLM based applications.

trulens v2.13.0 107.9K downloads/30d#12,591 on PyPI3,508
Permissive license MIT Active released

What it is and what it does

TruLens is an open-source library for systematically tracing and evaluating LLM-based applications. It uses OpenTelemetry-native instrumentation to capture every function call, LLM generation, retrieval, and tool invocation as structured spans, then scores outputs using LLM judges that explain their reasoning. The core workflow is: decorate your app functions with the @instrument decorator, run queries or batch datasets through your app, collect traces and evaluation scores, then compare versions to identify which performs best on the tradeoff between quality and cost.

The package bundles five internal components (trulens-core, trulens-dashboard, trulens-feedback, trulens-otel-semconv, trulens_eval) and is designed to integrate with existing observability infrastructure via OTLP backends. It includes evaluators for agentic systems and supports both inline evaluation (as the app runs) and offline batch evaluation over pre-collected datasets. Additional LLM provider packages and app framework integrations are installed separately.

Use it for:

  • Trace retrieval latency and token usage in a RAG pipeline to identify cost-quality tradeoffs.
  • Evaluate agent reasoning chains step-by-step to catch logical inconsistencies and tool-selection errors.
  • Compare two versions of an LLM application on a fixed dataset using batch evaluation.
  • Export traces to an OTLP backend to correlate LLM behavior with infrastructure metrics.
  • Score context relevance and groundedness of RAG outputs using LLM judges.
  • Capture Model Context Protocol tool calls with structured spans to debug agentic workflows.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

TruLens instruments LLM applications to trace execution step-by-step, evaluate outputs with LLM-based judges, and compare versions to identify failures and cost-quality tradeoffs.

Yes. TruLens is actively maintained, has low install friction, carries a permissive MIT license, and solves a concrete problem—systematic tracing and evaluation of LLM applications—that most LLM teams face. It is adopted by major organizations and integrates with standard observability infrastructure. Install it if you need to debug agent failures, compare LLM app versions, or measure quality-cost tradeoffs.

Install

trulens on PyPI

pip

pip install trulens

uv

uv add trulens

poetry

poetry add trulens

Installing trulens

Before you install

Low friction: pure Python wheel with five internal runtime dependencies (trulens-core, trulens-dashboard, trulens-feedback, trulens-otel-semconv, trulens_eval). Active maintenance as of 2026-08-14 with 3508 GitHub stars.

License in practice

MIT license (permissive) allows commercial and private use with minimal restrictions—suitable for production deployment in most organizational contexts.

Quickstart

pip install trulens

from trulens.core.otel.instrument import instrument
from trulens.otel.semconv.trace import SpanAttributes

class MyRAG:
    @instrument(
        span_type=SpanAttributes.SpanType.RETRIEVAL,
        attributes={
            SpanAttributes.RETRIEVAL.QUERY_TEXT: "query",
            SpanAttributes.RETRIEVAL.RETRIEVED_CONTEXTS: "return",
        },
    )
    def retrieve(self, query: str) -> list:
        pass

Requires Python 3.10 or later; LLM provider packages must be installed separately for feedback evaluation.

Verify before relying

  • Whether the seven agentic evaluators are available in the base package or distributed across the five runtime dependencies.
  • Whether the Run API for batch evaluation and Selector API are part of core or split across dependencies.
  • Performance characteristics and latency overhead of inline vs. batch evaluation on large datasets.

Package facts

License MIT (permissive)
Python support supports the current Python release (<4.0,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 5 — trulens-core, trulens-dashboard, trulens-feedback, trulens-otel-semconv, trulens_eval
Maintenance actively maintained — 0 days since the last release
Last repo commit
First released
Downloads 107,852/month — #12,591 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: trulens-2.13.0-py3-none-any.whl

Development Status :: 3 - AlphaLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

llm application tracing and evaluationagent monitoring and debuggingrag evaluation frameworkopentelemetry llm instrumentationllm judge and scoringagentic system evaluationtrace collection and analysis
llm-observabilityagentic-systemsrag-evaluation

More Artificial Intelligence packages

Further reading