Skip to main content

Set up Lens

Lens lets you inspect agent traces, investigate failures, and save useful runs as datasets. You can open it inside your LiteLLM dashboard or use it as a separate application.

In both cases, Lens runs as its own service and stores its data in ClickHouse. Your agent can keep its existing model provider.

How the pieces connect​

Agents send traces directly to Lens with a tracing key. Investigations send selected trace content to your analysis model. The Compose file, the release bundle and the Helm chart each include both Lens and ClickHouse.

Choose your starting point​

Your starting pointFollow this guide
Docker on one machine or serverDownload one Compose file and run it
KubernetesInstall the Helm chart
Add to an existing LiteLLM gatewayConnect Lens to LiteLLM

With a gateway connected, Lens reuses its users, teams, SSO and trace permissions. See Access control.

Already set up? Send your first trace.

Record coding agent sessions​

After Lens starts, generate a tracing key and install the Lens plugin for Claude Code or Codex. Keep your existing model login. Open Traces in Lens to find your sessions; no Python example or LiteLLM gateway is required.

Use Lens inside LiteLLM​

A gateway administrator connects Lens once. Users then open Lens in the sidebar with their existing session. If Lens already runs, keep its address, storage and credentials. You do not need a second copy.

Use Lens on its own​

Download the Lens Compose file and run docker compose up --wait. It starts Lens and ClickHouse from the published image. Sign in with the generated admin token. A LiteLLM gateway and PostgreSQL are not required.

Follow the quickstart. You can inspect traces without an analysis model. Add an analysis model when you want to run investigations.

Check your first result​

Open Lens, generate a tracing key, and follow Send your first trace. Open the resulting run and inspect its content. A health check confirms that the service is ready; a stored trace confirms that your exporter can send data and you can read it.

For help from a coding agent, copy the Set it up for me prompt in the Lens setup guide. It covers standalone setup, an existing gateway, and connecting an agent.

LiteLLM Enterprise
SSO/SAML, audit logs, spend tracking, multi-team management, and guardrails, built for production.
Learn more →