Skip to main content
To deploy on LangSmith, an application must consist of one or more graphs, a configuration file (langgraph.json), a file that specifies dependencies, and an optional .env file that specifies environment variables. This page explains how a LangSmith application is organized and how to provide the configuration details required for deployment.

Key concepts

To deploy using LangSmith, provide the following information:
  1. A configuration file (langgraph.json) that specifies the dependencies, graphs, and environment variables to use for the application.
  2. The graphs that implement the logic of the application.
  3. A file that specifies dependencies required to run the application.
  4. Environment variables that are required for the application to run.
Framework agnosticLangSmith Deployment supports deploying a LangGraph graph. However, the implementation of a node of a graph can contain arbitrary code. This means any framework can be implemented within a node and deployed on LangSmith Deployment. This lets you implement your core application logic without using additional LangGraph OSS APIs while still using LangSmith for deployment, scaling, and observability. For more details, refer to Use any framework with LangSmith Deployment.

File structure

The following are examples of directory structures for Python and JavaScript applications:
The directory structure of an application can vary depending on the programming language and the package manager used.

Configuration file

The langgraph.json file is a JSON file that specifies the dependencies, graphs, environment variables, and other settings required to deploy an application. For details on all supported keys in the JSON file, refer to the LangGraph configuration file reference.
The LangGraph CLI defaults to using the configuration file langgraph.json in the current directory.

Examples

  • The dependencies involve a custom local package and the langchain_openai package.
  • A single graph will be loaded from the file ./your_package/your_file.py with the variable agent.
  • The environment variables are loaded from the .env file.

Dependencies

An application may depend on other Python packages or JavaScript libraries (depending on the programming language in which the application is written). You will generally need to specify the following information for dependencies to be set up correctly:
  1. A file in the directory that specifies the dependencies (e.g., requirements.txt, pyproject.toml, or package.json).
  2. A dependencies key in the configuration file that specifies the dependencies required to run the application.
  3. Any additional binaries or system libraries can be specified using dockerfile_lines key in the LangGraph configuration file.

Graphs

Use the graphs key in the configuration file to specify which graphs will be available in the deployed application. You can specify one or more graphs in the configuration file. Each graph is identified by a unique name and a path to either (1) a compiled graph or (2) a function that defines a graph.

Use any framework with LangSmith Deployment

While LangSmith Deployment requires applications to be structured as a LangGraph graph, individual nodes within that graph can contain arbitrary code. This means you can use any framework or library within your nodes while still benefiting from LangSmith’s deployment infrastructure. The graph structure serves as a deployment interface, but your core application logic can use whichever tools and frameworks best suit your needs. To deploy with LangSmith, you need:
  1. A LangGraph graph structure: Define a graph using StateGraph with add_node and add_edge.
  2. Node functions with arbitrary logic: Your node functions can call any framework or library.
  3. A compiled graph: Compile the graph to create a deployable application.
The following example shows how to wrap your existing application logic within a minimal LangGraph structure:
In this example, the node functions (my_app_node for Python and myAppNode for JavaScript) can contain calls to any framework or library. The LangGraph structure simply provides the deployment interface and orchestration layer. For end-to-end examples, refer to the deployment guides for Google ADK and Claude Agent SDK, Strands, CrewAI, and AutoGen. LangSmith added support for Google ADK through deployments-wrap-sdk, an extensible package for wrapping agent SDKs to run on LangSmith Deployment.

Environment variables

If you’re working with a deployed LangGraph application locally, you can configure environment variables in the env key of the configuration file. For a production deployment, you will typically want to configure the environment variables in the deployment environment.