TruLens

Python toolkit that traces LLM apps and agents with OpenTelemetry and scores each step with LLM judges.

Open SourceSelf Hosted
0.0 (0)

About

Started at TruEra and now maintained by Snowflake, TruLens measures how well an LLM app or agent is doing. It instruments Python code, records each step as an OpenTelemetry span, and scores those steps with feedback functions, mostly LLM-as-judge prompts that return a score plus their reasoning. LangChain, LangGraph and LlamaIndex apps get ready-made recorders; custom code is traced with a decorator that tags retrieval, generation, tool and MCP calls. Built-in metrics cover the RAG triad of context relevance, groundedness and answer relevance, plus agent judges for planning and tool use. Judges can run on OpenAI, Gemini, Bedrock, Snowflake Cortex, Hugging Face or any model reachable through LiteLLM. Results go to SQLite by default or any SQLAlchemy database, and a Streamlit dashboard compares app versions on quality, latency, tokens and cost; traces can also feed any OTLP backend. It installs with pip and needs no GPU. MIT licensed and free for commercial use, though judge API costs are yours. Fits teams iterating on RAG pipelines and agents who want regressions measured, not eyeballed.

Should you use TruLens?

Pick it when

Pick TruLens when you are tuning a RAG app and want groundedness, context relevance, and answer relevance scores tracked across prompt, model, and retriever versions, from an MIT library you instrument in Python.

Look elsewhere when

Skip it if you need CI gating with pass-fail tests, where DeepEval or promptfoo fit better, or a production trace platform with prompt management, where Langfuse or Phoenix go further.

Alternatives to TruLens

  • Ragas

    RAG metrics plus synthetic test set generation from your documents; scores datasets rather than tracking app versions.

  • DeepEval

    Pytest-style tests with 30+ metrics, including agent checks, for pass-fail CI gates; version dashboards need its optional cloud.

  • Opik

    Self-hosted platform combining traces, metrics, datasets, and prompt optimization; more to deploy than TruLens.

Reviews (0)

Leave a Review

No reviews yet. Be the first to review!

Details

Price
Free
Platform
Local/Desktop
Difficulty
Easy (2/5)
License
MIT
Added
Apr 3, 2026

Tags