Deployment Overview
Genkit flows are just functions that can be deployed anywhere you can run JavaScript, Go, or Python code. This guide covers the most common deployment patterns and platforms.Deployment Options
Genkit applications can be deployed to:| Platform | Best For | Language Support |
|---|---|---|
| Firebase Functions | Firebase ecosystem integration, managed scaling | JavaScript/TypeScript |
| Google Cloud Run | Containerized deployments, auto-scaling | All (JS, Go, Python) |
| Node.js Platforms | Traditional Node.js hosting (Vercel, Fly.io, AWS) | JavaScript/TypeScript |
| Go Deployments | High-performance standalone servers | Go |
| Python Deployments | Flask/FastAPI integration, ASGI servers | Python |
Architecture Patterns
1. Serverless Functions
Deploy individual flows as serverless functions that scale automatically:- Automatic scaling
- Pay-per-use pricing
- No server management
- Cold start latency
- Runtime limitations (timeouts, memory)
2. Containerized Services
Package your entire application in a container for flexible deployment:- Consistent environments
- Full control over runtime
- Can run anywhere (GCP, AWS, Kubernetes)
- More configuration required
- Infrastructure management
3. Standalone Servers
Deploy a traditional HTTP server with all flows exposed as endpoints:Choosing a Platform
Use Firebase Functions When:
- You’re already using Firebase (Auth, Firestore, etc.)
- You want managed infrastructure
- You need automatic scaling
- You’re building with JavaScript/TypeScript
Use Cloud Run When:
- You need containerized deployments
- You want language flexibility (Go, Python, Node.js)
- You need more control than Functions
- You want pay-per-use serverless scaling
Use Node.js Platforms When:
- You’re deploying to Vercel, Fly.io, or AWS
- You need Express.js integration
- You want full control over the server
Use Go Servers When:
- You need maximum performance
- You want minimal resource usage
- You’re building high-throughput services
Use Python (Flask/FastAPI) When:
- You’re integrating with Python ML pipelines
- You prefer Flask or FastAPI
- You need ASGI server features
General Best Practices
1. Environment Variables
Store API keys and secrets in environment variables, never in code:2. Health Checks
Add health check endpoints for load balancers:3. Timeouts and Resource Limits
Configure appropriate timeouts for AI operations:4. Error Handling
Implement proper error handling for production:5. Monitoring and Observability
Enable telemetry for production monitoring:6. Authentication
Secure your endpoints with authentication:Next Steps
Firebase Deployment
Deploy to Cloud Functions for Firebase
Cloud Run Deployment
Containerize and deploy to Google Cloud Run
Node.js Deployment
Deploy Express apps to any Node.js platform
Go Deployment
Build and deploy Go HTTP servers