GEO
赞助商内容

如何使用Laminar开源平台监控AI智能体?2026年完整功能解析

2026/4/25
如何使用Laminar开源平台监控AI智能体?2026年完整功能解析

AI Summary (BLUF)

Laminar is an open-source observability platform for AI agents, offering tracing, evals, monitoring, SQL access, and dashboards. Built with Rust for high performance, it supports OpenTelemetry and integrates with major LLM frameworks.

原文翻译:Laminar是一个面向AI智能体的开源可观测性平台,提供追踪、评估、监控、SQL访问和仪表板功能。基于Rust构建以实现高性能,支持OpenTelemetry,并与主流LLM框架集成。

Product Overview

Laminar is an open-source observability platform purpose-built for AI agents. It provides comprehensive tracing, evaluation, and monitoring capabilities for LLM-powered applications, from development through production.

Laminar 是一款专为 AI 智能体构建的开源可观测性平台。它为基于大语言模型的应用提供了从开发到生产的全面追踪、评估和监控能力。


Core Features

The platform delivers a complete observability stack for AI agent workflows, including tracing, evaluation, monitoring, and data management.

该平台为 AI 智能体工作流提供了完整的可观测性技术栈,涵盖追踪、评估、监控和数据管理。

Feature Category Core Description Key Highlight
Tracing OpenTelemetry-native powerful tracing SDK One line of code to auto-trace Vercel AI SDK, Browser Use, Stagehand, LangChain, OpenAI, Anthropic, Gemini, etc.
Evals Unopinionated SDK and CLI for running evaluations locally or in CI/CD Extensible framework with UI for visualizing and comparing evaluation results
AI Monitoring Define events with natural language descriptions Track issues, logical errors, and custom agent behaviors with semantic event definitions
SQL Access Built-in SQL editor for all data Query traces, metrics, and events; bulk create datasets from queries (also available via API)
Dashboards Powerful dashboard builder Full SQL query support for traces, metrics, and events
Data Annotation & Datasets Custom data rendering UI Fast annotation and dataset creation for evaluations

Quick Start

Self-Hosting with Docker Compose

Laminar is straightforward to self-host locally. Clone the repository and start services with Docker Compose:

Laminar 的本地自托管非常简便。克隆仓库后,使用 Docker Compose 启动服务:

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

This launches a lightweight but fully functional version of the stack. Access the UI at http://localhost:5667. For production environments, we recommend using the managed platform or running docker compose -f docker-compose-full.yml up -d.

这将启动一个轻量级但功能完整的服务栈。在浏览器中访问 http://localhost:5667 即可使用 UI。生产环境建议使用托管平台或运行 docker compose -f docker-compose-full.yml up -d

Enabling AI Monitoring (Signals)

To enable the AI monitoring feature in self-hosted mode, set the GOOGLE_GENERATIVE_AI_API_KEY environment variable in your .env file (required by both app-server and frontend):

要在自托管模式下启用 AI 监控(Signals)功能,请在 .env 文件中设置 GOOGLE_GENERATIVE_AI_API_KEY 环境变量(后端和前端均需要此配置):

# In .env at the repo root
GOOGLE_GENERATIVE_AI_API_KEY=your_key_here

SDK Integration Quickstart

TypeScript SDK

Install the SDK and all instrumentation packages:

安装 SDK 及所有检测工具包:

npm add @lmnr-ai/lmnr

Initialize tracing for LLM calls:

初始化 LLM 调用追踪:

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

Wrap functions with the observe decorator to trace inputs and outputs:

使用 observe 包装函数以追踪输入和输出:

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

Python SDK

Install the SDK with all instrumentation:

安装 SDK 及所有检测工具:

pip install --upgrade 'lmnr[all]'

Initialize and trace functions with the @observe() decorator:

初始化并使用 @observe() 装饰器追踪函数:

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()
def poem_writer(topic):
    response = client.chat.completions.create(
        model="gpt-4o",
        messages=[{"role": "user", "content": f"write a poem about {topic}"}],
    )
    return response.choices[0].message.content

Technical Architecture

Laminar is built for high performance, leveraging modern technologies to handle real-time observability at scale:

Laminar 基于高性能架构设计,利用现代技术应对大规模实时可观测性需求:

Component Technology Benefit
Core Engine Rust 🦀 High memory safety and runtime performance
Trace Viewer Custom realtime engine View traces as they happen without lag
Full-Text Search Ultra-fast engine over span data Instant querying across large trace volumes
Data Export gRPC exporter Efficient streaming of tracing data

Summary

Laminar provides a comprehensive, open-source observability solution specifically designed for AI agent workflows. With native OpenTelemetry support, powerful tracing capabilities, built-in evaluation tools, and a high-performance Rust core, it addresses the unique monitoring needs of modern LLM-based applications. Whether self-hosted via Docker or used through the managed platform, Laminar offers a complete toolkit for understanding, debugging, and optimizing AI agent behavior from development through production.

Laminar 提供了一套全面且开源的可观测性解决方案,专为 AI 智能体工作流设计。凭借原生 OpenTelemetry 支持、强大的追踪能力、内置评估工具以及高性能的 Rust 核心引擎,它能够满足现代基于大语言模型应用的独特监控需求。无论是通过 Docker 自托管,还是使用托管平台,Laminar 都提供了从开发到生产全流程理解、调试和优化 AI 智能体行为的完整工具集。


For complete documentation, visit docs.laminar.sh. Community discussions and support are available on Discord.

完整文档请访问 docs.laminar.sh。欢迎通过 Discord 参与社区讨论和获取支持。

常见问题(FAQ)

Laminar是什么?适用于哪些场景?

Laminar是开源LLM可观测性平台,专为AI智能体设计,提供全链路追踪、评估与监控,支持从开发到生产环境。

如何快速开始使用Laminar?

克隆GitHub仓库后运行docker compose up -d,访问http://localhost:5667。或通过npm/pip安装SDK,用@observe()装饰器一行代码自动追踪LLM调用。

Laminar支持哪些AI框架和语言?

支持Vercel AI SDK、LangChain、OpenAI、Anthropic等主流框架,提供TypeScript和Python SDK,并兼容OpenTelemetry标准。

← 返回文章列表
分享到:微博

版权与免责声明:本文仅用于信息分享与交流,不构成任何形式的法律、投资、医疗或其他专业建议,也不构成对任何结果的承诺或保证。

文中提及的商标、品牌、Logo、产品名称及相关图片/素材,其权利归各自合法权利人所有。本站内容可能基于公开资料整理,亦可能使用 AI 辅助生成或润色;我们尽力确保准确与合规,但不保证完整性、时效性与适用性,请读者自行甄别并以官方信息为准。

若本文内容或素材涉嫌侵权、隐私不当或存在错误,请相关权利人/当事人联系本站,我们将及时核实并采取删除、修正或下架等处理措施。 也请勿在评论或联系信息中提交身份证号、手机号、住址等个人敏感信息。

您可能感兴趣