5.8 KiB
How to Deploy to LangGraph Cloud
LangGraph Cloud is available within LangSmith. To deploy a LangGraph Cloud API, navigate to the LangSmith UI.
Prerequisites
- LangGraph Cloud applications are deployed from GitHub repositories. Configure and upload a LangGraph Cloud application to a GitHub repository in order to deploy it to LangGraph Cloud.
- Verify that the LangGraph API runs locally. If the API does not build and run successfully (i.e.
langgraph up), deploying to LangGraph Cloud will fail as well.
Create New Deployment
Starting from the LangSmith UI...
- In the left-hand navigation panel, select
Deployments. TheDeploymentsview contains a list of existing LangGraph Cloud deployments. - In the top-right corner, select
+ New Deploymentto create a new deployment. - In the
Create New Deploymentpanel, fill out the required fields.Deployment details- Select
Import from GitHuband follow the GitHub OAuth workflow to install and authorize LangChain'shosted-langserveGitHub app to access the selected repositories. After installation is complete, return to theCreate New Deploymentpanel and select the GitHub repository to deploy from the dropdown menu. - Specify a name for the deployment.
- Specify the full path to the LangGraph API config file including the file name. For example, if the file
langgraph.jsonis in the root of the repository, simply specifylanggraph.json. - Specify the desired
gitreference (e.g. branch name). For example, different branches of the repository can be deployed.
- Select
- Select the desired
Deployment Type.Developmentdeployments are meant for non-production use cases and are provisioned with minimal resources.Productiondeployments can serve up to 500 requests/second and are provisioned with highly available storage with automatic backups.
- Specify
Environment Variablesand secrets. See the Environment Variables reference to configure additional variables for the deployment.- Sensitive values such as API keys (e.g.
OPENAI_API_KEY) should be specified as secrets. - Additional non-secret environment variables can be specified as well.
- Sensitive values such as API keys (e.g.
- A new LangSmith
Tracing Projectis automatically created with the same name as the deployment.
- In the top-right corner, select
Submit. After a few seconds, theDeploymentview appears and the new deployment will be queued for provisioning.
Create New Revision
When creating a new deployment, a new revision is created by default. Subsequent revisions can be created to deploy new code changes.
Starting from the LangSmith UI...
- In the left-hand navigation panel, select
Deployments. TheDeploymentsview contains a list of existing LangGraph Cloud deployments. - Select an existing deployment to create a new revision for.
- In the
Deploymentview, in the top-right corner, select+ New Revision. - In the
New Revisionmodal, fill out the required fields.- Specify the full path to the LangGraph API config file including the file name. For example, if the file
langgraph.jsonis in the root of the repository, simply specifylanggraph.json. - Specify the desired
gitreference (e.g. branch name). For example, different branches of the repository can be deployed. - Specify
Environment Variablesand secrets. Existing secrets and environment variables are prepopulated. See the Environment Variables reference to configure additional variables for the revision.- Add new secrets or environment variables.
- Remove existing secrets or environment variables.
- Update the value of existing secrets or environment variables.
- Specify the full path to the LangGraph API config file including the file name. For example, if the file
- Select
Submit. After a few seconds, theNew Revisionmodal will close and the new revision will be queued for deployment.
View Build and Deployment Logs
Build and deployment logs are available for each revision.
Starting from the Deployment view...
- Select the desired revision from the
Revisionstable. A panel slides open from the right-hand side and theBuildtab is selected by default, which displays build logs for the revision. - In the panel, select the
Deploytab to view deployment logs for the revision. - Within the
Deploytab, adjust the date/time range picker as needed. By default, the date/time range picker is set to theLast 15 minutes.
Interrupt Revision
Interrupting a revision will stop deployment of the revision.
!!! warning "Undefined Behavior" Interrupted revisions have undefined behavior. This is only useful if you need to deploy a new revision and you already have a revision "stuck" in progress. In the future, this feature may be removed.
Starting from the Deployment view...
- Select the menu icon (three dots) on the right-hand side of the row for the desired revision from the
Revisionstable. - Select
Interruptfrom the menu. - A modal will appear. Review the confirmation message. Select
Interrupt revision.
Delete Deployment
Starting from the LangSmith UI...
- In the left-hand navigation panel, select
Deployments. TheDeploymentsview contains a list of existing LangGraph Cloud deployments. - Select the menu icon (three dots) on the right-hand side of the row for the desired deployment and select
Delete. - A
Confirmationmodal will appear. SelectDelete.