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.

ℹ️
Recommended Architecture

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 & Kubernetes

Docker Compose

docker-compose.yml
version: '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.yaml
apiVersion: 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.yaml
apiVersion: 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
⚠️
GPU Memory Limits

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:

For production observability, deploy the official NexusAI Grafana dashboard (#18492) alongside Prometheus & Loki.

Security & Compliance

Troubleshooting

High Latency or Timeout Errors

🚨
Model Crashing on Startup

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.

Ready to deploy?

Run nexus init --template production to scaffold a complete deployment manifest with CI/CD pipelines, monitoring, and security policies pre-configured.