Production Deployment Guide
Deploy NexusAI models to production environments with enterprise-grade reliability, auto-scaling, GPU optimization, and comprehensive observability.
Overview
Production deployment of NexusAI requires careful configuration of inference endpoints, resource allocation, and monitoring pipelines. This guide covers containerized deployments, cloud-native patterns, and serverless architectures optimized for low-latency AI inference.
For production workloads, we recommend Kubernetes with Horizontal Pod Autoscaler (HPA) backed by GPU nodes, or managed services like AWS SageMaker / GCP Vertex AI for rapid deployment.
Prerequisites
- Docker Engine ≥ 24.0 or containerd
- Kubernetes 1.28+ (for cluster deployments)
- NVIDIA CUDA 12.2+ drivers (for GPU acceleration)
- NexusAI API credentials & organization ID
- Minimum 16GB RAM, 8 vCPU (CPU-only) or 1x NVIDIA A10/V100 (GPU)
Docker & Kubernetes
Docker Compose
docker-compose.ymlversion: '3.9' services: nexus-inference: image: registry.nexus.ai/nexus-core:v3.2.1 ports: - "8000:8000" environment: - NEXUS_API_KEY=${NEXUS_API_KEY} - MODEL_ID=nexus-v3-ultra - DEVICE=gpu - MAX_BATCH_SIZE=32 deploy: resources: reservations: devices: - driver: nvidia count: all
Kubernetes Deployment
k8s-deployment.yamlapiVersion: apps/v1 kind: Deployment metadata: name: nexus-ai-inference spec: replicas: 3 selector: matchLabels: app: nexus-inference template: metadata: labels: app: nexus-inference spec: containers: - name: nexus image: registry.nexus.ai/nexus-core:v3.2.1 resources: limits: nvidia.com/gpu: 1 memory: 16Gi requests: cpu: 2 memory: 8Gi
Cloud Providers
NexusAI provides official Terraform modules and CLI tools for rapid provisioning across major cloud platforms.
| Provider | Service | Command | Best For |
|---|---|---|---|
| AWS | SageMaker / EKS | nexus deploy aws --region us-east-1 |
Enterprise scale, multi-region |
| GCP | Vertex AI / GKE | nexus deploy gcp --zone us-central1-a |
ML pipelines, TPUs |
| Azure | ML Studio / AKS | nexus deploy azure --location eastus |
Microsoft ecosystem, compliance |
Configuration & Environment Variables
All runtime behavior is controlled via environment variables or a config.yaml file.
| Variable | Type | Default | Description |
|---|---|---|---|
NEXUS_API_KEY |
string | - | Authentication token for model registry |
MAX_BATCH_SIZE |
int | 16 | Max concurrent requests per worker |
QUANTIZATION |
string | none | fp16, int8, int4, or none |
ENABLE_TRACING |
bool | false | Enable OpenTelemetry distributed tracing |
Scaling & Load Balancing
Horizontal Pod Autoscaler (HPA)
hpa.yamlapiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: nexus-ai-inference minReplicas: 2 maxReplicas: 20 metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 70 - type: Pods pods: metric: name: nexus_queue_depth target: type: AverageValue averageValue: 50
When auto-scaling GPU pods, ensure your node pool has sufficient VRAM. Use memoryFraction and cudaVisibleDevices to prevent OOM kills under load.
Monitoring & Logging
NexusAI exposes Prometheus-compatible metrics on /metrics by default. Key metrics include:
nexus_inference_latency_seconds- P50, P95, P99 response timesnexus_requests_total- Successful/failed request countersnexus_gpu_memory_allocated_bytes- VRAM utilizationnexus_model_loading_time- Cold start duration
For production observability, deploy the official NexusAI Grafana dashboard (#18492) alongside Prometheus & Loki.
Security & Compliance
- All endpoints support mTLS & OIDC authentication
- Model weights are encrypted at rest using AES-256-GCM
- Compliant with SOC 2 Type II, HIPAA, and GDPR by design
- Enable
REQUEST_SANDBOX=trueto isolate untrusted prompts
Troubleshooting
High Latency or Timeout Errors
- Check GPU utilization:
nvidia-smi - Reduce
MAX_BATCH_SIZEif VRAM is exhausted - Enable
QUANTIZATION=fp16to reduce memory footprint - Verify network policies aren't blocking inference traffic
If pods fail with Exit Code 137, your requests/limits are misconfigured. Ensure resources.limits.memory matches your model size. Use kubectl describe pod to inspect OOM events.
FAQ
Can I deploy multiple models on a single instance?
Yes. Use the MODEL_REGISTRY environment variable to load multiple checkpoints. NexusAI handles dynamic routing and memory pooling automatically.
How do I perform zero-downtime updates?
Use Kubernetes Rolling Updates with maxUnavailable: 0 and preStop hooks to gracefully drain inference requests. NexusAI supports health check probes out of the box.
Is cold start mitigation available?
Yes. Enable WARM_POOL_SIZE=2 to maintain pre-loaded model instances. Combined with predictive scaling, cold starts are reduced to <100ms.
Run nexus init --template production to scaffold a complete deployment manifest with CI/CD pipelines, monitoring, and security policies pre-configured.