Deployment - janardhanhere/langgraph-deployment-kit GitHub Wiki
Deployment Guide
This guide explains how to deploy the LangGraph Deployment Kit to production environments.
Deployment Options
There are several ways to deploy the kit:
- Directly on a server
- Using Docker
- Using a cloud platform (AWS, Azure, GCP)
Direct Server Deployment
Prerequisites
- Python 3.11 or higher
- A server with appropriate networking
- API keys for your LLM providers
Steps
-
Clone the repository on your server:
git clone https://github.com/your-username/langgraph-deployment-kit.git cd langgraph-deployment-kit
-
Create a virtual environment and install dependencies:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -e .
-
Configure environment variables:
cp .env.example .env # Edit .env with production settings
-
Start the service (with a process manager like supervisord):
python src/run_service.py
Docker Deployment
Prerequisites
- Docker installed
- Docker Compose (optional, for more complex setups)
Steps
-
Create a Dockerfile in the root directory:
FROM python:3.12-slim WORKDIR /app COPY . . RUN pip install -e . EXPOSE 8080 CMD ["python", "src/run_service.py"]
-
Build and run the Docker container:
docker build -t langgraph-deployment-kit . docker run -p 8080:8080 --env-file .env langgraph-deployment-kit
Cloud Deployment
AWS Elastic Beanstalk
- Install the AWS EB CLI
- Configure your application:
eb init
- Create an environment and deploy:
eb create
Google Cloud Run
- Install the Google Cloud SDK
- Build and push your Docker image:
gcloud builds submit --tag gcr.io/your-project/langgraph-deployment-kit
- Deploy to Cloud Run:
gcloud run deploy --image gcr.io/your-project/langgraph-deployment-kit --platform managed
Production Considerations
Security
- Always set
AUTH_SECRET
to a strong random string - Use HTTPS in production environments
- Consider using a reverse proxy like Nginx
Scaling
- For high traffic, consider using a database like PostgreSQL instead of SQLite
- Set up proper monitoring and logging
- Implement rate limiting if needed
Monitoring
- Set up Langfuse for observability
- Consider adding Prometheus metrics
- Set up uptime monitoring
Environment Variables
Key environment variables for production:
MODE
: Set to "deployment" in productionHOST
andPORT
: Configure according to your environmentAUTH_SECRET
: A secure authentication keyDATABASE_TYPE
: "postgres" recommended for productionPOSTGRES_*
: Configure your PostgreSQL connection