这是将您的第一个应用程序部署到 LangSmith 云的快速入门指南。
有关包含所有配置选项的全面云部署指南,请参阅云部署设置指南

先决条件

在开始之前,请确保您具备以下条件:

1. 在 GitHub 上创建仓库

要将应用程序部署到 LangSmith,您的应用程序代码必须驻留在 GitHub 仓库中。支持公共和私有仓库。对于本快速入门,请为您的应用程序使用 new-langgraph-project 模板
  1. 转到 new-langgraph-project 仓库new-langgraphjs-project 模板
  2. 单击右上角的 Fork 按钮以将仓库分叉到您的 GitHub 账户。
  3. 单击 Create fork

2. 部署到 LangSmith

  1. 登录到 LangSmith
  2. 在左侧边栏中,选择 Deployments
  3. 单击 + New Deployment 按钮。将打开一个窗格,您可以在其中填写必填字段。
  4. 如果您是首次用户或添加以前未连接的私有仓库,请单击 Import from GitHub 按钮并按照说明连接您的 GitHub 账户。
  5. 选择您的新 LangGraph 项目仓库。
  6. 单击 Submit 进行部署。 这可能需要大约 15 分钟才能完成。您可以在 Deployment details 视图中检查状态。

3. 在 Studio 中测试您的应用程序

应用程序部署后:
  1. 选择您刚刚创建的部署以查看更多详细信息。
  2. 单击右上角的 Studio 按钮。Studio 将打开以显示您的图。

4. 获取部署的 API URL

  1. Deployment details 视图中,单击 API URL 以将其复制到剪贴板。
  2. 单击 URL 以将其复制到剪贴板。

5. Test the API

You can now test the API:
  • Python SDK (Async)
  • Python SDK (Sync)
  • JavaScript SDK
  • Rest API
  1. Install the LangGraph Python SDK:
pip install langgraph-sdk
  1. Send a message to the assistant (threadless run):
from langgraph_sdk import get_client

client = get_client(url="your-deployment-url", api_key="your-langsmith-api-key")

async for chunk in client.runs.stream(
    None,  # Threadless run
    "agent", # Name of assistant. Defined in langgraph.json.
    input={
        "messages": [{
            "role": "human",
            "content": "What is LangGraph?",
        }],
    },
    stream_mode="updates",
):
    print(f"Receiving new event of type: {chunk.event}...")
    print(chunk.data)
    print("\n\n")

Next steps

You’ve successfully deployed your application to LangSmith Cloud. Here are some next steps:
  • Explore Studio: Use Studio to visualize and debug your graph interactively.
  • Monitor your app: Set up observability with traces, dashboards, and alerts.
  • Learn more about Cloud: See the complete Cloud setup guide for all configuration options.

Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.