Ollama on a Laptop to a Production GPU Endpoint
Connor Blier
Founding GTM
Ollama on a Laptop to a Production GPU Endpoint
Going from Ollama on a laptop to a production GPU inference endpoint is a migration, not a rewrite: keep Ollama for prototyping, swap its engine for vLLM or TGI behind the same OpenAI-compatible API, scale across GPUs with tensor parallelism, then containerize onto autoscaling serverless GPUs.
TL;DR: the migration path in one breath
Ollama is the right place to start and the wrong place to finish. The journey from Ollama on a laptop to a production GPU inference endpoint keeps one thing constant across every stage: the OpenAI-compatible API surface your application calls. You change what runs behind that API, not your client code.
The sequence: (1) prototype with ollama run locally; (2) stand up a production engine such as vLLM or TGI on a single GPU; (3) scale across GPUs with tensor parallelism; (4) tune throughput with continuous batching and quantization; (5) containerize and deploy onto an autoscaling serverless GPU platform with observability and cost controls. Because Ollama already exposes an OpenAI-compatible endpoint at http://localhost:11434/v1, and vLLM implements the same Completions and Chat APIs, the seam between stages is nearly free.
Why a laptop Ollama setup won't survive production
Ollama does several things exactly right for the prototype phase. It is, by its own description, "the most popular way to build with open models," giving you local model deployment where "models run entirely on your infrastructure, ensuring data privacy and reducing latency," with a RESTful, API-first architecture. Your prompts are never stored or trained on. For a single developer iterating on a prompt, that is ideal.
The ceiling appears when you add concurrent users. A laptop runtime processes requests more or less one at a time; it has no continuous batching, no horizontal scaling, no autoscaling, no per-request observability, and no way to pin an SLO. The migration triggers are concrete: you need to serve many simultaneous requests, your model no longer fits in a single consumer GPU's VRAM, you need predictable tail latency, or you need the endpoint to survive a machine dying. When any one of those is true, you have outgrown the laptop - not Ollama the tool, the laptop.
The production inference engine landscape
Three engines dominate production GPU serving.
vLLM is the common default. It implements an HTTP server for OpenAI's Completions and Chat APIs and scales from a single GPU up to multi-node clusters. Start here unless you have a specific reason not to. The full set of server parameters that govern its throughput is worth studying before you tune.
Text Generation Inference (TGI) is Hugging Face's serving stack, explicitly production-ready with "distributed tracing with Open Telemetry, Prometheus metrics," tensor parallelism, token streaming, and "continuous batching of incoming requests for increased total throughput." Reach for it when you want observability batteries included.
NVIDIA Triton Inference Server answers the question "how do I deploy it at-scale with an optimal configuration," and is the choice when you serve mixed-framework models behind one server. For a deeper engine bake-off, see our vLLM, SGLang and TensorRT benchmark for Llama 3.1.
The OpenAI-compatible API is the painless migration seam
The reason this is a migration and not a rewrite: Ollama already speaks the OpenAI dialect locally, and so do the production engines. Point your client at http://localhost:11434/v1 during prototyping, then at your vLLM server's /v1 in production, and the request bodies are identical. We cover the serving-side details in serving open-source LLMs behind an OpenAI-compatible endpoint. Keep this seam clean and every later stage becomes a backend swap your application never notices.
Stage-by-stage migration walkthrough
1. Reproduce the prototype. Pin the exact model and quantization you ran with ollama run. Capture a handful of real prompts as a regression set - these become your benchmark inputs later.
2. Stand up vLLM on a single GPU. Per vLLM's own guidance, "if the model fits on a single GPU, distributed inference is probably unnecessary. Run inference on that GPU." Launch the OpenAI-compatible server, repoint your client, and confirm the regression set still passes. If you are coming from a local Python service rather than Ollama, the same shape applies - see local FastAPI to a serverless GPU endpoint.
3. Scale across GPUs. When the model is too big for one card, vLLM uses tensor parallelism, and for models too large for one node you "combine tensor parallelism with pipeline parallelism," setting tensor_parallel_size to GPUs per node and pipeline_parallel_size to the node count. Its default runtimes are Ray for multi-node and native multiprocessing for single-node. We walk through the cluster side in multi-node LLM inference on serverless clusters.
4. Tune throughput. The single highest-impact lever is continuous batching, which "attempts to maximize performance by processing multiple conversations in parallel and swapping them out when they are done," unlike static batching. Pair it with quantization to shrink VRAM and lift tokens-per-second; our 4-bit LLM inference on H100 measures what that buys you.
5. Containerize and deploy. Bake the engine, weights, and runtime into an image and ship it to a GPU platform.
Making it production-grade
A running vLLM server is not yet a production endpoint. Three things close the gap.
Autoscaling and GPU scheduling. The endpoint must add and drop replicas with load, and cold starts dominate that experience. Here is what we measured: in our testing, restoring a 9 GiB memory checkpoint cut startup to 2.25 seconds from S3 and 9 seconds from local NVMe, against a roughly 50-second full vLLM cold start on a g5.12xlarge. We also reduced machine boot time from 2 to 7 minutes down to under 30 seconds. Those numbers decide whether autoscaling the way we do for Llama 70B replica startup is viable or painful.
Observability. Export per-request latency, queue depth, and throughput, and hold them against explicit targets - the discipline in LLM serving goodput and latency SLOs.
Cost. The serving layer, not the silicon, usually sets the invoice; our CoreWeave alternatives analysis unpacks why, and LLM inference cost at scale models it end to end.
Benchmarking
Re-run your captured prompts against each configuration and record tokens-per-second, time-to-first-token, and cost-per-token. Cost-per-token is the number that reframes decisions: in a Cerebrium-run Llama 3 8B benchmark, Inferentia generated 1014 tokens at $0.000479 per second - roughly twice A10 performance at a lower price. Benchmark on your own prompts; synthetic token counts rarely match production traffic.
Migration checklist
Pin model, quantization, and a real-prompt regression set.
Confirm your client speaks OpenAI-compatible calls, nothing Ollama-specific.
Stand up vLLM single-GPU; pass the regression set.
Add tensor/pipeline parallelism only when the model demands it.
Enable continuous batching; apply quantization; re-benchmark.
Containerize; measure cold start; wire autoscaling.
Add metrics and SLOs; model cost-per-token before you launch.
Migrate in that order and each step is reversible, because the API seam never moves.
Frequently asked questions
- Can I keep using Ollama in production?
- Ollama is best kept for prototyping and local development. It gives you privacy and an API-first local server, but it lacks the continuous batching, horizontal autoscaling, and per-request observability a production GPU endpoint needs. Migrate the model to a production engine like vLLM or TGI while keeping the OpenAI-compatible API your client already calls.
- Do I have to rewrite my application code to migrate?
- No. Ollama exposes an OpenAI-compatible endpoint locally, and vLLM implements the same Completions and Chat APIs. If your client only uses the OpenAI dialect, migration is a backend swap: repoint from localhost:11434/v1 to your production server's /v1 and the request bodies stay identical.
- When should I move off a single GPU?
- vLLM's own guidance is that if the model fits on one GPU, distributed inference is unnecessary. Move to tensor parallelism when the model no longer fits in a single card's VRAM, and add pipeline parallelism across nodes only when the model is too large for one node.
- What is the single most impactful throughput optimization?
- Continuous batching. Instead of static batching, it processes multiple conversations in parallel and swaps each out as it finishes, which raises total throughput substantially for concurrent traffic. Pair it with quantization to reduce VRAM and increase tokens per second.
- Why do cold starts matter for a production endpoint?
- Autoscaling means replicas start on demand, and a slow cold start is felt as latency by real users. In our testing, memory-snapshot restore cut a roughly 50-second vLLM cold start to 2.25 seconds from S3, which is what makes aggressive autoscaling practical rather than painful.
Get started with Cerebrium
Deploy AI models on serverless GPUs in minutes, with no infrastructure to manage. Start for free and pay only for the compute you use.
Sources
- ollama.com
“Ollama is the most popular way to build with open models. Access the latest open models with complete privacy locally or in the cloud. Your prompts are never stored or trained on.”
Establishes Ollama as the correct prototyping starting point with privacy.
- collabnix.com
“Local Model Deployment: Models run entirely on your infrastructure, ensuring data privacy and reducing latency. API-First Architecture: RESTful API makes integration straightforward.”
What Ollama does right before the production ceiling.
- docs.ollama.com
“| API | Direct cloud access | Local Ollama server | | --- | --- | --- | | Ollama | `https://ollama.com/api` | `http://localhost:11434/api` | | OpenAI compatibility | `https://ollama.com/v1` | `http://localhost:11434/v1` | | Anthropic client base URL | `https://ollama.com` | `http://localhost:11434` |”
Ollama's OpenAI-compatible endpoint is the migration seam.
- docs.vllm.ai
“vLLM provides an HTTP server that implements OpenAI's [Completions API](https://platform.openai.com/docs/api-reference/completions), [Chat API](https://platform.openai.com/docs/api-reference/chat), and more!”
vLLM matches the same API surface, making migration a backend swap.
- docs.vllm.ai
“Single GPU (no distributed inference): if the model fits on a single GPU, distributed inference is probably unnecessary. Run inference on that GPU.”
Stand up vLLM on a single GPU first.
- docs.vllm.ai
“Multi-node multi-GPU using tensor parallel and pipeline parallel inference: if the model is too large for a single node, combine _tensor parallelism_ with _pipeline parallelism_. Set `tensor_parallel_size` to the number of GPUs per node and `pipeline_parallel_size` to the number of nodes.”
Scaling across GPUs and nodes.
- docs.vllm.ai
“The default distributed runtimes are [Ray](https://github.com/ray-project/ray) for multi-node inference and native Python `multiprocessing` for single-node inference.”
Runtime detail for distributed vLLM.
- huggingface.co
“Simple launcher to serve most popular LLMs, Production ready (distributed tracing with Open Telemetry, Prometheus metrics), Tensor Parallelism for faster inference on multiple GPUs, Token streaming using Server-Sent Events (SSE), Continuous batching of incoming requests for increased total throughput”
TGI as a production-ready engine option.
- huggingface.co
“One of the most impactful optimizations is **continuous batching**, which attempts to maximize performance by processing multiple conversations in parallel and swapping them out when they are done.”
The highest-impact throughput optimization.
- docs.nvidia.com
“Given a trained model, how do I deploy it at-scale with an optimal configuration using Triton Inference Server?”
Triton's role in at-scale deployment.
- cerebrium.ai
“Restoring from a 9 GiB checkpoint reduced startup to 2.25 seconds from S3 and 9 seconds from local NVMe.”
First-hand cold-start benchmark for autoscaling viability.
- cerebrium.ai
“From the moment we requested a machine to the moment it was ready to run user containers, the process could take anywhere from 2 to 7 minutes.”
Boot-time baseline before optimization.
- cerebrium.ai
“The result was a dramatic improvement: we reduced machine boot time from 2–7 minutes to under 30 seconds.”
Boot-time after optimization.
- cerebrium.ai
“Inferentia are able to generate 1014 tokens at a cost of $0.000479 per second.”
First-hand cost-per-token benchmark for the benchmarking section.