Skip to main content

Deploy in 3 Steps

1

Install CLI

uv tool install langgraph-cli
2

Login to LangChain

langgraph login
This will prompt for your LangSmith API key. Get it from smith.langchain.com/settings.
3

Deploy

langgraph deploy
Your agent is now live on LangGraph Platform!
Deployment complete! Your agent is now running on LangGraph Platform with automatic scaling and built-in LangSmith tracing.

What Happens During Deployment

When you run langgraph deploy, the CLI:
  1. Packages your code - Bundles your agent and dependencies
  2. Uploads to platform - Securely transfers to LangGraph Platform
  3. Provisions infrastructure - Creates serverless compute resources
  4. Deploys your graph - Makes your agent available via API
  5. Returns endpoint URL - Gives you the deployment URL

Test Your Deployment

Via CLI

langgraph deployment invoke my-agent \
  --input '{"messages": [{"role": "user", "content": "Hello!"}]}'

Via HTTP

curl -X POST https://your-deployment.langchain.com/invoke \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "input": {
      "messages": [{"role": "user", "content": "Hello!"}]
    }
  }'

Via Python SDK

from langgraph_sdk import get_client

client = get_client(url="https://your-deployment.langchain.com")
response = client.runs.stream(
    assistant_id="agent",
    input={"messages": [{"role": "user", "content": "Hello!"}]}
)

for chunk in response:
    print(chunk)

View Traces in LangSmith

All invocations are automatically traced in LangSmith:
  1. Go to smith.langchain.com
  2. Select your project
  3. See all traces with full LLM details

Local Testing First

Test locally before deploying:
## Start local dev server
langgraph dev

## In another terminal, test
langgraph deployment invoke --local \
  --input '{"messages": [{"role": "user", "content": "Test"}]}'

Deployment Commands

langgraph deploy my-agent-prod
langgraph deploy my-agent-prod --tag v1.0.0
langgraph deployment list
langgraph deployment logs my-agent-prod --follow
langgraph deployment rollback my-agent-prod --revision 3
langgraph deployment delete my-agent-prod

Next Steps

Troubleshooting

Solution: Ensure you’re using a valid LangSmith API key from smith.langchain.com/settings.
# Re-login
langgraph logout
langgraph login
Common causes:
  • Missing dependencies in langgraph/requirements.txt
  • Invalid langgraph.json configuration
  • Graph import errors
Solution: Test locally first with langgraph dev
Solution: Verify langgraph.json has correct graph path:
{
  "graphs": {
    "agent": "./langgraph/agent.py:graph"
  }
}

Need help? Check the full deployment guide or visit LangChain docs.