<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Serving Models on AI Vault</title><link>https://namphuongtran.github.io/ai-vault/building/serving-models/</link><description>Recent content in Serving Models on AI Vault</description><generator>Hugo</generator><language>en</language><atom:link href="https://namphuongtran.github.io/ai-vault/building/serving-models/index.xml" rel="self" type="application/rss+xml"/><item><title>Local vs Cloud</title><link>https://namphuongtran.github.io/ai-vault/building/serving-models/local-vs-cloud/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://namphuongtran.github.io/ai-vault/building/serving-models/local-vs-cloud/</guid><description>&lt;p&gt;&lt;em&gt;The gate for this whole section.&lt;/em&gt;&lt;/p&gt;&#10;&lt;h2 id="goal"&gt;Goal&lt;/h2&gt;&#10;&lt;p&gt;Decide honestly whether to self-host an open model or stay on a managed API. This is the most&#10;expensive decision in the section, it is usually made for the wrong reason, and every other&#10;page here only matters if you answer &amp;ldquo;self-host.&amp;rdquo;&lt;/p&gt;&#10;&lt;h2 id="the-three-options"&gt;The three options&lt;/h2&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Option&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;What you run&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;What you pay for&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Scales by&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;strong&gt;Managed API&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Nothing&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Tokens&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Someone else&amp;rsquo;s problem&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;strong&gt;Managed open model&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Nothing; an open model on a provider&amp;rsquo;s GPUs&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Tokens, or GPU-hours&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Provider autoscaling&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;strong&gt;Self-hosted&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Weights, engine, GPUs, the lot&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;GPU-hours, whether or not you use them&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;You, deliberately&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;p&gt;The middle row is the one people forget. Providers serve open weights per-token, which gets you&#10;model choice and portability without owning a single GPU. &lt;strong&gt;It is the right first step away&#10;from a closed API — not a jump straight to your own cluster.&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Quantization</title><link>https://namphuongtran.github.io/ai-vault/building/serving-models/quantization/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://namphuongtran.github.io/ai-vault/building/serving-models/quantization/</guid><description>&lt;p&gt;&lt;em&gt;How a model that needs 140 GB runs on a 48 GB card.&lt;/em&gt;&lt;/p&gt;&#10;&lt;h2 id="goal"&gt;Goal&lt;/h2&gt;&#10;&lt;p&gt;Understand the one lever that decides whether a model fits your hardware at all, what it costs&#10;you in quality, and which of the confusing format names — AWQ, GPTQ, GGUF — you actually need.&lt;/p&gt;&#10;&lt;h2 id="what-it-is"&gt;What it is&lt;/h2&gt;&#10;&lt;p&gt;A model&amp;rsquo;s weights are numbers. Training produces them at high precision; &lt;strong&gt;inference rarely&#10;needs that precision&lt;/strong&gt;. Quantization stores each weight in fewer bits — 16 down to 8, or 4 —&#10;and dequantizes on the fly during the matrix multiplications.&lt;/p&gt;</description></item><item><title>Serving Engines</title><link>https://namphuongtran.github.io/ai-vault/building/serving-models/serving-engines/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://namphuongtran.github.io/ai-vault/building/serving-models/serving-engines/</guid><description>&lt;p&gt;&lt;em&gt;Why the same GPU serves 5 users or 100, depending on the software in front of it.&lt;/em&gt;&lt;/p&gt;&#10;&lt;h2 id="goal"&gt;Goal&lt;/h2&gt;&#10;&lt;p&gt;Understand what a serving engine actually does, why it is worth 5–20× the throughput of a&#10;straightforward generation loop, and how to choose between the three engines that matter.&lt;/p&gt;&#10;&lt;h2 id="the-two-phases-of-a-request"&gt;The two phases of a request&lt;/h2&gt;&#10;&lt;p&gt;Every generation splits into two phases with completely different performance characters, and&#10;almost everything an engine does follows from this split:&lt;/p&gt;</description></item><item><title>Load Balancing &amp; Queuing</title><link>https://namphuongtran.github.io/ai-vault/building/serving-models/load-balancing-queuing/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://namphuongtran.github.io/ai-vault/building/serving-models/load-balancing-queuing/</guid><description>&lt;p&gt;&lt;em&gt;The front door, and what it does when too many people arrive.&lt;/em&gt;&lt;/p&gt;&#10;&lt;h2 id="goal"&gt;Goal&lt;/h2&gt;&#10;&lt;p&gt;Keep a fleet of model replicas fast and honest under bursty traffic: decide what to admit, what&#10;to queue, what to reject, and which replica each request should go to. This page deepens&#10;&lt;a href="https://namphuongtran.github.io/ai-vault/building/scaling-to-production/"&gt;§Queues and async&lt;/a&gt; for the self-hosted case.&lt;/p&gt;&#10;&lt;h2 id="why-the-usual-load-balancer-is-wrong-here"&gt;Why the usual load balancer is wrong here&lt;/h2&gt;&#10;&lt;p&gt;A web load balancer assumes requests are short, cheap, and interchangeable. Model requests are&#10;none of those:&lt;/p&gt;</description></item><item><title>Routing &amp; Fallback</title><link>https://namphuongtran.github.io/ai-vault/building/serving-models/routing-and-fallback/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://namphuongtran.github.io/ai-vault/building/serving-models/routing-and-fallback/</guid><description>&lt;p&gt;&lt;em&gt;The two patterns every production AI app needs — self-hosted or not.&lt;/em&gt;&lt;/p&gt;&#10;&lt;h2 id="goal"&gt;Goal&lt;/h2&gt;&#10;&lt;p&gt;Stop treating &amp;ldquo;the model&amp;rdquo; as one fixed dependency. Route each request to the cheapest model&#10;that can handle it, and degrade gracefully when a model is overloaded, rate-limited, or gone.&#10;This page deepens &lt;a href="https://namphuongtran.github.io/ai-vault/building/scaling-to-production/"&gt;§Reliability&lt;/a&gt; and applies&#10;unchanged whether you self-host or call a managed API.&lt;/p&gt;&#10;&lt;h2 id="the-gateway"&gt;The gateway&lt;/h2&gt;&#10;&lt;p&gt;Both patterns live in one place: a &lt;strong&gt;model gateway&lt;/strong&gt; between your app and every model, so that&#10;&amp;ldquo;which model answers&amp;rdquo; becomes a policy decision rather than a constant scattered through your&#10;code.&lt;/p&gt;</description></item></channel></rss>