Prompt
I'm building an AI product and want to avoid running Kubernetes for inference
Latest observation
Absolutely — you can build a solid AI inference stack without Kubernetes. In many cases, avoiding K8s makes things simpler, cheaper, and faster to operate, especially early on.
Here are the main alternatives, depending on your scale and reliability needs:
1. Single VM / Bare Metal + process manager
Best for: MVPs, low-to-moderate traffic, one or a few models.
- Run your inference server directly on a VM or GPU box.
- Use something like:
systemdsupervisorddocker compose
- Put a reverse proxy in front:
- Nginx
- Caddy
- Traefik
Common setup
- Model server: vLLM, TGI, Triton, Ollama, llama.cpp server, etc.
- API layer: FastAPI/Node/Go service
- Proxy/load balancing: Nginx/Caddy
- Observability: Prometheus + Grafana, or a managed service
Pros
- Simple
- Low overhead
- Easy debugging
- Cheap to operate
Cons
- Manual scaling
- Less fault isolation
- Harder to do rolling deploys at scale
2. Docker Compose on one or a few machines
Best for: teams that want containerization without orchestration complexity.
- Package each component as a container.
- Use
docker composefor:- inference server
- API gateway
- queue worker
- Redis / Postgres if needed
Pros
- Reproducible
- Easier deployments than raw VMs
- Good stepping stone before more complex infra
Cons
- Not ideal for large clusters
- Limited self-healing and scheduling
3. Managed container platforms
Best for: production apps that want autoscaling without K8s.
Examples:
- AWS ECS/Fargate
- Google Cloud Run
- Azure Container Apps
- Fly.io
- Render
- Railway
- Modal
- Replicate
- Baseten
- Hugging Face Inference Endpoints
Pros
- No cluster management
- Auto scaling options
- Easier deployments
- Often integrated logging/monitoring
Cons
- Can be expensive
- GPU support varies
- Some platforms have cold starts or runtime constraints
- Less control over networking and hardware
For GPU inference, Modal, Baseten, Replicate, and Hugging Face Inference Endpoints are often attractive if you want to avoid infra ops entirely.
4. Queue-based async inference
Best for: long-running tasks, batch jobs, expensive model calls.
Architecture:
- API receives request
- Push job to queue:
- Redis Queue / Celery
- SQS
- RabbitMQ
- NATS
- Worker processes jobs on GPU instances
- Result stored in DB/object store
Pros
- Handles spikes well
- Easier to scale workers independently
- Better for non-interactive workloads
Cons
- Not ideal for low-latency chat/completion APIs unless combined with a fast online path
5. “Autoscaling without Kubernetes” using VM groups
Best for: teams needing more control but not wanting K8s.
You can use:
- AWS Auto Scaling Groups + launch templates
- GCP MIGs
- Azure VM Scale Sets
Run your inference service in a VM image or startup script.
Pros
- Good control
- Real autoscaling
- No Kubernetes
Cons
- More ops than managed container platforms
- You still manage VM lifecycle and images
Practical recommendation
If you're early stage, I’d usually suggest:
Option A: simplest
- One GPU VM
- Docker Compose or systemd
- vLLM/TGI/your model server
- Nginx/Caddy in front
Option B: if you need some elasticity
- Managed GPU service like Modal/Baseten/Replicate/HF Endpoints
Option C: if you need to scale predictably but still avoid K8s
- VM autoscaling group
- Queue-based workers
- Stateless API frontend
A good non-Kubernetes inference architecture
Client
-> API Gateway / FastAPI
-> (optional) Redis queue
-> Inference worker on GPU VM
-> DB / cache / object storage
Or for synchronous inference:
Client
-> Load balancer / reverse proxy
-> GPU inference server
-> Response
Key design tips to stay out of Kubernetes
- Keep services stateless where possible
- Separate API from model workers
- Use a queue for heavy jobs
- Store artifacts in S3/GCS/Azure Blob
- Use one model server per GPU type if possible
- Build a thin deployment layer with Docker + systemd or Compose
- Use managed observability rather than self-hosting everything
When Kubernetes is actually worth it
You may eventually want K8s if you have:
- Many models with different runtime needs
- Multi-team infrastructure
- Complex autoscaling and scheduling
- Heavy compliance / platform requirements
- Large heterogeneous GPU fleets
But you do not need Kubernetes to ship a serious AI product.
If you want, I can propose:
- a recommended stack for your exact use case, or
- a non-Kubernetes reference architecture for LLM inference, embeddings, or batch jobs.