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 can send traces directly to Lens with a tracing key or through a connected LiteLLM gateway with their LiteLLM 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
Try Lens locally with DockerDownload one Compose file and run it
Docker on a serverDeploy with Docker Compose and HTTPS
KubernetesInstall the Helm chart
Add to an existing LiteLLM gatewayConnect Lens to LiteLLM

The Docker and Helm installs include ClickHouse. To use ClickHouse Cloud for storage, follow Managed ClickHouse.

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​

Open Agents > Connect agent and choose Claude Code, Codex, or OpenCode. Run a task, then open Traces to see the conversation and tool calls.

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 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 →