Deploying large language models at scale traditionally meant provisioning dedicated GPU clusters and managing complex orchestration. Serverless architectures promise to eliminate idle compute costs and automate scaling, yet running LLMs in serverless containers introduces unique challenges: massive container images, cold starts measured in seconds, and strict concurrency limits. For many engineering teams, the more practical path is to separate the application layer, which can run on standard serverless compute, from the inference layer, which is best handled by a specialized serverless platform. Oxlo.ai offers exactly that: a developer-first, serverless inference API with flat per-request pricing and no cold starts on popular models.
Why Serverless for LLM Inference
Serverless computing shifts responsibility for infrastructure management to the platform provider. Your code or model runs only when a request arrives, and you pay for execution time rather than reserved capacity. For LLMs, this pattern is attractive because inference demand is often spiky. A customer support bot might see ten requests per minute for hours, then surge to thousands during an incident.
The challenge is that transformer models are not lightweight artifacts. A quantized Llama 3.3 70B still requires gigabytes of storage and substantial GPU memory. When you deploy these inside serverless containers, you must optimize startup behavior, caching, and concurrency carefully. If you misconfigure these parameters, user-facing latency will degrade quickly.
Architecture Patterns
There are two primary patterns for serverless LLM deployment.
- Self-hosted serverless containers: You package an inference engine such as vLLM or Text Generation Inference inside a container, then deploy it to a serverless GPU service. This gives you full control over the model weights and runtime, but you are responsible for container optimization, health checks, and scaling logic.
- Managed serverless API: Your application calls an external inference endpoint over HTTP. The provider handles model loading, batching, GPU scheduling, and scaling. This is the fastest path to production and removes cold-start penalties if the provider keeps popular models warm.
Oxlo.ai fits the second pattern. It provides fully OpenAI SDK compatible endpoints for more than 45 open-source and proprietary models, so you can treat inference as a utility rather than infrastructure.
Step 1: Containerizing an Open-Source Model
If your organization requires self-hosting, start by selecting an efficient inference server. vLLM is a common choice because it implements PagedAttention for high throughput. Below is a minimal Dockerfile for serving a model with vLLM.
FROM vllm/vllm-openai:latest
# Download weights at build time to reduce cold starts
ENV MODEL_NAME="meta-llama/Llama-3.3-70B-Instruct"
RUN python -c "from huggingface_hub import snapshot_download; snapshot_download('${MODEL_NAME}')"
ENTRYPOINT ["python", "-m", "vllm.entrypoints.openai.api_server"]
CMD ["--model", "meta-llama/Llama-3.3-70B-Instruct", "--tensor-parallel-size", "2"]
Build this image, push it to a registry, and configure your serverless platform to allocate GPU memory. Be aware that pulling a multi-gigabyte container and loading weights into GPU memory can take 30 to 90 seconds. You will need to implement either request queuing or keep-alive pings to mask that latency, which partially undermines the serverless cost model.
Step 2: Deploying to a Serverless GPU Platform
Once your container is ready, deployment follows standard serverless workflows:
- Configure GPU allocation. Most serverless platforms bill by the millisecond of GPU time, so choose the smallest instance type that fits your model in memory.
- Set concurrency limits. LLM inference is memory-bound, so allowing unlimited concurrent requests will trigger out-of-memory errors. Cap concurrency at the batch size your GPU can support.
- Implement observability. Track time-to-first-token and tokens-per-second, not just HTTP status codes. These metrics reveal whether your container is recycling between requests or keeping the model resident.
This approach works, but the operational burden is significant. Every model update requires a new container build and redeployment. Every scaling event risks a cold start. For teams that want to focus on application logic rather than infrastructure, a managed API is a better fit.
Step 3: Managed Inference with Oxlo.ai
Oxlo.ai eliminates the need to build, ship, or scale model containers. Because the platform maintains warm pools of popular models, there are no cold starts. You send a request
Top comments (0)