<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/">
  <channel>
    <title>VLLM · Jared Lynskey</title>
    <link>https://jared.lynskey.co.nz/en/tags/vllm/</link>
    <description>Short stories of value on software engineering and engineering leadership — performance reviews, hiring and scaling teams, CI/CD, DevOps monitoring and agentic AI. Written from Seoul.</description>
    <generator>Hugo</generator>
    <language>en</language>
    <copyright>© 2026 Jared Lynskey</copyright>
    <lastBuildDate>Fri, 30 Oct 2026 18:20:44 +0900</lastBuildDate>
    <atom:link href="https://jared.lynskey.co.nz/en/tags/vllm/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>vLLM vs Ollama: When to Use Each for Self-Hosted LLMs</title>
      <link>https://jared.lynskey.co.nz/en/posts/2026/2026-10-30-vllm-vs-ollama/</link>
      <guid isPermaLink="true">https://jared.lynskey.co.nz/en/posts/2026/2026-10-30-vllm-vs-ollama/</guid>
      <pubDate>Fri, 30 Oct 2026 00:00:00 +1300</pubDate>
      <dc:creator>Jared Lynskey</dc:creator>
      <category>vLLM</category>
      <category>Ollama</category>
      <category>LLM</category>
      <category>Self-Hosted</category>
      <category>MLOps</category>
      <category>DevOps</category>
      <category>Docker</category>
      <category>Kubernetes</category>
      <description>vLLM vs Ollama from running both: Ollama for a laptop or a one-person tool, vLLM for serving many requests from a GPU server. How to install each, Docker and Kubernetes setups, and what bit me.</description>
      <content:encoded><![CDATA[<p>Use Ollama when one person, or one app on one machine, needs a model running in a few minutes. Use vLLM when a GPU server has to answer lots of requests at once and throughput matters. Ollama is a model runner: it pulls a quantised model, loads it when you ask for it and lets it go when you stop. vLLM is an inference server: it takes most of a GPU at startup and keeps it busy by batching every request in flight. Both speak the OpenAI API, so the code that calls them can be identical.</p>
<p>I use both every day. Ollama runs on my laptop and on the GPU workstation in the office, for development and for my own tools. vLLM serves a chat model from a single 96 GB GPU for a freelance project, first under Docker Compose and now in a small Kubernetes cluster. This post covers what each one is good at, how to install them, and the things that cost me time on the vLLM side.</p>

<h2 class="relative group">vLLM vs Ollama at a glance
    <div id="vllm-vs-ollama-at-a-glance" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#vllm-vs-ollama-at-a-glance" aria-label="Anchor">#</a>
    </span>
    
</h2>
<table>
	<thead>
			<tr>
					<th></th>
					<th>Ollama</th>
					<th>vLLM</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>Best for</td>
					<td>One user: a laptop, a dev box, a personal tool</td>
					<td>Many users or a busy app, on a GPU server</td>
			</tr>
			<tr>
					<td>Runs on</td>
					<td>macOS, Linux, Windows; Apple silicon, NVIDIA, AMD, or CPU</td>
					<td>Linux with an NVIDIA GPU is the smooth path; other hardware works with more effort</td>
			</tr>
			<tr>
					<td>Models</td>
					<td>Quantised GGUF from its own library (<code>qwen3:8b</code>)</td>
					<td>Hugging Face weights in BF16, FP8, AWQ or GPTQ (<code>Qwen/Qwen3-8B</code>)</td>
			</tr>
			<tr>
					<td>Install</td>
					<td>An installer, then <code>ollama run</code></td>
					<td><code>pip install vllm</code>, or the <code>vllm/vllm-openai</code> Docker image</td>
			</tr>
			<tr>
					<td>GPU memory</td>
					<td>Loads a model on first use, unloads it after 5 idle minutes</td>
					<td>Reserves a fixed share of the card at startup (over 90% by default) and keeps it</td>
			</tr>
			<tr>
					<td>Many requests at once</td>
					<td>A few parallel slots</td>
					<td>Continuous batching; this is what it&rsquo;s for</td>
			</tr>
			<tr>
					<td>Startup</td>
					<td>Seconds for a small model</td>
					<td>Minutes for a large one</td>
			</tr>
			<tr>
					<td>LoRA adapters</td>
					<td>Baked into a new model with a Modelfile</td>
					<td>Several per server, chosen per request</td>
			</tr>
			<tr>
					<td>API</td>
					<td>Its own, plus OpenAI-compatible at <code>:11434/v1</code></td>
					<td>OpenAI-compatible at <code>:8000/v1</code></td>
			</tr>
	</tbody>
</table>

<h2 class="relative group">What Ollama is
    <div id="what-ollama-is" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#what-ollama-is" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>Ollama is the easiest way I know to get a model answering on your own machine. It grew out of llama.cpp and runs quantised GGUF models, which is why an 8B model fits in about 5 GB and runs happily on a MacBook. You pull a model by name, it loads the first time you call it, and it drops out of memory after five minutes with nothing to do, so it shares a machine politely with everything else you have running.</p>
<p>That politeness is the trade-off. Ollama is built around one person at a time. It can answer a few requests in parallel, but every parallel slot costs memory, and it was never meant to batch dozens of users onto one GPU.</p>

<h2 class="relative group">What vLLM is
    <div id="what-vllm-is" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#what-vllm-is" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>vLLM is a serving engine, and it&rsquo;s built for exactly that batching. Two ideas carry most of the weight. PagedAttention stores each request&rsquo;s KV cache (the attention state a model builds up as it reads and writes tokens) in small fixed-size blocks, so GPU memory isn&rsquo;t lost to padding and fragmentation. Continuous batching lets new requests join the batch between generation steps instead of waiting for the current batch to finish. Between them, one GPU running vLLM serves far more concurrent users than the same GPU working through requests one at a time.</p>
<p>The cost is that vLLM behaves as if it owns the card. It claims its share of GPU memory when it starts, fills whatever the weights don&rsquo;t need with KV cache, and holds all of it whether anyone is calling or not. It also wants full Hugging Face weights or a GPU-friendly quantisation like FP8, not the GGUF files Ollama uses.</p>

<h2 class="relative group">One API, two servers
    <div id="one-api-two-servers" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#one-api-two-servers" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>Because both expose the OpenAI chat completions API, my code doesn&rsquo;t know which one it&rsquo;s talking to. The URL and model name come from the environment:</p>
<div class="highlight-wrapper"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">os</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">openai</span> <span class="kn">import</span> <span class="n">OpenAI</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Laptop:     LLM_URL=http://localhost:11434/v1  LLM_MODEL=qwen3:8b</span>
</span></span><span class="line"><span class="cl"><span class="c1"># GPU server: LLM_URL=http://localhost:8000/v1   LLM_MODEL=qwen3-8b</span>
</span></span><span class="line"><span class="cl"><span class="n">client</span> <span class="o">=</span> <span class="n">OpenAI</span><span class="p">(</span><span class="n">base_url</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s2">&#34;LLM_URL&#34;</span><span class="p">],</span> <span class="n">api_key</span><span class="o">=</span><span class="s2">&#34;not-needed&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">reply</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">chat</span><span class="o">.</span><span class="n">completions</span><span class="o">.</span><span class="n">create</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="n">model</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s2">&#34;LLM_MODEL&#34;</span><span class="p">],</span>
</span></span><span class="line"><span class="cl">    <span class="n">messages</span><span class="o">=</span><span class="p">[{</span><span class="s2">&#34;role&#34;</span><span class="p">:</span> <span class="s2">&#34;user&#34;</span><span class="p">,</span> <span class="s2">&#34;content&#34;</span><span class="p">:</span> <span class="s2">&#34;Say hello in Korean.&#34;</span><span class="p">}],</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">reply</span><span class="o">.</span><span class="n">choices</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">message</span><span class="o">.</span><span class="n">content</span><span class="p">)</span></span></span></code></pre></div></div>
<p>On my laptop, which has no big GPU, the app points at Ollama. On the server it points at vLLM. Nothing else changes, and the app can be developed without the GPU box switched on at all. On the vLLM side, <code>--served-model-name</code> gives the model a short name, so clients don&rsquo;t have to send the full Hugging Face path.</p>
<p>One caution, because it&rsquo;s easy to forget: the same model on both doesn&rsquo;t give the same answers. Ollama&rsquo;s <code>qwen3:8b</code> is a 4-bit quantisation, while on vLLM you&rsquo;d usually run 16-bit or FP8 weights. A prompt tuned against one can behave differently on the other, so anything you&rsquo;re measuring, whether that&rsquo;s answer quality, refusals or whether the JSON parses, has to be checked against the server production will actually use.</p>

<h2 class="relative group">How to install Ollama
    <div id="how-to-install-ollama" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#how-to-install-ollama" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>On a Mac or Windows, download the app from ollama.com. On Linux:</p>
<div class="highlight-wrapper"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">curl -fsSL https://ollama.com/install.sh <span class="p">|</span> sh
</span></span><span class="line"><span class="cl">ollama run qwen3:8b</span></span></code></pre></div></div>
<p>That&rsquo;s the whole job. The API is now at <code>http://localhost:11434</code>, and it only listens on localhost unless you set <code>OLLAMA_HOST</code>, which is what you want. Mine runs on the office workstation bound to <code>127.0.0.1</code>, and I reach it from anywhere through a tunnel (<a href="https://jared.lynskey.co.nz/en/posts/2026/2026-10-01-cloudflare-warp-dev-network/" >how I set that up with Cloudflare WARP</a>).</p>

<h2 class="relative group">How to install vLLM
    <div id="how-to-install-vllm" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#how-to-install-vllm" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>On Linux with an NVIDIA GPU and a recent driver:</p>
<div class="highlight-wrapper"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">python -m venv .venv <span class="o">&amp;&amp;</span> <span class="nb">source</span> .venv/bin/activate
</span></span><span class="line"><span class="cl">pip install vllm
</span></span><span class="line"><span class="cl">vllm serve Qwen/Qwen3-8B --served-model-name qwen3-8b --max-model-len <span class="m">16384</span></span></span></code></pre></div></div>
<p>The first run downloads the weights from Hugging Face. Once the log says <code>Application startup complete</code>, <code>curl localhost:8000/v1/models</code> lists the model, and the Python above works against it.</p>

<h2 class="relative group">Running vLLM in Docker
    <div id="running-vllm-in-docker" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#running-vllm-in-docker" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>For anything that has to stay up, I use the official image rather than a pip install, mostly so CUDA, PyTorch and vLLM come pinned together. A generic Compose service:</p>
<div class="highlight-wrapper"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">services</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">vllm</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">image</span><span class="p">:</span><span class="w"> </span><span class="l">vllm/vllm-openai:v0.30.0  </span><span class="w"> </span><span class="c"># pin a tag; the image is about 30 GB</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">restart</span><span class="p">:</span><span class="w"> </span><span class="l">unless-stopped</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">ipc</span><span class="p">:</span><span class="w"> </span><span class="l">host                         </span><span class="w"> </span><span class="c"># PyTorch needs shared memory</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">command</span><span class="p">:</span><span class="w"> </span><span class="p">&gt;</span><span class="sd">
</span></span></span><span class="line"><span class="cl"><span class="sd">      --model Qwen/Qwen3-8B
</span></span></span><span class="line"><span class="cl"><span class="sd">      --served-model-name qwen3-8b
</span></span></span><span class="line"><span class="cl"><span class="sd">      --gpu-memory-utilization 0.85
</span></span></span><span class="line"><span class="cl"><span class="sd">      --max-model-len 16384</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">volumes</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="l">${HOME}/.cache/huggingface:/root/.cache/huggingface</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">ports</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="s2">&#34;127.0.0.1:8000:8000&#34;</span><span class="w">          </span><span class="c"># reach it over ssh -L, not the LAN</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">deploy</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="nt">resources</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="nt">reservations</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">          </span><span class="nt">devices</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">            </span>- <span class="nt">driver</span><span class="p">:</span><span class="w"> </span><span class="l">nvidia</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">              </span><span class="nt">count</span><span class="p">:</span><span class="w"> </span><span class="l">all</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">              </span><span class="nt">capabilities</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="l">gpu]</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">healthcheck</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="nt">test</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">&#34;CMD&#34;</span><span class="p">,</span><span class="w"> </span><span class="s2">&#34;python3&#34;</span><span class="p">,</span><span class="w"> </span><span class="s2">&#34;-c&#34;</span><span class="p">,</span><span class="w"> </span><span class="s2">&#34;import urllib.request; urllib.request.urlopen(&#39;http://localhost:8000/health&#39;)&#34;</span><span class="p">]</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="nt">interval</span><span class="p">:</span><span class="w"> </span><span class="l">10s</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="nt">timeout</span><span class="p">:</span><span class="w"> </span><span class="l">5s</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="nt">retries</span><span class="p">:</span><span class="w"> </span><span class="m">90</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="nt">start_period</span><span class="p">:</span><span class="w"> </span><span class="l">120s</span></span></span></code></pre></div></div>
<p>Pin the tag. vLLM moves quickly, flags and defaults change between releases, and you want to be the one who decides when that happens. <code>ipc: host</code> (or a generous <code>shm_size</code>) is in vLLM&rsquo;s own Docker instructions. The long <code>start_period</code> is the first of the things below.</p>

<h2 class="relative group">What bit me running vLLM
    <div id="what-bit-me-running-vllm" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#what-bit-me-running-vllm" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p><strong>Startup takes minutes.</strong> Loading the weights, compiling and capturing CUDA graphs took 190 seconds on my server, and three to five minutes is normal for a large model. A health check written for a web app will kill it before it&rsquo;s ready. In Compose that means a long <code>start_period</code>; in Kubernetes it means a startup probe. It also means every restart is a few minutes with no model, so restarts shouldn&rsquo;t be casual.</p>
<p><strong>It takes the GPU memory you give it, at startup.</strong> <code>--gpu-memory-utilization</code> is the share of the card vLLM may use, 0.92 by default in recent releases, and whatever the weights don&rsquo;t need becomes KV cache. That&rsquo;s fine when vLLM is alone on the card. Mine isn&rsquo;t, because smaller models run beside it, so I set 0.70 on the 96 GB card. The model, a 35B mixture-of-experts in FP8, loaded at 47.7 GiB and left 15 GiB for KV cache, which is plenty at a 16k context. If vLLM refuses to start because the maximum sequence length won&rsquo;t fit in the KV cache, lower <code>--max-model-len</code> before you go looking for a bigger GPU.</p>
<p><strong>LoRA slots cost memory up front.</strong> vLLM can serve one base model with several LoRA adapters and switch between them per request, by model name, which Ollama can&rsquo;t really do. But it reserves room for <code>--max-loras</code> adapters at <code>--max-lora-rank</code> when it starts, and on a mixture-of-experts model that reservation covers the experts too, so it adds up fast. Four adapters at rank 64 didn&rsquo;t fit at 0.70. Two did.</p>
<p><strong>The default sequence limit didn&rsquo;t suit a hybrid model.</strong> The model I serve mixes Mamba-style layers in with attention, and each sequence needs its own cache block for those layers. At vLLM&rsquo;s default <code>--max-num-seqs</code> on that card it failed to start; <code>--max-num-seqs 256</code> fixed it. If a newer architecture won&rsquo;t start, check this flag before anything more exotic.</p>
<p><strong>A Kubernetes Service named <code>vllm</code> crashes vLLM.</strong> This one&rsquo;s my favourite. Kubernetes injects environment variables for every Service in the namespace, named after the Service, so a Service called <code>vllm</code> hands every pod <code>VLLM_PORT=tcp://&lt;cluster-ip&gt;:8000</code>. vLLM reads <code>VLLM_PORT</code> as one of its own settings, couldn&rsquo;t make sense of a URL there, and died. After loading the whole model, naturally, so every attempt cost three minutes. vLLM&rsquo;s docs warn about this, which I found afterwards. The fix is <code>enableServiceLinks: false</code> on the pod, or a Service with a different name.</p>
<p>Here&rsquo;s the shape of a Deployment that works, cut down to the parts that matter:</p>
<div class="highlight-wrapper"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">apiVersion</span><span class="p">:</span><span class="w"> </span><span class="l">apps/v1</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="nt">kind</span><span class="p">:</span><span class="w"> </span><span class="l">Deployment</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="nt">metadata</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l">vllm</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="nt">spec</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">replicas</span><span class="p">:</span><span class="w"> </span><span class="m">1</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">strategy</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l">Recreate              </span><span class="w"> </span><span class="c"># the old pod has to free the GPU first</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">selector</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">matchLabels</span><span class="p">:</span><span class="w"> </span>{<span class="nt">app</span><span class="p">:</span><span class="w"> </span><span class="l">vllm}</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">template</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">metadata</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="nt">labels</span><span class="p">:</span><span class="w"> </span>{<span class="nt">app</span><span class="p">:</span><span class="w"> </span><span class="l">vllm}</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">spec</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="nt">enableServiceLinks</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="w">  </span><span class="c"># no VLLM_PORT=tcp://... from the Service</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="nt">containers</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span>- <span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l">vllm</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">          </span><span class="nt">image</span><span class="p">:</span><span class="w"> </span><span class="l">vllm/vllm-openai:v0.30.0</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">          </span><span class="nt">args</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">&#34;--model=Qwen/Qwen3-8B&#34;</span><span class="p">,</span><span class="w"> </span><span class="s2">&#34;--served-model-name=qwen3-8b&#34;</span><span class="p">]</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">          </span><span class="nt">resources</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">            </span><span class="nt">limits</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">              </span><span class="nt">nvidia.com/gpu</span><span class="p">:</span><span class="w"> </span><span class="s2">&#34;1&#34;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">              </span><span class="nt">memory</span><span class="p">:</span><span class="w"> </span><span class="l">32Gi      </span><span class="w"> </span><span class="c"># loading needs far more host RAM than serving</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">          </span><span class="nt">volumeMounts</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">            </span>- {<span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="nt">shm, mountPath</span><span class="p">:</span><span class="w"> </span><span class="l">/dev/shm}</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">          </span><span class="nt">startupProbe</span><span class="p">:</span><span class="w">          </span><span class="c"># don&#39;t judge it until the model is loaded</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">            </span><span class="nt">httpGet</span><span class="p">:</span><span class="w"> </span>{<span class="nt">path</span><span class="p">:</span><span class="w"> </span><span class="nt">/health, port</span><span class="p">:</span><span class="w"> </span><span class="m">8000</span>}<span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">            </span><span class="nt">initialDelaySeconds</span><span class="p">:</span><span class="w"> </span><span class="m">120</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">            </span><span class="nt">periodSeconds</span><span class="p">:</span><span class="w"> </span><span class="m">10</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">            </span><span class="nt">failureThreshold</span><span class="p">:</span><span class="w"> </span><span class="m">90</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">          </span><span class="nt">livenessProbe</span><span class="p">:</span><span class="w">         </span><span class="c"># a restart costs a full reload, so be patient</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">            </span><span class="nt">httpGet</span><span class="p">:</span><span class="w"> </span>{<span class="nt">path</span><span class="p">:</span><span class="w"> </span><span class="nt">/health, port</span><span class="p">:</span><span class="w"> </span><span class="m">8000</span>}<span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">            </span><span class="nt">periodSeconds</span><span class="p">:</span><span class="w"> </span><span class="m">30</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">            </span><span class="nt">timeoutSeconds</span><span class="p">:</span><span class="w"> </span><span class="m">5</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">            </span><span class="nt">failureThreshold</span><span class="p">:</span><span class="w"> </span><span class="m">10</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="nt">volumes</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span>- <span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l">shm</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">          </span><span class="nt">emptyDir</span><span class="p">:</span><span class="w"> </span>{<span class="nt">medium</span><span class="p">:</span><span class="w"> </span><span class="nt">Memory, sizeLimit</span><span class="p">:</span><span class="w"> </span><span class="l">16Gi}</span></span></span></code></pre></div></div>
<p>The probes are the part worth copying. The startup probe waits two minutes, then gives the model another fifteen to come up before Kubernetes calls it dead. The liveness probe only restarts it after about five minutes of failures, because <code>/health</code> can be slow on a busy engine and a restart costs a full reload anyway. <code>Recreate</code> matters on a single GPU: a rolling update starts the new pod first, and it sits there waiting for a GPU the old pod still holds. The memory limit looks generous because it is; mine settles at about 7 GiB of host RAM once the weights are on the GPU, but the load itself needs a lot more.</p>

<h2 class="relative group">What to know about Ollama
    <div id="what-to-know-about-ollama" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#what-to-know-about-ollama" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>Fewer surprises, mostly because it does less.</p>
<p>The first request after a quiet spell is slow, because the model was unloaded and has to load again. <code>OLLAMA_KEEP_ALIVE</code> sets how long a model stays in memory after its last request; raise it if that pause annoys you, or set it to <code>-1</code> on a machine that does nothing else.</p>
<p>The context window depends on how much GPU memory you have. Under 24 GiB, Ollama defaults to 4k tokens, far less than most models support, and a prompt that doesn&rsquo;t fit is trimmed quietly rather than refused. If answers seem to ignore the start of a long prompt, set <code>OLLAMA_CONTEXT_LENGTH</code> (or <code>num_ctx</code> per request) to what you actually need.</p>
<p>If you forward a remote Ollama to your laptop, don&rsquo;t put it on 11434. That&rsquo;s Ollama&rsquo;s default port, and if a local Ollama ever starts, the two race for it and you can end up talking to the wrong one without noticing. I forward mine to 11435.</p>
<p>And it isn&rsquo;t a multi-user server. It&rsquo;s fine for an internal tool a handful of people use; once real concurrency turns up, that&rsquo;s the point to move to vLLM.</p>

<h2 class="relative group">How much GPU memory you need
    <div id="how-much-gpu-memory-you-need" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#how-much-gpu-memory-you-need" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>Rough sizes for the weights alone:</p>
<table>
	<thead>
			<tr>
					<th>Model size</th>
					<th>16-bit (BF16)</th>
					<th>8-bit (FP8)</th>
					<th>4-bit GGUF (Q4_K_M)</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>8B</td>
					<td>~16 GB</td>
					<td>~8 GB</td>
					<td>~5 GB</td>
			</tr>
			<tr>
					<td>32B</td>
					<td>~64 GB</td>
					<td>~32 GB</td>
					<td>~20 GB</td>
			</tr>
			<tr>
					<td>70B</td>
					<td>~140 GB</td>
					<td>~70 GB</td>
					<td>~43 GB</td>
			</tr>
	</tbody>
</table>
<p>That&rsquo;s about 2 bytes per parameter at 16-bit, 1 at 8-bit, and a little over half a byte at Q4_K_M. On top of the weights goes the KV cache, which grows with context length and with how many requests are in flight. That second part is why the same model needs much more memory on vLLM serving fifty users than on Ollama serving you.</p>

<h2 class="relative group">Which one to use
    <div id="which-one-to-use" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#which-one-to-use" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>If you want a model on your own machine, install Ollama and stop there; you&rsquo;ll have something answering in ten minutes. If you have a GPU server and users, or an app, that will call it all day, use vLLM, accept the slow start and the memory it takes, and get the probes right. Plenty of setups end up with both, mine included: Ollama where the code gets written, vLLM where the requests land.</p>
<p>There are other options. SGLang is the usual alternative to vLLM, but I haven&rsquo;t run it in production, so I&rsquo;ve left it out rather than guess. And if the model has to run on a phone, that&rsquo;s llama.cpp again, which I wrote about in <a href="https://jared.lynskey.co.nz/en/posts/2026/2026-01-30-on-device-ai/" >running an LLM on-device in React Native</a>.</p>
]]></content:encoded>
      <media:content url="https://jared.lynskey.co.nz/en/posts/2026/2026-10-30-vllm-vs-ollama/featured.jpg" medium="image" type="image/jpeg" />
    </item>
  </channel>
</rss>
