{"id":24736,"library":"trulens-core","title":"TruLens","description":"TruLens is a library for systematically tracking and evaluating LLM-based applications. It provides instrumentation, feedback functions, and a dashboard for monitoring and improving LLM app performance. Current version: 2.8.0, with monthly releases.","status":"active","version":"2.8.0","language":"python","source_language":"en","source_url":"https://github.com/truera/trulens","tags":["llm","evaluation","observability","feedback","tracing"],"install":[{"cmd":"pip install trulens-core","lang":"bash","label":"Install TruLens core"}],"dependencies":[],"imports":[],"quickstart":{"code":"from trulens.core import TruSession\nfrom trulens.feedback import Feedback\nfrom trulens.providers.openai import OpenAI\n\nsession = TruSession()\nsession.reset_database()\n\nprovider = OpenAI(model_engine=\"gpt-4o-mini\", api_key=os.environ.get('OPENAI_API_KEY', ''))\nf_groundedness = Feedback(provider.groundedness_measure_with_cot_reasons, name=\"Groundedness\")\nprint(\"Feedback defined.\")\n# See docs for full quickstart: https://www.trulens.org/","lang":"python","description":"Initialize TruLens session and define a feedback function."},"warnings":[{"fix":"Migrate to `Metric` class with explicit selectors dictionary. See migration guide: https://www.trulens.org/trulens/api/metrics/","message":"In version 2.7.0, the `Feedback` class and `MetricConfig` were replaced by the unified `Metric` class. Old code using `Feedback(...).on_output().on_input()` will break.","severity":"breaking","affected_versions":"<2.7.0"},{"fix":"Use `TruSession().run_dashboard()` instead.","message":"`run_dashboard_sis` is deprecated as of 2.7.2.","severity":"deprecated","affected_versions":">=2.7.2"},{"fix":"Always check that the provider is correctly instantiated with `api_key` or `base_url` and test with a known good key.","message":"Feedback functions require an LLM provider to be initialized with a valid API key. If the key is missing or invalid, they will fail silently or raise cryptic errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `from trulens.core import TruSession` instead of `from trulens import Tru`.","message":"`TruSession` is the new session class starting from 2.0, replacing the old `Tru` class. Importing `Tru` directly will raise ImportError.","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"search_vec":"'2.8.0':32 'app':28 'applic':14 'base':13 'current':30 'dashboard':22 'evalu':10,37 'feedback':18,39 'function':19 'improv':26 'instrument':17 'librari':5 'llm':12,27,36 'llm-base':11 'monitor':24 'month':34 'observ':38 'perform':29 'provid':16 'releas':35 'systemat':7 'trace':40 'track':8 'trulen':1,2 'version':31","created_at":"2026-05-01T08:14:39.067126+00:00","updated_at":"2026-05-01T08:14:39.067126+00:00","problems":[{"fix":"Use `from trulens.core import TruSession` and replace `Tru()` with `TruSession()`.","cause":"The old `Tru` class was removed in favor of `TruSession` starting from v2.0.","error":"ImportError: cannot import name 'Tru' from 'trulens'"},{"fix":"Check the correct method name in the provider's documentation. For OpenAI, use `provider.groundedness_measure_with_cot_reasons` (available in 2.x).","cause":"Feedback function names changed between versions. The API is version-specific.","error":"AttributeError: 'OpenAI' object has no attribute 'groundedness_measure_with_cot_reasons'"},{"fix":"Install `trulens-core` and use `from trulens.core import ...` instead.","cause":"The old `trulens_eval` package was split into `trulens-core` and other subpackages starting from v2.0.","error":"ModuleNotFoundError: No module named 'trulens_eval'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"tru","cli_version":"sh: 1: tru: not found","type":"library","homepage":"https://trulens.org/","github":"https://github.com/truera/trulens","docs":"https://trulens.org/getting_started/","changelog":null,"pypi":"https://pypi.org/project/trulens-core/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["llm-agents","ai-ml","observability"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}