--- id: trulens version: "2.13.0" license: MIT license_treatment: permissive maintenance: active --- # trulens — Library to systematically track and evaluate LLM based applications. License: permissive · Maintenance: active · Downloads: 107.9K/mo ## 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 above — 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 pip install trulens uv add trulens 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_current - Install friction: low - Maintenance: active - Downloads: 107.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags llm application tracing and evaluation, agent monitoring and debugging, rag evaluation framework, opentelemetry llm instrumentation, llm judge and scoring, agentic system evaluation, trace collection and analysis, llm-observability, agentic-systems, rag-evaluation [View on SkillFed](https://skillfed.io/packages/trulens) · [View on PyPI](https://pypi.org/project/trulens/)