<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Deployed Lab]]></title><description><![CDATA[Plain-language, hands-on articles on AI engineering and the forward deployed engineer role: how LLMs work, how much GPU memory a model needs, RAG, embeddings, a]]></description><link>https://deployedlab.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6afb74564523ddb00ebb7d8b/f8bdd045-0a38-4a3f-94df-c4b2272f8248.png</url><title>Deployed Lab</title><link>https://deployedlab.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Mon, 30 Nov 2026 22:40:25 GMT</lastBuildDate><atom:link href="https://deployedlab.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Why message 50 of your chatbot costs 19x more than message 1]]></title><description><![CDATA[Tokens and context windows in plain language, with one worked example of why long chats get expensive.]]></description><link>https://deployedlab.hashnode.dev/why-message-50-of-your-chatbot-costs-19x-more-than-message-1</link><guid isPermaLink="true">https://deployedlab.hashnode.dev/why-message-50-of-your-chatbot-costs-19x-more-than-message-1</guid><dc:creator><![CDATA[DeployedLab]]></dc:creator><pubDate>Wed, 18 Nov 2026 03:16:49 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6afb74564523ddb00ebb7d8b/ba480b9d-516a-4e7a-8c29-7942b3af4eae.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>You build a chatbot and quote the cost of one short message. The real bill arrives, and it is far higher. The reason is two ideas: tokens, and the context window. Here is the arithmetic.</p>
<p>All numbers below are made up for illustration.</p>
<h2>What is a token?</h2>
<p>A model does not read whole words. It reads tokens: a short word, part of a long word, a piece of a number, or a punctuation mark. A tokenizer cuts your text into these pieces before the model sees it.</p>
<ul>
<li>Rule of thumb for English: one token is about four characters, so a 500-word page is roughly 700 tokens.</li>
<li>Code, numbers and non-English text need more tokens for the same meaning, so they cost more.</li>
<li>Repeated words are counted every time. You pay for both copies.</li>
<li>Each model has its own tokenizer, so the same text has different counts in different models. Use the AI company's own counter when the count matters.</li>
</ul>
<h2>What is a context window?</h2>
<p>Think of it as the model's desk, counted in tokens. Everything for one request must fit on it at once:</p>
<ul>
<li>The system prompt</li>
<li>The chat so far</li>
<li>Your documents</li>
<li>Your question</li>
<li>Room for the answer</li>
</ul>
<p>If the total is too big, the request fails with a length error. The model also keeps nothing between requests, so the app fills the desk again every time.</p>
<h2>Worked example: message 50 vs message 1</h2>
<p>Because the app re-sends the history with each new message, a long chat gets heavier with every turn. Assume:</p>
<ul>
<li>The system prompt is 500 tokens.</li>
<li>Each turn adds 200 tokens: a 40-token message plus a 160-token reply.</li>
</ul>
<p>Message 1 sends:</p>
<pre><code class="language-plaintext">500 + 40 = 540 tokens
</code></pre>
<p>Before message 50 there are 49 old turns:</p>
<pre><code class="language-plaintext">49 x 200 = 9,800 tokens
</code></pre>
<p>Message 50 sends:</p>
<pre><code class="language-plaintext">500 + 9,800 + 40 = 10,340 tokens
</code></pre>
<p>Compare them:</p>
<pre><code class="language-plaintext">10,340 / 540 = about 19
</code></pre>
<p>The customer types about the same amount each time. The same short question sends about 19 times more input, and input is billed per token on every request.</p>
<p>The same pattern at other points in the chat: 2,340 tokens at message 10, and 5,340 at message 25.</p>
<h2>What to do about it</h2>
<p>A bigger window only delays the problem, because cost and waiting time grow with the size of what you send. Send less, but better:</p>
<ul>
<li>Retrieval: search first, then send only the few best passages instead of everything.</li>
<li>Trim history: keep recent turns, replace older ones with a short summary, and drop what the next answer does not need.</li>
<li>Budget each category (system prompt, history, documents, question, answer) separately. The bill shows only a total, and the total does not tell you what to cut.</li>
<li>Plan for your longest chats, not the average one. History is re-sent, so a few very long chats cost the most.</li>
</ul>
<h2>Caveats</h2>
<ul>
<li>The numbers here are made up. Your system prompt, turn length and window size will differ.</li>
<li>Real tokenizers cut text in other places than any simple rule. The rule of thumb is a rough guide.</li>
<li>Replies often cost more per token than input. Check your provider's price list rather than assuming.</li>
<li>Reserving room for the answer matters. If input plus the reserved answer is bigger than the window, something must be trimmed.</li>
</ul>
<h2>Go deeper</h2>
<p>This article is a short version of Chapter 7 of <a href="https://deployedlab.dev">Deployed Lab</a>. The interactive chapter has a tokenizer you can type into, a slider tool to spend a 32,000-token window across five parts, and a short quiz. It is free with no signup: <a href="https://deployedlab.dev/lessons/07-tokens-and-context">Tokens and context windows</a>. Deployed Lab is a course on AI engineering and the forward deployed engineer role.</p>
]]></content:encoded></item><item><title><![CDATA[What does a forward deployed engineer actually do?]]></title><description><![CDATA[A plain-language look at the forward deployed engineer (FDE) role, how it differs from an SDE, solutions engineer or consultant, and one worked example of…]]></description><link>https://deployedlab.hashnode.dev/what-does-a-forward-deployed-engineer-actually-do</link><guid isPermaLink="true">https://deployedlab.hashnode.dev/what-does-a-forward-deployed-engineer-actually-do</guid><category><![CDATA[Forward-Deployed Engineer]]></category><category><![CDATA[AI]]></category><dc:creator><![CDATA[DeployedLab]]></dc:creator><pubDate>Mon, 16 Nov 2026 21:40:13 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6afb74564523ddb00ebb7d8b/988d0d4b-4a3c-49c8-8e37-d42dbc18e59c.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A forward deployed engineer (FDE) is a software builder who works inside a customer's business and stays until the software really works. The picture to remember: the FDE is the chef who cooks in your kitchen.</p>
<p>Here is what that means in practice, with one worked example.</p>
<h2>Four jobs, one kitchen</h2>
<p>Four jobs touch software and customers, and people mix them up:</p>
<ul>
<li><strong>Software engineer (SDE):</strong> designs the recipe and the big factory kitchen, for thousands of customers.</li>
<li><strong>Solutions engineer:</strong> does the tasting demo at the trade show and helps close the sale.</li>
<li><strong>Consultant:</strong> writes a report on how your kitchen should run. Someone else does the cooking.</li>
<li><strong>FDE:</strong> walks into your kitchen, cooks with your ingredients, fixes the oven and trains your staff.</li>
</ul>
<p>The FDE is the only one who is high on both customer time and responsibility if it breaks, while still writing real code. Those bars are an illustrative picture, not measured data.</p>
<p>One more thing: a real FDE carries what worked back to the company, so the product gets better for everyone.</p>
<h2>Five stages of a project</h2>
<ol>
<li><strong>Discover:</strong> watch how the work really happens.</li>
<li><strong>Proof of concept:</strong> build the smallest thing that shows the idea works.</li>
<li><strong>Pilot:</strong> a small real trial with real users and real data.</li>
<li><strong>Production:</strong> the real thing people depend on.</li>
<li><strong>Expand:</strong> the next team asks for one too.</li>
</ol>
<p>Projects commonly stall between the demo and production. A demo runs on clean sample data and skips access rules, alarms and ownership. Closing that gap is a large part of what customers pay an FDE for.</p>
<h2>Worked example: turn a wish into a number</h2>
<p>A made-up delivery company has 6 planners. The VP says, "We need AI for our supply chain." That is a wish, not a problem. So in Discover you ask what goes wrong today. The answer: planners spend about 4 hours a day phoning carriers to find late shipments.</p>
<p>Now measure it:</p>
<ul>
<li>One planner: 4 hours a day.</li>
<li>6 planners: 6 x 4 = 24 hours a day.</li>
<li>5 days a week: 24 x 5 = <strong>120 hours a week</strong>. This is the baseline.</li>
<li>Goal, cut chasing in half: 120 / 2 = <strong>60 hours saved</strong>. This is a guess to agree with the VP.</li>
<li>One full-time person is about 40 hours: 60 / 40 = <strong>1.5 people's time</strong>.</li>
</ul>
<p>You leave Discover with four things: a problem (late shipments found too slowly), a user (the planners), a baseline (120 hours a week) and a champion (a person at the customer who wants it to work). Notice that you never had to say "AI" or "no".</p>
<h2>Why learn it now</h2>
<p>Snapshot of public job boards, 15 November 2026. Posted base salary only:</p>
<ul>
<li>367 open FDE-style roles across 10 companies.</li>
<li>Pay is listed on only some postings: 144 of the 367 give US-dollar ranges.</li>
<li>Median posted base is about $243K, with a range of $146K to $445K.</li>
</ul>
<h2>Caveats</h2>
<ul>
<li>The delivery company, the 6 planners and the 4 hours a day are made up. They show the method, not a real project.</li>
<li>The 50 percent goal is a guess you agree with the customer, not a promise.</li>
<li>The job numbers are one snapshot, base pay only, and ranges vary by level and location.</li>
<li>"FDE" is not used the same way everywhere. Some titles are builder roles, some are sales-flavoured, and some build tools for a sales team. Read the responsibilities, not just the title. Quota and pipeline language points to a sales-adjacent role.</li>
</ul>
<h2>Try it yourself</h2>
<p>The full chapter has the diagrams, a first-call simulation where you choose how to answer the VP, and a short quiz. It is free with no signup: <a href="https://deployedlab.dev/lessons/01-what-an-fde-does">What an FDE actually does</a>. You can browse every opening and the pay data on the <a href="https://deployedlab.dev/fde-jobs">jobs and pay page</a>. Both are part of <a href="https://deployedlab.dev">Deployed Lab</a>, a course on AI engineering and the forward deployed engineer role.</p>
]]></content:encoded></item><item><title><![CDATA[How much GPU memory does an LLM need? The arithmetic, step by step]]></title><description><![CDATA[Weights, KV cache and overhead, with the formulas shown and a worked example for an 8B model. Includes a free, open-source calculator.]]></description><link>https://deployedlab.hashnode.dev/how-much-gpu-memory-does-an-llm-need-the-arithmetic-step-by-step</link><guid isPermaLink="true">https://deployedlab.hashnode.dev/how-much-gpu-memory-does-an-llm-need-the-arithmetic-step-by-step</guid><category><![CDATA[AI]]></category><category><![CDATA[GPU]]></category><category><![CDATA[Machine Learning]]></category><dc:creator><![CDATA[DeployedLab]]></dc:creator><pubDate>Mon, 16 Nov 2026 21:38:04 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6afb74564523ddb00ebb7d8b/260a7bba-32e1-4ec2-ad23-6e4f45e58c50.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>"Will this model fit on my GPU?" is one of the most common questions in local and self-hosted LLM work. The answer is three numbers added together. Here is the arithmetic, with a worked example.</p>
<p>All sizes below use 1 GB = 1 billion bytes. The model setup is illustrative, not a benchmark of a specific model.</p>
<h2>1. Weights</h2>
<p>The weights are the model's learned numbers. Every one must sit in GPU memory.</p>
<pre><code class="language-plaintext">weights = parameters x bytes per weight
</code></pre>
<p>Bytes per weight depend on the precision: 4 (32-bit), 2 (16-bit), 1 (8-bit), about 0.5 (4-bit).</p>
<p>For an 8-billion-parameter model at 16-bit: 8e9 x 2 bytes = <strong>16.0 GB</strong>.</p>
<h2>2. KV cache</h2>
<p>While generating, the model keeps short notes about the text so far, called the KV cache (K and V stand for key and value). Without them it would re-read everything for every new token. The notes cost memory, and they grow with every token and every open chat.</p>
<pre><code class="language-plaintext">kv_per_token = 2 x layers x kv_heads x head_dim x bytes per cache value
kv_cache     = kv_per_token x context_tokens x batch_size
</code></pre>
<p>The 2 is one key and one value per layer. For our example: 32 layers, 8 KV heads, head size 128, 16-bit cache values.</p>
<ul>
<li>kv_per_token = 2 x 32 x 8 x 128 x 2 = 131,072 bytes</li>
<li>For 8 chats at 4,096 tokens each: 131,072 x 4,096 x 8 = <strong>4.29 GB</strong></li>
</ul>
<h2>3. Overhead</h2>
<p>Real engines need room for temporary buffers and lose some memory to gaps. A rough planning default is 10 to 20 percent of weights plus cache. With 15 percent:</p>
<pre><code class="language-plaintext">overhead = 0.15 x (16.0 + 4.29) = 3.04 GB
</code></pre>
<h2>Total</h2>
<p>16.0 + 4.29 + 3.04 = <strong>about 23.3 GB</strong>.</p>
<p>That barely fits a 24 GB card, with under 1 GB spare. Add a few more users or longer chats and it will not fit.</p>
<h2>What you can change</h2>
<ul>
<li>Weights are the biggest part here, so a smaller model or lower precision (for example 8-bit) is the biggest lever.</li>
<li>If the cache dominates (long context, many users), shorten the context, serve fewer chats at once, or use a lower-precision cache.</li>
</ul>
<h2>Caveats</h2>
<p>This is an estimate for planning. Real engines allocate memory differently, some architectures differ (for example mixture-of-experts models store all experts but use only a few per token), and you should read your model's config for the real layer count, KV heads and head size. Test on your own hardware.</p>
<h2>Try it yourself</h2>
<p>I put the calculator in one HTML file, MIT licensed, with the formulas shown: <a href="https://github.com/deployedlab/llm-vram-calculator">github.com/deployedlab/llm-vram-calculator</a>.</p>
<p>There is also a step-by-step interactive version with diagrams and a "does it fit" table, free with no signup: <a href="https://deployedlab.dev/lessons/37-gpus-memory-sizing">GPUs and memory sizing</a>. It is one of seven free chapters of <a href="https://deployedlab.dev">Deployed Lab</a>, a course on AI engineering and the forward deployed engineer role.</p>
]]></content:encoded></item></channel></rss>