← 返回首页

langchain-ai_langsmith

已发布
LangChain官方LLM应用可观测性和评估平台,全链路追踪、Prompt测试和生产监控
平台/工具 提示词工程链路追踪可观测性
首页 / 工具 / 平台/工具 / langchain-ai_langsmith

LangChain官方LLM应用可观测性和评估平台,全链路追踪、Prompt测试和生产监控

谁会用得上

  • LangChain开发者
  • 生产级LLM应用团队

解决什么问题

  • LLM应用行为不可观测
    全链路Trace记录每次调用,快速定位问题
  • Prompt迭代缺数据支撑
    版本对比、回归测试和数据集管理

装备说明

LangSmith

> GitHub: langchain-ai/langsmith

一句话说明

LangChain官方可观测性和评估平台,全链路追踪LLM应用

---

谁会用得上

LangChain开发者、生产级LLM应用团队、需要全链路追踪的AI工程师

解决什么问题

LLM应用缺乏有效的调试和监控手段,Prompt版本管理混乱,性能问题难以定位

什么情况下别用

非LangChain生态的简单项目、不需要追踪和监控的原型、预算受限的个人项目

用了能得到什么

全链路追踪、Prompt版本管理、性能分析、回归测试、团队协作、生产级监控

---

快速开始

``bash

pip install langsmith

`

`python

import os

os.environ["LANGCHAIN_API_KEY"] = "your-key"

from langsmith import traceable

@traceable

def my_agent(input):

return llm.invoke(input)

`

---

安装配置

环境要求

  • Python 3.8+
  • 相关API密钥(如需要)
  • 安装步骤

    `bash

    基础安装

    pip install langsmith

    如需完整功能(可选)

    pip install "langsmith[all]"

    `

    环境变量配置

    `bash

    根据需要设置以下环境变量

    export OPENAI_API_KEY="your-openai-key"

    或其他模型提供商的API密钥

    `

    ---

    怎么使用

    追踪Agent执行

    `python

    from langsmith import Client, traceable

    from langchain import OpenAI

    client = Client()

    @traceable(run_type="chain")

    def research_agent(query):

    llm = OpenAI()

    search_result = search_tool.run(query)

    analysis = llm.invoke(f"分析: {search_result}")

    return analysis

    result = research_agent("AI趋势")

    `

    数据集与测试

    `python

    from langsmith import Client

    client = Client()

    dataset = client.create_dataset("qa-tests")

    results = client.run_on_dataset(

    dataset_name="qa-tests",

    llm_or_chain=my_agent

    )

    ``

    ---

    > 更多详情请参考 GitHub 官方文档

    装备信息

    来源开源社区
    类型可观测性平台
    漏斗层级Layer 2
    板块平台/工具
    收录时间2026/5/30
    收藏数★ 49