Getting Started

How to get started with Trulens

1

Install TruLens and Provider Packages

Run `pip install trulens trulens-providers-openai` to install the core library and OpenAI provider package.

2

Instrument Your Application

Use the `@instrument()` decorator or `TruApp` wrapper to trace your LLM app, defining feedback functions such as groundedness and answer relevance.

3

Set API Keys

Configure environment variables with your LLM provider API keys, for example, `os.environ["OPENAI_API_KEY"] = "your_key_here"`.

4

Run Your Instrumented Application

Execute your app to generate traces and evaluations automatically.

5

Launch the Dashboard

Import and run the dashboard with `from trulens.dashboard import run_dashboard; run_dashboard(session)` to visualize results.