Skip to main content

Set up Lens

Start by connecting Lens to your gateway. Your team can then explore AI usage and efficiency or improve an agent from the LiteLLM dashboard with their existing permissions

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
Use Lens with your LiteLLM gatewayConnect Lens to your gateway
Try Lens locally with DockerDownload one Compose file and run it
Docker on a serverDeploy with Docker Compose and HTTPS
KubernetesInstall the Helm chart

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​

Follow the setup for Claude Code, Codex, or OpenCode using the gateway address and the key the agent uses for model calls. 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 →