MCPcopy
hub / github.com/lmnr-ai/lmnr

github.com/lmnr-ai/lmnr @v0.2.0 sqlite

repository ↗ · DeepWiki ↗ · release v0.2.0 ↗
3,362 symbols 9,925 edges 1,118 files 30 documented · 1%
README

Static Badge X (formerly Twitter) Follow Static Badge

Laminar banner

Laminar

Laminar is an open-source observability platform purpose-built for AI agents.

  • [x] Tracing. Docs
    • [x] OpenTelemetry-native powerful tracing SDK - 1 line of code to automatically trace Vercel AI SDK, Browser Use, Stagehand, LangChain, OpenAI, Anthropic, Gemini, and more.
  • [x] Evals. Docs
    • [x] Unopinionated, extensible SDK and CLI for running evals locally or in CI/CD pipeline.
    • [x] UI for visualizing evals and comparing results.
  • [x] AI monitoring. Docs
    • [x] Define events with natural language descriptions to track issues, logical errors, and custom behavior of your agent.
  • [x] SQL access to all data. Docs
    • [x] Query traces, metrics, and events with a built-in SQL editor. Bulk create datasets from queries. Available via API.
  • [x] Dashboards. Docs
    • [x] Powerful dashboard builder for traces, metrics, and events with support of custom SQL queries.
  • [x] Data annotation & Datasets. Docs
    • [x] Custom data rendering UI for fast data annotation and dataset creation for evals.
  • [x] Extremely high performance.
    • [x] Written in Rust 🦀
    • [x] Custom realtime engine for viewing traces as they happen.
    • [x] Ultra-fast full-text search over span data.
    • [x] gRPC exporter for tracing data.

Traces

Documentation

Check out full documentation here laminar.sh/docs.

Getting started

The fastest and easiest way to get started is with our managed platform -> laminar.sh

Self-hosting with Docker compose

Laminar is very easy to self-host locally. For a quick start, clone the repo and start the services with docker compose:

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

This will spin up a lightweight but full-featured version of the stack. This is good for a quickstart or for lightweight usage. You can access the UI at http://localhost:5667 in your browser.

You will also need to properly configure the SDK, with baseUrl and correct ports. See guide on self-hosting.

For production environment, we recommend using our managed platform or docker compose -f docker-compose-full.yml up -d.

Configuring LLM provider (optional)

Frontend AI features (chat-with-trace, SQL-with-AI) and server-side AI workers require an LLM provider. Configure one in your .env file at the repo root.

Pick one of the following provider setups. LLM_MODEL_SMALL|MEDIUM|LARGE are optional — per-provider defaults apply when unset. LLM_DEFAULT_HEADERS_JSON is optional for any provider or gateway that requires static headers.

# Optional for any provider/gateway that requires static headers
# LLM_DEFAULT_HEADERS_JSON='{"X-Gateway-Tenant":"tenant"}'

# Option A: Gemini
LLM_PROVIDER=gemini
LLM_API_KEY=your_gemini_key

# Option B: OpenAI (or any OpenAI-compatible gateway such as LiteLLM, OpenRouter, vLLM)
LLM_PROVIDER=openai
# LLM_BASE_URL=http://localhost:4000   # optional, for OpenAI-compatible gateways
LLM_API_KEY=your_openai_key

# Option C: AWS Bedrock (Anthropic Claude). Uses AWS credentials instead of LLM_API_KEY.
LLM_PROVIDER=bedrock
AWS_ACCESS_KEY_ID=...
AWS_SECRET_ACCESS_KEY=...
AWS_REGION=us-east-1

Custom Postgres schema (optional)

By default Laminar uses the public schema. To target a different schema (e.g. when deploying alongside other services in a shared Postgres instance), set the same value for both the frontend and the app-server:

POSTGRES_SCHEMA=laminar
# Set to false if the schema is pre-provisioned or the DB role lacks CREATE.
# POSTGRES_CREATE_SCHEMA=true

The schema is applied as the connection search_path, so all tables, foreign keys, and migrations target it. When a non-public schema is set, the frontend also tracks migrations inside that schema (<schema>.__drizzle_migrations) rather than the shared drizzle schema. Note that running Laminar alongside another Drizzle-managed service in the same database may still require manual intervention, since Drizzle's migration journal is versioned per-schema.

Anonymous usage telemetry

Self-hosted deployments collect anonymized usage telemetry. To opt out, set LAMINAR_TELEMETRY_DISABLED=true in your .env.

Contributing

For running and building Laminar locally, or to learn more about docker compose files, follow the guide in Contributing.

TS quickstart

First, create a project and generate a project API key. Then,

npm add @lmnr-ai/lmnr

It will install Laminar TS SDK and all instrumentation packages (OpenAI, Anthropic, LangChain ...)

To start tracing LLM calls just add

import { Laminar } from '@lmnr-ai/lmnr';
Laminar.initialize({ projectApiKey: process.env.LMNR_PROJECT_API_KEY });

To trace inputs / outputs of functions use observe wrapper.

import { OpenAI } from 'openai';
import { observe } from '@lmnr-ai/lmnr';

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();

Python quickstart

First, create a project and generate a project API key. Then,

pip install --upgrade 'lmnr[all]'

It will install Laminar Python SDK and all instrumentation packages. See list of all instruments here

To start tracing LLM calls just add

from lmnr import Laminar
Laminar.initialize(project_api_key="<LMNR_PROJECT_API_KEY>")

To trace inputs / outputs of functions use @observe() decorator.

import os
from openai import OpenAI

from lmnr import observe, Laminar
Laminar.initialize(project_api_key="<LMNR_PROJECT_API_KEY>")

client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])

@observe()  # annotate all functions you want to trace
def poem_writer(topic):
    response = client.chat.completions.create(
        model="gpt-4o",
        messages=[
            {"role": "user", "content": f"write a poem about {topic}"},
        ],
    )
    poem = response.choices[0].message.content
    return poem

if __name__ == "__main__":
    print(poem_writer(topic="laminar flow"))

Client libraries

To learn more about instrumenting your code, check out our client libraries:

NPM Version PyPI - Version

Extension points exported contracts — how you extend this code

SchemaDriftBannerProps (Interface)
* Renders inside the Fields tab when the row's target disagrees with the * schema in a way the form can't represent. Tw
frontend/components/queue/target-panel/schema-drift-banner.tsx
TableMeta (Interface)
(no doc)
frontend/types/tanstack-table.ts
CacheEntry (Interface)
(no doc)
frontend/lib/cache.ts
OnboardingPageProps (Interface)
(no doc)
frontend/app/(auth)/onboarding/page.tsx
SpanInput (Interface)
(no doc)
frontend/tests/test-subagent-grouping.test.ts
SubagentLlmGrouping (Interface)
* Subagent grouping output. * * Each non-main LLM/CACHED span is keyed by `(parentSpanPath, promptHash, invocationRoot
frontend/components/traces/trace-view/store/utils.ts
ColumnMeta (Interface)
(no doc)
frontend/types/tanstack-table.ts
RedisSetOptions (Interface)
(no doc)
frontend/lib/cache.ts

Core symbols most depended-on inside this repo

cn
called by 593
frontend/lib/utils.ts
set
called by 374
frontend/lib/cache.ts
get
called by 315
frontend/lib/cache.ts
toast
called by 266
frontend/lib/hooks/use-toast.ts
has
called by 189
frontend/lib/simple-lru.ts
useToast
called by 113
frontend/lib/hooks/use-toast.ts
track
called by 110
frontend/lib/posthog/client.ts
useQueueStore
called by 64
frontend/components/queue/queue-store/index.tsx

Shape

Function 2,571
Interface 711
Method 38
Class 24
Enum 18

Languages

TypeScript100%

Modules by API surface

frontend/lib/utils.ts43 symbols
frontend/components/traces/trace-view/store/utils.ts32 symbols
frontend/components/ui/icons.tsx28 symbols
frontend/components/sql/utils.ts24 symbols
frontend/lib/actions/common/query-builder.ts23 symbols
frontend/lib/cache.ts19 symbols
frontend/components/traces/span-view/openai-responses-parts.tsx19 symbols
frontend/components/ui/content-renderer/utils.ts18 symbols
frontend/lib/actions/slack/broker.ts17 symbols
frontend/components/traces/span-view/common.tsx17 symbols
frontend/components/ui/infinite-datatable/model/table-config-store.tsx16 symbols
frontend/components/traces/session-view/session-timeline/utils.ts16 symbols

Dependencies from manifests, versioned

@ai-sdk/amazon-bedrock3.0.17 · 1×
@ai-sdk/anthropic2.0.71 · 1×
@ai-sdk/azure2.0.26 · 1×
@ai-sdk/google2.0.64 · 1×
@ai-sdk/groq2.0.17 · 1×
@ai-sdk/mistral2.0.13 · 1×
@ai-sdk/openai2.0.23 · 1×
@ai-sdk/provider2.0.0 · 1×
@ai-sdk/react2.0.116 · 1×
@aws-sdk/client-s33.1053.0 · 1×
@clickhouse/client1.12.1 · 1×
@codemirror/autocomplete6.18.6 · 1×

For agents

$ claude mcp add lmnr \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact