# Laminar

> Open-source, OpenTelemetry-native tracing and evals for AI agents

- Category: Evaluation & Production Ops / Observability & LLMOps
- Language: TypeScript, Python, Rust
- Repository: https://github.com/lmnr-ai/lmnr
- Website: https://www.lmnr.ai
- Canonical page: https://ai-tldr.dev/tools/laminar/

## In short

Laminar is an open-source observability platform built specifically for AI agents. It collects traces from your LLM and agent code, lets you run evaluations, monitor behavior, and query everything as data. It sits in the Observability & LLMOps category of the Evaluation & Production Ops tools and is open-source, written in TypeScript, Python, Rust.

## Overview

Laminar is an open-source observability platform built specifically for AI agents. It collects traces from your LLM and agent code, lets you run evaluations, monitor behavior, and query everything as data. The backend is written in Rust for high-throughput trace ingestion and realtime viewing.

It is aimed at developers building agents and LLM apps who need to see what their code actually did at each step. Its tracing SDK is OpenTelemetry-native, so a single line of setup auto-instruments common frameworks and providers including the Vercel AI SDK, Browser Use, Stagehand, LangChain, OpenAI, Anthropic, and Gemini.

As an LLM observability and tracing tool, Laminar covers the full loop: capture traces, define natural-language events to flag issues, run evals locally or in CI/CD, and query traces, metrics, and events through a built-in SQL editor. You can use the managed platform at laminar.sh or self-host the stack with Docker Compose.

## What it does

- OpenTelemetry-native SDK that auto-traces Vercel AI SDK, Browser Use, Stagehand, LangChain, OpenAI, Anthropic, Gemini and more with one line of code
- Evals: an extensible SDK and CLI to run evaluations locally or in CI/CD, plus a UI for visualizing and comparing results
- AI monitoring via natural-language event descriptions to track issues, logical errors, and custom agent behavior
- SQL access to all data through a built-in SQL editor, with bulk dataset creation from queries and API access
- Custom dashboards for traces, metrics, and events, including custom SQL queries
- Rust backend with a realtime engine, full-text search over span data, and a gRPC exporter

## Getting started

Use the managed platform at laminar.sh, or self-host with Docker Compose. After creating a project and API key, add the SDK in TypeScript or Python.

1. Self-host with Docker Compose (optional)

   Clone the repo and start the services. The UI is available at http://localhost:5667. If you self-host, configure the SDK with the matching baseUrl and ports.

```bash
git clone https://github.com/lmnr-ai/lmnr
cd lmnr
docker compose up -d
```

2. Install the TypeScript SDK

   This installs the Laminar TS SDK and all instrumentation packages. Create a project and generate a project API key first.

```bash
npm add @lmnr-ai/lmnr
```

3. Initialize and trace (TypeScript)

   Initialize Laminar with your project API key, then wrap functions with observe to trace their inputs and outputs.

```ts
import { OpenAI } from 'openai';
import { Laminar, observe } from '@lmnr-ai/lmnr';

Laminar.initialize({ projectApiKey: process.env.LMNR_PROJECT_API_KEY });

const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });

const poemWriter = observe({ name: 'poemWriter' }, async (topic) => {
  const response = await client.chat.completions.create({
    model: 'gpt-4o-mini',
    messages: [{ role: 'user', content: `write a poem about ${topic}` }],
  });
  return response.choices[0].message.content;
});

await poemWriter();
```

4. Or use the Python SDK

   Install with the [all] extra to include all instrumentation packages, initialize Laminar, then annotate functions with the @observe() decorator.

```bash
pip install --upgrade 'lmnr[all]'
```

## When to use it

- Debug long-running AI agents by viewing each step's inputs and outputs as traces appear in realtime
- Run evaluations on LLM and agent outputs locally or in a CI/CD pipeline and compare results in the UI
- Monitor production agents by defining natural-language events that flag logical errors and custom behavior
- Query traces, metrics, and events with SQL to build dashboards or bulk-create datasets from real usage
