Skip to main content
Before deploying LangShazam, ensure your environment meets these requirements.

Core Requirements

Python Environment

LangShazam requires Python 3.9 or higher. The official Docker image uses Python 3.9-slim.
From backend/deployment/docker/Dockerfile:1:
FROM python:3.9-slim

Python Dependencies

The following packages are required (from backend/requirements.txt):
fastapi==0.109.0
uvicorn==0.27.0
openai==1.66.3
psutil==5.9.8
python-multipart==0.0.9
websockets==12.0
Key Dependencies:
  • FastAPI: Modern web framework for building APIs
  • Uvicorn: ASGI server for running the application
  • OpenAI SDK: Integration with Whisper API for language detection
  • WebSockets: Real-time communication support
  • python-multipart: File upload handling
  • psutil: System metrics monitoring

Platform-Specific Requirements

Docker Deployment

Docker Engine

Version 20.10 or higher

Docker Compose

Version 2.0 or higher (optional)
Minimum System Resources:
  • CPU: 1 core (2+ recommended)
  • RAM: 512 MB minimum, 1 GB recommended
  • Disk: 2 GB for image and logs
  • Network: Port 10000 available

Kubernetes Deployment

Prerequisites:
  • Kubernetes cluster v1.24+
  • kubectl CLI configured
  • Docker registry access (ECR, Docker Hub, etc.)
  • Ingress controller (nginx recommended)
Cluster Resources (from kubernetes/manifests/deployment.yaml:31-36): Per pod:
resources:
  requests:
    cpu: "100m"
    memory: "256Mi"
  limits:
    cpu: "500m"
    memory: "512Mi"
Minimum Cluster Capacity:
  • 2 replicas (default) × 500m CPU = 1 vCPU minimum
  • 2 replicas × 512 MB = 1 GB RAM minimum
  • Auto-scaling up to 10 replicas requires 5 vCPU and 5 GB RAM

EC2 Deployment

AWS Account Requirements:
  • EC2 permissions
  • CloudFormation permissions
  • VPC and Security Group creation permissions
  • SSH key pair
Recommended Instance Types (from ec2/ec2-config.yaml:14):
InstanceType:
  Default: t2.micro
  AllowedValues: [t2.micro, t2.small, t2.medium, t3.micro, t3.small, t3.medium]
Instance Resource Mapping:
Instance TypevCPURAMCost/MonthBest For
t2.micro11 GB~$8.50Development
t2.small12 GB~$17Light production
t2.medium24 GB~$34Production
t3.micro21 GB~$7.50Burst workloads
t3.small22 GB~$15Production
Software Requirements (auto-installed via CloudFormation):
  • Amazon Linux 2
  • Docker Engine
  • Docker Compose v2.24.5+
  • Git
  • jq

Render Deployment

Render manages all infrastructure automatically. No manual setup required.
Render Free Tier:
  • 512 MB RAM
  • Shared CPU
  • Automatic sleep after 15 minutes of inactivity
  • Cold start time: 30-60 seconds
Render Paid Plans:
  • Starting at $7/month
  • Dedicated resources
  • No automatic sleep
  • Faster deployment and scaling

API Keys and Secrets

OpenAI API Key (Required)

An OpenAI API key with Whisper API access is required for all deployments.
How to get an OpenAI API key:
  1. Sign up at platform.openai.com
  2. Navigate to API keys section
  3. Create a new secret key
  4. Ensure your account has credit/billing enabled
Whisper API Costs:
  • $0.006 per minute of audio
  • Example: 1000 detections × 5 seconds = ~$0.50

Base64 Encoding for Kubernetes

For Kubernetes deployments, encode your API key:
echo -n "your-api-key" | base64
Then add to kubernetes/manifests/secrets.yaml:9:
openai-api-key: ${BASE64_ENCODED_OPENAI_API_KEY}

Network Requirements

Ports

PortProtocolPurposeRequired
10000HTTP/WSApplication serverYes
80HTTPWeb traffic (with proxy)Optional
443HTTPSSecure traffic (with SSL)Optional
22SSHServer access (EC2 only)EC2 only

Outbound Connectivity

Your deployment must have outbound HTTPS access to OpenAI’s API:
  • api.openai.com (port 443)

Firewall Rules

For EC2 (from ec2/ec2-config.yaml:91-107):
SecurityGroupIngress:
  - IpProtocol: tcp
    FromPort: 22
    ToPort: 22
    CidrIp: 0.0.0.0/0  # Restrict in production
  - IpProtocol: tcp
    FromPort: 80
    ToPort: 80
    CidrIp: 0.0.0.0/0
  - IpProtocol: tcp
    FromPort: 443
    ToPort: 443
    CidrIp: 0.0.0.0/0
  - IpProtocol: tcp
    FromPort: 10000
    ToPort: 10000
    CidrIp: 0.0.0.0/0
For production deployments, restrict SSH access (port 22) to your IP address only.

Storage Requirements

Docker Volumes

From ec2/docker-compose.yml:40:
volumes:
  app_logs:
  • Logs: ~100 MB per day (varies with traffic)
  • Docker image: ~200 MB

Kubernetes Persistent Storage

Not required for stateless deployments, but recommended for:
  • Log persistence
  • Metrics storage
  • Application state (if adding future features)

Health Check Requirements

All deployments include health checks on the root endpoint. From backend/deployment/docker/Dockerfile:17-18:
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
    CMD curl -f http://localhost:$PORT/ || exit 1
curl must be available in the container for health checks to work.

Optional Requirements

SSL/TLS Certificates

For production deployments with custom domains:
  • Let’s Encrypt: Free, auto-renewable certificates
  • AWS ACM: Free for AWS resources
  • Custom certificates: Can be mounted in containers

Monitoring and Observability

While not required, consider:
  • Metrics endpoint: Available at /metrics (built-in)
  • Log aggregation: CloudWatch, ELK, Datadog
  • APM: New Relic, Datadog, Prometheus

Next Steps

Environment Variables

Configure required environment variables

Choose Deployment

Select your deployment platform

Build docs developers (and LLMs) love