<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Mlops on lo0 — Tech Blog</title><link>https://blog.lo0.es/en/tags/mlops/</link><description>Recent content in Mlops on lo0 — Tech Blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Mon, 31 Aug 2026 09:30:00 +0200</lastBuildDate><atom:link href="https://blog.lo0.es/en/tags/mlops/index.xml" rel="self" type="application/rss+xml"/><item><title>Anatomy of an LLM request in production, May 2026: a tour of the six stages following a single request</title><link>https://blog.lo0.es/en/posts/anatomy-llm-request-production-tour-six-stages/</link><pubDate>Fri, 22 May 2026 16:00:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/anatomy-llm-request-production-tour-six-stages/</guid><description>&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>Across several series the blog has laid out the pieces that hold up an LLM system in production: the &lt;strong>Data stage&lt;/strong> (&lt;a href="https://blog.lo0.es/en/posts/data-versioning-llmops-dvc-lakefs-reproducible-golden-dataset/">dataset versioning&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/postgresql-qdrant-rag-ingestion-postman-syncing-two-worlds/">ingestion and vector stores&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/rag-on-kafka-reference-architecture-streaming-datalakes/">RAG over Kafka&lt;/a>), the &lt;strong>Tune stage&lt;/strong> (&lt;a href="https://blog.lo0.es/en/posts/continuous-fine-tuning-production-real-traffic-deployed-adapter/">continuous fine-tuning&lt;/a>), the &lt;strong>Eval stage&lt;/strong> (&lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">evals as the layer after tracing&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/llm-guardrails-safety-four-lines-of-defence/">guardrails and safety&lt;/a>), the &lt;strong>Deploy stage&lt;/strong> (&lt;a href="https://blog.lo0.es/en/posts/kv-cache-working-memory-llm-inference/">KV cache&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/pagedattention-vllm-block-manager/">PagedAttention&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">disaggregated serving&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/gpu-cluster-as-multi-tenant-platform/">multi-tenant GPU cluster&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/vllm-kubernetes-llm-inference-that-scales/">vLLM on Kubernetes&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/llm-inference-operators-kubernetes/">LLM operators on K8s&lt;/a>), the &lt;strong>Observe stage&lt;/strong> (&lt;a href="https://blog.lo0.es/en/posts/agentsight-llm-tracing-ebpf-zero-instrumentation/">tracing with AgentSight&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/mcp-deep-observability-opentelemetry/">MCP observability&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/ebpf-local-inference-statistical-drift-detection/">eBPF + drift&lt;/a>), the &lt;strong>Retrain stage&lt;/strong> (&lt;a href="https://blog.lo0.es/en/posts/retrain-closing-the-loop-feedback-dataset-adapter/">closing the feedback → dataset → adapter loop&lt;/a>), and the cross-cutting components (&lt;a href="https://blog.lo0.es/en/posts/prompt-versioning-contract-five-word-change/">prompt versioning&lt;/a> and &lt;a href="https://blog.lo0.es/en/posts/data-versioning-llmops-dvc-lakefs-reproducible-golden-dataset/">data versioning&lt;/a>). What is missing is &lt;strong>joining them up&lt;/strong>: seeing a single request cross every piece in order, in one coherent story. That is what this post does. We take a specific request from a multi-tenant support chatbot, rewind it back to the data that trained the adapter serving it today, follow it forward through serving, watch it reach the feedback store when the user marks a thumbs-down, and leave it as the seed of the next quarterly retrain cycle. The route works as a mental map and as an integrator&amp;rsquo;s guide: the system does not hold up if a single one of the seven pieces (six stages + two cross-cutting) is broken or absent. The practical lesson of the tour is not a new one. It is that &lt;strong>everything is connected&lt;/strong>, that local measurements lie when taken in isolation, and that the real cost of not operating one stage well is paid by another stage further down the line.&lt;/p>
&lt;h2 id="you-are-here-every-stage-at-once">You are here: every stage at once&lt;/h2>
&lt;p>Unlike previous posts, where the mini-map marked a single active box, this one covers &lt;strong>the whole&lt;/strong> pipeline. It is the only post on the blog that activates the six stages and the two cross-cutting components simultaneously, because we follow a real request that crosses all of them.&lt;/p>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 180" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="tour of every stage and cross-cutting component of the LLMOps pipeline">
&lt;style>.box{stroke:#444;stroke-width:1.4;rx:6}.active{fill:#ff8a4c;stroke-width:2.4}.cross{fill:#ffe9d6;stroke-width:1.6;stroke:#c66;rx:6}.lbl{font:600 12px sans-serif;fill:#222}.sm{font:11px sans-serif;fill:#444}.tiny{font:600 10px sans-serif;fill:#333}.arr{stroke:#666;stroke-width:1.4;fill:none;marker-end:url(#trm)}.cyc{stroke:#c66;stroke-width:2;fill:none;stroke-dasharray:4 2;marker-end:url(#trm)}.trace{stroke:#1a73e8;stroke-width:2.4;fill:none}&lt;/style>
&lt;defs>&lt;marker id="trm" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#666"/>&lt;/marker>&lt;/defs>
&lt;text x="390" y="20" text-anchor="middle" class="lbl">Full tour: one request crosses the 6 stages and the 2 cross-cutting components&lt;/text>
&lt;rect x="30" y="35" width="110" height="35" class="box active"/>&lt;text x="85" y="58" text-anchor="middle" class="lbl">1 · Data&lt;/text>
&lt;rect x="155" y="35" width="110" height="35" class="box active"/>&lt;text x="210" y="58" text-anchor="middle" class="lbl">2 · Tune&lt;/text>
&lt;rect x="280" y="35" width="110" height="35" class="box active"/>&lt;text x="335" y="58" text-anchor="middle" class="lbl">3 · Eval&lt;/text>
&lt;rect x="405" y="35" width="110" height="35" class="box active"/>&lt;text x="460" y="58" text-anchor="middle" class="lbl">4 · Deploy&lt;/text>
&lt;rect x="530" y="35" width="110" height="35" class="box active"/>&lt;text x="585" y="58" text-anchor="middle" class="lbl">5 · Observe&lt;/text>
&lt;rect x="655" y="35" width="110" height="35" class="box active"/>&lt;text x="710" y="58" text-anchor="middle" class="lbl">6 · Retrain&lt;/text>
&lt;path class="arr" d="M140,52 L155,52"/>&lt;path class="arr" d="M265,52 L280,52"/>&lt;path class="arr" d="M390,52 L405,52"/>&lt;path class="arr" d="M515,52 L530,52"/>&lt;path class="arr" d="M640,52 L655,52"/>
&lt;path class="cyc" d="M710,72 L710,82 L85,82 L85,72"/>
&lt;rect x="30" y="98" width="357" height="25" class="cross"/>
&lt;text x="208" y="115" text-anchor="middle" class="sm">Prompt versioning (Langfuse / MLflow Prompts)&lt;/text>
&lt;rect x="405" y="98" width="360" height="25" class="cross"/>
&lt;text x="585" y="115" text-anchor="middle" class="sm">Data versioning (DVC / lakeFS) · Schema Registry&lt;/text>
&lt;text x="50" y="148" class="tiny">trace_id · prompt_id · prompt_version · dataset_id · dataset_version · model_id · model_version · deployment_id&lt;/text>
&lt;path class="trace" d="M30,165 Q200,140 400,165 T760,160"/>
&lt;text x="755" y="172" text-anchor="end" class="tiny" fill="#1a73e8">trace running through the whole system&lt;/text>
&lt;/svg>
&lt;/div>
&lt;h2 id="the-analogy-forensic-analysis-of-a-request">The analogy: forensic analysis of a request&lt;/h2>
&lt;p>When an air accident happens, the forensic analysis does not limit itself to the last seconds of the flight. The investigation team rewinds to the maintenance of the previous six months, the manufacturer&amp;rsquo;s protocols, the pilot&amp;rsquo;s record, the weather briefing, the controller&amp;rsquo;s decisions, the incident history on the same model. The conclusion is rarely &lt;em>&amp;ldquo;the wing broke&amp;rdquo;&lt;/em>; it is &lt;em>&amp;ldquo;the wing broke because an inspection protocol written a certain way did not detect microcracks that the 2014 calculation model did not consider critical and that were critical beyond a certain fatigue cycle&amp;rdquo;&lt;/em>.&lt;/p>
&lt;p>When an LLM request in production &lt;strong>fails&lt;/strong> or &lt;strong>succeeds&lt;/strong>, there is also a long causal chain behind it. The answer the user sees is the last frame; what determined it starts months earlier and branches across six operational stages. If you only look at the last frame, you attribute the result to the model. If you look at the whole chain, you see that the model is one of twelve factors and rarely the most important.&lt;/p>
&lt;p>This post does that forensic analysis, but the other way round: instead of starting from a failure and rewinding, we start from a &lt;strong>specific request that works&lt;/strong> and break down what had to happen for it to work, and what will happen to it afterwards. It is a guided tour, not an incident diagnosis. But the mental discipline is the same: no stage is autonomous, and understanding the system means understanding the bridges between stages, not just the boxes.&lt;/p>
&lt;h2 id="the-scenario-a-multi-tenant-support-chatbot-for-regulated-customers">The scenario: a multi-tenant support chatbot for regulated customers&lt;/h2>
&lt;p>For the tour we use a concrete realistic scenario, representative enough that the observations carry over to most serious deployments in May 2026. It is an &lt;strong>LLM customer support SaaS product&lt;/strong>, sold to several corporate customers (multi-tenant) in regulated sectors (banking, insurance, health). The product:&lt;/p>
&lt;ul>
&lt;li>Accepts natural-language questions through a chat embedded in the customer&amp;rsquo;s website.&lt;/li>
&lt;li>Retrieves relevant fragments from the customer&amp;rsquo;s internal knowledge base (product documents, contractual terms, FAQs).&lt;/li>
&lt;li>Answers citing the fragment used, in the user&amp;rsquo;s language, with a tone adapted to the brand.&lt;/li>
&lt;li>If the question requires an action (cancel, change plan, open a case), it invokes a &lt;strong>tool&lt;/strong> from the catalogue exposed via MCP, with user confirmation.&lt;/li>
&lt;li>It is contractually obliged not to invent customer data, to respect the tenant&amp;rsquo;s style guide, and to meet ENS / NIS2 compliance on data in the EU.&lt;/li>
&lt;/ul>
&lt;p>The infrastructure is &lt;strong>on-premise&lt;/strong> over Kubernetes (RKE2 with the Cilium CNI, in the pattern covered in &lt;a href="https://blog.lo0.es/en/posts/kubernetes-cilium-bgp-services-without-ingress/">Cilium BGP&lt;/a> and CNI networking). The GPU plane is a &lt;strong>generic 4×H100 SXM cluster&lt;/strong> (80 GB each, NVLink) for serving and production training, plus an &lt;strong>RTX 4090&lt;/strong> (24 GB) for development, offline evals and ad-hoc re-embeddings.&lt;/p>
&lt;p>The request we are going to follow:&lt;/p>
&lt;blockquote>
&lt;p>&lt;strong>User&lt;/strong> (end customer, Spanish, premium plan with an insurer):
&lt;em>&amp;ldquo;How do I cancel my premium subscription? I have been paying for three months and I have not used half of the cover.&amp;rdquo;&lt;/em>&lt;/p>
&lt;/blockquote>
&lt;p>At first sight, a simple question. Let us see what is behind it.&lt;/p>
&lt;h2 id="step-0--the-frame-the-answer-the-user-sees">Step 0 — The frame: the answer the user sees&lt;/h2>
&lt;p>At 11:47:32 on a Tuesday, the user sends the message. 4.2 seconds later, this appears in the UI:&lt;/p>
&lt;blockquote>
&lt;p>To cancel your premium subscription, follow these steps: (1) Sign in to the customer portal with your ID number and password. (2) Go to &lt;em>My policies&lt;/em> → &lt;em>Premium Life 2024&lt;/em>. (3) Press &lt;em>Request cancellation&lt;/em>. (4) Select the reason (in your case, &amp;ldquo;not using the product&amp;rdquo;) and confirm. You will receive a confirmation email within 24-48 h.&lt;/p>
&lt;p>Before you cancel, let me remind you that your plan includes a &lt;strong>free annual medical check-up&lt;/strong> and &lt;strong>24/7 travel assistance&lt;/strong>, cover that is lost on cancellation. If you like, I can help you review your use of the cover over the past three months to see whether switching to a more tailored plan suits you better than cancelling.&lt;/p>
&lt;p>&lt;em>Source: [Cancellation policy, section 4.2 of the 2024 General Terms]&lt;/em>&lt;/p>
&lt;/blockquote>
&lt;p>After reading it, the user marks a &lt;strong>thumbs-down&lt;/strong> and writes in the form: &lt;em>&amp;ldquo;the answer is correct but the tone is too salesy; I only wanted to know how to cancel&amp;rdquo;&lt;/em>.&lt;/p>
&lt;p>That sequence, question, answer, thumbs-down with structured feedback, is the last visible frame. Let us go backwards to understand what had to happen for the answer to come out that way.&lt;/p>
&lt;h2 id="rewinding-backwards-what-was-already-in-place-before-the-request">Rewinding backwards: what was already in place before the request&lt;/h2>
&lt;p>Before the user typed, &lt;strong>the system already had&lt;/strong> a model loaded in serving, an active prompt labelled &lt;code>production&lt;/code>, an up-to-date vector index, a versioned dataset from the last fine-tuning, and a golden eval set that validated the promotion. Each of those artefacts got there through a process. We go through four jumps backwards.&lt;/p>
&lt;h3 id="t--90-days--the-previous-retrain-stage-closes-the-earlier-cycle">t = −90 days — The previous Retrain stage closes the earlier cycle&lt;/h3>
&lt;p>Three months ago, during a quarterly Retrain cycle, two things happened. The first: the support team reviewed the feedback accumulated over the previous six months and saw a pattern, the model answering premium users in an excessively formal tone, with users reporting that it &amp;ldquo;feels robotic&amp;rdquo;. The second: a one-off incident (a customer cancelling over an answer perceived as curt) triggered an incident-driven mini-cycle.&lt;/p>
&lt;p>The process, covered in detail in the &lt;a href="https://blog.lo0.es/en/posts/retrain-closing-the-loop-feedback-dataset-adapter/">Retrain post&lt;/a>, followed five sub-processes:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Feedback capture&lt;/strong> — explicit thumbs-down plus implicit feedback (abandonments, retries) accumulated in a &lt;code>feedback_signals&lt;/code> table in Postgres, all of them with a &lt;code>trace_id&lt;/code> that allows rewinding to the exact context.&lt;/li>
&lt;li>&lt;strong>Triage by root cause&lt;/strong> — the &amp;ldquo;curt tone&amp;rdquo; incident cluster was categorised as a &lt;code>prompt issue&lt;/code> (it was not the model answering badly, it was the system prompt asking for an overly formal register). One sub-cluster was a &lt;code>model issue&lt;/code> (in some cases the model dug its heels in even with a warmer prompt).&lt;/li>
&lt;li>&lt;strong>Dataset enrichment&lt;/strong> — the team manually annotated 280 cases where the model was too curt, labelled with the reference answer (&amp;ldquo;how it should have answered&amp;rdquo;). Double annotation on the critical 20%; cases with a quality score below 4 were left out.&lt;/li>
&lt;li>&lt;strong>Cadence decision&lt;/strong> — the incident was treated as incident-driven; the rest of the quarterly Retrain followed the calendar.&lt;/li>
&lt;li>&lt;strong>Promotion&lt;/strong> — the new &lt;code>customer_support_v7&lt;/code> adapter went through eval gates against &lt;code>customer_support_v6&lt;/code>, a 5% canary for a week, and was promoted when the golden set metrics showed a stable improvement in the &amp;ldquo;tone / clarity&amp;rdquo; segment with no regressions elsewhere.&lt;/li>
&lt;/ol>
&lt;p>The result: the adapter active in production when the user sent the Step 0 request is &lt;code>customer_support_v7&lt;/code>, trained on the enriched dataset &lt;code>enriched_retrain_2026_q1&lt;/code> version 3, with double lineage back to the original incident.&lt;/p>
&lt;h3 id="t--60-days--the-data-stage-the-enriched-dataset-is-versioned-and-enters-circulation">t = −60 days — The Data stage: the enriched dataset is versioned and enters circulation&lt;/h3>
&lt;p>Immediately after Retrain, the Data stage of the &lt;a href="https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/">LLMOps pipeline&lt;/a> does its work. Three critical operations, covered in detail in the &lt;a href="https://blog.lo0.es/en/posts/data-versioning-llmops-dvc-lakefs-reproducible-golden-dataset/">data versioning post&lt;/a>:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Immutable versioning of the enriched dataset&lt;/strong> with DVC, sha256 hash propagated to the registry. The identifier &lt;code>(enriched_retrain_2026_q1, v3, sha256:9af...)&lt;/code> becomes the luggage tag that will travel through the coming stages.&lt;/li>
&lt;li>&lt;strong>Schema contract&lt;/strong> validated by CI: every row meets the JSON Schema of the entry the trainer expects (&lt;code>example_id&lt;/code>, &lt;code>input.user_query&lt;/code>, &lt;code>input.retrieved_context&lt;/code>, &lt;code>expected_output&lt;/code>, &lt;code>rubric&lt;/code>, &lt;code>segment&lt;/code>, &lt;code>difficulty&lt;/code>). A validation fails in CI if any row breaks the contract.&lt;/li>
&lt;li>&lt;strong>Holdout segregation check&lt;/strong>: the normalised sha256 hash of each &lt;code>input&lt;/code> is compared against every hash in the active golden eval set (&lt;code>customer_support_golden_v12&lt;/code>). Zero overlaps = the dataset does not contaminate the eval. Had there been a single one, CI would have blocked the merge.&lt;/li>
&lt;/ul>
&lt;p>In parallel, the &lt;strong>RAG corpus&lt;/strong> (product manuals, FAQs, general terms of the insurer tenant) is kept alive. The &lt;a href="https://blog.lo0.es/en/posts/postgresql-qdrant-rag-ingestion-postman-syncing-two-worlds/">ingestion pipeline&lt;/a> keeps capturing changes from the customer&amp;rsquo;s CMS: a new section of the cancellation policy was modified in February and reindexed in Qdrant. As the &lt;a href="https://blog.lo0.es/en/posts/rag-on-kafka-reference-architecture-streaming-datalakes/">post about RAG over Kafka&lt;/a> explains, the corpus is not retrained with every change: only the delta is re-embedded, and &lt;code>lakeFS&lt;/code> keeps a branch of the embeddings bucket with the new version. The branch is merged into &lt;code>main&lt;/code> when &lt;code>recall@10&lt;/code> over a representative set of queries stays above the threshold (0.78 in this system).&lt;/p>
&lt;h3 id="t--45-days--the-tune-stage-the-customer_support_v7-adapter-is-trained">t = −45 days — The Tune stage: the customer_support_v7 adapter is trained&lt;/h3>
&lt;p>Three weeks after closing the dataset, training of the new LoRA adapter starts. As the &lt;a href="https://blog.lo0.es/en/posts/continuous-fine-tuning-production-real-traffic-deployed-adapter/">continuous fine-tuning post&lt;/a> details, the production pattern in 2026 avoids retraining the base model, which is expensive, slow and irreversible, and favours a &lt;strong>LoRA adapter over a stable base model&lt;/strong> (in this system, Llama 3 70B-instruct quantised to INT8 for serving). The training:&lt;/p>
&lt;ul>
&lt;li>Runs over 4 of the H100s (NVLink, tensor parallel) for ~6 hours.&lt;/li>
&lt;li>Uses &lt;code>transformers + PEFT + bitsandbytes&lt;/code>, monitored by MLflow.&lt;/li>
&lt;li>Every step records the &lt;code>dataset_id&lt;/code>, &lt;code>dataset_version&lt;/code> and &lt;code>dataset_hash&lt;/code> as an input artifact in MLflow.&lt;/li>
&lt;li>The output, a &lt;code>customer_support_v7.safetensors&lt;/code> file of ~280 MB with the LoRA weights, is uploaded to MinIO with its own hash, and MLflow records &lt;code>model_id, model_version, parent_dataset&lt;/code>.&lt;/li>
&lt;/ul>
&lt;p>At this point the lineage chain is closed for this leg:&lt;/p>
&lt;pre tabindex="0">&lt;code>enriched_retrain_2026_q1, v3, sha256:9af...
│
▼
mlflow run train, run_id: 0xa721...
│
▼
customer_support_v7, sha256:5c1...
&lt;/code>&lt;/pre>&lt;h3 id="t--38-days--the-eval-stage-the-v7-adapter-goes-through-eval-gates">t = −38 days — The Eval stage: the v7 adapter goes through eval gates&lt;/h3>
&lt;p>The freshly trained adapter is not promoted. It goes through an &lt;strong>eval suite&lt;/strong> covered in detail in the &lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">post about evals&lt;/a>. The golden eval set, &lt;code>customer_support_golden_v12&lt;/code>, 850 human-curated examples with an inter-annotator kappa of 0.81, is run against two models: the candidate v7 adapter and the v6 currently in production. The metrics:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Metric&lt;/th>
&lt;th>v6 (prod)&lt;/th>
&lt;th>v7 (cand.)&lt;/th>
&lt;th>Threshold&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Faithfulness to the RAG fragment&lt;/td>
&lt;td>0.87&lt;/td>
&lt;td>0.89&lt;/td>
&lt;td>≥ 0.82&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Toxicity (low is good)&lt;/td>
&lt;td>0.012&lt;/td>
&lt;td>0.011&lt;/td>
&lt;td>≤ 0.02&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&amp;ldquo;Warm but professional&amp;rdquo; tone (judge LLM)&lt;/td>
&lt;td>0.71&lt;/td>
&lt;td>0.84&lt;/td>
&lt;td>≥ 0.78&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Format compliance (structured markdown)&lt;/td>
&lt;td>0.94&lt;/td>
&lt;td>0.93&lt;/td>
&lt;td>≥ 0.90&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Helpful-but-not-pushy (judge LLM)&lt;/td>
&lt;td>0.66&lt;/td>
&lt;td>0.79&lt;/td>
&lt;td>≥ 0.75&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Latency p95 (ms)&lt;/td>
&lt;td>2,840&lt;/td>
&lt;td>2,910&lt;/td>
&lt;td>≤ 3,500&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>To this is added the &lt;strong>guardrails and safety suite&lt;/strong> covered in the &lt;a href="https://blog.lo0.es/en/posts/llm-guardrails-safety-four-lines-of-defence/">guardrails post&lt;/a>: jailbreak resistance, PII leakage detection, prompt injection over MCP tools. The v7 improves on safety in two metrics and ties on the rest.&lt;/p>
&lt;p>The v7 enters a 5% traffic canary for 7 days, under close monitoring. At the end of the canary, the &lt;strong>online metrics&lt;/strong> confirm what the offline ones anticipated: an improvement in tone and helpfulness, equivalent latency, no new failure modes. Promotion approved. The v7 moves to the &lt;code>production&lt;/code> label.&lt;/p>
&lt;h3 id="t--31-days--the-deploy-stage-the-v7-adapter-enters-serving">t = −31 days — The Deploy stage: the v7 adapter enters serving&lt;/h3>
&lt;p>The &lt;code>customer_support_v7&lt;/code> adapter is promoted to the serving cluster. Three pieces covered in separate posts come into play.&lt;/p>
&lt;p>&lt;strong>vLLM as the inference engine.&lt;/strong> The engine lives on Kubernetes, deployed via a dedicated Operator, as the &lt;a href="https://blog.lo0.es/en/posts/llm-inference-operators-kubernetes/">post about LLM operators&lt;/a> and the &lt;a href="https://blog.lo0.es/en/posts/vllm-kubernetes-llm-inference-that-scales/">post about vLLM on K8s&lt;/a> explain. The operator is responsible for detecting the new adapter in the registry, hot-loading it without restarting the engine (a native vLLM capability with &lt;code>--enable-lora&lt;/code>), and directing traffic based on the label.&lt;/p>
&lt;p>&lt;strong>Disaggregated serving.&lt;/strong> As the &lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">post about disaggregated serving&lt;/a> details, the system separates &lt;strong>prefill&lt;/strong> (compute-intensive, throughput-bound) and &lt;strong>decode&lt;/strong> (memory-intensive, latency-bound) into different GPU pools. The user&amp;rsquo;s request, when it arrives, prefills in a specialised pod and decodes in another, communicating over NVLink plus a shared KV cache fabric.&lt;/p>
&lt;p>&lt;strong>Multi-tenant GPU cluster.&lt;/strong> The H100 cluster serves several tenants, not just the insurer from Step 0. As the &lt;a href="https://blog.lo0.es/en/posts/gpu-cluster-as-multi-tenant-platform/">post about the multi-tenant cluster&lt;/a> explains, isolation is realised on four planes: the Kubernetes namespace, ACLs over adapters (only the tenant&amp;rsquo;s namespace loads its LoRAs), partitioning of the &lt;a href="https://blog.lo0.es/en/posts/kv-cache-working-memory-llm-inference/">KV cache&lt;/a> per tenant (one tenant cannot read another&amp;rsquo;s cached prefixes), and a tokens-per-minute quota enforced at the gateway.&lt;/p>
&lt;p>&lt;strong>Synchronised prompt registry.&lt;/strong> The product&amp;rsquo;s &lt;code>system_prompt&lt;/code> lives in Langfuse with the &lt;code>production&lt;/code> label. The active version is &lt;code>customer_support_system_prompt&lt;/code>, version 12. The gateway reads the prompt from Langfuse on the request path (with a few seconds of cache so it does not hammer the registry). Detailed in the &lt;a href="https://blog.lo0.es/en/posts/prompt-versioning-contract-five-word-change/">prompt versioning post&lt;/a>.&lt;/p>
&lt;p>The result at t = −31 days: the combination &lt;code>(adapter v7, prompt v12, golden v12)&lt;/code> is active and served. The system is ready for the request that will arrive 31 days later.&lt;/p>
&lt;h2 id="moving-forward-the-users-request-crosses-the-system">Moving forward: the user&amp;rsquo;s request crosses the system&lt;/h2>
&lt;p>Back to Step 0: 11:47:32 on a Tuesday. The user presses Enter. We go in real time, in milliseconds.&lt;/p>
&lt;h3 id="t--0-ms--entry-through-the-gateway">t = 0 ms — Entry through the gateway&lt;/h3>
&lt;p>The user&amp;rsquo;s browser POSTs to &lt;code>chat.aseguradora-ejemplo.com/api/chat&lt;/code>. The traffic crosses the edge load balancer and enters the SaaS product&amp;rsquo;s API gateway. The gateway:&lt;/p>
&lt;ul>
&lt;li>Authenticates the user&amp;rsquo;s JWT (an end customer of the insurer tenant).&lt;/li>
&lt;li>Extracts the &lt;code>tenant_id&lt;/code> and checks that its tokens-per-minute quota is not exhausted.&lt;/li>
&lt;li>Resolves which &lt;code>model_id&lt;/code>, &lt;code>adapter_id&lt;/code> and &lt;code>prompt_id&lt;/code> correspond to this tenant and product. In this case: &lt;code>llama-3-70b-int8&lt;/code> + &lt;code>customer_support_v7&lt;/code> + prompt label &lt;code>production&lt;/code>.&lt;/li>
&lt;li>Builds a unique &lt;code>trace_id&lt;/code> (W3C TraceContext, propagable to OTel) and starts a root span.&lt;/li>
&lt;/ul>
&lt;p>At 8 ms, the gateway passes the request to the prefill pool.&lt;/p>
&lt;h3 id="t--8-ms--pulling-the-versioned-prompt">t = 8 ms — Pulling the versioned prompt&lt;/h3>
&lt;p>Before serving, the OpenAI-compatible client the engine uses internally pulls the active system prompt. As the &lt;a href="https://blog.lo0.es/en/posts/prompt-versioning-contract-five-word-change/">post about prompt versioning&lt;/a> details, the pattern is:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-python" data-lang="python">&lt;span class="line">&lt;span class="cl">&lt;span class="n">prompt&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">prompt_registry&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">pull&lt;/span>&lt;span class="p">(&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">name&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s2">&amp;#34;customer_support_system_prompt&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">label&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s2">&amp;#34;production&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="c1"># now pointing at v12&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># A local 30 s cache reduces the round-trip to 0.1 % of requests&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The OTel span of the prompt pull carries the attributes &lt;code>gen_ai.prompt.id = customer_support_system_prompt&lt;/code>, &lt;code>gen_ai.prompt.version = 12&lt;/code>, &lt;code>gen_ai.prompt.label = production&lt;/code>. They are propagated to all children.&lt;/p>
&lt;h3 id="t--12-ms--rag-retrieval">t = 12 ms — RAG retrieval&lt;/h3>
&lt;p>The system needs context from the tenant&amp;rsquo;s knowledge base. It runs:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-python" data-lang="python">&lt;span class="line">&lt;span class="cl">&lt;span class="n">query_embedding&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">encoder&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">encode&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">user_query&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">chunks&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">qdrant&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">search&lt;/span>&lt;span class="p">(&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">collection&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="sa">f&lt;/span>&lt;span class="s2">&amp;#34;tenant_&lt;/span>&lt;span class="si">{&lt;/span>&lt;span class="n">tenant_id&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="s2">_kb_v3&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">vector&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="n">query_embedding&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">limit&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="mi">4&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">score_threshold&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="mf">0.72&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">reranked&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">reranker&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">rerank&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">user_query&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">chunks&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">top_k&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="mi">2&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>At 38 ms, the reranker returns two fragments: one from the &lt;em>Cancellation policy, section 4.2&lt;/em> and another from &lt;em>Premium plan benefits, section 2.1&lt;/em>. As the &lt;a href="https://blog.lo0.es/en/posts/postgresql-qdrant-rag-ingestion-postman-syncing-two-worlds/">post about PostgreSQL + Qdrant&lt;/a> details, the tenant&amp;rsquo;s corpus is kept isolated by collection and ACL: no tenant can read another&amp;rsquo;s chunks.&lt;/p>
&lt;h3 id="t--40-ms--building-the-final-payload">t = 40 ms — Building the final payload&lt;/h3>
&lt;p>The engine composes:&lt;/p>
&lt;pre tabindex="0">&lt;code>[system_prompt v12]
+ [retrieved context: 2 chunks]
+ [short session history: 1 previous turn]
+ [user query]
&lt;/code>&lt;/pre>&lt;p>Total: ~1,850 tokens of context. The OTel span records &lt;code>gen_ai.request.input_tokens = 1850&lt;/code>, &lt;code>gen_ai.request.model = llama-3-70b-int8&lt;/code>, &lt;code>gen_ai.request.adapter = customer_support_v7&lt;/code>.&lt;/p>
&lt;h3 id="t--45-ms--prefill">t = 45 ms — Prefill&lt;/h3>
&lt;p>The payload enters the prefill pool. The GPU processes the 1,850 tokens in a single parallel pass, computing for each token its K and V vectors (attention key and value). Those vectors are materialised as the &lt;strong>KV cache&lt;/strong>, covered in detail in the &lt;a href="https://blog.lo0.es/en/posts/kv-cache-working-memory-llm-inference/">KV cache fundamentals post&lt;/a>. The resulting cache takes up ~120 MB of VRAM in INT8.&lt;/p>
&lt;p>Here a key optimisation appears: the v12 system prompt is cached in the prefill pool (prefix caching, covered in the &lt;a href="https://blog.lo0.es/en/posts/pagedattention-vllm-block-manager/">post about PagedAttention&lt;/a>). Since the system prompt is the same for this tenant, the first ~500 tokens of the context are not recomputed: they are read from the prefix cache. That reduces the effective prefill from 1,850 tokens to ~1,350 tokens, saving ~270 ms of compute.&lt;/p>
&lt;p>At 580 ms (effective prefill), the TTFT (time to first token) is ready. The first token leaves for the decode pool.&lt;/p>
&lt;h3 id="t--580-ms--decode-streaming">t = 580 ms — Decode (streaming)&lt;/h3>
&lt;p>The decode pool receives the prefilled KV cache and starts generation token by token. As the &lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">post about disaggregated serving&lt;/a> details, the prefill/decode separation is what lets a multi-tenant system keep TPS stable: the decode pool is sized to sustain thousands of sessions decoding in parallel at a low cost per token, while the prefill pool is sized for bursts of short TTFT.&lt;/p>
&lt;p>Generation at ~80 tokens per second. The answer will be ~290 tokens. Total decode time: ~3.6 s. Streaming: the user starts seeing words from t = 580 ms.&lt;/p>
&lt;p>While decode advances, the engine emits child spans on every iteration with &lt;code>gen_ai.response.tokens_generated&lt;/code>, &lt;code>gen_ai.response.cache_hit_ratio&lt;/code>, &lt;code>gen_ai.response.cumulative_latency&lt;/code>. The &lt;a href="https://blog.lo0.es/en/posts/agentsight-llm-tracing-ebpf-zero-instrumentation/">post about AgentSight&lt;/a> and the &lt;a href="https://blog.lo0.es/en/posts/mcp-deep-observability-opentelemetry/">post about MCP observability with OTel&lt;/a> cover the detailed instrumentation of this layer.&lt;/p>
&lt;h3 id="t--4200-ms--complete-answer-root-span-closed">t = 4,200 ms — Complete answer, root span closed&lt;/h3>
&lt;p>Generation finishes. The engine closes the root span with &lt;code>gen_ai.response.completion_tokens = 290&lt;/code>, &lt;code>gen_ai.response.finish_reason = stop&lt;/code>, &lt;code>gen_ai.response.total_latency_ms = 4200&lt;/code>. The user sees the final answer. The session is ready for a next turn or for the user to click thumbs-up/thumbs-down.&lt;/p>
&lt;p>By this point, every active stage has taken part:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Data&lt;/strong> (pre-existing): the indexed RAG corpus, the dataset that trained the adapter, the golden set that validated it.&lt;/li>
&lt;li>&lt;strong>Tune&lt;/strong> (pre-existing): the v7 adapter trained 45 days ago.&lt;/li>
&lt;li>&lt;strong>Eval&lt;/strong> (pre-existing): the gates that approved the promotion.&lt;/li>
&lt;li>&lt;strong>Deploy&lt;/strong> (at this very moment): vLLM + disaggregated + KV cache + multi-tenant.&lt;/li>
&lt;li>&lt;strong>Observe&lt;/strong> (at this very moment): the OTel spans emitted to Langfuse + Tempo, the metrics to Prometheus.&lt;/li>
&lt;li>&lt;strong>Retrain&lt;/strong> (about to activate): the feedback the user will leave in 15 seconds.&lt;/li>
&lt;/ul>
&lt;h2 id="in-parallel-observe-is-watching">In parallel: Observe is watching&lt;/h2>
&lt;p>While the request happens, several pieces of Observe run in parallel and leave a structured trail.&lt;/p>
&lt;p>&lt;strong>OTel tracing.&lt;/strong> Every span (gateway, prompt pull, retrieval, prefill, decode) travels to Langfuse and to an OTel collector that forwards them to a backend (Tempo / Jaeger). The unique &lt;code>trace_id&lt;/code> links all the spans. As the &lt;a href="https://blog.lo0.es/en/posts/agentsight-llm-tracing-ebpf-zero-instrumentation/">post about tracing with AgentSight&lt;/a> details, end-to-end propagation is the main enabler of post-incident debugging: without it, you cannot reconstruct what happened three weeks later.&lt;/p>
&lt;p>&lt;strong>Runtime metrics.&lt;/strong> The engine emits Prometheus metrics per interval: &lt;code>gpu_utilization&lt;/code>, &lt;code>kv_cache_usage&lt;/code>, &lt;code>tokens_per_second&lt;/code>, &lt;code>queue_depth&lt;/code>, &lt;code>prefill_latency_p95&lt;/code>, &lt;code>decode_latency_p95&lt;/code>. The metrics are not tied to a trace; they are aggregated by tenant and service.&lt;/p>
&lt;p>&lt;strong>Online LLM-as-judge.&lt;/strong> A configurable percentage of answers (2% in this system) is also run through a judge LLM in the background, which scores the answer against a simple rubric (correct / partial / incorrect + a tone score). The judge does not block the answer to the user; it feeds the dashboard.&lt;/p>
&lt;p>&lt;strong>Statistical drift.&lt;/strong> In parallel, a slower pipeline computes drift over the distribution of inputs and outputs. As the &lt;a href="https://blog.lo0.es/en/posts/ebpf-local-inference-statistical-drift-detection/">post about eBPF + drift&lt;/a> explains, low-level monitoring (latency, error rate per endpoint) is complemented with statistical drift detection (KS test, embedding distance) that spots when &amp;ldquo;something is wrong&amp;rdquo; before a thumbs-down confirms it.&lt;/p>
&lt;p>&lt;strong>Safety and guardrails monitor.&lt;/strong> The &lt;a href="https://blog.lo0.es/en/posts/llm-guardrails-safety-four-lines-of-defence/">guardrails post&lt;/a> describes the layer that watches for jailbreak attempts, PII leakage and prompt injection via MCP tools. In this case, none of them fires.&lt;/p>
&lt;p>All these pieces operate &lt;strong>continuously&lt;/strong>, not per request. But this particular request left its trail in every one of them.&lt;/p>
&lt;h2 id="the-feedback-the-loop-closes">The feedback: the loop closes&lt;/h2>
&lt;p>Fifteen seconds after reading the answer, the user marks a thumbs-down and writes in the form: &lt;em>&amp;ldquo;the answer is correct but the tone is too salesy; I only wanted to know how to cancel&amp;rdquo;&lt;/em>. That apparently trivial gesture triggers an important sequence.&lt;/p>
&lt;h3 id="insertion-into-feedback_signals">Insertion into feedback_signals&lt;/h3>
&lt;p>As the &lt;a href="https://blog.lo0.es/en/posts/retrain-closing-the-loop-feedback-dataset-adapter/">post about Retrain&lt;/a> details, the thumbs-down is persisted as a structured row in a Postgres table:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-sql" data-lang="sql">&lt;span class="line">&lt;span class="cl">&lt;span class="k">INSERT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">INTO&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">feedback_signals&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">signal_id&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">trace_id&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">request_id&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">signal_type&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">signal_value&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">prompt_id&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">prompt_version&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">model&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">user_segment&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">occurred_at&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">VALUES&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">gen_random_uuid&lt;/span>&lt;span class="p">(),&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;4f5...&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c1">-- the trace_id from Step 0
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;r-22a...&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c1">-- request_id
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;thumbs&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;{&amp;#34;vote&amp;#34;:&amp;#34;down&amp;#34;,&amp;#34;reason&amp;#34;:&amp;#34;too pushy&amp;#34;,&amp;#34;text&amp;#34;:&amp;#34;I only wanted to know how to cancel&amp;#34;}&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;customer_support_system_prompt&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="mi">12&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;llama-3-70b-int8+customer_support_v7&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;premium-es&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;2026-05-19T11:47:51+02:00&amp;#39;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>With this, the row is linked by &lt;code>trace_id&lt;/code> to everything that happened: prompt v12, retrieved context, complete output, latency metrics, judge score (0.82 in this case, considered good by the judge, though the human disagrees).&lt;/p>
&lt;h3 id="triage-by-root-cause">Triage by root cause&lt;/h3>
&lt;p>The MLE team runs triage the next morning. Combining heuristic rules, LLM-as-classifier and human review:&lt;/p>
&lt;ul>
&lt;li>The signal is not a &lt;code>model issue&lt;/code>: the model answered correctly to the prompt it received.&lt;/li>
&lt;li>It is not a &lt;code>retrieval issue&lt;/code>: the retrieved chunks were the right ones.&lt;/li>
&lt;li>It is not an &lt;code>infra issue&lt;/code>: latency was normal.&lt;/li>
&lt;li>It is a &lt;strong>&lt;code>prompt issue&lt;/code>&lt;/strong>: the v12 system prompt instructs the model to &amp;ldquo;offer alternatives before processing destructive actions&amp;rdquo;. That instruction generates the &amp;ldquo;salesy tone&amp;rdquo; in some contexts.&lt;/li>
&lt;/ul>
&lt;p>The incident accumulates with others from the month in the &amp;ldquo;salesy tone&amp;rdquo; cluster. When the cluster crosses a threshold (typically 30-50 incidents of the same type or a percentage of the total), it will enter an incident-driven mini-cycle or wait for the quarterly Retrain, depending on the size.&lt;/p>
&lt;h3 id="the-next-cycle-picks-it-up">The next cycle picks it up&lt;/h3>
&lt;p>Three months later, in the next quarterly Retrain, this feedback is one of many that will motivate two changes:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>A new prompt version v13&lt;/strong> with an adjusted instruction: &amp;ldquo;offer alternatives only if the user does not express a clear intention to cancel&amp;rdquo;.&lt;/li>
&lt;li>&lt;strong>A possible reinforcement of the adapter&lt;/strong> with cases of a more direct tone for premium-es. If the cluster justifies it.&lt;/li>
&lt;/ul>
&lt;p>The v13 will go into its own eval gate. The golden set will grow with cases where the correct tone is &amp;ldquo;direct, not salesy&amp;rdquo;. The v8 of the adapter (if it arrives) will retrain over the enriched dataset &lt;code>enriched_retrain_2026_q2&lt;/code> that already contains this annotated case.&lt;/p>
&lt;p>The loop closes. The Step 0 request has contributed to the version of the system that will serve another user three months later.&lt;/p>
&lt;h2 id="what-goes-in-each-trace-identity-and-traceability">What goes in each trace: identity and traceability&lt;/h2>
&lt;p>If the reader looks at the seven identifiers that are everywhere in this route, they see the network of identities that makes all of the above possible. It is the &lt;strong>identity infrastructure&lt;/strong> of an LLM system in production:&lt;/p>
&lt;pre tabindex="0">&lt;code>trace_id 4f5... (unique per request)
request_id r-22a... (idem)
prompt_id customer_support_system_prompt
prompt_version 12
prompt_label production
dataset_id enriched_retrain_2026_q1
dataset_version v3 (sha256:9af...)
model_id llama-3-70b-int8
adapter_id customer_support_v7 (sha256:5c1...)
deployment_id d-prod-7b
schema_version 3.2
tenant_id aseguradora-ejemplo
user_segment premium-es
golden_set_id customer_support_golden_v12
&lt;/code>&lt;/pre>&lt;p>If a single piece of that set is missing or does not propagate, &lt;strong>the chain breaks&lt;/strong>. The next incident investigated will land in &amp;ldquo;we cannot rewind to the origin because the system did not record it&amp;rdquo;. That is why the cross-cutting components, prompt versioning and data versioning, are not luxuries: they are the connection without which the other six stages operate blind.&lt;/p>
&lt;h2 id="synthesis-diagram-how-the-pieces-fit">Synthesis diagram: how the pieces fit&lt;/h2>
&lt;pre tabindex="0">&lt;code> ┌─────────────────────────────────────────┐
│ User (end customer, B2C) │
└─────────────────┬───────────────────────┘
│ chat msg + JWT
▼
┌─────────────────────────────────────────┐
│ Edge LB + WAF + Cilium CNI │
└─────────────────┬───────────────────────┘
│ HTTPS, internal mTLS
▼
┌─────────────────────────────────────────────────┐
│ API Gateway (auth, quota, model routing) │
│ - Resolves tenant → model + adapter + prompt │
│ - Starts trace_id (W3C) │
└──────┬─────────────────────┬────────────────────┘
│ │
(pull prompt) │ │ (pull config)
▼ ▼
┌────────────────────┐ ┌──────────────────────┐
│ Langfuse Prompt │ │ Model registry │
│ Registry (v12) │ │ (adapter v7) │
└─────────┬──────────┘ └──────────┬───────────┘
│ │
└──────────┬───────────────┘
│ payload ready
▼
┌──────────────────────────────────────────┐
│ vLLM engine (K8s Operator) │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ Pool prefill │ → │ Pool decode │ │
│ │ (H100×N) │ │ (H100×M) │ │
│ └──────┬───────┘ └──────┬───────┘ │
│ │ KV cache fabric │ │
│ └──────────────────┘ │
│ - prefix caching of the system prompt │
│ - PagedAttention │
└──────┬───────────────────────────────────┘
│ tokens stream
▼
┌─────────────────────────────────────────┐
│ User sees the answer + thumbs/UX UI │
└─────────────────┬───────────────────────┘
│ feedback (15 s later)
▼
┌─────────────────────────────────────────┐
│ feedback_signals (Postgres) │
│ + Langfuse scores │
└─────────────────┬───────────────────────┘
│
┌────────────────────────┼────────────────────────┐
│ │ │
▼ ▼ ▼
triage quarterly Retrain cycle dataset_id
root cause or incident-driven enriched (DVC)
│
▼
Tune of v8
(next cycle)
In parallel throughout the request, OTel instrumentation:
spans → Tempo / Jaeger ; events → Langfuse ; metrics → Prometheus
&lt;/code>&lt;/pre>&lt;h2 id="the-on-premise-stack-applied">The on-premise stack applied&lt;/h2>
&lt;p>Taking the above to a generic on-premise consultant-profile infrastructure (RTX 4090 + 4×H100 SXM cluster):&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Layer&lt;/th>
&lt;th>Typical resources&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Network plane&lt;/td>
&lt;td>Edge LB (HAProxy / nginx ingress) + Cilium CNI with BGP, covered in &lt;a href="https://blog.lo0.es/en/posts/kubernetes-cilium-bgp-services-without-ingress/">Cilium BGP&lt;/a>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>K8s compute plane&lt;/td>
&lt;td>RKE2 with two manager nodes + a GPU node pool&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Production GPU plane&lt;/td>
&lt;td>4× H100 SXM (NVLink, 80 GB each), partitioned via MIG into prefill/decode pools&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Development GPU plane&lt;/td>
&lt;td>1× RTX 4090 (24 GB) for offline evals, drift-check embeddings, smoke tests&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Storage plane&lt;/td>
&lt;td>MinIO or Ceph object store; DVC remote + lakeFS backend&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>OLTP data plane&lt;/td>
&lt;td>Postgres 18 with replication; pgvector 0.8 for small cases&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Vector plane&lt;/td>
&lt;td>Qdrant or Milvus for large RAG corpora&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Stream plane&lt;/td>
&lt;td>Kafka (Redpanda / pure Apache) + Schema Registry; CDC with Debezium or Flink CDC&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Observability plane&lt;/td>
&lt;td>OTel Collector + Tempo (traces) + Prometheus (metrics) + Loki (logs); Langfuse for the LLM-specific part&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Runtime security plane&lt;/td>
&lt;td>Tetragon, covered in the &lt;a href="https://blog.lo0.es/en/posts/tetragon-cilium-security-syscalls-kernel/">runtime security post&lt;/a>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The real density is not the sum of the boxes: it is the &lt;strong>operations&lt;/strong> that tie the boxes together. A cluster with every piece but no versioning discipline, no end-to-end &lt;code>trace_id&lt;/code> propagation, no schema contracts and no cadenced retraining is a cluster that serves LLM &lt;strong>once&lt;/strong> and then ages. The difference between a project and a platform is exactly that.&lt;/p>
&lt;h2 id="ten-bridges-between-stages-where-the-system-breaks">Ten bridges between stages where the system breaks&lt;/h2>
&lt;p>The route reveals something important: failures are rarely &lt;strong>inside&lt;/strong> a stage; they are on the &lt;strong>bridges&lt;/strong> between stages. Ten common bridges:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Data → Tune&lt;/strong>: the dataset does not propagate its &lt;code>(dataset_id, dataset_version)&lt;/code> to the trainer. The same dataset trained twice produces two &lt;code>model_id&lt;/code> values that cannot be told apart.&lt;/li>
&lt;li>&lt;strong>Tune → Eval&lt;/strong>: the trained model does not propagate its lineage to the eval run. The eval passes, but there is no record of which dataset it was trained on. Three months later, irreproducible.&lt;/li>
&lt;li>&lt;strong>Eval → Deploy&lt;/strong>: promotion happens without the serving system recording which version of the adapter it is serving at each moment. The day the model gives a dangerous answer, nobody knows which adapter answered.&lt;/li>
&lt;li>&lt;strong>Deploy → Observe&lt;/strong>: the engine does not emit &lt;code>gen_ai.request.adapter&lt;/code>, &lt;code>gen_ai.prompt.version&lt;/code>, &lt;code>gen_ai.dataset.version&lt;/code> as span attributes. The traces exist but cannot be crossed with the lineage.&lt;/li>
&lt;li>&lt;strong>Observe → Retrain&lt;/strong>: the feedback is captured in a tool (Langfuse, Phoenix) but nobody reads it. The Retrain stage &amp;ldquo;exists&amp;rdquo;, but feedback piles up untriaged.&lt;/li>
&lt;li>&lt;strong>Retrain → Data&lt;/strong>: the enriched dataset goes into the next Tune without passing through versioning discipline, schema contract and holdout check. Silent contamination of the golden set.&lt;/li>
&lt;li>&lt;strong>Prompt versioning ↔ everything&lt;/strong>: the &lt;code>prompt_id, prompt_version&lt;/code> does not propagate to the spans. The day the team discovers that a prompt change regressed the system, it cannot isolate which one or when.&lt;/li>
&lt;li>&lt;strong>Data versioning ↔ everything&lt;/strong>: the &lt;code>dataset_id, dataset_version&lt;/code> does not show up in experiment tracking. &amp;ldquo;v8 is retrained&amp;rdquo; but nobody can prove it was over the enriched dataset and not the old one.&lt;/li>
&lt;li>&lt;strong>MCP ↔ tools&lt;/strong>: the system invokes tools (cancellation, policy changes) but does not record a &lt;code>gen_ai.tool.invocation_id&lt;/code> linked to the trace. The actions end up dissociated from the answer that generated them.&lt;/li>
&lt;li>&lt;strong>Schema Registry ↔ data&lt;/strong>: datasets version content but not schema. A breaking change in &lt;code>expected_output&lt;/code> breaks the eval silently; nobody notices anything until a human reviews the results.&lt;/li>
&lt;/ol>
&lt;p>The bridges are covered throughout the blog. Operations enforce them. The team&amp;rsquo;s culture keeps them.&lt;/p>
&lt;h2 id="how-to-walk-through-the-blog">How to walk through the blog&lt;/h2>
&lt;p>If you arrive at this post from outside and want a reading route:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>The map&lt;/strong>: &lt;a href="https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/">The six-stage LLMOps pipeline&lt;/a> — the master map of everything else.&lt;/li>
&lt;li>&lt;strong>The context&lt;/strong>: &lt;a href="https://blog.lo0.es/en/posts/mlops-for-llms-landscape-2026/">MLOps specific to LLMs in 2026&lt;/a> — the landscape and why LLMOps is not classic MLOps.&lt;/li>
&lt;li>&lt;strong>Inference from the inside out&lt;/strong>: &lt;a href="https://blog.lo0.es/en/posts/kv-cache-working-memory-llm-inference/">KV cache&lt;/a> → &lt;a href="https://blog.lo0.es/en/posts/pagedattention-vllm-block-manager/">PagedAttention deep dive&lt;/a> → &lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">Disaggregated serving&lt;/a> → &lt;a href="https://blog.lo0.es/en/posts/gpu-cluster-as-multi-tenant-platform/">Multi-tenant GPU cluster&lt;/a> → &lt;a href="https://blog.lo0.es/en/posts/vllm-kubernetes-llm-inference-that-scales/">vLLM on K8s&lt;/a> → &lt;a href="https://blog.lo0.es/en/posts/llm-inference-operators-kubernetes/">LLM operators on K8s&lt;/a>.&lt;/li>
&lt;li>&lt;strong>Data&lt;/strong>: &lt;a href="https://blog.lo0.es/en/posts/data-versioning-llmops-dvc-lakefs-reproducible-golden-dataset/">Data versioning with DVC and lakeFS&lt;/a> → &lt;a href="https://blog.lo0.es/en/posts/postgresql-qdrant-rag-ingestion-postman-syncing-two-worlds/">PostgreSQL + Qdrant ingestion&lt;/a> → &lt;a href="https://blog.lo0.es/en/posts/rag-on-kafka-reference-architecture-streaming-datalakes/">RAG over Kafka&lt;/a>.&lt;/li>
&lt;li>&lt;strong>Tune&lt;/strong>: &lt;a href="https://blog.lo0.es/en/posts/continuous-fine-tuning-production-real-traffic-deployed-adapter/">Continuous fine-tuning in production&lt;/a>.&lt;/li>
&lt;li>&lt;strong>Eval&lt;/strong>: &lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">Evals: the layer after tracing&lt;/a> → &lt;a href="https://blog.lo0.es/en/posts/llm-guardrails-safety-four-lines-of-defence/">Guardrails and safety&lt;/a>.&lt;/li>
&lt;li>&lt;strong>Observe&lt;/strong>: &lt;a href="https://blog.lo0.es/en/posts/agentsight-llm-tracing-ebpf-zero-instrumentation/">AgentSight LLM tracing&lt;/a> → &lt;a href="https://blog.lo0.es/en/posts/mcp-deep-observability-opentelemetry/">MCP observability with OTel&lt;/a> → &lt;a href="https://blog.lo0.es/en/posts/ebpf-local-inference-statistical-drift-detection/">On-device eBPF + drift&lt;/a>.&lt;/li>
&lt;li>&lt;strong>Retrain&lt;/strong>: &lt;a href="https://blog.lo0.es/en/posts/retrain-closing-the-loop-feedback-dataset-adapter/">Closing the feedback → dataset → adapter loop&lt;/a>.&lt;/li>
&lt;li>&lt;strong>Cross-cutting&lt;/strong>: &lt;a href="https://blog.lo0.es/en/posts/prompt-versioning-contract-five-word-change/">Prompt versioning with Langfuse and MLflow&lt;/a>.&lt;/li>
&lt;li>&lt;strong>Supporting infrastructure&lt;/strong> (the base everything is built on): &lt;a href="https://blog.lo0.es/en/posts/kubernetes-cilium-bgp-services-without-ingress/">RKE2 with Cilium BGP&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/hubble-ebpf-network-observability-ai-agents/">Hubble + eBPF observability&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/tetragon-cilium-security-syscalls-kernel/">Tetragon runtime security&lt;/a>.&lt;/li>
&lt;/ol>
&lt;h2 id="what-we-have-not-covered-yet">What we have not covered (yet)&lt;/h2>
&lt;p>At the first level the main things are there. The following posts on the blog, when the topics justify it, could go deeper into:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Schema Registry for LLM data and prompts&lt;/strong>: the other half of the data contract.&lt;/li>
&lt;li>&lt;strong>A dedicated AI Gateway&lt;/strong>: LiteLLM, Portkey, Kong AI Gateway as a control plane.&lt;/li>
&lt;li>&lt;strong>OTel gen_ai semantic conventions&lt;/strong>: the emerging standard that ties the seven identifiers of the &amp;ldquo;identity&amp;rdquo; block into well-formed spans.&lt;/li>
&lt;li>&lt;strong>Federated learning over regulated customer data&lt;/strong>: how to train without centralising the corpus.&lt;/li>
&lt;li>&lt;strong>Capacity planning&lt;/strong> for shared multi-tenant clusters.&lt;/li>
&lt;li>&lt;strong>Disaster recovery&lt;/strong> of an LLM service: how to reproduce the state of the system 30 days back.&lt;/li>
&lt;li>&lt;strong>Cost accounting per tenant&lt;/strong>: tokens × weights × adapter × infrastructure → invoice.&lt;/li>
&lt;/ul>
&lt;h2 id="see-also">See also&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/parallel-catalogue-llmops-stages-open-source-hyperscalers/">The parallel catalogue: the six LLMOps stages in open source and in the hyperscalers&lt;/a> — the vertical cut that complements this post: the same six stages + two cross-cutting components, but crossed with their equivalents in AWS, GCP and Azure, and with the insurer&amp;rsquo;s chatbot ported to an AWS stack.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/oss-catalogue-llmops-six-stages-tool-by-tool/">The OSS catalogue for LLMOps in six stages: entry by entry&lt;/a> — the zoom in on the open source side of the parallel catalogue: a ~150-word entry per core tool (vLLM, Langfuse, DVC, Qdrant, Airflow, NeMo Guardrails, Presidio…), licence and governance, a decision matrix per stage and a diagram of the connected OSS stack. It works as the consultant&amp;rsquo;s reference toolbox.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/">The six-stage LLMOps pipeline&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/mlops-for-llms-landscape-2026/">MLOps specific to LLMs in 2026&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/data-versioning-llmops-dvc-lakefs-reproducible-golden-dataset/">Data versioning for LLMOps&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/postgresql-qdrant-rag-ingestion-postman-syncing-two-worlds/">PostgreSQL + Qdrant for ingestion&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/rag-on-kafka-reference-architecture-streaming-datalakes/">RAG over Kafka: technical architecture&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/continuous-fine-tuning-production-real-traffic-deployed-adapter/">Continuous fine-tuning in production&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">Evals: the layer after tracing&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/llm-guardrails-safety-four-lines-of-defence/">Guardrails and safety in LLMs&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/kv-cache-working-memory-llm-inference/">KV cache: the working memory of LLM inference&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/pagedattention-vllm-block-manager/">PagedAttention from the inside&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">Disaggregated serving: prefill and decode&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/speculative-decoding-fundamentals-maths-state-of-play/">Speculative decoding: the secretary who anticipates what the boss is going to say&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/flashattention-librarian-io-awareness-async-blackwell-asymmetry/">FlashAttention v1/v2/v3/v4: the librarian who never clears the desk&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/gpu-cluster-as-multi-tenant-platform/">The GPU cluster as a multi-tenant platform&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/vllm-kubernetes-llm-inference-that-scales/">vLLM on Kubernetes&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/llm-inference-operators-kubernetes/">LLM operators on Kubernetes&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/agentsight-llm-tracing-ebpf-zero-instrumentation/">AgentSight: end-to-end LLM tracing&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/mcp-deep-observability-opentelemetry/">MCP from the inside and observability with OTel&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/ebpf-local-inference-statistical-drift-detection/">eBPF in local inference and drift detection&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/retrain-closing-the-loop-feedback-dataset-adapter/">Retrain: closing the feedback → dataset → adapter loop&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/prompt-versioning-contract-five-word-change/">Prompt versioning with Langfuse and MLflow&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/kubernetes-cilium-bgp-services-without-ingress/">RKE2 with Cilium BGP&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/hubble-ebpf-network-observability-ai-agents/">Hubble + eBPF observability&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/tetragon-cilium-security-syscalls-kernel/">Tetragon runtime security&lt;/a>&lt;/li>
&lt;/ul>
&lt;h2 id="references">References&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://www.w3.org/TR/trace-context/">W3C Trace Context&lt;/a> — end-to-end propagation of &lt;code>traceparent&lt;/code> and &lt;code>tracestate&lt;/code>.&lt;/li>
&lt;li>&lt;a href="https://opentelemetry.io/docs/specs/semconv/gen-ai/">OpenTelemetry GenAI Semantic Conventions&lt;/a> — &lt;code>gen_ai.*&lt;/code> attributes for LLM spans.&lt;/li>
&lt;li>&lt;a href="https://langfuse.com/docs">Langfuse documentation&lt;/a> — observability and prompt registry.&lt;/li>
&lt;li>&lt;a href="https://docs.vllm.ai/">vLLM documentation&lt;/a> — production inference engine with PagedAttention and LoRA hot-swap.&lt;/li>
&lt;li>&lt;a href="https://kubernetes.io/docs/concepts/extend-kubernetes/operator/">Kubernetes Operators&lt;/a> — the declarative management pattern.&lt;/li>
&lt;li>&lt;a href="https://mlflow.org/docs/latest/">MLflow Tracking and Model Registry&lt;/a> — lineage of runs and input artifacts.&lt;/li>
&lt;li>&lt;a href="https://dvc.org/">DVC&lt;/a> and &lt;a href="https://lakefs.io/">lakeFS&lt;/a> — dataset versioning, unified in Nov 2025.&lt;/li>
&lt;li>&lt;a href="https://openlineage.io/">OpenLineage&lt;/a> — an open standard for lineage events between systems.&lt;/li>
&lt;li>ENS / NIS2: compliance frameworks that apply to operators in the EU; recommended reading for the context in which the scenario operates.&lt;/li>
&lt;/ul></description></item><item><title>Kubeflow in depth: which pieces are worth it in an on-premise LLM platform and which ones you already have</title><link>https://blog.lo0.es/en/posts/kubeflow-pieces-worth-it-on-premise-llm-platform/</link><pubDate>Mon, 31 Aug 2026 09:30:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/kubeflow-pieces-worth-it-on-premise-llm-platform/</guid><description>&lt;blockquote>
&lt;p>Second post in the platform and self-service run, after &lt;a href="https://blog.lo0.es/en/posts/backstage-self-service-portal-llm-platform/">Backstage&lt;/a> and before &lt;a href="https://blog.lo0.es/en/posts/knative-scale-to-zero-llm-inference/">Knative&lt;/a>. The question here is not what Kubeflow is, but which parts of Kubeflow still make sense once you have built half a platform on your own.&lt;/p>
&lt;/blockquote>
&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>Kubeflow graduated in the CNCF on 17 August 2026, and that headline hides the important one: it is no longer a monolithic platform, it is an umbrella of independent subprojects, each with its own repository, its own version and its own life. That changes how you have to evaluate it entirely. The 2020 question, should I install Kubeflow?, has become the 2026 one, which piece of Kubeflow do I install, and at what cost?&lt;/p>
&lt;p>For a platform that already has RKE2, vLLM, &lt;a href="https://blog.lo0.es/en/posts/kserve-open-inference-protocol-control-plane/">KServe&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/gitops-inference-stack-flux/">Flux&lt;/a> and &lt;a href="https://blog.lo0.es/en/posts/volcano-kueue-gang-scheduling-gpu-quotas-kubernetes/">Volcano or Kueue&lt;/a>, the honest answer is that Kubeflow as a whole &lt;strong>duplicates&lt;/strong> almost everything you already have. KServe no longer lives under Kubeflow: it left, and since November 2025 it has been a CNCF project in its own right, so anyone serving models with KServe does not need Kubeflow to serve. The Trainer leans on Volcano and Kueue, it does not replace them. And the full manifest drags in Istio, Dex and cert-manager as hard dependencies that clash with what you already operate. The only thing that may be worth installing on its own is Pipelines, as an orchestrator for data and training flows, and perhaps the Trainer for its fine-tuning templates. The rest you either already have, or do not need.&lt;/p>
&lt;h2 id="the-analogy-the-hypermarket-and-the-specialist-shop">The analogy: the hypermarket and the specialist shop&lt;/h2>
&lt;p>Kubeflow was born as a hypermarket: a single building with everything an ML team might need, from notebooks to the inference server, taking in pipelines and hyperparameter tuning along the way. It made sense in 2019, when assembling each piece separately was a project in itself and there were no standards.&lt;/p>
&lt;p>By 2026 the hypermarket has been converted into a street of specialist shops. The butcher&amp;rsquo;s counter, KServe, went independent, opened its own premises and is doing better alone. The fishmonger&amp;rsquo;s, the Trainer, now depends on the central market next door, Volcano and Kueue, instead of having its own cold store. And the shared building still demands that you put in its wiring, its plumbing and its security system (Istio, cert-manager, Dex) even though you already have your own.&lt;/p>
&lt;p>Anyone arriving today with a half-full fridge, which is the case for anyone with a platform already running, does not need the whole hypermarket. They need to know which shop to walk into for what they are missing, and to avoid buying twice what they already have at home.&lt;/p>
&lt;h2 id="what-kubeflow-is-in-2026">What Kubeflow is in 2026&lt;/h2>
&lt;p>Kubeflow was created by Google in 2017 and graduated in the CNCF on 17 August 2026, reaching the top level alongside Kubernetes or Prometheus. The graduation figures are serious: more than 6,600 contributors from over a thousand organisations, and adopters such as Bloomberg, NVIDIA, Red Hat or Spotify.&lt;/p>
&lt;p>The structural change is the one that matters for the decision. The full distribution, the &lt;em>Kubeflow Community Distribution&lt;/em>, is numbered by year and month (the current one is 26.03, from March 2026, on a six-monthly cadence), but &lt;strong>each component is by now a subproject with its own repository and its own cycle&lt;/strong>, usable independently. The distribution only packages them together. That means &amp;ldquo;installing Kubeflow&amp;rdquo; is no longer an atomic decision: it is a shopping list.&lt;/p>
&lt;h2 id="component-by-component">Component by component&lt;/h2>
&lt;h3 id="kubeflow-pipelines-the-piece-you-may-actually-want">Kubeflow Pipelines: the piece you may actually want&lt;/h3>
&lt;p>Pipelines orchestrates containerised ML workflows. They are written in Python with its SDK, which compiles to an intermediate YAML representation so they are portable, and underneath they run on &lt;strong>Argo Workflows&lt;/strong>. It is the piece most likely to add value to an existing platform: a flow of &amp;ldquo;ingest, embeddings, fine-tuning, evaluation, deployment&amp;rdquo; is exactly what you need to operate RAG and adapters repeatably.&lt;/p>
&lt;p>The small print has two parts. The first is that if you already use plain Argo Workflows, Pipelines adds a layer of SDK, interface and metadata &lt;strong>on top of the same engine&lt;/strong>: it does not bring a new scheduler, it brings the typed component model and the runs interface. The second is that its metadata and lineage system, MLMD, is &lt;strong>being removed&lt;/strong> from Pipelines itself, so it is not wise to build the platform&amp;rsquo;s traceability on that particular piece.&lt;/p>
&lt;h3 id="kubeflow-trainer-it-leans-on-your-scheduler-it-does-not-replace-it">Kubeflow Trainer: it leans on your scheduler, it does not replace it&lt;/h3>
&lt;p>The old Training Operator, the one with &lt;code>PyTorchJob&lt;/code> and &lt;code>TFJob&lt;/code>, has been rewritten as &lt;strong>Kubeflow Trainer&lt;/strong>, with a single &lt;code>TrainJob&lt;/code> API that unifies all frameworks. Version 2.2 positions itself explicitly for distributed training and &lt;strong>LLM fine-tuning&lt;/strong>, with support for PyTorch, DeepSpeed, HuggingFace and company.&lt;/p>
&lt;p>A common expectation needs correcting here. The Trainer &lt;strong>does not replace Volcano or Kueue&lt;/strong>: it leans on them. The &lt;code>TrainJob&lt;/code> carries a &lt;code>podGroupPolicy&lt;/code> field that automatically creates the Volcano &lt;code>PodGroup&lt;/code> objects for &lt;em>gang scheduling&lt;/em>, and it integrates with Kueue&amp;rsquo;s queues. If you already built that scheduler, as we saw in its post, the Trainer adds the &lt;code>TrainJob&lt;/code> abstraction and some fine-tuning templates on top of what you already have, not a new scheduling layer. It may be worth it for the templates; not for the scheduler.&lt;/p>
&lt;h3 id="katib-only-half-relevant">Katib: only half relevant&lt;/h3>
&lt;p>Katib does Kubernetes-native AutoML: hyperparameter optimisation with algorithms such as Bayesian optimisation, TPE or Hyperband, plus architecture search. In the LLM era it has repositioned itself, with official documentation for tuning fine-tuning hyperparameters and even for tuning RAG pipelines.&lt;/p>
&lt;p>The practical reading is lukewarm. Architecture search is irrelevant for anyone doing LoRA and RAG. Hyperparameter optimisation can be useful for learning-rate or LoRA-rank sweeps, but it competes with doing it from the SDK of the &lt;a href="https://blog.lo0.es/en/posts/qlora-runbook-dataset-to-served-adapter/">QLoRA runbook&lt;/a> itself or with Ray Tune, and it rarely justifies dragging in Katib for that alone.&lt;/p>
&lt;h3 id="kserve-the-piece-that-is-no-longer-in-kubeflow">KServe: the piece that is no longer in Kubeflow&lt;/h3>
&lt;p>This is the fact that settles half the evaluation. &lt;strong>KServe left Kubeflow.&lt;/strong> It was born inside the project in 2019, was donated to the Linux Foundation in 2022, was renamed from KFServing to KServe and graduated from Kubeflow that same year, and since November 2025 it has been a &lt;strong>CNCF incubating project in its own right&lt;/strong>. In the 2026 taxonomy it appears as an ecosystem project, external, not as a core component.&lt;/p>
&lt;p>The consequence is direct: &lt;strong>anyone already serving with KServe does not need Kubeflow to serve&lt;/strong>. And KServe is exactly where the LLM action is: its 0.15 release strengthened the vLLM backend and introduced an &lt;code>LLMInferenceService&lt;/code> resource with disaggregated serving, prefix caching, per-variant autoscaling and OpenAI-compatible APIs. If your serving layer is vLLM on KServe, you already have that layer complete and Kubeflow adds nothing to it.&lt;/p>
&lt;h3 id="model-registry-notebooks-and-the-rest">Model Registry, Notebooks and the rest&lt;/h3>
&lt;p>The &lt;strong>Model Registry&lt;/strong>, now reorganised under the name Kubeflow Hub, is an index of models, versions and metadata. It stores pointers and states, not the bytes. Against MLflow, it lacks the experiment and metric tracking that is MLflow&amp;rsquo;s strength, to the point that the guides recommend combining them rather than substituting one for the other; and against an OCI registry, it does not package the binary, which still lives wherever you put it. It is still a young component, below version 1.0.&lt;/p>
&lt;p>The &lt;strong>Notebooks&lt;/strong> live in two versions, the stable 1 and a 2 redesigned on CRDs that is still in alpha. The &lt;strong>Spark Operator&lt;/strong> remains in the core; &lt;strong>Feast&lt;/strong>, by contrast, has left the core and is now an ecosystem project, a nuance worth being clear about before counting on it.&lt;/p>
&lt;h3 id="multi-tenancy-powerful-and-tied-to-istio">Multi-tenancy: powerful and tied to Istio&lt;/h3>
&lt;p>Isolation between teams is done with &lt;strong>Profiles&lt;/strong>, a CRD that wraps a namespace and gives it RoleBindings, ServiceAccounts and Istio authorisation policies that validate an identity header derived from OIDC. It is a complete model, but it has an Achilles heel: &lt;strong>it depends entirely on the Istio sidecar and on that header&lt;/strong>. If traffic bypasses the mesh or someone forges the header, isolation breaks, and all multi-tenant security ends up coupled to Istio, which clashes head-on if you already operate another mesh or no &lt;em>service mesh&lt;/em> at all.&lt;/p>
&lt;h2 id="the-cost-of-installing-the-whole-thing">The cost of installing the whole thing&lt;/h2>
&lt;p>Here is the main reason not to install the full distribution on top of an existing platform. The 26.03 manifest drags in as &lt;strong>hard dependencies&lt;/strong>: Istio, cert-manager, Dex for OIDC, OAuth2-Proxy, and Knative Serving and Eventing for KServe. It recommends 16 GB of RAM and 8 vCPU as a minimum, and the aggregate of all components comes to around 4.4 CPU cores and 12 GB of memory for the control plane alone.&lt;/p>
&lt;p>The project itself acknowledges the problem. There is an open thread in its repository, bluntly titled &amp;ldquo;community feedback on Kubeflow&amp;rsquo;s complexity&amp;rdquo;, where it is admitted that Kubeflow practically forces a dedicated cluster because of the assumptions it makes about what is installed, that Istio and Dex should be swappable and not fixed dependencies, and that a lighter Helm that installs only what is needed is missing. For anyone already operating cert-manager, an ingress and GitOps with Flux, the full manifest does not coexist: it duplicates and tramples the base infrastructure.&lt;/p>
&lt;h2 id="kubeflow-against-the-alternatives">Kubeflow against the alternatives&lt;/h2>
&lt;p>The field is wide and almost all the comparative literature is written by vendors with a product of their own, so it has to be read with tweezers. With that caution:&lt;/p>
&lt;p>&lt;strong>Plain Argo Workflows&lt;/strong> is the engine Pipelines uses underneath; if all you need is container graphs, Pipelines is overhead. &lt;strong>MLflow&lt;/strong> is strong in experiment tracking and lightweight registry, installs in minutes, and does not orchestrate distributed training: it is complementary, and in fact we use it in the post on &lt;a href="https://blog.lo0.es/en/posts/prompt-versioning-contract-five-word-change/">prompt versioning&lt;/a>. &lt;strong>Flyte&lt;/strong> is a typed orchestrator that many perceive as lighter to operate than full Kubeflow. And &lt;strong>Ray on Kubernetes&lt;/strong> is the most serious competitor for LLM workloads, because with a single runtime it covers training, serving and tuning, overlapping at once with the Trainer, Katib and KServe.&lt;/p>
&lt;p>Where Kubeflow wins is in breadth and in governance: a CNCF-graduated umbrella with adoption by large companies. Where it loses is in operational weight, in hard dependencies, and in the fact that its best pieces are already independent projects that do not require the rest.&lt;/p>
&lt;h2 id="the-real-fit-with-llm-workloads">The real fit with LLM workloads&lt;/h2>
&lt;p>The project has moved towards GenAI, and that has to be acknowledged: there is an SDK with LLM fine-tuning templates, the Trainer adds support for reinforcement post-training methods, and new agent-oriented pieces have appeared. It is not empty marketing, there is real work there.&lt;/p>
&lt;p>But the question for a specific platform is not whether Kubeflow does LLM: it is which part I have not already duplicated. On a stack of RKE2, vLLM, KServe, Flux and Volcano or Kueue, the balance looks like this:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Component&lt;/th>
&lt;th>Does it add anything new to your stack?&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>KServe&lt;/td>
&lt;td>No: you already have it, and it is no longer Kubeflow&amp;rsquo;s&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Trainer&lt;/td>
&lt;td>Only the fine-tuning templates; you already have the scheduler&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Katib&lt;/td>
&lt;td>Marginal: LoRA HP sweeps, little more&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Pipelines&lt;/td>
&lt;td>Possibly yes, as a flow orchestrator, but it runs on Argo&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Model Registry&lt;/td>
&lt;td>Optional: competes with MLflow and with your OCI registry&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Notebooks&lt;/td>
&lt;td>Depends on what you use for notebooks today&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Multi-tenancy&lt;/td>
&lt;td>No, if you already isolate by namespace without tying everything to Istio&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 id="operational-traps-and-honest-scepticism">Operational traps and honest scepticism&lt;/h2>
&lt;p>&lt;strong>Do not install the full manifest on a platform that already works.&lt;/strong> You are going to duplicate Istio, cert-manager and the rest, and fight a dependency war with no prize at the end. If something in Kubeflow interests you, install it as a standalone subproject.&lt;/p>
&lt;p>&lt;strong>KServe is not Kubeflow.&lt;/strong> It is the most common category error of 2026. If someone justifies building all of Kubeflow &amp;ldquo;to serve models&amp;rdquo;, you already know they have not checked that KServe left long ago and lives on its own.&lt;/p>
&lt;p>&lt;strong>The Trainer does not save you the scheduler.&lt;/strong> It needs Volcano or Kueue underneath. If you expected it to solve GPU &lt;em>gang scheduling&lt;/em> by itself, it does not.&lt;/p>
&lt;p>&lt;strong>Multi-tenancy ties you to Istio.&lt;/strong> Before adopting Profiles, ask yourself whether you want security between teams to depend on one specific mesh. If you already isolate well by namespace and RBAC, you may not need that layer.&lt;/p>
&lt;p>&lt;strong>MLMD is on its way out.&lt;/strong> Do not build your pipelines&amp;rsquo; traceability on the metadata system the project itself is retiring.&lt;/p>
&lt;h2 id="for-an-inference-factory">For an inference factory&lt;/h2>
&lt;p>The conclusion is comfortable to apply. Kubeflow in 2026 is not a yes-or-no decision, it is a menu you order from à la carte. On a platform that already serves with KServe, schedules with Volcano and deploys with Flux, the menu shrinks a great deal.&lt;/p>
&lt;p>If you need to orchestrate data and training flows repeatably, and you do not want to build plain Argo Workflows with its ergonomics, &lt;strong>Pipelines&lt;/strong> is the piece worth evaluating, installed standalone. If you do distributed fine-tuning frequently and want a uniform abstraction on top of your scheduler, the &lt;strong>Trainer&lt;/strong> may save you some templates, knowing that it leans on the Volcano you already have. Everything else you either have, or a specialist piece covers better.&lt;/p>
&lt;p>The expensive mistake would be installing the whole hypermarket to buy bread. Kubeflow stopped being that; treat it as what it is, a street of shops, and walk only into the one you are missing. The next piece in this run, &lt;a href="https://blog.lo0.es/en/posts/knative-scale-to-zero-llm-inference/">Knative&lt;/a>, is precisely one of those specialist shops, the one that decides whether switching off the GPU when nobody is using it pays off or costs you dear.&lt;/p>
&lt;h2 id="see-also">See also&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/kserve-open-inference-protocol-control-plane/">KServe and the Open Inference Protocol&lt;/a> — the piece that left Kubeflow and holds up your serving.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/volcano-kueue-gang-scheduling-gpu-quotas-kubernetes/">Volcano and Kueue: gang scheduling and GPU quotas&lt;/a> — the scheduler the Trainer leans on.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/qlora-runbook-dataset-to-served-adapter/">QLoRA runbook: from dataset to served adapter&lt;/a> — the fine-tuning that Pipelines and Trainer orchestrate.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/backstage-self-service-portal-llm-platform/">Backstage as a self-service portal&lt;/a> — the shop window that shows all this to the teams.&lt;/li>
&lt;/ul>
&lt;h2 id="sources">Sources&lt;/h2>
&lt;ul>
&lt;li>CNCF, &lt;em>CNCF announces Kubeflow&amp;rsquo;s graduation&lt;/em> — &lt;a href="https://www.cncf.io/announcements/2026/08/17/cncf-announces-kubeflows-graduation-solidifying-the-standard-for-cloud-native-ai-operations/">https://www.cncf.io/announcements/2026/08/17/cncf-announces-kubeflows-graduation-solidifying-the-standard-for-cloud-native-ai-operations/&lt;/a>&lt;/li>
&lt;li>CNCF, &lt;em>Kubeflow unveils new cloud native innovations to supercharge AI&lt;/em> — &lt;a href="https://www.cncf.io/blog/2026/07/28/kubeflow-unveils-new-cloud-native-innovations-to-supercharge-ai/">https://www.cncf.io/blog/2026/07/28/kubeflow-unveils-new-cloud-native-innovations-to-supercharge-ai/&lt;/a>&lt;/li>
&lt;li>CNCF, &lt;em>KServe becomes a CNCF incubating project&lt;/em> — &lt;a href="https://www.cncf.io/blog/2025/11/11/kserve-becomes-a-cncf-incubating-project/">https://www.cncf.io/blog/2025/11/11/kserve-becomes-a-cncf-incubating-project/&lt;/a>&lt;/li>
&lt;li>Kubeflow Docs, &lt;em>Introduction / components&lt;/em> — &lt;a href="https://www.kubeflow.org/docs/started/introduction/">https://www.kubeflow.org/docs/started/introduction/&lt;/a>&lt;/li>
&lt;li>Kubeflow Docs, &lt;em>Pipelines overview&lt;/em> — &lt;a href="https://www.kubeflow.org/docs/components/pipelines/overview/">https://www.kubeflow.org/docs/components/pipelines/overview/&lt;/a>&lt;/li>
&lt;li>Kubeflow Trainer Docs, &lt;em>Volcano gang scheduling and Kueue&lt;/em> — &lt;a href="https://trainer.kubeflow.org/en/latest/operator-guides/job-scheduling/volcano.html">https://trainer.kubeflow.org/en/latest/operator-guides/job-scheduling/volcano.html&lt;/a>&lt;/li>
&lt;li>Kubeflow Docs, &lt;em>Migrating to Kubeflow Trainer v2&lt;/em> — &lt;a href="https://www.kubeflow.org/docs/components/trainer/operator-guides/migration/">https://www.kubeflow.org/docs/components/trainer/operator-guides/migration/&lt;/a>&lt;/li>
&lt;li>Kubeflow Docs, &lt;em>Katib overview&lt;/em> — &lt;a href="https://www.kubeflow.org/docs/components/katib/overview/">https://www.kubeflow.org/docs/components/katib/overview/&lt;/a>&lt;/li>
&lt;li>Kubeflow Docs, &lt;em>Hyperparameter optimization for LLM fine-tuning&lt;/em> — &lt;a href="https://www.kubeflow.org/docs/components/katib/user-guides/llm-hp-optimization/">https://www.kubeflow.org/docs/components/katib/user-guides/llm-hp-optimization/&lt;/a>&lt;/li>
&lt;li>Kubeflow Docs, &lt;em>Model Registry overview&lt;/em> — &lt;a href="https://www.kubeflow.org/docs/components/model-registry/overview/">https://www.kubeflow.org/docs/components/model-registry/overview/&lt;/a>&lt;/li>
&lt;li>Kubeflow Docs, &lt;em>Multi-tenancy design&lt;/em> — &lt;a href="https://www.kubeflow.org/docs/concepts/multi-tenancy/design/">https://www.kubeflow.org/docs/concepts/multi-tenancy/design/&lt;/a>&lt;/li>
&lt;li>GitHub, &lt;em>kubeflow/manifests (dependencias y recursos)&lt;/em> — &lt;a href="https://github.com/kubeflow/manifests">https://github.com/kubeflow/manifests&lt;/a>&lt;/li>
&lt;li>GitHub, &lt;em>kubeflow/manifests #2451: community feedback on complexity&lt;/em> — &lt;a href="https://github.com/kubeflow/manifests/issues/2451">https://github.com/kubeflow/manifests/issues/2451&lt;/a>&lt;/li>
&lt;li>InfoQ, &lt;em>Kubeflow expands AI capabilities as CNCF graduation nears&lt;/em> — &lt;a href="https://www.infoq.com/news/2026/08/kubeflow/">https://www.infoq.com/news/2026/08/kubeflow/&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>Reranker and hybrid retrieval: the committee that decides the 5 chunks the LLM will actually read</title><link>https://blog.lo0.es/en/posts/reranker-hybrid-retrieval-five-chunks-llm-reads/</link><pubDate>Mon, 25 May 2026 14:00:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/reranker-hybrid-retrieval-five-chunks-llm-reads/</guid><description>&lt;blockquote>
&lt;p>This post takes apart the retrieval layer inside the RAG piece of the &lt;a href="https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/">six-stage LLMOps pipeline&lt;/a>. It sits directly on top of the &lt;a href="https://blog.lo0.es/en/posts/rag-corpus-curation-active-librarian/">corpus curation post&lt;/a>: if the librarian decided &lt;strong>what enters the index&lt;/strong>, the committee in this post decides &lt;strong>what leaves the index for the LLM&amp;rsquo;s face&lt;/strong>. It is the stage that moves the real quality of a RAG in production the most, and the one most teams solve with &amp;ldquo;dense top-k and off we go&amp;rdquo;.&lt;/p>
&lt;/blockquote>
&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>The most widespread antipattern in real RAG is: curated corpus, dense embeddings with &lt;code>bge-m3&lt;/code>, the user&amp;rsquo;s query straight through, &lt;code>top_k=5&lt;/code> of cosine similarity and off to the LLM. The system delivers answers that look good in the demo, mediocre with real traffic and dreadful with three-word queries, technical jargon, internal abbreviations or anything outside the embedder&amp;rsquo;s fine-tuning domain. The root cause is almost never the model: it is that &lt;strong>a single pass of dense retrieval over the raw query is structurally insufficient&lt;/strong> for the cases a real user produces. In 2026 the field has consolidated the &lt;strong>three-layer retrieval&lt;/strong> pattern: a broad layer that mixes dense + sparse (BM25 / SPLADE) via Reciprocal Rank Fusion to secure recall, a fine layer with a &lt;strong>cross-encoder reranker&lt;/strong> (BAAI/bge-reranker-v2-m3, Cohere Rerank 3, mxbai-rerank-large) that reorders the 30-50 candidates by true relevance, and optionally a late interaction layer with ColBERT-v2 or an LLM reranker for critical cases. On top of it all, a &lt;strong>query rewriting&lt;/strong> pattern that rewrites malformed queries and HyDE, which generates a hypothetical document so you embed the &lt;em>expected answer&lt;/em> instead of the &lt;em>question&lt;/em>. This post goes through them one by one: why each layer exists, what latency budget it consumes, the minimum maths of RRF and of the recall/precision trade-off, the dominant OSS stack in 2026, the on-premise hardware for serving it under data sovereignty, and the seven operational traps that kill the stage.&lt;/p>
&lt;h2 id="the-analogy-the-committee-for-a-professorial-chair">The analogy: the committee for a professorial chair&lt;/h2>
&lt;p>A university department has a chair to fill and receives 3,000 applications. Nobody is going to read 3,000 CVs in depth. The real process is organised in rounds:&lt;/p>
&lt;p>&lt;strong>Round 1, mass pre-screening.&lt;/strong> A system of automatic filters reads each CV in seconds. One route looks at the keywords of the post (publications in specific journals, languages, certifications); another route looks at the overall profile (research area, h-index, career). The two routes run in parallel. Each proposes its shortlist of 30-50 candidates. The two rankings are combined and what remains is a list of some 50-100 candidates for the next round to act on. The metric that matters here is &lt;strong>recall&lt;/strong>: not losing the good candidate through a filter error.&lt;/p>
&lt;p>&lt;strong>Round 2, careful reading.&lt;/strong> A member of the panel reads each CV on the shortlist thoroughly and scores it against the real profile of the post. It is slow, 10-20 minutes per CV, but it discriminates far better than the automatic filter. It reorders the 100 candidates into a fine ranking and keeps the 5 finalists. The metric that matters here is &lt;strong>precision&lt;/strong>: that the top-5 is genuinely the real top-5.&lt;/p>
&lt;p>&lt;strong>Round 3 (optional), personal interview.&lt;/strong> Long interviews are held for the 5 finalists. Face to face, questions adapted to each candidate&amp;rsquo;s profile, a check against the reality of the post. It is extremely expensive and very slow, but for critical chairs it justifies the cost.&lt;/p>
&lt;p>The retrieval of a modern RAG works exactly like this. Change the vocabulary and the structure holds:&lt;/p>
&lt;div class="diagram" style="max-width:780px;margin:1.5rem auto;">
&lt;svg viewBox="0 0 780 380" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="RAG retrieval as a committee for a professorial chair">
&lt;style>
.rbox{fill:#f8f8f8;stroke:#444;stroke-width:1.4;rx:8}
.rhead{fill:#ff8a4c;stroke:#444;stroke-width:1.4;rx:8}
.rspar{fill:#a8d5a8;stroke:#444;stroke-width:1.4;rx:8}
.rdens{fill:#7aafff;stroke:#444;stroke-width:1.4;rx:8}
.rfuse{fill:#d8a8ff;stroke:#444;stroke-width:1.4;rx:8}
.rrer{fill:#ffb86b;stroke:#444;stroke-width:1.4;rx:8}
.rllm{fill:#ffe18a;stroke:#444;stroke-width:1.4;rx:8}
.rfin{fill:#f4f4f4;stroke:#444;stroke-width:1.4;rx:8}
.rblt{font:600 13px sans-serif;fill:#222}
.rsub{font:400 11px sans-serif;fill:#444}
.rarr{stroke:#666;stroke-width:1.5;fill:none;marker-end:url(#mr1)}
.rlbl{font:600 11px sans-serif;fill:#555}
&lt;/style>
&lt;defs>&lt;marker id="mr1" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#666"/>&lt;/marker>&lt;/defs>
&lt;rect x="20" y="20" width="160" height="60" class="rhead"/>
&lt;text x="100" y="44" text-anchor="middle" class="rblt">User query&lt;/text>
&lt;text x="100" y="62" text-anchor="middle" class="rsub">"how do I cancel subscription"&lt;/text>
&lt;text x="100" y="76" text-anchor="middle" class="rsub">+ rewriter / HyDE&lt;/text>
&lt;rect x="220" y="20" width="160" height="60" class="rspar"/>
&lt;text x="300" y="42" text-anchor="middle" class="rblt">Layer 1a · Sparse&lt;/text>
&lt;text x="300" y="60" text-anchor="middle" class="rsub">BM25 / SPLADE&lt;/text>
&lt;text x="300" y="76" text-anchor="middle" class="rsub">top-50 lexical&lt;/text>
&lt;rect x="220" y="100" width="160" height="60" class="rdens"/>
&lt;text x="300" y="122" text-anchor="middle" class="rblt">Layer 1b · Dense&lt;/text>
&lt;text x="300" y="140" text-anchor="middle" class="rsub">bi-encoder (bge-m3)&lt;/text>
&lt;text x="300" y="156" text-anchor="middle" class="rsub">top-50 semantic&lt;/text>
&lt;rect x="420" y="60" width="150" height="60" class="rfuse"/>
&lt;text x="495" y="82" text-anchor="middle" class="rblt">Layer 2 · Fusion&lt;/text>
&lt;text x="495" y="100" text-anchor="middle" class="rsub">Reciprocal Rank Fusion&lt;/text>
&lt;text x="495" y="116" text-anchor="middle" class="rsub">→ top-30 combined&lt;/text>
&lt;rect x="600" y="60" width="160" height="60" class="rrer"/>
&lt;text x="680" y="82" text-anchor="middle" class="rblt">Layer 3 · Reranker&lt;/text>
&lt;text x="680" y="100" text-anchor="middle" class="rsub">cross-encoder bge-rerank-v2&lt;/text>
&lt;text x="680" y="116" text-anchor="middle" class="rsub">→ top-5 reordered&lt;/text>
&lt;rect x="280" y="200" width="220" height="60" class="rllm"/>
&lt;text x="390" y="222" text-anchor="middle" class="rblt">Layer 4 (optional) · ColBERT / LLM reranker&lt;/text>
&lt;text x="390" y="240" text-anchor="middle" class="rsub">late interaction or LLM judge&lt;/text>
&lt;text x="390" y="256" text-anchor="middle" class="rsub">for critical cases&lt;/text>
&lt;rect x="280" y="290" width="220" height="60" class="rfin"/>
&lt;text x="390" y="312" text-anchor="middle" class="rblt">LLM context&lt;/text>
&lt;text x="390" y="330" text-anchor="middle" class="rsub">5 chunks ready to answer&lt;/text>
&lt;text x="390" y="346" text-anchor="middle" class="rsub">~2,000 tokens&lt;/text>
&lt;path class="rarr" d="M180,40 L220,40"/>
&lt;path class="rarr" d="M180,60 L220,120"/>
&lt;path class="rarr" d="M380,40 L420,80"/>
&lt;path class="rarr" d="M380,120 L420,100"/>
&lt;path class="rarr" d="M570,90 L600,90"/>
&lt;path class="rarr" d="M680,120 L390,200"/>
&lt;path class="rarr" d="M390,260 L390,290"/>
&lt;text x="200" y="200" class="rlbl">broad recall&lt;/text>
&lt;text x="200" y="216" class="rlbl">~50-100ms total&lt;/text>
&lt;text x="450" y="40" class="rlbl">k=60 typical&lt;/text>
&lt;text x="630" y="50" class="rlbl">fine precision&lt;/text>
&lt;text x="630" y="66" class="rlbl">~80-300ms&lt;/text>
&lt;/svg>
&lt;/div>
&lt;p>The equivalence is exact. The &lt;strong>broad layer&lt;/strong> guarantees that the right chunk is on the shortlist (recall). The &lt;strong>fine layer&lt;/strong> orders well inside the shortlist (precision). Each layer is justified by an operational asymmetry: the broad one is cheap and parallelises, the fine one is expensive and sequential. Solving everything with the expensive one, a single cross-encoder over the whole corpus, is operationally unsustainable. Solving everything with the cheap one, a single dense top-k, is functionally insufficient.&lt;/p>
&lt;h2 id="the-problem-why-dense-on-its-own-is-not-enough">The problem: why dense on its own is not enough&lt;/h2>
&lt;p>The argument against dense-only is not theoretical. It is that the queries a real user produces have patterns the dense bi-encoder &lt;em>does not capture well by construction&lt;/em>:&lt;/p>
&lt;p>&lt;strong>Short queries.&lt;/strong> &amp;ldquo;IRPF dates 2026&amp;rdquo; goes through the embedder and produces a vector close to any chunk that mentions dates and IRPF, including chunks from 2023, chunks of generic calendars, chunks of corporate IRPF when you were asking about personal income tax. &lt;strong>BM25 disambiguates better&lt;/strong> because the weight of the infrequent terms (&amp;ldquo;2026&amp;rdquo;, &amp;ldquo;IRPF&amp;rdquo;) dominates the score.&lt;/p>
&lt;p>&lt;strong>Infrequent or internal technical terms.&lt;/strong> Product codes (&lt;code>FBR-X42-PRO&lt;/code>), organisation abbreviations (&lt;code>PYM-23-bis&lt;/code>), internal variable names. The embedder, trained on a public corpus, breaks them down into sub-tokens and pushes them into the &amp;ldquo;noisy&amp;rdquo; zone of the latent space. Two completely different codes can end up 0.02 cosine distance apart. &lt;strong>BM25 treats them as exact tokens&lt;/strong> and scores them correctly.&lt;/p>
&lt;p>&lt;strong>Polysemy.&lt;/strong> &amp;ldquo;Java&amp;rdquo; as a language vs Java as an island vs Java as coffee. The dense embedding averages the meanings; the ranking becomes mediocre. Here dense can beat BM25 &lt;em>if&lt;/em> the query carries enough context, but that &amp;ldquo;if&amp;rdquo; is rarely met with real user queries.&lt;/p>
&lt;p>&lt;strong>Synonyms and rephrasings.&lt;/strong> &amp;ldquo;How do I cancel my subscription&amp;rdquo; vs a chunk titled &amp;ldquo;Service termination procedure&amp;rdquo;. Here dense beats BM25: the semantic space brings them together even though they share no tokens. It is exactly the case where dense shines and BM25 fails.&lt;/p>
&lt;p>The operational conclusion: &lt;strong>no single retriever covers the four cases&lt;/strong>. The combination covers them all. And for the cases where both retrievers fail (very ambiguous queries, contradictory context between chunks), the &lt;strong>third layer&lt;/strong> comes in: the reranker that reads the query and each chunk together with a cross-encoder, and produces a &lt;em>real&lt;/em> relevance score far more discriminating than cosine similarity.&lt;/p>
&lt;h2 id="layer-1--hybrid-retrieval-dense--sparse">Layer 1 — Hybrid retrieval: dense + sparse&lt;/h2>
&lt;h3 id="why-bm25-is-still-alive-in-2026">Why BM25 is still alive in 2026&lt;/h3>
&lt;p>BM25 is from 1994. It is not deep learning. It needs no GPU. And it is still competitive with dense retrievers of hundreds of millions of parameters on many retrieval benchmarks (&lt;a href="https://github.com/beir-cellar/beir">BEIR&lt;/a>, 2021-2024). Its formula is simple:&lt;/p>
$$
\mathrm{BM25}(q, d) = \sum_{t \in q} \mathrm{IDF}(t) \cdot \frac{\mathrm{tf}(t,d) \cdot (k_1 + 1)}{\mathrm{tf}(t,d) + k_1 \cdot (1 - b + b \cdot \frac{|d|}{\overline{|d|}})}
$$
&lt;p>Where $\mathrm{tf}(t,d)$ is the frequency of term $t$ in document $d$, $|d|$ the document length, $\overline{|d|}$ the mean length of the corpus, and IDF the inverse document frequency. $k_1$ and $b$ are hyperparameters (typically $k_1 = 1.2$, $b = 0.75$). In practice you use &lt;code>pyserini&lt;/code>, &lt;code>Tantivy&lt;/code>, &lt;code>Elasticsearch&lt;/code> or &lt;code>OpenSearch&lt;/code> and never write the formula.&lt;/p>
&lt;p>SPLADE (&lt;a href="https://arxiv.org/abs/2107.05720">Formal et al., 2021&lt;/a>) is the neural generation of BM25: it learns sparse weights over the BERT vocabulary, expanding each token to its related terms. It keeps BM25&amp;rsquo;s interpretability (you can see which query terms match which document terms) and beats plain BM25 on BEIR. The price is that you need GPU inference over the query (and over each document at indexing time, once).&lt;/p>
&lt;p>The rule of thumb in 2026:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Corpus &amp;lt; 10M chunks, queries with a broad vocabulary&lt;/strong>: plain BM25 via Elasticsearch / Tantivy. Trivial indexing, 1-5ms queries.&lt;/li>
&lt;li>&lt;strong>Corpus 10M-100M, specific domain&lt;/strong>: SPLADE-v3 indexed in Elasticsearch or Vespa. Slow indexing (you need a GPU once), 5-20ms queries.&lt;/li>
&lt;li>&lt;strong>Corpus &amp;gt; 100M, latency critical&lt;/strong>: BM25 with external query expansion (synonyms, query2doc) is the operational option, with SPLADE reserved for the critical segments.&lt;/li>
&lt;/ul>
&lt;h3 id="dense-bi-encoder-the-second-lane">Dense bi-encoder: the second lane&lt;/h3>
&lt;p>The bi-encoder produces one vector per chunk and another per query, and relevance is the cosine similarity (or dot product) between the two. The dominant multilingual model in 2026 is &lt;code>BAAI/bge-m3&lt;/code>: 568M params, 1024 dimensions, support for up to 8,192 context tokens per chunk, multivector (dense + sparse + ColBERT-style multi-vec in the same embedder), trained on 100+ languages. Alternatives:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Embedder&lt;/th>
&lt;th style="text-align:right">Params&lt;/th>
&lt;th style="text-align:right">Dim&lt;/th>
&lt;th style="text-align:center">Multilingual&lt;/th>
&lt;th>Comment&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>BAAI/bge-m3&lt;/code>&lt;/td>
&lt;td style="text-align:right">568M&lt;/td>
&lt;td style="text-align:right">1024&lt;/td>
&lt;td style="text-align:center">yes&lt;/td>
&lt;td>the default all-rounder in 2026&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>intfloat/multilingual-e5-large-instruct&lt;/code>&lt;/td>
&lt;td style="text-align:right">560M&lt;/td>
&lt;td style="text-align:right">1024&lt;/td>
&lt;td style="text-align:center">yes&lt;/td>
&lt;td>direct competitor, instruct-style queries&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>nomic-ai/nomic-embed-text-v1.5&lt;/code>&lt;/td>
&lt;td style="text-align:right">137M&lt;/td>
&lt;td style="text-align:right">768&lt;/td>
&lt;td style="text-align:center">English&lt;/td>
&lt;td>fast, variable Matryoshka dimension&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>jinaai/jina-embeddings-v3&lt;/code>&lt;/td>
&lt;td style="text-align:right">570M&lt;/td>
&lt;td style="text-align:right">1024&lt;/td>
&lt;td style="text-align:center">yes&lt;/td>
&lt;td>with task-specific LoRAs per domain&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>mixedbread-ai/mxbai-embed-large-v1&lt;/code>&lt;/td>
&lt;td style="text-align:right">335M&lt;/td>
&lt;td style="text-align:right">1024&lt;/td>
&lt;td style="text-align:center">English&lt;/td>
&lt;td>top English on MTEB&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Snowflake/arctic-embed-l-v2.0&lt;/code>&lt;/td>
&lt;td style="text-align:right">568M&lt;/td>
&lt;td style="text-align:right">1024&lt;/td>
&lt;td style="text-align:center">yes&lt;/td>
&lt;td>enterprise-oriented, Apache licence&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The practical selection criterion: &lt;strong>multilingual no matter what if your corpus or queries need it&lt;/strong> (&lt;code>bge-m3&lt;/code>, &lt;code>multilingual-e5&lt;/code>, &lt;code>jina-v3&lt;/code>, &lt;code>arctic-l-v2&lt;/code>), Matryoshka if you want to save vector store memory by reducing dimensions without re-embedding (&lt;code>nomic&lt;/code>), and the MTEB leaderboard ranking only as a &lt;strong>tie-breaker&lt;/strong>, never as the sole criterion, since MTEB benchmarks are contaminable and a 1-2 point difference rarely translates into a real improvement in your domain.&lt;/p>
&lt;h3 id="the-fusion-reciprocal-rank-fusion-rrf">The fusion: Reciprocal Rank Fusion (RRF)&lt;/h3>
&lt;p>You have two rankings, one from BM25 and one from dense. How do you combine them? The naive option, adding the scores, fails because the scores are not comparable (BM25 produces numbers of 0-30, cosine 0-1, L2 distances 0-2…). The option that has consolidated is Reciprocal Rank Fusion (&lt;a href="https://dl.acm.org/doi/10.1145/1571941.1572114">Cormack, Clarke, Buettcher 2009&lt;/a>), which ignores absolute scores and uses only the &lt;em>rankings&lt;/em>:&lt;/p>
$$
\mathrm{RRF}(d) = \sum_{r \in R} \frac{1}{k + \mathrm{rank}_r(d)}
$$
&lt;p>Where $R$ is the set of retrievers and $\mathrm{rank}_r(d)$ is the position of document $d$ in the ranking of retriever $r$. The constant $k$ is typically $60$ and smooths the weight of the first positions.&lt;/p>
&lt;p>A numerical example. You have BM25 with top-5: &lt;code>[d_a, d_b, d_c, d_d, d_e]&lt;/code> and dense with top-5: &lt;code>[d_b, d_f, d_a, d_g, d_h]&lt;/code>. You compute the RRF of each candidate:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Doc&lt;/th>
&lt;th style="text-align:right">BM25 rank&lt;/th>
&lt;th style="text-align:right">dense rank&lt;/th>
&lt;th style="text-align:right">$\frac{1}{60+r_{\text{BM25}}}$&lt;/th>
&lt;th style="text-align:right">$\frac{1}{60+r_{\text{dense}}}$&lt;/th>
&lt;th style="text-align:right">total RRF&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>d_b&lt;/code>&lt;/td>
&lt;td style="text-align:right">2&lt;/td>
&lt;td style="text-align:right">1&lt;/td>
&lt;td style="text-align:right">0.01613&lt;/td>
&lt;td style="text-align:right">0.01639&lt;/td>
&lt;td style="text-align:right">0.03252&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>d_a&lt;/code>&lt;/td>
&lt;td style="text-align:right">1&lt;/td>
&lt;td style="text-align:right">3&lt;/td>
&lt;td style="text-align:right">0.01639&lt;/td>
&lt;td style="text-align:right">0.01587&lt;/td>
&lt;td style="text-align:right">0.03226&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>d_c&lt;/code>&lt;/td>
&lt;td style="text-align:right">3&lt;/td>
&lt;td style="text-align:right">—&lt;/td>
&lt;td style="text-align:right">0.01587&lt;/td>
&lt;td style="text-align:right">0&lt;/td>
&lt;td style="text-align:right">0.01587&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>d_f&lt;/code>&lt;/td>
&lt;td style="text-align:right">—&lt;/td>
&lt;td style="text-align:right">2&lt;/td>
&lt;td style="text-align:right">0&lt;/td>
&lt;td style="text-align:right">0.01613&lt;/td>
&lt;td style="text-align:right">0.01613&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>d_d&lt;/code>&lt;/td>
&lt;td style="text-align:right">4&lt;/td>
&lt;td style="text-align:right">—&lt;/td>
&lt;td style="text-align:right">0.01562&lt;/td>
&lt;td style="text-align:right">0&lt;/td>
&lt;td style="text-align:right">0.01562&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>&lt;code>d_b&lt;/code> wins because it appears well ranked in both. &lt;code>d_a&lt;/code> follows it. Those that appear in only one list stay below. With nothing tuned, RRF tends to push the &lt;em>consensus&lt;/em> candidates to the top, which is exactly what you want as a coarse filter before the reranker.&lt;/p>
&lt;p>Variants: weighted RRF assigns a multiplier per retriever ($w_r \cdot \frac{1}{k + \mathrm{rank}_r(d)}$) when you have reasons to trust one more; learning-to-rank trains a model (LambdaMART or a LightGBM ranker) over features from the two retrievers, a more powerful option but one that demands relevance labels most teams do not have.&lt;/p>
&lt;p>In Qdrant, Vespa, Weaviate and Elastic 8.11+ the RRF fusion is built in as a native mode: you ask for hybrid search with a lexical query and a vector and they return the combined top-k without you having to compute the fusion.&lt;/p>
&lt;h2 id="layer-2--the-reranker-bi-encoder-vs-cross-encoder">Layer 2 — The reranker: bi-encoder vs cross-encoder&lt;/h2>
&lt;p>The bi-encoder looks at query and document &lt;em>separately&lt;/em> and compares the resulting vectors. It is extremely fast (a dot product) and lets you index the document embeddings once and for all. The price is that the model never sees query and document together, and the compressed representation loses nuance.&lt;/p>
&lt;p>The cross-encoder looks at query and document &lt;em>concatenated&lt;/em>: &lt;code>[CLS] query [SEP] document [SEP]&lt;/code> goes through the model and the output is a relevance score. It discriminates far better, since shades of ordering and of local relationship between terms are captured, but the cost explodes: each (query, doc) pair requires a full inference of the model. You cannot precompute anything. If you want to rerank 50 candidates, that is 50 inferences.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Aspect&lt;/th>
&lt;th>Bi-encoder&lt;/th>
&lt;th>Cross-encoder&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Inference per chunk at indexing&lt;/td>
&lt;td>yes, once&lt;/td>
&lt;td>not precomputable&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Inference at query time&lt;/td>
&lt;td>1 (query) + dot product per chunk&lt;/td>
&lt;td>1 per (query, chunk) pair&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Typical latency for top-50&lt;/td>
&lt;td>5-20 ms (CPU possible)&lt;/td>
&lt;td>80-300 ms (GPU recommended)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Discrimination&lt;/td>
&lt;td>medium&lt;/td>
&lt;td>high&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Typical use&lt;/td>
&lt;td>recall (layer 1)&lt;/td>
&lt;td>precision (layer 2)&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>This asymmetry is why the canonical pattern is a &lt;strong>two-step funnel&lt;/strong>: the bi-encoder does cheap broad recall and the cross-encoder does expensive fine precision, over 30-50 candidates instead of millions.&lt;/p>
&lt;h3 id="2026-oss-cross-encoder-reranker-stack">2026 OSS cross-encoder reranker stack&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Reranker&lt;/th>
&lt;th style="text-align:right">Params&lt;/th>
&lt;th style="text-align:center">Multilingual&lt;/th>
&lt;th style="text-align:right">top-50 latency (A100)&lt;/th>
&lt;th>Comment&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>BAAI/bge-reranker-v2-m3&lt;/code>&lt;/td>
&lt;td style="text-align:right">568M&lt;/td>
&lt;td style="text-align:center">yes (100+ languages)&lt;/td>
&lt;td style="text-align:right">~90 ms&lt;/td>
&lt;td>the de facto default in 2026&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>BAAI/bge-reranker-v2-gemma&lt;/code>&lt;/td>
&lt;td style="text-align:right">2B&lt;/td>
&lt;td style="text-align:center">yes&lt;/td>
&lt;td style="text-align:right">~250 ms&lt;/td>
&lt;td>more quality, more cost&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>mixedbread-ai/mxbai-rerank-large-v2&lt;/code>&lt;/td>
&lt;td style="text-align:right">1.5B&lt;/td>
&lt;td style="text-align:center">English&lt;/td>
&lt;td style="text-align:right">~180 ms&lt;/td>
&lt;td>top English on BEIR rerank&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>jinaai/jina-reranker-v2-base-multilingual&lt;/code>&lt;/td>
&lt;td style="text-align:right">278M&lt;/td>
&lt;td style="text-align:center">yes&lt;/td>
&lt;td style="text-align:right">~50 ms&lt;/td>
&lt;td>fast and enough for many cases&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Alibaba-NLP/gte-multilingual-reranker-base&lt;/code>&lt;/td>
&lt;td style="text-align:right">306M&lt;/td>
&lt;td style="text-align:center">yes&lt;/td>
&lt;td style="text-align:right">~55 ms&lt;/td>
&lt;td>direct competitor to jina&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Cohere Rerank 3&lt;/code>&lt;/td>
&lt;td style="text-align:right">(closed)&lt;/td>
&lt;td style="text-align:center">yes (100+ languages)&lt;/td>
&lt;td style="text-align:right">~120 ms (API)&lt;/td>
&lt;td>commercial, not on-prem&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Voyage rerank-2&lt;/code>&lt;/td>
&lt;td style="text-align:right">(closed)&lt;/td>
&lt;td style="text-align:center">yes&lt;/td>
&lt;td style="text-align:right">~100 ms (API)&lt;/td>
&lt;td>commercial, not on-prem&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>For deployments under data sovereignty the obvious choice is &lt;strong>&lt;code>bge-reranker-v2-m3&lt;/code>&lt;/strong> as a starting point, with &lt;code>jina-reranker-v2-base&lt;/code> as the lightweight alternative. If the domain is exclusively English and the hardware budget allows it, &lt;code>mxbai-rerank-large-v2&lt;/code> takes a point or two more on BEIR. Cohere and Voyage are the option when you can reach out to an external API, ruled out in ENS / NIS2 scenarios with sensitive data.&lt;/p>
&lt;h3 id="late-interaction-colbert-v2-as-a-compromise">Late interaction: ColBERT-v2 as a compromise&lt;/h3>
&lt;p>There is a third option gaining traction: late interaction, embodied in ColBERT-v2 (&lt;a href="https://arxiv.org/abs/2112.01488">Santhanam et al., 2022&lt;/a>). The idea is that the document is embedded not as a single vector but as a &lt;em>matrix&lt;/em> of embeddings, one per token. And at query time the query is also embedded as a matrix, and the similarity is the sum of the maxima per column (&lt;code>MaxSim&lt;/code>):&lt;/p>
$$
S(q, d) = \sum_{i \in q} \max_{j \in d} \langle E_q[i], E_d[j] \rangle
$$
&lt;p>The result is retrieval with quality close to a cross-encoder but at a much lower cost (there is no need to run the whole model over each pair). The price is space: each chunk is ~150-200 vectors instead of 1, and that multiplies the index size by ~100. For small to medium corpora (&amp;lt;10M chunks) it is manageable; for huge corpora &lt;code>PLAID&lt;/code> compression and &lt;code>ColBERT-v2 quantization&lt;/code> make it viable up to 100M.&lt;/p>
&lt;p>In 2026 the reference implementations are &lt;code>RAGatouille&lt;/code> (Python wrapper), &lt;code>JaColBERT&lt;/code> (Japanese), &lt;code>Vespa.ai&lt;/code> (a search engine with native ColBERT support as a first-class citizen), and the native integration in &lt;code>bge-m3&lt;/code> that produces the ColBERT-style multivectors as part of the same dense model.&lt;/p>
&lt;p>My operational recommendation: &lt;strong>start with a cross-encoder reranker&lt;/strong> over the top-30 of the hybrid retrieval. Only if the precision numbers fall short, try late interaction as an alternative to the cross-encoder (not as an additional layer). Late interaction as a &lt;em>third&lt;/em> layer rarely pays back the operational cost for most cases.&lt;/p>
&lt;h2 id="query-rewriting-and-hyde-correcting-the-query-before-retrieval">Query rewriting and HyDE: correcting the query before retrieval&lt;/h2>
&lt;p>The user&amp;rsquo;s query is the worst-controlled input in the whole system. The most frequent problems:&lt;/p>
&lt;p>&lt;strong>Queries that are too short&lt;/strong>: &amp;ldquo;GDPR fines&amp;rdquo; → retrieves any chunk about GDPR or about fines.&lt;/p>
&lt;p>&lt;strong>Queries with typos or jargon&lt;/strong>: &amp;ldquo;i wnat to know how to cancel the premium subscripton&amp;rdquo; → the embedder is noisy because of the typos.&lt;/p>
&lt;p>&lt;strong>Multi-intent queries&lt;/strong>: &amp;ldquo;compare the premium and enterprise plans and tell me which has the better SLA&amp;rdquo; → dense will try to embed the three questions into one vector.&lt;/p>
&lt;p>&lt;strong>Queries with references resolved in context&lt;/strong>: &amp;ldquo;and for next month?&amp;rdquo; → without the previous context, dense does not know what it is about.&lt;/p>
&lt;p>&lt;strong>Canonical 2026 patterns to mitigate&lt;/strong>:&lt;/p>
&lt;p>&lt;strong>Query rewriting with a light LLM.&lt;/strong> Before retrieval, a small model (Qwen2.5-7B, Llama-3.2-3B, Phi-4-mini) rewrites the user&amp;rsquo;s query into a &amp;ldquo;canonical&amp;rdquo; version: it expands abbreviations, fixes typos, breaks multi-intent into sub-queries, resolves references using the conversation history. Cost: one cheap inference (~50-100 ms). Benefit: the four pathologies above are noticeably reduced.&lt;/p>
&lt;p>&lt;strong>Multi-query&lt;/strong>: the LLM generates 3-5 rephrasings of the query and you retrieve with each one; then you fuse with RRF. It increases recall at the cost of time and LLM tokens.&lt;/p>
&lt;p>&lt;strong>Step-back prompting&lt;/strong> (&lt;a href="https://arxiv.org/abs/2310.06117">Zheng et al., 2023&lt;/a>): the LLM generates a &lt;em>more general&lt;/em> question than the original query (&amp;ldquo;what is a premium subscription in this system?&amp;rdquo;), you retrieve with both and combine. It helps with very specific queries that need context.&lt;/p>
&lt;p>&lt;strong>HyDE — Hypothetical Document Embeddings&lt;/strong> (&lt;a href="https://arxiv.org/abs/2212.10496">Gao et al., 2022&lt;/a>): instead of embedding the question, you ask a light LLM to generate a &lt;em>hypothetical answer&lt;/em> and you embed that. The reasoning is that the semantic space of answers is closer to that of the real chunks than the space of questions. It works especially well in domains with very specific vocabulary. Cost: one inference of the light LLM (~100-200 ms). Benefit: in many cases +5-15 points of Recall@10.&lt;/p>
&lt;p>The operational trade-off is the added latency. Each technique adds 50-300 ms to the pipeline. In synchronous interactions with a 2s SLO there is still headroom; in agentic interactions with tool-use loops, every ms counts. The practical choice in 2026: &lt;strong>rewriting with a light LLM as the default&lt;/strong>, &lt;strong>HyDE for specific cases where it has been measured to help&lt;/strong>, &lt;strong>multi-query and step-back only when the case justifies it with numbers&lt;/strong>.&lt;/p>
&lt;h2 id="minimum-maths-latency-budget-and-metrics">Minimum maths: latency budget and metrics&lt;/h2>
&lt;h3 id="latency-budget-of-a-canonical-pipeline">Latency budget of a canonical pipeline&lt;/h3>
&lt;p>A typical hybrid + rerank pipeline in 2026 production over a corpus of 5M chunks with bge-m3 + bge-reranker-v2-m3 on an H100 with TEI:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Stage&lt;/th>
&lt;th style="text-align:right">p50 latency&lt;/th>
&lt;th style="text-align:right">p95 latency&lt;/th>
&lt;th>Comment&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Query rewrite (LLM 3B)&lt;/td>
&lt;td style="text-align:right">60 ms&lt;/td>
&lt;td style="text-align:right">150 ms&lt;/td>
&lt;td>only if enabled&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>HyDE (LLM 3B)&lt;/td>
&lt;td style="text-align:right">90 ms&lt;/td>
&lt;td style="text-align:right">220 ms&lt;/td>
&lt;td>only if enabled&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>BM25 / SPLADE top-50&lt;/td>
&lt;td style="text-align:right">8 ms&lt;/td>
&lt;td style="text-align:right">20 ms&lt;/td>
&lt;td>Elasticsearch or local Tantivy&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Dense embedding of the query&lt;/td>
&lt;td style="text-align:right">12 ms&lt;/td>
&lt;td style="text-align:right">35 ms&lt;/td>
&lt;td>bge-m3 with batch=1&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Dense top-50 (filterable HNSW)&lt;/td>
&lt;td style="text-align:right">6 ms&lt;/td>
&lt;td style="text-align:right">18 ms&lt;/td>
&lt;td>Qdrant with scalar quantization&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>RRF fusion → top-30&lt;/td>
&lt;td style="text-align:right">&amp;lt;1 ms&lt;/td>
&lt;td style="text-align:right">&amp;lt;1 ms&lt;/td>
&lt;td>arithmetic&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Cross-encoder rerank top-30&lt;/td>
&lt;td style="text-align:right">60 ms&lt;/td>
&lt;td style="text-align:right">180 ms&lt;/td>
&lt;td>bge-reranker-v2-m3 batched&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Top-5 selection + format&lt;/td>
&lt;td style="text-align:right">&amp;lt;1 ms&lt;/td>
&lt;td style="text-align:right">&amp;lt;1 ms&lt;/td>
&lt;td>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Total without rewrite/HyDE&lt;/strong>&lt;/td>
&lt;td style="text-align:right">~90 ms&lt;/td>
&lt;td style="text-align:right">~270 ms&lt;/td>
&lt;td>realistic range on an H100&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Total with rewrite + HyDE&lt;/strong>&lt;/td>
&lt;td style="text-align:right">~240 ms&lt;/td>
&lt;td style="text-align:right">~640 ms&lt;/td>
&lt;td>+ ~150-370 ms&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>On an RTX 4090 (~3× slower than an H100 on a large cross-encoder, similar on everything else) the numbers shift: ~180 ms p50 without rewrite, ~400 ms p50 with rewrite + HyDE. It is perfectly serviceable for a synchronous assistant with a 2-3s SLO, but tight for one with a 500 ms SLO.&lt;/p>
&lt;h3 id="metrics-ndcg-mrr-recallk">Metrics: nDCG, MRR, Recall@k&lt;/h3>
&lt;p>There are three classic metrics that any retrieval eval reports:&lt;/p>
&lt;p>&lt;strong>Recall@k&lt;/strong>: is the relevant chunk among the top-k? A binary metric, it ignores ordering. The one that matters for the &lt;strong>broad layer&lt;/strong>.&lt;/p>
$$
\mathrm{Recall@k} = \frac{|\{\text{relevant}\} \cap \{\text{top-k}\}|}{|\{\text{relevant}\}|}
$$
&lt;p>&lt;strong>Mean Reciprocal Rank (MRR@k)&lt;/strong>: in which position does the first relevant chunk appear? It penalises placing it far down.&lt;/p>
$$
\mathrm{MRR@k} = \frac{1}{|Q|} \sum_{q \in Q} \frac{1}{\mathrm{rank}_q}
$$
&lt;p>where $\mathrm{rank}_q$ is the position of the first relevant item for query $q$ (or $\infty$ if it does not appear in the top-k).&lt;/p>
&lt;p>&lt;strong>nDCG@k&lt;/strong>: it takes into account multiple relevant chunks with degrees of relevance. The most used metric for evaluating rerankers:&lt;/p>
$$
\mathrm{DCG@k} = \sum_{i=1}^{k} \frac{2^{\mathrm{rel}_i} - 1}{\log_2(i+1)} \quad \mathrm{nDCG@k} = \frac{\mathrm{DCG@k}}{\mathrm{IDCG@k}}
$$
&lt;p>The operational heuristic: &lt;strong>Recall@50 measures the quality of your broad layer&lt;/strong> (we want &amp;gt; 95%; otherwise layer 2 will never be able to recover what was lost), &lt;strong>nDCG@5 measures the quality of your reranker&lt;/strong> (we want &amp;gt; 0.75 on the golden set to consider the system &amp;ldquo;good&amp;rdquo;) and &lt;strong>MRR@5 measures the quality of your top-1&lt;/strong> (it matters especially in systems with &lt;code>top_k=1&lt;/code> or where the LLM&amp;rsquo;s answer is based mainly on the first chunk).&lt;/p>
&lt;h3 id="costs-and-throughput">Costs and throughput&lt;/h3>
&lt;p>Assuming a bge-reranker-v2-m3 cross-encoder (568M params) on an H100 SXM with TEI 1.7 and dynamic batching:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Throughput&lt;/strong>: ~280 queries/sec with top-30 each (= ~8,400 chunk-query pairs/sec).&lt;/li>
&lt;li>&lt;strong>VRAM used&lt;/strong>: ~3.5 GB for the model + ~6 GB of KV cache + activations at batch=32.&lt;/li>
&lt;li>&lt;strong>Energy cost&lt;/strong>: an H100 SXM draws ~700 W. At 8,400 pairs/sec, the energy cost of pure reranking is ~0.083 mJ per pair. In Spanish industrial electricity bill terms (~0.12 €/kWh, May 2026): ~0.000003 € per rerank of 30 candidates. The bill is negligible compared with the cost of the downstream LLM.&lt;/li>
&lt;/ul>
&lt;p>On an RTX 4090 with TEI: ~95 queries/sec at top-30 (~2,850 pairs/sec), VRAM ~3.5 GB + ~5 GB. Serviceable for an internal assistant with modest traffic (~5 QPS sustained, peaks at 20-30).&lt;/p>
&lt;h2 id="the-canonical-pattern--which-piece-goes-where">The canonical pattern — which piece goes where&lt;/h2>
&lt;p>The 2026 operational reference stack for an on-premise hybrid + rerank RAG under data sovereignty:&lt;/p>
&lt;pre tabindex="0">&lt;code> ┌─────────────────┐
User query ────────▶│ Query rewriter │ (optional, LLM 3B)
│ (Qwen2.5-7B-IT) │
└────────┬────────┘
▼
┌─────────────────┐
│ HyDE │ (optional)
│ (same LLM) │
└────────┬────────┘
┌─────────────────┼─────────────────┐
▼ ▼ ▼
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ BM25/SPLADE │ │ Dense bi-enc │ │ (metadata │
│ Elasticsearch│ │ bge-m3 + TEI │ │ filters │
│ top-50 │ │ + Qdrant │ │ per tenant) │
│ │ │ top-50 │ │ │
└──────┬───────┘ └──────┬───────┘ └──────┬───────┘
└─────────┬───────┘ │
▼ │
┌──────────────┐ │
│ RRF k=60 │◀─────────────────┘
│ → top-30 │
└──────┬───────┘
▼
┌──────────────────┐
│ Cross-encoder │
│ bge-reranker-v2 │
│ TEI batch=32 │
│ → final top-5 │
└──────┬───────────┘
▼
┌──────────────────┐
│ LLM context │
│ ~2,000 tokens │
└──────────────────┘
&lt;/code>&lt;/pre>&lt;p>Key services:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Sparse index&lt;/strong>: Elasticsearch 8.16, OpenSearch 2.18 or embedded Tantivy. Native BM25, SPLADE optional via plugin.&lt;/li>
&lt;li>&lt;strong>Vector index&lt;/strong>: Qdrant 1.13 (filterable HNSW, scalar quantization, multivectors). Covered in detail in the &lt;a href="https://blog.lo0.es/en/posts/postgresql-qdrant-rag-ingestion-postman-syncing-two-worlds/">PostgreSQL + Qdrant in ingestion post&lt;/a>.&lt;/li>
&lt;li>&lt;strong>Embedder serving&lt;/strong>: HuggingFace&amp;rsquo;s &lt;a href="https://github.com/huggingface/text-embeddings-inference">TEI (Text Embeddings Inference)&lt;/a> for bge-m3, multilingual-e5 and compatible models. OpenAI-compatible endpoint.&lt;/li>
&lt;li>&lt;strong>Reranker serving&lt;/strong>: TEI too, for the rerankers of the bge-reranker, jina-reranker and mxbai-rerank families. Separate &lt;code>/rerank&lt;/code> endpoint.&lt;/li>
&lt;li>&lt;strong>LLM for rewriter/HyDE&lt;/strong>: vLLM 0.7+ serving Qwen2.5-7B-Instruct or Phi-4-mini-Instruct. If the main LLM is the same, it shares resources; if not, a dedicated pod with GPTQ-INT4 quantization.&lt;/li>
&lt;li>&lt;strong>Orchestration&lt;/strong>: the RAG client (FastAPI, LangChain, LlamaIndex) composes the three lanes. Each parallel call (Sparse + Dense) is made concurrently; rewriter, HyDE and rerank are sequential.&lt;/li>
&lt;/ul>
&lt;p>Minimum Kubernetes manifests are already developed in the &lt;a href="https://blog.lo0.es/en/posts/vllm-kubernetes-llm-inference-that-scales/">vLLM on Kubernetes post&lt;/a> and the full orchestration piece fits the pattern of the &lt;a href="https://blog.lo0.es/en/posts/gpu-cluster-as-multi-tenant-platform/">multi-tenant H100 cluster&lt;/a>.&lt;/p>
&lt;h2 id="on-premise-hardware-what-fits-in-an-rtx-4090-vs-a-generic-4h100-sxm-configuration">On-premise hardware: what fits in an RTX 4090 vs a generic 4×H100 SXM configuration&lt;/h2>
&lt;p>The operational reality matters. Two typical profiles:&lt;/p>
&lt;p>&lt;strong>Modest configuration — 1× RTX 4090 (24 GB Ada Lovelace)&lt;/strong>&lt;/p>
&lt;p>It comfortably serves:&lt;/p>
&lt;ul>
&lt;li>bge-m3 (568M) for dense embedding of the query → ~1 GB VRAM&lt;/li>
&lt;li>bge-reranker-v2-m3 (568M) cross-encoder → ~3.5 GB VRAM at batch=32&lt;/li>
&lt;li>A light LLM for rewriter/HyDE (Qwen2.5-7B GPTQ-INT4) → ~5-6 GB VRAM&lt;/li>
&lt;li>The main LLM (Llama-3.1-8B-Instruct FP8) → ~11-12 GB VRAM&lt;/li>
&lt;/ul>
&lt;p>Total VRAM used: ~21 GB. That leaves ~3 GB for the main LLM&amp;rsquo;s KV cache, enough for 4-8 concurrent users with ~4K token contexts. For an internal corporate assistant it is viable. If you need a larger context or more concurrency, you have to split things up: either the main LLM is served outside the 4090 (another GPU, another node), or you fall back on quantising the reranker (not advisable: you lose the nDCG points that justify the cost of adding it).&lt;/p>
&lt;p>&lt;strong>Generic configuration — 4×H100 SXM (320 GB total, NVLink)&lt;/strong>&lt;/p>
&lt;p>It comfortably serves everything above multiplied by 30-50× in throughput and opens the door to:&lt;/p>
&lt;ul>
&lt;li>A large main LLM (Llama 3.3 70B FP8 or Qwen2.5-72B FP8) on 2 GPUs with tensor parallelism&lt;/li>
&lt;li>Large rerankers (bge-reranker-v2-gemma 2B) with quality ~2 points higher&lt;/li>
&lt;li>Late interaction (ColBERT-v2) on one of the nodes for critical cases&lt;/li>
&lt;li>Several light LLMs in parallel for rewriter, HyDE and the evals judge&lt;/li>
&lt;/ul>
&lt;p>The practical rule: &lt;strong>the reranker is one of the most efficient things you can put on a GPU&lt;/strong>. The VRAM used is modest, the throughput is high, and the quality improvement per euro of extra hardware is among the best in the RAG stack.&lt;/p>
&lt;h2 id="the-seven-traps-that-kill-retrieval">The seven traps that kill retrieval&lt;/h2>
&lt;p>&lt;strong>Trap 1 — Top-k to the LLM with no reranker.&lt;/strong> Dense retrieval returns a top-5 and those 5 chunks go straight to the LLM. Without a reranker, the order of the 5 is the cosine similarity order, which is not the real relevance order. The LLM answers based much more on the first chunks than the last ones, and the nuance is lost. Symptom: confident answers with citations that are not the most relevant in the corpus.&lt;/p>
&lt;p>&lt;strong>Trap 2 — Dense-only with no BM25.&lt;/strong> Short queries and queries with internal jargon work badly, the demos look pretty, real traffic complains. Symptom: on QA with real support tickets, the system fails specifically on queries of fewer than 5 words or with product codes.&lt;/p>
&lt;p>&lt;strong>Trap 3 — Reranker badly calibrated on top-k.&lt;/strong> A layer 1 top-k that is too small (top-10) cuts before the reranker can do its job. A top-k that is too large (top-200) blows up latency without improving nDCG. The canonical sweet spot is top-30 to top-50 from the hybrid → top-5 to top-10 from the reranker. Symptom: the reranker&amp;rsquo;s nDCG@5 stuck no matter which reranker model you try.&lt;/p>
&lt;p>&lt;strong>Trap 4 — Embedder and reranker in different languages.&lt;/strong> The corpus is Spanish + Catalan, the embedder is &lt;code>all-MiniLM&lt;/code> (English only), the reranker is &lt;code>bge-reranker-v2-m3&lt;/code> (multilingual). The broad layer retrieves badly because of the embedder, and the reranker has little to rerank. Symptom: Recall@50 &amp;lt; 80%, unrecoverable by changing the reranker.&lt;/p>
&lt;p>&lt;strong>Trap 5 — RRF with &lt;code>k=1&lt;/code>.&lt;/strong> Someone reads the paper, copies the formula and sets &lt;code>k=1&lt;/code> &amp;ldquo;because they do not understand what it does&amp;rdquo;. The result: the first positions of the worst ranking (whichever it is) dominate. The fusion stops averaging and becomes &amp;ldquo;winner-takes-all&amp;rdquo;. Symptom: the final ranking is almost identical to that of just one of the retrievers.&lt;/p>
&lt;p>&lt;strong>Trap 6 — A query rewriter that changes the meaning.&lt;/strong> The LLM rewriter &amp;ldquo;improves&amp;rdquo; &lt;code>&amp;quot;how do I cancel&amp;quot;&lt;/code> into &lt;code>&amp;quot;termination procedure for the premium service for corporate customers&amp;quot;&lt;/code>. It retrieves chunks about corporate customers when the user was a private individual. Over-specification by the rewriter is worse than no rewriter. Symptom: queries from &amp;ldquo;normal&amp;rdquo; users come back worse than the old ones. Mitigation: the rewriter must keep the user&amp;rsquo;s intent and only add context, never assume.&lt;/p>
&lt;p>&lt;strong>Trap 7 — No retrieval telemetry.&lt;/strong> The system serves, the user complains, you do not know whether the fault was the corpus, the retrieval, the reranker or the LLM. Without emitting traces with &lt;code>retrieved_chunks_ids&lt;/code>, &lt;code>retrieved_chunks_scores&lt;/code>, &lt;code>rerank_scores&lt;/code>, &lt;code>query_rewritten_to&lt;/code>, &lt;code>selected_top_k&lt;/code>, debugging is theatre. Symptom: each incident takes days to investigate. The &lt;a href="https://blog.lo0.es/en/posts/mcp-deep-observability-opentelemetry/">tracing with OTel and MCP&lt;/a> piece covers the canonical pattern.&lt;/p>
&lt;p>All seven are operational. Just as with the corpus, retrieval does not break because the maths is wrong: it breaks because the discipline relaxes. And as in Eval, the metrics can go up while the real experience gets worse, because the golden set accommodates itself to the system instead of the system accommodating itself to the golden set.&lt;/p>
&lt;h2 id="what-we-have-not-covered-upcoming-posts">What we have not covered (upcoming posts)&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Embedding model selection and fine-tuning&lt;/strong>: how to choose among the embedders on the MTEB leaderboard without falling into goodharting, when and how to fine-tune an embedder on your own domain with MNR loss or triplet loss, which synthetic dataset is generated with an LLM for training (GPL, InPars, Promptagator), and the gotchas of massive re-embedding when you change model.&lt;/li>
&lt;li>&lt;strong>Semantic cache for RAG&lt;/strong>: how to cache semantically similar queries to serve answers without going through retrieval or the LLM, GPTCache, MeanCache, and the cache&amp;rsquo;s precision/coverage trade-off. It saves 30-70% of the cost on workloads with repeated queries.&lt;/li>
&lt;li>&lt;strong>Multi-vector and ColBERT-v2 at scale&lt;/strong>: how PLAID and CITADEL indexes are designed to serve corpora of 100M+ chunks with late interaction without burning the memory budget.&lt;/li>
&lt;li>&lt;strong>RAG-specific eval — RAGAS deep dive&lt;/strong>: faithfulness, answer relevance, context precision, context recall, noise sensitivity. How the RAG-specific golden set is built (with chunks labelled as relevant/irrelevant) and which metrics correlate with real user satisfaction.&lt;/li>
&lt;li>&lt;strong>Function calling and tool-augmented retrieval&lt;/strong>: when the LLM decides which retriever to invoke (SQL for structured data, vector for unstructured, web search for real time), the ReAct pattern, handling tool errors.&lt;/li>
&lt;li>&lt;strong>Agentic retrieval loops&lt;/strong>: when a single retrieval pass is not enough and the agent iterates (planning, sub-queries, summary-and-refine). The latency / quality trade-off and the anti-patterns (infinite loops, diverging sub-queries).&lt;/li>
&lt;/ul>
&lt;h2 id="see-also">See also&lt;/h2>
&lt;ul>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/serving-embeddings-rerankers-tei-production/">Serving embeddings and rerankers with TEI in production&lt;/a> — how to deploy the cross-encoder reranker with TEI and its /rerank endpoint.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/rag-cpu-data-plane-generation-plane/">Taking RAG to the CPU: separating the data plane from the generation plane&lt;/a> — where each piece runs: light rerank over a top-k fits on CPU; massive rerank demands a GPU.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/">The six-stage LLMOps pipeline&lt;/a> — the master map where the RAG piece crosses Data + Deploy + Observe. Retrieval lives between the curated corpus and the served LLM.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/rag-corpus-curation-active-librarian/">RAG corpus curation: the active librarian&lt;/a> — the previous layer. Without a curated corpus, no reranker rescues the system. Reranking is built on the librarian&amp;rsquo;s work.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/embeddings-2026-dense-sparse-multivector-families/">Embeddings in 2026: the three families, the model zoo and the decision that matters&lt;/a> — the piece that produces the vectors this retrieval consumes. bge-m3 runs dense + sparse + colbert in a single pass; the selection criteria and the real cost per million chunks are there.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/ontologies-knowledge-graphs-llmops-linnaean-nomenclature/">Ontologies and knowledge graphs in LLMOps&lt;/a> — the fourth retrieval channel alongside dense / sparse / multi-vector. GraphRAG (Microsoft v2 / LightRAG / HippoRAG 2 / KAG) joins the three-round committee via RRF, and typed chunks enable reranking by graph distance.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/postgresql-qdrant-rag-ingestion-postman-syncing-two-worlds/">PostgreSQL + Qdrant in the ingestion stage&lt;/a> — the retrieval microservice consumes the vector store that this architecture keeps in sync.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/rag-on-kafka-reference-architecture-streaming-datalakes/">RAG over Kafka and a datalake&lt;/a> — the streaming transport that keeps fresh the index this post&amp;rsquo;s retrieval operates over.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/anatomy-llm-request-production-tour-six-stages/">Anatomy of an LLM request in production, May 2026&lt;/a> — the forensic tour of the request crosses retrieval; this post details what happens inside that box.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">Evals for LLMs: the layer after tracing&lt;/a> — the retrieval&amp;rsquo;s Recall@k and nDCG@k are metrics the eval gate can use as a promotion criterion. If they drop, the adapter deploy is blocked.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/data-versioning-llmops-dvc-lakefs-reproducible-golden-dataset/">Data versioning: DVC, lakeFS and the challenge of a reproducible golden dataset&lt;/a> — the retrieval golden eval (queries with relevance-labelled chunks) is one of the four data artefacts worth versioning separately.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/llm-guardrails-safety-four-lines-of-defence/">Guardrails and safety for LLMs&lt;/a> — output filters are applied after the LLM, but retrieval also receives adversarial queries worth filtering beforehand (prompt injection via the query). The reranker is also a natural point for discarding chunks with sensitive material that slipped into the corpus.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/vllm-kubernetes-llm-inference-that-scales/">vLLM on Kubernetes&lt;/a> — the downstream LLM and the light LLMs for rewriter/HyDE are served with the same engine.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/oss-catalogue-llmops-six-stages-tool-by-tool/">The OSS catalogue for LLMOps in six stages&lt;/a> — spec sheets for Qdrant, Elasticsearch, TEI, vLLM, Langfuse, Phoenix.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/semantic-cache-rag-receptionist-photographic-memory/">Semantic cache in RAG: the receptionist with a photographic memory&lt;/a> — the middleware placed before this retrieval; when the query is semantically similar to one already answered (cosine ≥ θ), the reranking committee never even fires.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/evaluating-rag-ragas-golden-dataset-metrics/">Evaluating a RAG without fooling yourself: RAGAS, the golden dataset and the four metrics that matter&lt;/a> — context precision and context recall measure exactly the quality of this three-round committee; faithfulness measures what the LLM does with the resulting top-5.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/function-calling-tool-augmented-retrieval-detective-knows-which-file/">Function calling and tool-augmented retrieval: the detective who knows which file to ask for&lt;/a> — the retriever in this post is the &lt;code>vector_search&lt;/code> tool the LLM invokes in the ReAct pattern; the three-layer pipeline described here runs every time the agent picks that tool.&lt;/p>
&lt;/li>
&lt;/ul>
&lt;h2 id="references">References&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>BEIR&lt;/strong>: Thakur et al. (2021). &amp;ldquo;BEIR: A Heterogeneous Benchmark for Zero-shot Evaluation of Information Retrieval Models.&amp;rdquo; NeurIPS 2021 Datasets and Benchmarks Track. &lt;a href="https://github.com/beir-cellar/beir">https://github.com/beir-cellar/beir&lt;/a>&lt;/li>
&lt;li>&lt;strong>SPLADE&lt;/strong>: Formal et al. (2021). &amp;ldquo;SPLADE: Sparse Lexical and Expansion Model for First Stage Ranking.&amp;rdquo; SIGIR 2021. &lt;a href="https://arxiv.org/abs/2107.05720">https://arxiv.org/abs/2107.05720&lt;/a>&lt;/li>
&lt;li>&lt;strong>ColBERT-v2&lt;/strong>: Santhanam et al. (2022). &amp;ldquo;ColBERTv2: Effective and Efficient Retrieval via Lightweight Late Interaction.&amp;rdquo; NAACL 2022. &lt;a href="https://arxiv.org/abs/2112.01488">https://arxiv.org/abs/2112.01488&lt;/a>&lt;/li>
&lt;li>&lt;strong>Reciprocal Rank Fusion&lt;/strong>: Cormack, Clarke, Buettcher (2009). &amp;ldquo;Reciprocal Rank Fusion outperforms Condorcet and individual Rank Learning Methods.&amp;rdquo; SIGIR 2009. &lt;a href="https://dl.acm.org/doi/10.1145/1571941.1572114">https://dl.acm.org/doi/10.1145/1571941.1572114&lt;/a>&lt;/li>
&lt;li>&lt;strong>HyDE&lt;/strong>: Gao et al. (2022). &amp;ldquo;Precise Zero-Shot Dense Retrieval without Relevance Labels.&amp;rdquo; &lt;a href="https://arxiv.org/abs/2212.10496">https://arxiv.org/abs/2212.10496&lt;/a>&lt;/li>
&lt;li>&lt;strong>Step-back prompting&lt;/strong>: Zheng et al. (2023). &amp;ldquo;Take a Step Back: Evoking Reasoning via Abstraction in Large Language Models.&amp;rdquo; &lt;a href="https://arxiv.org/abs/2310.06117">https://arxiv.org/abs/2310.06117&lt;/a>&lt;/li>
&lt;li>&lt;strong>BGE-M3&lt;/strong>: Chen et al. (2024). &amp;ldquo;BGE M3-Embedding: Multi-Lingual, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillation.&amp;rdquo; &lt;a href="https://arxiv.org/abs/2402.03216">https://arxiv.org/abs/2402.03216&lt;/a>&lt;/li>
&lt;li>&lt;strong>MTEB leaderboard&lt;/strong>: &lt;a href="https://huggingface.co/spaces/mteb/leaderboard">https://huggingface.co/spaces/mteb/leaderboard&lt;/a> — útil como punto de partida, peligroso como criterio único (overfitting al benchmark, dataset contamination).&lt;/li>
&lt;li>&lt;strong>TEI (Text Embeddings Inference)&lt;/strong>: &lt;a href="https://github.com/huggingface/text-embeddings-inference">https://github.com/huggingface/text-embeddings-inference&lt;/a> — el motor de serving de HuggingFace para embedders y rerankers de tamaño pequeño-mediano. Endpoint OpenAI-compatible.&lt;/li>
&lt;li>&lt;strong>Qdrant hybrid search&lt;/strong>: &lt;a href="https://qdrant.tech/documentation/concepts/hybrid-queries/">https://qdrant.tech/documentation/concepts/hybrid-queries/&lt;/a> — implementación nativa de RRF y multi-vector queries.&lt;/li>
&lt;li>&lt;strong>RAGatouille&lt;/strong>: &lt;a href="https://github.com/AnswerDotAI/RAGatouille">https://github.com/AnswerDotAI/RAGatouille&lt;/a> — wrapper Python para ColBERT-v2 que reduce drásticamente la curva de entrada.&lt;/li>
&lt;li>&lt;strong>Cohere Rerank 3&lt;/strong>: &lt;a href="https://docs.cohere.com/docs/rerank-2">https://docs.cohere.com/docs/rerank-2&lt;/a> — referencia técnica del reranker comercial multilingüe líder.&lt;/li>
&lt;/ul></description></item><item><title>RAG corpus curation: the active librarian who decides what goes in, what goes out and what gets signed</title><link>https://blog.lo0.es/en/posts/rag-corpus-curation-active-librarian/</link><pubDate>Mon, 25 May 2026 11:00:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/rag-corpus-curation-active-librarian/</guid><description>&lt;blockquote>
&lt;p>This is the &lt;strong>curation&lt;/strong> layer inside stage 1 (Data) of the &lt;a href="https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/">six-stage LLMOps pipeline&lt;/a>. It complements the other Data posts: &lt;a href="https://blog.lo0.es/en/posts/data-versioning-llmops-dvc-lakefs-reproducible-golden-dataset/">dataset versioning&lt;/a> for the four versionable artefacts, &lt;a href="https://blog.lo0.es/en/posts/postgresql-qdrant-rag-ingestion-postman-syncing-two-worlds/">PostgreSQL + Qdrant ingestion in microservices&lt;/a> for the outbox + CDC pattern, and &lt;a href="https://blog.lo0.es/en/posts/rag-on-kafka-reference-architecture-streaming-datalakes/">RAG over Kafka and a datalake&lt;/a> for streaming transport. This post is not about moving data: it is about what to do with data before you let a model read it.&lt;/p>
&lt;/blockquote>
&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>A RAG system serving mediocre answers is rarely the retriever&amp;rsquo;s fault, nor the model&amp;rsquo;s. The root cause is usually the corpus: three nearly identical versions of the same PDF that make top-k return the same thing three times, an old manual nobody removed that contradicts the current one, a free-text field with customer numbers that the model quotes verbatim, a scanned PDF with dirty OCR that the chunker cut in the middle of a sentence. None of that is fixed by changing the model, the embedder, the reranker or the prompt. It is fixed by curating the corpus. This post takes apart the five operational layers of curation (schema-validated ingest, three-level deduplication, PII anonymisation measured with precision/recall, anti-contamination against the golden eval set, chunk→trace lineage), the minimum maths needed to avoid fooling yourself, the 2026 stack (Presidio, Unstructured, Argilla, LangChain text splitters, OpenLineage, Marquez, Great Expectations), the seven traps that reduce the stage to theatre, and the on-premise hardware to sustain all of it without sending anything sensitive to external APIs.&lt;/p>
&lt;h2 id="the-analogy-the-active-librarian">The analogy: the active librarian&lt;/h2>
&lt;div class="diagram" style="max-width:780px;margin:1.5rem auto;">
&lt;svg viewBox="0 0 780 360" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="RAG corpus curation as an active librarian">
&lt;style>
.lbox{fill:#f8f8f8;stroke:#444;stroke-width:1.4;rx:8}
.lhead{fill:#ff8a4c;stroke:#444;stroke-width:1.4;rx:8}
.lstage{fill:#7aafff;stroke:#444;stroke-width:1.4;rx:8}
.lblt{font:600 13px sans-serif;fill:#222}
.lsub{font:400 11px sans-serif;fill:#555}
.larr{stroke:#666;stroke-width:1.5;fill:none;marker-end:url(#mc1)}
.lgate{fill:#ffd76b;stroke:#444;stroke-width:1.6;rx:6}
.lrej{fill:#f4b8b8;stroke:#a44;stroke-width:1.4;rx:6}
&lt;/style>
&lt;defs>&lt;marker id="mc1" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#666"/>&lt;/marker>&lt;/defs>
&lt;rect x="20" y="20" width="180" height="60" class="lhead"/>
&lt;text x="110" y="44" text-anchor="middle" class="lblt">Document arrives&lt;/text>
&lt;text x="110" y="62" text-anchor="middle" class="lsub">PDF, HTML, ticket, manual&lt;/text>
&lt;text x="110" y="76" text-anchor="middle" class="lsub">(book offered to the librarian)&lt;/text>
&lt;rect x="240" y="20" width="160" height="60" class="lstage"/>
&lt;text x="320" y="44" text-anchor="middle" class="lblt">1 · Schema check&lt;/text>
&lt;text x="320" y="62" text-anchor="middle" class="lsub">Great Expectations&lt;/text>
&lt;text x="320" y="76" text-anchor="middle" class="lsub">required fields + types&lt;/text>
&lt;rect x="440" y="20" width="160" height="60" class="lstage"/>
&lt;text x="520" y="44" text-anchor="middle" class="lblt">2 · Dedup&lt;/text>
&lt;text x="520" y="62" text-anchor="middle" class="lsub">exact + near + semantic&lt;/text>
&lt;text x="520" y="76" text-anchor="middle" class="lsub">hash + MinHash + cosine&lt;/text>
&lt;rect x="640" y="20" width="120" height="60" class="lstage"/>
&lt;text x="700" y="44" text-anchor="middle" class="lblt">3 · PII&lt;/text>
&lt;text x="700" y="62" text-anchor="middle" class="lsub">Presidio + recall&lt;/text>
&lt;text x="700" y="76" text-anchor="middle" class="lsub">measured vs golden&lt;/text>
&lt;path class="larr" d="M200,50 L240,50"/>
&lt;path class="larr" d="M400,50 L440,50"/>
&lt;path class="larr" d="M600,50 L640,50"/>
&lt;rect x="100" y="130" width="220" height="60" class="lstage"/>
&lt;text x="210" y="154" text-anchor="middle" class="lblt">4 · Anti-contamination&lt;/text>
&lt;text x="210" y="172" text-anchor="middle" class="lsub">cross-check against golden eval set&lt;/text>
&lt;text x="210" y="186" text-anchor="middle" class="lsub">reject token-by-token overlaps&lt;/text>
&lt;rect x="360" y="130" width="220" height="60" class="lstage"/>
&lt;text x="470" y="154" text-anchor="middle" class="lblt">5 · Lineage emit&lt;/text>
&lt;text x="470" y="172" text-anchor="middle" class="lsub">OpenLineage event with source,&lt;/text>
&lt;text x="470" y="186" text-anchor="middle" class="lsub">hash, schema_version, embedder&lt;/text>
&lt;rect x="600" y="130" width="160" height="60" class="lgate"/>
&lt;text x="680" y="154" text-anchor="middle" class="lblt">Gate&lt;/text>
&lt;text x="680" y="172" text-anchor="middle" class="lsub">passes all 5 layers →&lt;/text>
&lt;text x="680" y="186" text-anchor="middle" class="lsub">index in the vector store&lt;/text>
&lt;path class="larr" d="M700,86 L210,124"/>
&lt;path class="larr" d="M700,86 L470,124"/>
&lt;path class="larr" d="M700,86 L680,124"/>
&lt;rect x="80" y="240" width="280" height="60" class="lbox"/>
&lt;text x="220" y="264" text-anchor="middle" class="lblt">Accept → living corpus&lt;/text>
&lt;text x="220" y="282" text-anchor="middle" class="lsub">chunks with metadata, embeddings computed,&lt;/text>
&lt;text x="220" y="296" text-anchor="middle" class="lsub">indexed with dataset_hash in metadata&lt;/text>
&lt;rect x="400" y="240" width="280" height="60" class="lrej"/>
&lt;text x="540" y="264" text-anchor="middle" class="lblt">Reject → auditable quarantine&lt;/text>
&lt;text x="540" y="282" text-anchor="middle" class="lsub">rejection reason + diff vs previous version&lt;/text>
&lt;text x="540" y="296" text-anchor="middle" class="lsub">available for human review&lt;/text>
&lt;path class="larr" d="M580,196 L220,236"/>
&lt;path class="larr" d="M700,196 L540,236"/>
&lt;text x="390" y="338" text-anchor="middle" class="lsub" style="font-style:italic;">The active librarian: pass 5 layers or stay out. Nothing is accepted because "it was already there".&lt;/text>
&lt;/svg>
&lt;/div>
&lt;p>A serious librarian does not accept books by the kilo. When someone offers a new volume:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>They look at the spine, the ISBN and the stamp&lt;/strong>: is it legible? Is it catalogued correctly? Does it belong to a recognised collection? Without valid metadata, it does not get in. This is the &lt;strong>schema check&lt;/strong>.&lt;/li>
&lt;li>&lt;strong>They check whether they already hold a copy&lt;/strong>: is it exactly the same book? Is it a later edition of the same one? Is it a translated version of something already on the shelves? If so, they decide explicitly what to do (replace, archive the old one, withdraw both from lending). This is &lt;strong>dedup&lt;/strong> at its three levels.&lt;/li>
&lt;li>&lt;strong>They flag what is restricted&lt;/strong>: if the book contains identifiable personal data, some pages cannot be lent as they are, so they must be redacted, anonymised or moved to the reserved section. This is &lt;strong>PII anonymisation&lt;/strong>.&lt;/li>
&lt;li>&lt;strong>They verify it is not this year&amp;rsquo;s final exam book&lt;/strong>: if it is, it stays out of the public collection until the syllabus changes, because if students can consult it the exam stops measuring what it is meant to measure. This is &lt;strong>anti-contamination&lt;/strong> against the golden eval set.&lt;/li>
&lt;li>&lt;strong>They write it into the register&lt;/strong>: this book, this edition, this provenance, this date, this person who approved the entry. This is &lt;strong>lineage&lt;/strong>.&lt;/li>
&lt;/ol>
&lt;p>If the book passes all five, it joins the collection. If it fails any of them, it goes to an &lt;strong>auditable quarantine shelf&lt;/strong> with the reason for rejection. The difference between a good collection and a mediocre one is not size: it is how much discipline you apply across the five layers, every day, to every new book that arrives.&lt;/p>
&lt;p>A RAG corpus is exactly that. The only differences are scale (thousands or millions of documents per month) and the fact that the &amp;ldquo;readers&amp;rdquo; are LLMs that cannot tell a duplicate from a reinforced truth, nor a PII value from a synthetic example, nor a contaminated fragment from an authentic one.&lt;/p>
&lt;h2 id="the-four-data-artefacts-and-where-the-rag-corpus-fits">The four data artefacts and where the RAG corpus fits&lt;/h2>
&lt;p>Before going down to the five layers it is worth being clear about which corpus we are curating. The Data stage of the pipeline manages four distinct artefacts, each with its own discipline. The &lt;a href="https://blog.lo0.es/en/posts/data-versioning-llmops-dvc-lakefs-reproducible-golden-dataset/">data versioning post&lt;/a> lists them; here I reorder them from a curation perspective:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Artefact&lt;/th>
&lt;th>Who consumes it&lt;/th>
&lt;th>Dominant curation&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>Training dataset&lt;/strong>&lt;/td>
&lt;td>Tune (fine-tuning the model or an adapter)&lt;/td>
&lt;td>aggressive dedup + quality filters + label balancing&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>RAG corpus&lt;/strong>&lt;/td>
&lt;td>Deploy (retrieval at request time)&lt;/td>
&lt;td>the 5 layers in this post&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Golden eval set&lt;/strong>&lt;/td>
&lt;td>Eval (promotion gates)&lt;/td>
&lt;td>strict hold-out + stratification + maintenance driven by incidents&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Retrain enriched dataset&lt;/strong>&lt;/td>
&lt;td>Retrain (closing the loop)&lt;/td>
&lt;td>production feedback + human triage&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The &lt;strong>RAG corpus&lt;/strong> is the most volatile of the four and the one most exposed to the end user: every answer the system serves literally contains fragments of it. A duplicate in the training dataset degrades learning but ends up buried in the weights; a duplicate in the RAG corpus shows up in today&amp;rsquo;s answer and tomorrow&amp;rsquo;s. That justifies the extra discipline that follows.&lt;/p>
&lt;h2 id="layer-1--schema-validated-ingest">Layer 1 — Schema-validated ingest&lt;/h2>
&lt;p>Every piece entering the corpus has to arrive with &lt;strong>structured metadata validated against a schema&lt;/strong>. This is not bureaucracy: it is the only way to make the following layers (dedup, PII, lineage) work without friction.&lt;/p>
&lt;p>The canonical pattern is to define a schema in JSON Schema or Pydantic that every document must satisfy:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-python" data-lang="python">&lt;span class="line">&lt;span class="cl">&lt;span class="k">class&lt;/span> &lt;span class="nc">CorpusDocument&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">BaseModel&lt;/span>&lt;span class="p">):&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">source_system&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="nb">str&lt;/span> &lt;span class="c1"># e.g. &amp;#34;confluence&amp;#34;, &amp;#34;salesforce&amp;#34;, &amp;#34;manual_pdf&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">source_id&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="nb">str&lt;/span> &lt;span class="c1"># unique ID in the source system&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">version&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="nb">str&lt;/span> &lt;span class="c1"># document version (semver or date)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">language&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="nb">str&lt;/span> &lt;span class="c1"># ISO 639-1: &amp;#34;es&amp;#34;, &amp;#34;en&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">title&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="nb">str&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">body&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="nb">str&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">captured_at&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="n">datetime&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">captured_by&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="nb">str&lt;/span> &lt;span class="c1"># pipeline or human&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">sensitivity&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="n">Literal&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s2">&amp;#34;public&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s2">&amp;#34;internal&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s2">&amp;#34;restricted&amp;#34;&lt;/span>&lt;span class="p">]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">schema_version&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="nb">str&lt;/span> &lt;span class="c1"># version of the schema itself, not of the document&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Any piece that fails this contract is rejected at ingest and never reaches the following layers. Validation is done with &lt;strong>Great Expectations&lt;/strong> (declarative suites), &lt;strong>Pandera&lt;/strong> (more pythonic, integrates with pandas) or &lt;strong>Soda&lt;/strong> (oriented towards continuous data quality). The choice is a matter of style; what matters is:&lt;/p>
&lt;ul>
&lt;li>Validation suites live in code and are versioned with the pipeline, not in a notebook off to one side.&lt;/li>
&lt;li>Rejection generates an auditable event (quarantine) with the specific schema failure as its reason, not a log line lost in stdout.&lt;/li>
&lt;li>The schema itself is versioned. When it changes, previous documents are reprocessed or explicit backward compatibility is maintained.&lt;/li>
&lt;/ul>
&lt;p>The &lt;a href="https://blog.lo0.es/en/posts/rag-on-kafka-reference-architecture-streaming-datalakes/">RAG over Kafka post&lt;/a> covers the &lt;strong>Schema Registry&lt;/strong> pattern (Confluent Schema Registry or Apicurio) that materialises this in streaming: every message on the topic is validated against the registered schema before propagating downstream. For batch or pull, Great Expectations is the equivalent.&lt;/p>
&lt;p>&lt;strong>Common trap&lt;/strong>: leaving the &lt;code>body&lt;/code> field free with no further validation. You have to tighten it up with minimum/maximum length (a PDF that yields 12 characters after extraction is almost certainly broken), valid encoding (UTF-8 with no control characters), proportion of alphanumeric characters (dirty OCR returns a soup of symbols). These are simple rules that filter 80% of the noise with no need for AI.&lt;/p>
&lt;h2 id="layer-2--three-level-deduplication">Layer 2 — Three-level deduplication&lt;/h2>
&lt;p>The most expensive and most silent mistake in a RAG corpus is the duplicate. A document that appears three times in the corpus makes retrieval&amp;rsquo;s top-k return it three times, wasting two slots and reinforcing a single source. The LLM reads it as if three independent sources agreed, when in fact it is the same thing repeated.&lt;/p>
&lt;p>Deduplication is done at three levels, in this order by cost:&lt;/p>
&lt;h3 id="level-a--exact-dedup-sha-256-hash">Level A — Exact dedup (SHA-256 hash)&lt;/h3>
&lt;p>Compute the hash of the normalised content (trim, lower-case where applicable, remove redundant whitespace) and compare it against an index of already ingested hashes. On a match, discard or replace. Cost: \(O(1)\) per document. It catches literal duplicates (the same PDF uploaded twice, two byte-for-byte copies of the same HTML).&lt;/p>
&lt;h3 id="level-b--near-duplicate-minhash--lsh">Level B — Near-duplicate (MinHash + LSH)&lt;/h3>
&lt;p>Nearly identical documents with minor differences (a different header, an updated date, one version in Castilian and another in Galician with minimal changes). The canonical algorithm is &lt;strong>MinHash with Locality-Sensitive Hashing (LSH)&lt;/strong>, which approximates Jaccard similarity over shingles of k tokens. For n documents, comparing all against all is \(O(n^2)\), which is unworkable for large corpora. LSH cuts the cost to \(O(n)\) most-likely buckets.&lt;/p>
&lt;p>A typical threshold is Jaccard ≥ 0.80 over shingles of 5 tokens. The standard libraries are &lt;code>datasketch&lt;/code> (Python, MIT) or &lt;code>dedup&lt;/code> (Python, MIT). A numerical example: for 1 M short documents (300 tokens each), &lt;code>datasketch.MinHashLSH&lt;/code> with 128 permutations and threshold 0.8 takes about 2 GB of RAM and processes the full corpus in around 30 minutes on a modern CPU. The fraction of duplicates found in a real enterprise corpus is usually between 5% and 25%; removing them cuts storage and improves retrieval quality at the same time.&lt;/p>
&lt;h3 id="level-c--semantic-dedup-cosine-over-embeddings">Level C — Semantic dedup (cosine over embeddings)&lt;/h3>
&lt;p>Documents saying the same thing in different words, such as paraphrases, translations or rewritten versions, are not caught by MinHash. This is where semantic similarity comes in: compute the embedding of each document and compare the cosine between pairs.&lt;/p>
&lt;p>The problem is quadratic cost: for n documents, computing every pair is \(O(n^2)\). For n = 1 M and 768-dimensional embeddings (a typical model such as &lt;code>BAAI/bge-base-en-v1.5&lt;/code>), that is 5×10^11 dot products, which is unworkable. The solution is the same idea as LSH but over dense vectors: &lt;strong>HNSW&lt;/strong> (Hierarchical Navigable Small World) or &lt;strong>IVF&lt;/strong> (Inverted File) to build an approximate search index. For each new document you run a k-NN query against the index and examine only the k nearest neighbours.&lt;/p>
&lt;p>A sensible threshold for treating something as a semantic duplicate: &lt;strong>cosine ≥ 0.95&lt;/strong>. Below 0.95 the documents are related but distinct; above it, they are almost always the same information rewritten. The exact threshold is calibrated by observing precision/recall over a human-annotated sample; 100 pairs confirmed by a reviewer is reasonable for setting it.&lt;/p>
&lt;p>A numerical example: with &lt;code>qdrant&lt;/code> or &lt;code>pgvector&lt;/code> as the HNSW index and k=10 neighbours per query, deduplicating 1 M documents against the existing corpus takes on the order of 2-4 hours on an RTX 4090 (including embedding computation). If the embedder is self-hosted with vLLM, the cost per token is negligible against compute time.&lt;/p>
&lt;h3 id="policy-on-what-to-do-with-a-duplicate">Policy on what to do with a duplicate&lt;/h3>
&lt;p>Detection is not enough, you have to decide. Three common policies, in order of complexity:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Drop&lt;/strong>: discard the more recent one, keep the older one. Simple, with no extra lineage.&lt;/li>
&lt;li>&lt;strong>Replace&lt;/strong>: discard the old one, index the new one. More volatility but it reflects the update.&lt;/li>
&lt;li>&lt;strong>Merge with provenance&lt;/strong>: mark the new one as a &amp;ldquo;shadow&amp;rdquo; of the old one, keep both in lineage but index only one. Better for regulated audit.&lt;/li>
&lt;/ul>
&lt;p>The policy has to be explicit and applied uniformly, not an ad-hoc decision per document.&lt;/p>
&lt;h2 id="layer-3--pii-anonymisation-with-measured-precisionrecall">Layer 3 — PII anonymisation with measured precision/recall&lt;/h2>
&lt;p>This layer is the one that most easily turns into theatre. The typical mistake: install Presidio, run it over the corpus, assume the output is clean. Without measuring the detector&amp;rsquo;s precision and recall against an annotated golden set, you know nothing.&lt;/p>
&lt;p>A PII detector can fail in two ways:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>False negative&lt;/strong> (low recall): it does not detect a national ID written as &amp;ldquo;12345678-A&amp;rdquo; because your model was trained on the &lt;code>12345678A&lt;/code> format without a hyphen. The RAG serves personal data unredacted.&lt;/li>
&lt;li>&lt;strong>False positive&lt;/strong> (low precision): it redacts a number from a configuration manual thinking it is a phone number. The RAG loses useful information.&lt;/li>
&lt;/ul>
&lt;p>Both are problems; regulation (GDPR, ENS, NIS2) penalises the first, and user experience degrades with the second. The acceptable ratio depends on the domain. In medical data, practically zero false negatives is non-negotiable; in internal technical documentation you can tolerate more recall in exchange for less precision.&lt;/p>
&lt;p>The standard metric is &lt;strong>F1 over an annotated golden set&lt;/strong>:&lt;/p>
\[
\text{precision} = \frac{TP}{TP + FP}, \quad \text{recall} = \frac{TP}{TP + FN}, \quad F_1 = 2 \cdot \frac{\text{precision} \cdot \text{recall}}{\text{precision} + \text{recall}}
\]
&lt;p>To build the PII golden set, annotate around 200 documents by hand with every entity marked (national ID, IBAN, email, phone, address, personal name). Then run the detector and compute the metrics per category, not just aggregated, because a global F1 of 0.90 can hide a recall of 0.55 on IBANs.&lt;/p>
&lt;p>&lt;strong>2026 stack&lt;/strong> for this layer:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Microsoft Presidio&lt;/strong> (MIT, Microsoft): the most complete OSS option. Configurable detectors, recognises around 50 entities by default, extensible with your own regex patterns or with fine-tuned NER models.&lt;/li>
&lt;li>&lt;strong>spaCy NER&lt;/strong> (MIT, Explosion AI): a base for custom detectors; useful when Presidio does not cover a domain entity.&lt;/li>
&lt;li>&lt;strong>Llama Guard 4&lt;/strong> (Llama Community License, Meta): a safety classifier that also detects PII in one pass, an option when you already have a GPU for inference and prefer a single pass.&lt;/li>
&lt;li>&lt;strong>DataFog&lt;/strong> (Apache 2.0): a more recent alternative, specialised in streaming pipelines.&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Recommended hybrid pattern&lt;/strong>: Presidio for rule-based + regex detection (fast, deterministic) → Llama Guard as a second pass over what Presidio did not flag (an ensemble that raises recall without killing throughput). This is measured and reported as aggregate and per-category F1 on every release of the detector.&lt;/p>
&lt;p>&lt;strong>Common fallacy&lt;/strong>: trusting that a detector with F1 0.95 &amp;ldquo;is very good&amp;rdquo;. If you have 1 M documents and each contains on average 1 PII entity, F1 0.95 means 50,000 mishandled entities (between false positives and negatives). With sensitive data you have to design so that false negatives go to human quarantine, not to the public corpus.&lt;/p>
&lt;h2 id="layer-4--anti-contamination-against-the-golden-eval-set">Layer 4 — Anti-contamination against the golden eval set&lt;/h2>
&lt;p>If the RAG corpus contains fragments of the golden eval set, Eval metrics measure memorisation. The model returns the exact answer because it has it literally in its context, not because it generalised anything. Deploy then promotes models that shine in the exam and fail in production.&lt;/p>
&lt;p>This layer is the easiest to implement and the easiest to forget:&lt;/p>
&lt;ol>
&lt;li>The &lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">golden eval set&lt;/a> has its own versioned hash.&lt;/li>
&lt;li>Before indexing any new document into the RAG corpus, run a token-by-token overlap check (or by shingles, similar to MinHash) against the golden set.&lt;/li>
&lt;li>If overlap exceeds a threshold (typically ≥ 30% of 5-token n-grams), the document is not indexed. It stays in quarantine flagged as &amp;ldquo;contamination risk vs golden_v12&amp;rdquo;.&lt;/li>
&lt;li>A human reviews the rejections. Sometimes they are false positives (a short quotation, a boilerplate sentence). Sometimes they are real contamination that a supplier introduced without realising.&lt;/li>
&lt;/ol>
&lt;p>The deeper reason: the RAG corpus and the golden set are enemies by design. The golden set measures how well the system generalises to questions it has not seen. If those questions are in the RAG, the system &amp;ldquo;sees&amp;rdquo; them on every query. The metric stops measuring generalisation.&lt;/p>
&lt;p>This check is computationally trivial, a hash join over n-grams. The difficulty is keeping it up: every time the golden set changes (monthly or quarterly), the full corpus has to be re-validated against the new golden set. Without that discipline, contamination sneaks in through the back door when someone updates the golden set with real cases that the RAG was already serving.&lt;/p>
&lt;h2 id="layer-5--end-to-end-lineage-from-document-to-trace">Layer 5 — End-to-end lineage: from document to trace&lt;/h2>
&lt;p>The last layer is the one that closes the auditable chain. Every chunk indexed in the vector store carries metadata that lets you answer the forensic question:&lt;/p>
&lt;blockquote>
&lt;p>&amp;ldquo;The system generated this answer on 14 March at 16:23. Which exact document did the quoted fragment come from? When did that document enter the corpus? Which version of the embedder processed it? Who approved its ingest?&amp;rdquo;&lt;/p>
&lt;/blockquote>
&lt;p>Without lineage, that question is unanswerable. With lineage done properly, it is four queries.&lt;/p>
&lt;p>The canonical pattern:&lt;/p>
&lt;ul>
&lt;li>Every indexed chunk carries in its metadata: &lt;code>source_system&lt;/code>, &lt;code>source_id&lt;/code>, &lt;code>document_version&lt;/code>, &lt;code>chunk_index&lt;/code>, &lt;code>embedder_version&lt;/code>, &lt;code>dataset_hash&lt;/code>, &lt;code>ingested_at&lt;/code>, &lt;code>ingested_by&lt;/code>, &lt;code>schema_version&lt;/code>.&lt;/li>
&lt;li>Every RAG answer in production emits a trace span that includes the retrieved &lt;code>chunk_id&lt;/code> values.&lt;/li>
&lt;li>The central tracing system (&lt;a href="https://blog.lo0.es/en/posts/agentsight-llm-tracing-ebpf-zero-instrumentation/">Langfuse, Phoenix or OpenLLMetry&lt;/a>) joins &lt;code>chunk_id&lt;/code> → chunk metadata → document metadata → corpus &lt;code>dataset_hash&lt;/code> → embedder version → and so on.&lt;/li>
&lt;/ul>
&lt;p>The tools that standardise this glue are &lt;strong>OpenLineage&lt;/strong> (Apache 2.0, LF AI &amp;amp; Data) and &lt;strong>Marquez&lt;/strong> (Apache 2.0, its server implementation). They define a lineage event schema that interoperates between systems; an ingest job emits an event &amp;ldquo;produced corpus_v12.3 from source X with embedder bge-base-v1.5&amp;rdquo;; a retrieval job emits &amp;ldquo;consumed corpus_v12.3 with query Q produced response R&amp;rdquo;. The graph is reconstructed automatically.&lt;/p>
&lt;p>This layer is the only way to pass real audits under regulations such as the EU AI Act, GDPR or ENS, where traceability of which data went into which answer is a requirement, not an option. Without it, the answer &amp;ldquo;we do not know which document this came from&amp;rdquo; is not acceptable, and it is the default answer if lineage is not built from day one.&lt;/p>
&lt;h2 id="the-maths-that-matter">The maths that matter&lt;/h2>
&lt;p>Beyond dedup thresholds and PII F1 scores, there are three mathematical pieces that any serious team ends up using.&lt;/p>
&lt;p>&lt;strong>Chunk size vs retrieval quality&lt;/strong>. Chunk size affects retrieval quality in a non-monotonic way: chunks that are too small fragment ideas (retrieval returns a piece without context), and chunks that are too large dilute the signal (the embedding mixes several topics and similarity drops). The empirical sweet spot for technical text in 2026 is between &lt;strong>256 and 768 tokens per chunk&lt;/strong>, with &lt;strong>15-25% overlap&lt;/strong> between contiguous chunks to preserve continuity.&lt;/p>
&lt;p>Numerically, for a corpus of 1 M documents with a mean length of 2,000 tokens, chunking at 512 tokens with overlap 100 gives \(\frac{2000}{512 - 100} \approx 5\) chunks per document, a total of roughly 5 M indexed chunks. With 768-dimensional embeddings in &lt;code>float32&lt;/code>, that occupies \(5 \cdot 10^6 \cdot 768 \cdot 4 \approx 15\) GB of vector memory, manageable in any modern vector store.&lt;/p>
&lt;p>&lt;strong>PII golden set coverage&lt;/strong>. To know whether the annotated PII golden set is representative enough, compute the proportion of categories covered: if your golden set of 200 documents has 5 IBAN examples and production has 12,000 IBANs per day, the measured F1 on IBANs is statistical noise. Rule of thumb: &lt;strong>a minimum of 30 examples per category&lt;/strong> for per-category metrics to mean anything.&lt;/p>
&lt;p>&lt;strong>Cost of re-embedding when rotating the model&lt;/strong>. Changing the embedder invalidates the whole index. For a corpus of 5 M chunks with a model such as &lt;code>BAAI/bge-base-en-v1.5&lt;/code> (768 dim, around 110 M parameters) served in vLLM on 1× H100, throughput is on the order of 8,000-15,000 chunks/second. Full re-embedding: about 5-10 minutes. For a larger embedder (&lt;code>bge-large&lt;/code>, 1024 dim, around 335 M parameters), a factor of 3× worse, around 15-30 minutes. The bottleneck is usually vector store I/O, not GPU compute. The &lt;strong>dual-index&lt;/strong> pattern, keeping the old index serving while the new one is built and doing an atomic swap at the end, avoids downtime and allows rollback.&lt;/p>
&lt;h2 id="applied-to-typical-on-premise-hardware">Applied to typical on-premise hardware&lt;/h2>
&lt;p>For an on-premise deployment that keeps all curation in-house without sending data to external APIs:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>RTX 4090 (24 GB)&lt;/strong>: covers layer 1 (the schema check with Great Expectations is CPU-bound), layer 2 levels A and B (hash + MinHash are CPU-bound), and layer 2 level C semantic dedup with a &lt;code>bge-base&lt;/code>-class embedder (8-15k chunks/s, enough for corpora of up to 5-10 M chunks in hours). For Presidio in NER mode (layer 3) it runs comfortably. It is the sensible GPU for the whole curation pipeline on a mid-size corpus.&lt;/li>
&lt;li>&lt;strong>Generic 4×H100 SXM configuration (320 GB total, NVLink)&lt;/strong>: only needed if the corpus exceeds around 50 M chunks or if you want frequent re-embeddings with large models (&lt;code>bge-large&lt;/code>, &lt;code>e5-mistral&lt;/code>). In practice, two GPUs serve the embedder at TP=2 with throughput above 50k chunks/s, and the other two go to the PII judge (Llama Guard 4) or to serving the main inference model. Capacity for corpora of hundreds of millions of chunks.&lt;/li>
&lt;/ul>
&lt;p>The stubborn arithmetic: with a 4090, corpus curation is an overnight job; with 4×H100, it is minutes. The decision depends on corpus size and on how often you rotate the embedder or the PII rules.&lt;/p>
&lt;h2 id="the-seven-traps-that-kill-this-stage">The seven traps that kill this stage&lt;/h2>
&lt;p>&lt;strong>Trap 1 — No validated schema at ingest.&lt;/strong> Malformed documents reach the chunker, the chunker slices them into nonsense, garbage embeddings enter the index. The RAG answer quotes incoherent text and nobody knows why.&lt;/p>
&lt;p>&lt;strong>Trap 2 — Dedup only at exact hash level.&lt;/strong> The corpus fills up with paraphrases and translations of the same document. Retrieval&amp;rsquo;s top-k returns the same source 3 times. The LLM reads it as three confirmations.&lt;/p>
&lt;p>&lt;strong>Trap 3 — PII detector without precision/recall measurement.&lt;/strong> Everyone assumes Presidio &amp;ldquo;works&amp;rdquo;. IBANs in non-standard formats slip through. The RAG serves personal data.&lt;/p>
&lt;p>&lt;strong>Trap 4 — Golden eval set contaminated with the corpus.&lt;/strong> Eval metrics measure memorisation. Promotions approve models that fail in real production.&lt;/p>
&lt;p>&lt;strong>Trap 5 — No lineage down to the chunk.&lt;/strong> The question &amp;ldquo;where did this quotation come from?&amp;rdquo; has no answer. Regulatory audit fails. Incidents cannot be investigated.&lt;/p>
&lt;p>&lt;strong>Trap 6 — Maintenance as a one-off event.&lt;/strong> The corpus is curated once when the system is initialised, and afterwards everyone assumes it is fine. Six months later the documents are out of date, the new PII rules are not applied retrospectively, dedup has not been re-run after adding new sources. The corpus degrades silently.&lt;/p>
&lt;p>&lt;strong>Trap 7 — Quarantine without human review.&lt;/strong> Rejected documents go into a table nobody looks at. False positives pile up, real contamination cases go uninvestigated, the team&amp;rsquo;s trust in curation erodes and the pressure to &amp;ldquo;relax the thresholds&amp;rdquo; begins.&lt;/p>
&lt;p>All seven are operational, not technical. Corpus curation does not break because of an algorithm bug: it breaks because discipline slackens. It is the exact equivalent of the kind of degradation that kills Eval suites, and in both cases the symptom is the same: the metrics improve or hold steady while the real experience gets worse.&lt;/p>
&lt;h2 id="what-we-have-not-covered-upcoming-posts">What we have not covered (upcoming posts)&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Vector store versioning proper&lt;/strong>: an embedding index is not versioned like a raw dataset because it depends on the embedding model. Changing the embedder rewrites the whole index. It is a different animal with its own patterns (index branching, selective reembedding, recall-aware ANN parameters).&lt;/li>
&lt;li>&lt;strong>Streaming corpus updates with CDC&lt;/strong>: when the corpus has to be updated in near-real time from an OLTP system. The &lt;a href="https://blog.lo0.es/en/posts/postgresql-qdrant-rag-ingestion-postman-syncing-two-worlds/">Postgres + Qdrant ingestion post&lt;/a> covers the mechanics; still pending is the pattern for selectively invalidating chunks that depend on deleted rows.&lt;/li>
&lt;li>&lt;strong>Multi-tenant corpus isolation&lt;/strong>: how to set up a shared corpus versus one with per-tenant namespaces, with ACLs over individual chunks. Especially relevant for multi-customer RAG under data sovereignty constraints.&lt;/li>
&lt;li>&lt;strong>Federated corpus&lt;/strong>: corpora distributed across silos that the system queries without centralising the content. An emerging pattern for companies with several sites and cross-border restrictions.&lt;/li>
&lt;li>&lt;strong>Reranking-aware curation&lt;/strong>: how curation discipline changes when there is a reranker (Cohere Rerank, ColBERTv2, BGE-Reranker) reordering the top-k after retrieval. Some duplicates you would tolerate without a reranker become intolerable when the reranker pushes them up the ranking.&lt;/li>
&lt;/ul>
&lt;h2 id="see-also">See also&lt;/h2>
&lt;ul>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/end-to-end-document-ingestion-pdf-to-indexed-chunk/">End-to-end document ingestion: from PDF to indexed chunk&lt;/a> — how curation materialises in the ingestion pipeline, from PDF to indexed chunk.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/">The six-stage LLMOps pipeline&lt;/a> — Stage 1 (Data) and why curation is the most underrated sub-task in the whole chain.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/embeddings-2026-dense-sparse-multivector-families/">Embeddings in 2026: the three families, the model zoo and the decision that matters&lt;/a> — which cartographer processes the chunks curated here to turn them into searchable vectors; embedder selection criteria (bge-m3 / Snowflake Arctic / Jina / Nomic / ColBERT) and storage cost.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/ontologies-knowledge-graphs-llmops-linnaean-nomenclature/">Ontologies and knowledge graphs in LLMOps&lt;/a> — the Linnaean nomenclature without which curation is left with ad-hoc categories; how the chunks in this post are typed against a TBox (FIBO / SNOMED / ENS / schema.org), validated with SHACL and enriched with metadata queryable in SPARQL.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/anatomy-llm-request-production-tour-six-stages/">Anatomy of an LLM request in production, May 2026&lt;/a> — the forensic tour crosses the corpus and the retrieved chunks; here are the criteria any chunk had to pass to be in production.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/data-versioning-llmops-dvc-lakefs-reproducible-golden-dataset/">Data versioning: DVC, lakeFS and the reproducible golden dataset challenge&lt;/a> — the four data artefacts and why they are versioned separately. The RAG corpus is one of the four.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/postgresql-qdrant-rag-ingestion-postman-syncing-two-worlds/">PostgreSQL + Qdrant in the ingestion stage&lt;/a> — the microservices pattern that moves documents from source to vector store. The curation in this post plugs in between ingest and indexer.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/rag-on-kafka-reference-architecture-streaming-datalakes/">RAG over Kafka and a datalake&lt;/a> — streaming transport. Schema Registry materialises layer 1.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">Evals for LLMs: the layer after tracing&lt;/a> — the golden eval set is the RAG corpus&amp;rsquo;s &amp;ldquo;enemy by design&amp;rdquo;; layer 4 (anti-contamination) materialises the discipline between the two.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/prompt-versioning-contract-five-word-change/">Prompt versioning: the contract that stops a five-word change sinking your system&lt;/a> — the &lt;code>prompt_id&lt;/code> travelling in the trace is the counterpart of the corpus &lt;code>dataset_hash&lt;/code> in lineage.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/retrain-closing-the-loop-feedback-dataset-adapter/">Retrain: closing the loop between the production incident and the adapter that fixes it&lt;/a> — the retrain enriched corpus also needs the five layers, with additional emphasis on human feedback.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/oss-catalogue-llmops-six-stages-tool-by-tool/">The OSS catalogue for LLMOps in six stages&lt;/a> — entries for Presidio, Unstructured, Argilla, Great Expectations, OpenLineage.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/llm-guardrails-safety-four-lines-of-defence/">Guardrails and safety in LLMs&lt;/a> — the curation in this post is prevention at ingest; guardrails are mitigation at runtime when something slips through. Line 2 (retrieval GR) filters chunks with indirect prompt injection before they enter the LLM&amp;rsquo;s context.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/iso-42001-aims-on-premise-llm-platform/">ISO/IEC 42001: the operations manual for an AI system&lt;/a> — the five curation layers in this post directly cover controls A.7.3 (acquisition), A.7.4 (quality), A.7.5 (provenance) and A.7.6 (preparation) of the AIMS Annex A.&lt;/p>
&lt;/li>
&lt;/ul>
&lt;h2 id="references">References&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Presidio&lt;/strong>: &lt;a href="https://microsoft.github.io/presidio/">https://microsoft.github.io/presidio/&lt;/a> — official docs, list of supported entities, guide to extending it with custom NER.&lt;/li>
&lt;li>&lt;strong>OpenLineage&lt;/strong>: &lt;a href="https://openlineage.io/">https://openlineage.io/&lt;/a> — event schema spec and libraries per language.&lt;/li>
&lt;li>&lt;strong>Marquez&lt;/strong>: &lt;a href="https://marquezproject.ai/">https://marquezproject.ai/&lt;/a> — server implementation of OpenLineage.&lt;/li>
&lt;li>&lt;strong>datasketch (MinHash + LSH)&lt;/strong>: &lt;a href="https://ekzhu.com/datasketch/">https://ekzhu.com/datasketch/&lt;/a> — the reference Python library for near-duplicate deduplication at scale.&lt;/li>
&lt;li>&lt;strong>Great Expectations&lt;/strong>: &lt;a href="https://docs.greatexpectations.io/">https://docs.greatexpectations.io/&lt;/a> — declarative data quality suites.&lt;/li>
&lt;li>&lt;strong>Unstructured&lt;/strong>: &lt;a href="https://docs.unstructured.io/">https://docs.unstructured.io/&lt;/a> — parsing and normalisation of heterogeneous documents (PDF, HTML, DOCX, eml) before chunking.&lt;/li>
&lt;li>&lt;strong>Argilla&lt;/strong>: &lt;a href="https://docs.argilla.io/">https://docs.argilla.io/&lt;/a> — human annotation UI for building the PII golden set and other calibration sets.&lt;/li>
&lt;li>&lt;strong>Llama Guard 4&lt;/strong>: Meta technical paper, multimodal safety classifier — useful as a second PII detection layer.&lt;/li>
&lt;li>&lt;strong>GDPR, EU AI Act, ENS, NIS2&lt;/strong> — the regulatory frameworks whose compliance depends, in practice, on the discipline of layers 3 (PII) and 5 (lineage). The CEN/CENELEC technical standards for conformity assessment of GenAI systems under the EU AI Act are still pending final publication.&lt;/li>
&lt;/ul></description></item><item><title>Evals for LLMs: the layer after tracing that decides whether your model performs or only looks like it does</title><link>https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/</link><pubDate>Mon, 25 May 2026 07:30:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/</guid><description>&lt;blockquote>
&lt;p>This is &lt;strong>stage 3&lt;/strong> of the LLMOps pipeline. If you arrive without context on the full journey, the &lt;a href="https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/">six-stage LLMOps pipeline&lt;/a> describes where Eval sits between Tune and Deploy, and the &lt;a href="https://blog.lo0.es/en/posts/anatomy-llm-request-production-tour-six-stages/">anatomy of a production LLM request&lt;/a> shows a real eval blocking the promotion of an adapter.&lt;/p>
&lt;/blockquote>
&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>Tracing is not evaluation. &lt;strong>Tracing tells you what happened; eval tells you whether what happened is any good.&lt;/strong> The two layers live in tools that overlap visually (Langfuse does both), but the discipline is different: tracing is continuous capture over real traffic; eval is controlled execution against a stable dataset, with metrics that have to &lt;strong>fail CI&lt;/strong> if they drop below a threshold. Without eval, the &lt;code>Tune → Deploy&lt;/code> loop closes blind: adapter v8 goes to production because the engineer &amp;ldquo;saw it answering well&amp;rdquo; on five examples. With eval done properly, v8 only gets in if it beats v7 across a battery of 500 curated cases, evaluated by a mix of heuristics, embeddings, an LLM judge calibrated against humans, and a sample of real traffic with human annotation. This post takes apart the mechanism, the mathematics that keep you honest, the real tools in 2026 and the pitfalls that turn it into theatre.&lt;/p>
&lt;h2 id="the-analogy-the-academic-examination-board">The analogy: the academic examination board&lt;/h2>
&lt;div class="diagram" style="max-width:760px;margin:1.5rem auto;">
&lt;svg viewBox="0 0 760 320" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Eval as an academic examination board">
&lt;style>
.tbox{fill:#f8f8f8;stroke:#444;stroke-width:1.4;rx:8}
.thead{fill:#7aafff;stroke:#444;stroke-width:1.4;rx:8}
.tlbl{font:600 13px sans-serif;fill:#222}
.tsub{font:400 11px sans-serif;fill:#555}
.tarr{stroke:#666;stroke-width:1.5;fill:none;marker-end:url(#me1)}
.tgate{fill:#ffd76b;stroke:#444;stroke-width:1.6;rx:6}
&lt;/style>
&lt;defs>&lt;marker id="me1" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#666"/>&lt;/marker>&lt;/defs>
&lt;rect x="20" y="20" width="160" height="60" class="thead"/>
&lt;text x="100" y="44" text-anchor="middle" class="tlbl">Candidate&lt;/text>
&lt;text x="100" y="62" text-anchor="middle" class="tsub">model + adapter + prompt&lt;/text>
&lt;text x="100" y="76" text-anchor="middle" class="tsub">(the "thesis" being defended)&lt;/text>
&lt;rect x="240" y="20" width="200" height="60" class="tbox"/>
&lt;text x="340" y="44" text-anchor="middle" class="tlbl">Fixed syllabus&lt;/text>
&lt;text x="340" y="62" text-anchor="middle" class="tsub">versioned golden dataset&lt;/text>
&lt;text x="340" y="76" text-anchor="middle" class="tsub">(500 questions with expected answer)&lt;/text>
&lt;rect x="500" y="20" width="240" height="60" class="tbox"/>
&lt;text x="620" y="44" text-anchor="middle" class="tlbl">Mixed board&lt;/text>
&lt;text x="620" y="62" text-anchor="middle" class="tsub">heuristics + embeddings + LLM judge&lt;/text>
&lt;text x="620" y="76" text-anchor="middle" class="tsub">+ human sample (calibrated panel)&lt;/text>
&lt;path class="tarr" d="M180,50 L240,50"/>
&lt;path class="tarr" d="M440,50 L500,50"/>
&lt;rect x="40" y="130" width="180" height="60" class="tbox"/>
&lt;text x="130" y="154" text-anchor="middle" class="tlbl">Marks per category&lt;/text>
&lt;text x="130" y="172" text-anchor="middle" class="tsub">faithfulness, relevancy,&lt;/text>
&lt;text x="130" y="186" text-anchor="middle" class="tsub">format, toxicity, latency&lt;/text>
&lt;rect x="270" y="130" width="220" height="60" class="tbox"/>
&lt;text x="380" y="154" text-anchor="middle" class="tlbl">Aggregation + segmentation&lt;/text>
&lt;text x="380" y="172" text-anchor="middle" class="tsub">global mean, by language,&lt;/text>
&lt;text x="380" y="186" text-anchor="middle" class="tsub">by tenant, by question type&lt;/text>
&lt;rect x="540" y="130" width="200" height="60" class="tgate"/>
&lt;text x="640" y="154" text-anchor="middle" class="tlbl">Eval gate (pass mark)&lt;/text>
&lt;text x="640" y="172" text-anchor="middle" class="tsub">faithfulness ≥ 0.85 ∧ tox &amp;lt; 0.02&lt;/text>
&lt;text x="640" y="186" text-anchor="middle" class="tsub">∧ regression vs baseline &amp;lt; 2 pp&lt;/text>
&lt;path class="tarr" d="M620,86 L130,124"/>
&lt;path class="tarr" d="M620,86 L380,124"/>
&lt;path class="tarr" d="M620,86 L640,124"/>
&lt;rect x="40" y="240" width="320" height="60" class="tbox"/>
&lt;text x="200" y="264" text-anchor="middle" class="tlbl">Pass → promotion to production&lt;/text>
&lt;text x="200" y="282" text-anchor="middle" class="tsub">label `production` moves to the candidate&lt;/text>
&lt;rect x="400" y="240" width="320" height="60" class="tbox"/>
&lt;text x="560" y="264" text-anchor="middle" class="tlbl">Fail → back to Tune&lt;/text>
&lt;text x="560" y="282" text-anchor="middle" class="tsub">incident or regression stays in lineage&lt;/text>
&lt;path class="tarr" d="M580,196 L200,236"/>
&lt;path class="tarr" d="M700,196 L560,236"/>
&lt;/svg>
&lt;/div>
&lt;p>A doctoral candidate defends a thesis. They do not defend it before a single distracted professor: they defend it before a &lt;strong>mixed board&lt;/strong>, with a &lt;strong>syllabus fixed in advance&lt;/strong> (not improvised on the day), and with an &lt;strong>explicit pass mark&lt;/strong> that separates pass from fail. The board is not a single expert: it is a panel combining fast readers (the heuristics: does it have the requested format? does it include the citation?), semantic reviewers (the embeddings: does it resemble the expected answer?), an external assessor trained on the subject (the LLM judge: is it faithful to the context, is it relevant, does it sound coherent?), and human jury members on a &lt;strong>sample of the most sensitive cases&lt;/strong>. If the candidate does not reach the mark, they are not promoted: they go back and prepare the defence again.&lt;/p>
&lt;p>That analogy has three edges worth holding on to from the first minute:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>The syllabus is fixed&lt;/strong>, but &lt;strong>it is actively updated when a new topic appears in the real world&lt;/strong> that the candidate must know. If it is not updated, the exam measures something increasingly distant from what happens outside.&lt;/li>
&lt;li>&lt;strong>The board has to be trained&lt;/strong>: an LLM judge not calibrated against humans is an examiner making up the criteria.&lt;/li>
&lt;li>&lt;strong>The pass mark is published beforehand&lt;/strong>: it is not decided after seeing the result, because then it is not a pass mark, it is a justification.&lt;/li>
&lt;/ol>
&lt;p>These three ideas run through the rest of the post. Every tool and every piece of mathematics that follows is, at bottom, a way of operationalising them.&lt;/p>
&lt;h2 id="the-mechanism-itself-four-layers-of-evaluators">The mechanism itself: four layers of evaluators&lt;/h2>
&lt;p>An eval suite in 2026 is made up of four layers that coexist. None replaces the others; each one measures what the rest cannot measure well, and leaves unmeasured what the rest do measure well.&lt;/p>
&lt;p>&lt;strong>Layer 1 — Deterministic heuristics.&lt;/strong> Rules that return &lt;code>true&lt;/code> or &lt;code>false&lt;/code> with no ambiguity: the output matches a regex, contains a specific entity, does not exceed a length, follows a valid JSON schema, respects a requested format (markdown, &lt;code>tool_call&lt;/code> function, mandatory citation). They are cheap, extremely fast, need neither judge nor embeddings, and catch the most frequent class of bug: the model answered in the wrong format. Their limit is obvious, in that they do not know whether the answer is &lt;strong>correct&lt;/strong>, only whether it is &lt;strong>well formed&lt;/strong>.&lt;/p>
&lt;p>&lt;strong>Layer 2 — Semantic metrics with embeddings.&lt;/strong> They compare the model&amp;rsquo;s output with an expected answer by computing cosine similarity between their embeddings, or by measuring whether a claim in the output is entailed by the retrieved context. They are cheap, deterministic given the embedding model, and very useful for detecting answers that drift in meaning but not in form. Their limit is equally clear: two answers can have high cosine similarity and say the opposite of each other (&amp;ldquo;the customer can cancel at any time&amp;rdquo; vs &amp;ldquo;the customer cannot cancel at any time&amp;rdquo; share 80% of their tokens).&lt;/p>
&lt;p>&lt;strong>Layer 3 — LLM-as-judge.&lt;/strong> A model, or an ensemble, evaluates the output of the model under test with a prompt designed to produce a score on a rubric. The canonical methods in 2026 are &lt;strong>G-Eval&lt;/strong> (chain-of-thought prompting with a calibrated numeric score), &lt;strong>Prometheus&lt;/strong> (open-source judge trained specifically for evals, reporting 0.897 correlation with humans in its v2.5 release from late 2025), and &lt;strong>panel-of-judges&lt;/strong> setups that average votes from three heterogeneous models to reduce bias. This layer captures nuances the previous two cannot see: is it faithful to the context? is it useful? is it safe? is it complete? Its limit is cost and the need for calibration, treated as a whole section below.&lt;/p>
&lt;p>&lt;strong>Layer 4 — Humans.&lt;/strong> Trained annotators who evaluate a &lt;strong>sample&lt;/strong> of the eval set, not all of it. They are the only layer with ultimate authority over the rubric: the LLM judge is calibrated against them, not the other way round. They are expensive (≈ 0.50–2.00 € per annotated sample when the domain is technical) and slow (a competent annotator produces 60–120 quality annotations per working day). The mistake teams make again and again is dropping this layer &amp;ldquo;because we have an LLM judge&amp;rdquo;; without humans there is no calibration, and without calibration the judge measures whatever it feels like.&lt;/p>
&lt;p>Normal operation of an eval gate combines all four: heuristics remove malformed outputs before spending judge tokens, embeddings filter out the manifestly irrelevant, the judge scores the rest, and humans annotate a sample every N runs to keep the judge calibrated.&lt;/p>
&lt;h2 id="the-golden-dataset-a-versioned-syllabus">The golden dataset: a versioned syllabus&lt;/h2>
&lt;p>The golden dataset is the most undervalued artefact in the pipeline. It is &lt;strong>the exam&lt;/strong>. If it is badly built, everything else, the best-calibrated judge in the world, the strictest gates, the fastest suite, measures noise. Covered at the top level in the &lt;a href="https://blog.lo0.es/en/posts/data-versioning-llmops-dvc-lakefs-reproducible-golden-dataset/">data versioning post&lt;/a> as one of the four artefacts to version differently; here we go into detail from the Eval perspective.&lt;/p>
&lt;p>The three properties a golden dataset has to satisfy are:&lt;/p>
&lt;p>&lt;strong>Stratified representativeness.&lt;/strong> The dataset has to cover the system&amp;rsquo;s real input space in proportions that reflect production. If 30% of real traffic is in German, 30% of the golden set has to be in German; if 12% of questions are about subscription cancellation, that category cannot be 60% of the eval set just because it was easy to annotate. Stratification stays auditable: each example carries tags (&lt;code>lang=de&lt;/code>, &lt;code>category=cancellation&lt;/code>, &lt;code>tenant_type=enterprise&lt;/code>, &lt;code>difficulty=hard&lt;/code>) and the suite reports metrics per segment, not just the aggregate.&lt;/p>
&lt;p>&lt;strong>Strict holdout, no contamination with training.&lt;/strong> This rule is so obvious that almost every team believes it is following it, and almost every team breaks it without noticing. If the golden eval set gets mixed with the fine-tuning dataset, because somebody did a badly built &lt;code>random_split&lt;/code>, because a purchased dataset is used by other vendors for training, because the LLM judge saw it during pretraining, then the metric stops measuring generalisation and starts measuring memorisation. The eval set hash is versioned separately (covered in the &lt;a href="https://blog.lo0.es/en/posts/continuous-fine-tuning-production-real-traffic-deployed-adapter/">continuous fine-tuning post&lt;/a>) and a routine leakage check is run: if an example in the golden set matches one in training token for token, it raises an alert.&lt;/p>
&lt;p>&lt;strong>Reasoned sample size, not aspirational.&lt;/strong> How many examples are needed? There is a mathematical minimum for telling two models apart with confidence. If model A is right 80% of the time and model B 85% on the same set, the 95% confidence interval for that difference of proportions (unpaired) is:&lt;/p>
\[
\Delta p \pm 1{.}96 \cdot \sqrt{\frac{p_A(1-p_A) + p_B(1-p_B)}{n}}
\]
&lt;p>To distinguish 80% from 85% with 95% confidence (an interval that does not cross zero), you need n ≈ 700 examples. To distinguish 90% from 91% under the same criterion, the calculation gives n ≈ 6,500. A &amp;ldquo;we have 50 examples in the golden set and we see adapter v8 scoring 90%&amp;rdquo; means nothing statistically: the confidence interval is ±8 points. The field&amp;rsquo;s practical rule in 2026 is &lt;strong>a minimum of 300 examples to detect coarse differences, ideally 500–1,500 if you want to detect fine improvements&lt;/strong>, and to start by stratifying properly before obsessing over sample size.&lt;/p>
&lt;p>On top of this comes &lt;strong>active maintenance&lt;/strong>: the golden set is enriched with &lt;strong>production incidents&lt;/strong> (covered in detail in the &lt;a href="https://blog.lo0.es/en/posts/retrain-closing-the-loop-feedback-dataset-adapter/">retrain post&lt;/a>), so that every real complaint that ends in a bug becomes a curated example the next deploy candidate will have to pass. The golden set is not static: it is a &lt;strong>living record of errors the system has already made and must not make again&lt;/strong>.&lt;/p>
&lt;h2 id="llm-as-judge-how-you-calibrate-an-examiner">LLM-as-judge: how you calibrate an examiner&lt;/h2>
&lt;p>Layer 3 is the one most teams misuse. The typical mistake is: &amp;ldquo;we use GPT-4 as judge because it is the most capable&amp;rdquo;. The judge is not chosen for nominal capability; it is chosen for &lt;strong>agreement with humans&lt;/strong> on the specific rubric you are measuring. A judge with 60% agreement is useless even if it is GPT-5; a Prometheus 7B fine-tuned for your domain with 88% agreement is worth more.&lt;/p>
&lt;p>The standard metric for measuring agreement between two annotators (human vs judge, or two humans with each other) is &lt;strong>Cohen&amp;rsquo;s kappa&lt;/strong>, which corrects for the agreement expected by chance:&lt;/p>
\[
\kappa = \frac{p_o - p_e}{1 - p_e}
\]
&lt;p>where \(p_o\) is the observed proportion of agreement and \(p_e\) is the proportion expected by chance under each annotator&amp;rsquo;s marginal distributions. The accepted interpretations in the literature are:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>κ &amp;lt; 0.40&lt;/strong>: poor agreement. The judge says whatever it likes.&lt;/li>
&lt;li>&lt;strong>κ ∈ [0.40, 0.60]&lt;/strong>: moderate. Acceptable for coarse signals (is it toxic?), dreadful for nuance (is it faithful to the context?).&lt;/li>
&lt;li>&lt;strong>κ ∈ [0.60, 0.80]&lt;/strong>: substantial. Useful in production for most metrics.&lt;/li>
&lt;li>&lt;strong>κ &amp;gt; 0.80&lt;/strong>: almost perfect. The judge can be treated as a substitute for the human for that specific kind of judgement.&lt;/li>
&lt;/ul>
&lt;p>Numerically, consider a binary rubric (faithful / not faithful) over 200 examples annotated by a human and by a judge. If the human said &amp;ldquo;faithful&amp;rdquo; in 150 cases and the judge in 140, and they agree on 175 of the 200, then \(p_o = 0{.}875\); the marginals are \(p_h = 0{.}75\), \(p_j = 0{.}70\), and \(p_e = 0{.}75 \cdot 0{.}70 + 0{.}25 \cdot 0{.}30 = 0{.}600\). Kappa comes out at &lt;strong>0.6875&lt;/strong>: substantial but not excellent, usable, with an eye kept on the rubric.&lt;/p>
&lt;p>Calibrating the judge means an explicit process:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Build a calibration set&lt;/strong> — 100–300 examples annotated by trained humans, with written guidelines. Inter-annotator kappa between the humans is also measured; if the humans themselves cannot agree, the rubric is badly written before you even start talking about a judge.&lt;/li>
&lt;li>&lt;strong>Iterate the judge prompt&lt;/strong> until judge agreement with the humans passes the accepted threshold (typically κ ≥ 0.7 for sensitive metrics).&lt;/li>
&lt;li>&lt;strong>Pin the judge version&lt;/strong> (&lt;code>claude-3-5-sonnet-20251022&lt;/code>, &lt;code>gpt-4o-2024-11&lt;/code>, &lt;code>prometheus-2-7b@sha256:…&lt;/code>): any change invalidates the calibration.&lt;/li>
&lt;li>&lt;strong>Recalibrate periodically&lt;/strong> — every time the judge, the judge prompt, or the rubric changes. The frequency the field recommends in 2026 is quarterly at minimum, monthly if the rubric is new.&lt;/li>
&lt;li>&lt;strong>Persist everything in lineage&lt;/strong> — a score of &amp;ldquo;faithfulness 0.87&amp;rdquo; with no traceability of which judge, which prompt, which calibration set and which human validated it, is decorative.&lt;/li>
&lt;/ol>
&lt;p>The &lt;a href="https://blog.lo0.es/en/posts/prompt-versioning-contract-five-word-change/">prompt versioning post&lt;/a> covers how judge prompt versioning is materialised. The practical consequence is that &lt;strong>the judge is versioned like any other model&lt;/strong>: your eval suite has &lt;code>judge_id = prometheus-2.5@v3&lt;/code> just as it has &lt;code>adapter_id = customer_support_v7&lt;/code>.&lt;/p>
&lt;h2 id="the-two-cadences-ci-gate-and-platform-regression">The two cadences: CI gate and platform regression&lt;/h2>
&lt;p>Eval suites live in two places and run on two different cadences. Teams that conflate them turn one of the two into theatre.&lt;/p>
&lt;p>&lt;strong>CI gate (pre-merge, blocking).&lt;/strong> It runs on every pull request that modifies prompts, adapters, RAG configuration, or any artefact that could move the model&amp;rsquo;s output. It runs against the golden dataset versioned at the hash that is on &lt;code>main&lt;/code>. The gate fails the merge if:&lt;/p>
&lt;ul>
&lt;li>the critical metric drops &lt;strong>more than X percentage points&lt;/strong> in absolute terms against the baseline (typically X = 2);&lt;/li>
&lt;li>some safety metric (toxicity, PII leakage) crosses a hard threshold (typically tox &amp;gt; 0.02);&lt;/li>
&lt;li>some strategic segment (a language, an enterprise-type tenant) drops more than Y points even if the aggregate improves.&lt;/li>
&lt;/ul>
&lt;p>This cadence has to be &lt;strong>fast&lt;/strong> (ideally &amp;lt; 10 minutes over 500 examples) and &lt;strong>cheap&lt;/strong> (LLM judge in batch mode, cached embeddings, heuristics run locally). The CI gate is not exhaustive: it is the low-latency line of defence.&lt;/p>
&lt;p>&lt;strong>Platform regression (post-deploy, continuous).&lt;/strong> It runs on a schedule (typically nightly or weekly) over &lt;strong>sampled production traffic&lt;/strong>, not over the static golden set. It detects drift: the model has not changed, the golden set has not changed, but the users have, and quality over real traffic drops. This cadence is more expensive (judge over thousands of samples, human annotation over hundreds), tolerates latencies of hours, and its main consumer is not CI but the &lt;a href="https://blog.lo0.es/en/posts/agentsight-llm-tracing-ebpf-zero-instrumentation/">observability&lt;/a> dashboard and the humans on the product team who decide whether to open a &lt;a href="https://blog.lo0.es/en/posts/retrain-closing-the-loop-feedback-dataset-adapter/">retrain&lt;/a> cycle.&lt;/p>
&lt;p>Both cadences persist results in the same store (Langfuse, MLflow, or equivalent) and connect them by &lt;code>model_id&lt;/code>, &lt;code>prompt_id&lt;/code>, &lt;code>dataset_hash&lt;/code> and &lt;code>judge_id&lt;/code>. Without that glue of identifiers, the metric that passes CI cannot be correlated with the one that fails in production three weeks later.&lt;/p>
&lt;h2 id="the-minimum-mathematics-that-matter">The minimum mathematics that matter&lt;/h2>
&lt;p>Beyond kappa and the interval for the difference of proportions, both already covered above, there are three more mathematical pieces that any team running evals seriously ends up using.&lt;/p>
&lt;p>&lt;strong>Confidence interval for a continuous metric.&lt;/strong> If your metric is a continuous score (faithfulness ∈ [0, 1]) and you measure the sample mean \(\bar{x}\) over n examples with standard deviation s, the 95% confidence interval for the population mean is:&lt;/p>
\[
\bar{x} \pm 1{.}96 \cdot \frac{s}{\sqrt{n}}
\]
&lt;p>For n = 300 and s ≈ 0.2 (typical of a 0-1 score with non-degenerate variance), the margin is ±0.023. This means that differences below 2 hundredths &lt;strong>cannot be distinguished&lt;/strong> from noise at that sample size. If your team is chasing &amp;ldquo;+0.5 pp&amp;rdquo; improvements over 100 examples, it is optimising noise.&lt;/p>
&lt;p>&lt;strong>Judge cost as a function of sample size and rubric.&lt;/strong> The cost of one eval pass with LLM-as-judge over n examples, with m metrics evaluated in a single call per example, and per-token price \(c_{in}, c_{out}\) on the judge model, is:&lt;/p>
\[
C \approx n \cdot (t_{in} \cdot c_{in} + t_{out} \cdot c_{out})
\]
&lt;p>where \(t_{in}\) is the number of input tokens (includes context, output of the model under test, full rubric) and \(t_{out}\) the output tokens (includes the judge&amp;rsquo;s CoT + score). For n = 500, \(t_{in}\) ≈ 4,000, \(t_{out}\) ≈ 300, a GPT-4o judge at May 2026 prices, one pass costs on the order of &lt;strong>8–15 USD per suite&lt;/strong>. If the pass fires on every PR and there are 30 PRs/day, that is 240–450 USD/day on CI gates alone. Multiplied by continuous regression, teams that do not control this spend four figures a month on judge tokens without realising. The canonical mitigation is a &lt;strong>mix of layers&lt;/strong>: heuristics and embeddings filter first, the judge is only invoked on what the cheap layers cannot resolve, and for platform regression a self-hosted open-source judge is used (Prometheus 7B on your own GPU plane) instead of a commercial model.&lt;/p>
&lt;p>&lt;strong>Distinction between aggregate metric and per-segment metric.&lt;/strong> The classic eval fallacy is the hidden mean. If your suite reports &lt;code>faithfulness = 0.87&lt;/code> and the team reads it as &amp;ldquo;up 2 points against the previous adapter&amp;rdquo;, this may be what is happening: the new adapter gains 4 points in English (where 70% of the eval set is) and loses 6 points in German (where 30% is). The aggregate mean improves, the German experience gets worse. Any serious suite reports a &lt;strong>breakdown by strategic segment&lt;/strong> (language, tenant type, question category, context length). The CI gate can also have per-segment thresholds, not just aggregate ones.&lt;/p>
&lt;h2 id="the-2026-stack-dominant-tools">The 2026 stack: dominant tools&lt;/h2>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Tool&lt;/th>
&lt;th>Main layer&lt;/th>
&lt;th>Licence&lt;/th>
&lt;th>Maintainer&lt;/th>
&lt;th>When to pick it&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>DeepEval&lt;/strong>&lt;/td>
&lt;td>CI gate&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>Confident AI&lt;/td>
&lt;td>&amp;ldquo;Evals as pytest&amp;rdquo; — assertions in Python code, trivial integration with GitHub Actions. A reasonable default.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Promptfoo&lt;/strong>&lt;/td>
&lt;td>CI gate&lt;/td>
&lt;td>MIT&lt;/td>
&lt;td>Promptfoo Inc.&lt;/td>
&lt;td>Declarative YAML, matrix of prompts × providers × assertions, diff vs baseline. DevOps-friendly.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>RAGAS&lt;/strong>&lt;/td>
&lt;td>RAG-specific metrics&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>Exploding Gradients&lt;/td>
&lt;td>Faithfulness, context relevancy, answer relevancy. The canonical piece if your system is RAG.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Inspect AI&lt;/strong>&lt;/td>
&lt;td>Safety/capability evals&lt;/td>
&lt;td>MIT&lt;/td>
&lt;td>UK AI Safety Institute&lt;/td>
&lt;td>Suite focused on safety and capability. Useful for regulatory gates under the EU AI Act.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Langfuse Evals&lt;/strong>&lt;/td>
&lt;td>Platform regression&lt;/td>
&lt;td>MIT (OSS) / EE&lt;/td>
&lt;td>Langfuse GmbH&lt;/td>
&lt;td>Integrated with tracing — datasets, runs and scores in the same UI as production traces.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>MLflow GenAI Evals&lt;/strong>&lt;/td>
&lt;td>Registry + evals&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>Databricks/LF AI&lt;/td>
&lt;td>Good when you already have MLflow for classic models; &amp;ldquo;GenAI dashboard&amp;rdquo; since 3.10.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Phoenix (Arize)&lt;/strong>&lt;/td>
&lt;td>Eval + visual drift&lt;/td>
&lt;td>Elastic License 2.0&lt;/td>
&lt;td>Arize AI&lt;/td>
&lt;td>Focused on visual debugging of embeddings and drift; a complement to Langfuse, not a replacement.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Prometheus 2.5&lt;/strong>&lt;/td>
&lt;td>Self-hosted OSS judge&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>KAIST + LG AI&lt;/td>
&lt;td>Fine-tuned judge, high correlation with GPT-4 at zero cost per token when self-hosted.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>G-Eval / JudgeLM&lt;/strong>&lt;/td>
&lt;td>Prompting methods&lt;/td>
&lt;td>— (techniques)&lt;/td>
&lt;td>academic&lt;/td>
&lt;td>Prompting frameworks for LLM-as-judge — they apply on top of any judge model.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The &lt;a href="https://blog.lo0.es/en/posts/oss-catalogue-llmops-six-stages-tool-by-tool/">OSS catalogue by stage&lt;/a> goes into detail entry by entry; the &lt;a href="https://blog.lo0.es/en/posts/parallel-catalogue-llmops-stages-open-source-hyperscalers/">parallel OSS vs hyperscalers catalogue&lt;/a> compares against Bedrock Evaluations, Vertex AI Eval Service and Azure AI Evaluation.&lt;/p>
&lt;p>The canonical pattern in 2026 is hybrid: &lt;strong>DeepEval or Promptfoo for CI gates + Langfuse Evals for platform regression + Prometheus 2.5 as a self-hosted judge + human annotation on Argilla or Label Studio for the calibration set&lt;/strong>. Swapping any of these pillars for equivalents (W&amp;amp;B Weave instead of Langfuse, Inspect instead of DeepEval) is style, not functionality; what matters is that the four functions are present and connected.&lt;/p>
&lt;h2 id="applied-to-typical-on-premise-hardware">Applied to typical on-premise hardware&lt;/h2>
&lt;p>For an on-premise deployment that wants to avoid sending sensitive outputs to a commercial LLM judge (for data sovereignty, ENS, NIS2 or equivalents), the judge is hosted on your own GPU plane. Reference figures for May 2026, based on &lt;strong>Prometheus 2.5 (Llama-3.1-8B fine-tuned as a judge)&lt;/strong> served on vLLM:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>RTX 4090 (24 GB, Ada Lovelace)&lt;/strong>: viable for small suites (&amp;lt; 200 examples) and for running the judge offline during development. Latency per evaluation ≈ 1.5–3 s with BF16; aggregate throughput on the order of 25–40 evaluations/min with batching. Useful for a developer&amp;rsquo;s local CI gates, not for platform regression.&lt;/li>
&lt;li>&lt;strong>Generic 4×H100 SXM configuration (320 GB total, NVLink)&lt;/strong>: runs the judge in parallel at TP=2 across two GPUs, leaving two free to serve the model under test. Aggregate throughput on the order of 200–350 evaluations/min, a full 500-example suite in 2–3 min. This allows PR gates with no perceptible waiting and nightly platform regression over thousands of samples with no per-token cost.&lt;/li>
&lt;/ul>
&lt;p>The comparative cost arithmetic is stubborn: self-hosting Prometheus 2.5 pays off an H100 in roughly 6 months &lt;strong>if the team fires ≥ 30 PRs/day with eval gates&lt;/strong>. Below that volume, the commercial judge still wins unless sovereignty is a requirement, and under ENS / NIS2 it is.&lt;/p>
&lt;h2 id="the-seven-pitfalls-that-kill-this-stage">The seven pitfalls that kill this stage&lt;/h2>
&lt;p>&lt;strong>Pitfall 1 — Aged golden dataset.&lt;/strong> It is not enriched with production incidents. After months it measures a world that no longer exists. The metric climbs comfortably while real users complain more.&lt;/p>
&lt;p>&lt;strong>Pitfall 2 — Contaminated or uncalibrated judge.&lt;/strong> The LLM judge evaluates with criteria it invents itself. Without a human calibration set as reference, there is no way to know whether its 0.89 is generous, severe or random.&lt;/p>
&lt;p>&lt;strong>Pitfall 3 — Insufficient sample size.&lt;/strong> A 50-example suite, 1-point differences the team treats as significant. The confidence interval is ±10 points. They are measuring noise and making real decisions on it.&lt;/p>
&lt;p>&lt;strong>Pitfall 4 — Runaway cost.&lt;/strong> A GPT-4 batch-mode judge fired on every PR over 1,000 examples, with no prior filtering by cheap layers. The eval bill overtakes production serving. It happens more often than people admit.&lt;/p>
&lt;p>&lt;strong>Pitfall 5 — Aggregate metric hiding segments.&lt;/strong> Global mean improves 2 points, German drops 6, enterprise tenants drop 3. With no explicit per-segment breakdown, the gate approves what it should not.&lt;/p>
&lt;p>&lt;strong>Pitfall 6 — Judge with a floating version.&lt;/strong> Judge model updated without recalibrating the rubric. Thresholds lose their statistical meaning. Last month&amp;rsquo;s regressions are not comparable with those from two months ago.&lt;/p>
&lt;p>&lt;strong>Pitfall 7 — Eval gate that is not enforced.&lt;/strong> The gate exists in the documentation but not in the real workflow: the suite takes 30 minutes, developers skip it with &lt;code>--no-verify&lt;/code>, managers ask for one-off exceptions that become the norm. An eval gate without enforcement is ornament.&lt;/p>
&lt;p>All seven are operational, not technical. The Eval layer does not break because the mathematics are wrong: it breaks because the discipline slackens. It is the same thing that happens with unit tests in any project that grows, except that here, without the discipline, the system &lt;strong>improves its metrics while getting worse&lt;/strong>, and that makes the degradation invisible until it is already ungovernable.&lt;/p>
&lt;h2 id="what-we-have-not-covered-upcoming-posts">What we have not covered (upcoming posts)&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Guardrails and online safety&lt;/strong>: the &lt;strong>inline&lt;/strong> eval layer that filters outputs in real time, not in CI. Conceptually a cousin of Eval, but with very different latency constraints. Covered in detail in the &lt;a href="https://blog.lo0.es/en/posts/llm-guardrails-safety-four-lines-of-defence/">guardrails post&lt;/a>: four lines of defence (input, retrieval, tool, output), OWASP LLM Top 10 (2025), OSS catalogue and deployment patterns.&lt;/li>
&lt;li>&lt;strong>Judge ensembles and agreement between multiple judges&lt;/strong>: how to reduce bias by combining three heterogeneous models as a panel, which aggregation function works (simple majority, trimmed mean, calibrated meta-judge).&lt;/li>
&lt;li>&lt;strong>Meta-eval&lt;/strong>: how you evaluate the suite itself. If the eval improvement from adapter v7 to v8 does not translate into a real improvement for the user, the suite is wrong, and that is also measured, by correlating eval metrics against product metrics.&lt;/li>
&lt;li>&lt;strong>Metamorphic testing&lt;/strong>: evaluating robustness against input perturbations (typos, paraphrasing, alternative language) as an extra gate. Beyond nominal agreement, it measures consistency.&lt;/li>
&lt;li>&lt;strong>Adversarial evals with red teaming&lt;/strong>: introducing prompt injection and jailbreak attacks as part of the gate.&lt;/li>
&lt;li>&lt;strong>Privacy in the judge&lt;/strong>: how to stop sensitive outputs from the model under test travelling to an external judge when regulation forbids it — homomorphic judge, judge in a TEE, or simply a self-hosted judge.&lt;/li>
&lt;/ul>
&lt;h2 id="see-also">See also&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/">The six-stage LLMOps pipeline&lt;/a> — the master map where Eval sits between Tune and Deploy. The &amp;ldquo;Stage 3 — Eval&amp;rdquo; section gives the structured summary this post develops.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/anatomy-llm-request-production-tour-six-stages/">Anatomy of a production LLM request, May 2026&lt;/a> — the forensic tour of a request crossing the six stages; the moment the eval suite is invoked to promote adapter v7→v8 is the materialisation of the gate described here.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/prompt-versioning-contract-five-word-change/">Prompt versioning: the contract that stops a five-word change sinking your system&lt;/a> — judge prompts are versioned with the same mechanisms as any other prompt. The &lt;code>prompt_id&lt;/code> travels in lineage.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/data-versioning-llmops-dvc-lakefs-reproducible-golden-dataset/">Data versioning: DVC, lakeFS and the reproducible golden dataset challenge&lt;/a> — the golden eval set is one of the four artefacts to version differently. Without a strict holdout, the metric measures memorisation.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/continuous-fine-tuning-production-real-traffic-deployed-adapter/">Continuous fine-tuning in production&lt;/a> — the eval gates that appear in that post as SQL predicates are the concrete materialisation of the framework described here.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/retrain-closing-the-loop-feedback-dataset-adapter/">Retrain: closing the loop between the production incident and the adapter that fixes it&lt;/a> — the golden set is enriched with incidents coming from the Retrain loop; without that flow the dataset ages and pitfalls 1 and 5 trigger by themselves.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/oss-catalogue-llmops-six-stages-tool-by-tool/">The OSS catalogue for LLMOps in six stages&lt;/a> — entry-by-entry write-ups of DeepEval, Promptfoo, RAGAS, Langfuse, Phoenix.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/parallel-catalogue-llmops-stages-open-source-hyperscalers/">The parallel catalogue: OSS vs AWS / GCP / Azure&lt;/a> — how the Eval stage translates to Bedrock Evaluations, Vertex AI Eval Service and Azure AI Evaluation.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/llm-as-judge-exam-marker-not-oracle/">LLM-as-judge: the examination marker&lt;/a> — the judge piece of this mixed board taken apart in depth. G-Eval, Prometheus 2, panel of judges, the four biases (position, verbosity, self-preference, narcissism) and calibration with Cohen&amp;rsquo;s kappa.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/modern-alignment-dpo-kto-orpo-simpo/">Modern alignment: DPO, KTO, ORPO and SimPO&lt;/a> — the judge calibrated by the techniques here produces the preference pairs that enter as an alignment dataset. Closing the Eval → Tune loop.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/llm-tracing-opentelemetry-genai/">LLM tracing with OpenTelemetry GenAI&lt;/a> — the capture substrate on which continuous eval runs. The traces that tail sampling preserves (errors, high latencies, guardrail blocks) are the natural input for the judge in production.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/langfuse-inside-sorting-centre-bottleneck/">Langfuse from the inside: v3 architecture and the 10 backend knobs&lt;/a> — the datasets and evaluators designed here rest on the Langfuse backend (ClickHouse + Postgres); that post explains how to size and tune it so it withstands the trace volume feeding the eval.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/structured-output-bitmask-outlines-xgrammar-llguidance/">Structured output&lt;/a> — LLM-as-judge evals benefit enormously from guaranteed structured output: a &lt;code>{score, justification, pass}&lt;/code> verdict that parses 100 % of the time removes retries and simplifies storage in the data warehouse for longitudinal analysis.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/llm-guardrails-safety-four-lines-of-defence/">Guardrails and safety in LLMs&lt;/a> — the sibling layer at runtime. Same categories as those evaluated offline here (toxicity, PII, prompt injection, jailbreak, groundedness) but with a latency budget of 30-150 ms and compact models (PromptGuard 2, Llama Guard 4, Granite Guardian, ShieldGemma) instead of large judges.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/canary-blue-green-shadow-llm-models/">Canary, blue-green and shadow for LLM models&lt;/a> — the eval suite designed here is the gate &lt;strong>before&lt;/strong> the canary; unless the suite has passed offline on the candidate model, the rollout does not start.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/evaluating-rag-ragas-golden-dataset-metrics/">Evaluating a RAG without fooling yourself: RAGAS, the golden dataset and the four metrics that matter&lt;/a> — the specialisation of this post&amp;rsquo;s eval framework for RAG systems; faithfulness, context precision and context recall are the eval gate metrics when the system has retrieval.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/llm-quality-benchmarks-contamination-trap-oss-tools/">LLM quality benchmarks: MMLU, MT-Bench, HELM and the leaderboards that matter&lt;/a> — the external benchmarks that serve as a reference for calibrating whether internal evals are measuring the same thing as the field.&lt;/li>
&lt;/ul>
&lt;h2 id="references">References&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>G-Eval&lt;/strong>: Liu et al., &amp;ldquo;G-Eval: NLG Evaluation using GPT-4 with Better Human Alignment&amp;rdquo; — the reference paper for the chain-of-thought LLM judge method.&lt;/li>
&lt;li>&lt;strong>Prometheus&lt;/strong>: Kim et al., &amp;ldquo;Prometheus 2: An Open Source Language Model Specialized in Evaluating Other Language Models&amp;rdquo; — OSS judge with a reported 0.897 correlation vs humans.&lt;/li>
&lt;li>&lt;strong>RAGAS&lt;/strong>: Es et al., &amp;ldquo;RAGAS: Automated Evaluation of Retrieval Augmented Generation&amp;rdquo; — the paper that standardises faithfulness, context relevancy and answer relevancy.&lt;/li>
&lt;li>&lt;strong>Cohen&amp;rsquo;s kappa&lt;/strong>: Cohen, J. (1960). &amp;ldquo;A Coefficient of Agreement for Nominal Scales.&amp;rdquo; Educational and Psychological Measurement — the classic metric for inter-annotator agreement, still the operational reference.&lt;/li>
&lt;li>&lt;strong>DeepEval docs&lt;/strong>: &lt;a href="https://docs.confident-ai.com/">https://docs.confident-ai.com/&lt;/a>&lt;/li>
&lt;li>&lt;strong>Promptfoo docs&lt;/strong>: &lt;a href="https://promptfoo.dev/docs/">https://promptfoo.dev/docs/&lt;/a>&lt;/li>
&lt;li>&lt;strong>Langfuse Evals&lt;/strong>: &lt;a href="https://langfuse.com/docs/scores">https://langfuse.com/docs/scores&lt;/a>&lt;/li>
&lt;li>&lt;strong>Inspect AI&lt;/strong>: &lt;a href="https://inspect.ai-safety-institute.org.uk/">https://inspect.ai-safety-institute.org.uk/&lt;/a>&lt;/li>
&lt;li>&lt;strong>EU AI Act&lt;/strong>, relevant articles on mandatory evaluation of high-risk systems — pending publication of the CEN/CENELEC technical standards on conformity assessment for GenAI.&lt;/li>
&lt;/ul></description></item><item><title>The OSS catalogue for LLMOps in six stages: tool by tool, what each one does and when to choose it</title><link>https://blog.lo0.es/en/posts/oss-catalogue-llmops-six-stages-tool-by-tool/</link><pubDate>Sat, 23 May 2026 07:30:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/oss-catalogue-llmops-six-stages-tool-by-tool/</guid><description>&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>For each of the six LLMOps stages (Data, Tune, Eval, Deploy, Observe, Retrain) and the two cross-cutting components (prompt + data versioning), the open source ecosystem has canonical pieces that this blog has been citing again and again. This post gathers them in one place with &lt;strong>cards of roughly 150 words per core tool&lt;/strong>: what it does, how it differs from the alternatives inside the same bucket, its &lt;strong>licence and governance model&lt;/strong>, and a typical gotcha that you only learn in production. Plus more alternatives as bullets, a &lt;strong>decision matrix per stage&lt;/strong> according to the case (small / large corpus, single tenant / multi-tenant…), a &lt;strong>diagram&lt;/strong> of the connected OSS stack and a &lt;strong>master table&lt;/strong> of licences / EE offerings. The intention: that the reader closes the post knowing what is available, which company maintains it, what gap each piece fills, and when to choose it. This is not opinion: it is a curated catalogue.&lt;/p>
&lt;h2 id="you-are-here-every-stage-but-by-oss-column">You are here: every stage, but by OSS column&lt;/h2>
&lt;p>This post shares a map with the two previous ones in the series, the six stages and the two cross-cutting pieces are all active, but it zooms in on the &lt;strong>open source column&lt;/strong>.&lt;/p>
&lt;div class="diagram" style="max-width:820px;margin:1rem auto;">
&lt;svg viewBox="0 0 820 220" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="OSS catalogue by LLMOps pipeline stage">
&lt;style>.box{stroke:#444;stroke-width:1.4;rx:6}.active{fill:#ff8a4c;stroke-width:2}.cross{fill:#ffe9d6;stroke:#c66;stroke-width:1.4;rx:6}.lbl{font:600 12px sans-serif;fill:#222}.sm{font:11px sans-serif;fill:#333}.tiny{font:10px sans-serif;fill:#444}.oss{fill:#dfe9f5;stroke:#356}&lt;/style>
&lt;text x="410" y="20" text-anchor="middle" class="lbl">OSS catalogue: the consultant's toolbox by stage&lt;/text>
&lt;rect x="20" y="38" width="120" height="32" class="box active"/>&lt;text x="80" y="58" text-anchor="middle" class="lbl">1 · Data&lt;/text>
&lt;rect x="150" y="38" width="120" height="32" class="box active"/>&lt;text x="210" y="58" text-anchor="middle" class="lbl">2 · Tune&lt;/text>
&lt;rect x="280" y="38" width="120" height="32" class="box active"/>&lt;text x="340" y="58" text-anchor="middle" class="lbl">3 · Eval&lt;/text>
&lt;rect x="410" y="38" width="120" height="32" class="box active"/>&lt;text x="470" y="58" text-anchor="middle" class="lbl">4 · Deploy&lt;/text>
&lt;rect x="540" y="38" width="120" height="32" class="box active"/>&lt;text x="600" y="58" text-anchor="middle" class="lbl">5 · Observe&lt;/text>
&lt;rect x="670" y="38" width="120" height="32" class="box active"/>&lt;text x="730" y="58" text-anchor="middle" class="lbl">6 · Retrain&lt;/text>
&lt;rect x="20" y="88" width="120" height="78" class="box oss"/>
&lt;text x="80" y="103" text-anchor="middle" class="tiny">DVC · lakeFS&lt;/text>
&lt;text x="80" y="117" text-anchor="middle" class="tiny">MinIO · Ceph&lt;/text>
&lt;text x="80" y="131" text-anchor="middle" class="tiny">Qdrant · pgvector&lt;/text>
&lt;text x="80" y="145" text-anchor="middle" class="tiny">Kafka · Flink&lt;/text>
&lt;text x="80" y="159" text-anchor="middle" class="tiny">Debezium · Karapace&lt;/text>
&lt;rect x="150" y="88" width="120" height="78" class="box oss"/>
&lt;text x="210" y="103" text-anchor="middle" class="tiny">HF Transformers&lt;/text>
&lt;text x="210" y="117" text-anchor="middle" class="tiny">PEFT · bitsandbytes&lt;/text>
&lt;text x="210" y="131" text-anchor="middle" class="tiny">DeepSpeed · FSDP&lt;/text>
&lt;text x="210" y="145" text-anchor="middle" class="tiny">Axolotl · LLaMA-Factory&lt;/text>
&lt;text x="210" y="159" text-anchor="middle" class="tiny">Ray Train · MLflow&lt;/text>
&lt;rect x="280" y="88" width="120" height="78" class="box oss"/>
&lt;text x="340" y="103" text-anchor="middle" class="tiny">DeepEval · RAGAS&lt;/text>
&lt;text x="340" y="117" text-anchor="middle" class="tiny">Promptfoo&lt;/text>
&lt;text x="340" y="131" text-anchor="middle" class="tiny">lm-eval-harness&lt;/text>
&lt;text x="340" y="145" text-anchor="middle" class="tiny">NeMo Guardrails&lt;/text>
&lt;text x="340" y="159" text-anchor="middle" class="tiny">Presidio · LlamaGuard&lt;/text>
&lt;rect x="410" y="88" width="120" height="78" class="box oss"/>
&lt;text x="470" y="103" text-anchor="middle" class="tiny">vLLM · TGI · SGLang&lt;/text>
&lt;text x="470" y="117" text-anchor="middle" class="tiny">TensorRT-LLM&lt;/text>
&lt;text x="470" y="131" text-anchor="middle" class="tiny">llama.cpp · Triton&lt;/text>
&lt;text x="470" y="145" text-anchor="middle" class="tiny">KServe · KubeRay&lt;/text>
&lt;text x="470" y="159" text-anchor="middle" class="tiny">Envoy AI · LiteLLM&lt;/text>
&lt;rect x="540" y="88" width="120" height="78" class="box oss"/>
&lt;text x="600" y="103" text-anchor="middle" class="tiny">OpenTelemetry&lt;/text>
&lt;text x="600" y="117" text-anchor="middle" class="tiny">Tempo · Jaeger&lt;/text>
&lt;text x="600" y="131" text-anchor="middle" class="tiny">Prometheus · Loki&lt;/text>
&lt;text x="600" y="145" text-anchor="middle" class="tiny">Langfuse · Phoenix&lt;/text>
&lt;text x="600" y="159" text-anchor="middle" class="tiny">Tetragon · Evidently&lt;/text>
&lt;rect x="670" y="88" width="120" height="78" class="box oss"/>
&lt;text x="730" y="103" text-anchor="middle" class="tiny">Airflow · Prefect&lt;/text>
&lt;text x="730" y="117" text-anchor="middle" class="tiny">Dagster · Argo&lt;/text>
&lt;text x="730" y="131" text-anchor="middle" class="tiny">Kubeflow Pipelines&lt;/text>
&lt;text x="730" y="145" text-anchor="middle" class="tiny">Feast&lt;/text>
&lt;text x="730" y="159" text-anchor="middle" class="tiny">Argilla · Label Studio&lt;/text>
&lt;rect x="20" y="180" width="380" height="22" class="cross"/>
&lt;text x="210" y="195" text-anchor="middle" class="sm">Prompt versioning: Langfuse Prompts · MLflow Prompt Registry&lt;/text>
&lt;rect x="410" y="180" width="380" height="22" class="cross"/>
&lt;text x="600" y="195" text-anchor="middle" class="sm">Data versioning: DVC · lakeFS · OpenLineage · DataHub&lt;/text>
&lt;/svg>
&lt;/div>
&lt;h2 id="the-analogy-the-electricians-toolbox">The analogy: the electrician&amp;rsquo;s toolbox&lt;/h2>
&lt;p>A professional electrician arrives at an installation with a box organised into compartments. Nothing is improvised: for every type of cable there is a specific wire stripper, for every screw a screwdriver of the exact gauge, for every measurement a multimeter and a clamp meter, for every connection the right terminal block or connector. The difference between a professional electrician and a handyman is not that one knows more theory, the handyman has often read the manuals, it is that &lt;strong>the right tool is within arm&amp;rsquo;s reach and he knows when to use each one&lt;/strong>. The day the specific stripper is missing, improvising with a box cutter breaks the insulation, leaves a badly terminated cable, and the panel comes back under warranty two months later.&lt;/p>
&lt;p>The OSS LLMOps stack works the same way. For every canonical problem, versioning a dataset, indexing a corpus for retrieval, serving tokens with dynamic batching, propagating &lt;code>trace_id&lt;/code> end-to-end, managing prompts with a &lt;code>production&lt;/code> label, orchestrating retraining pipelines, there is a canonical piece of the open source ecosystem that solves it, maintained by a serious community or foundation, with a clear licence and a well documented gotcha. The consultant who knows which tool to use for each job builds a robust system in weeks; the one who improvises with &amp;ldquo;whatever the team already knows&amp;rdquo; pays later in operations, usually once the system is carrying real load and any replacement is expensive.&lt;/p>
&lt;p>This post opens the toolbox and shows each card. It is not a user manual, that is what the deep-dive posts linked at the end are for; it is the &lt;strong>curated catalogue&lt;/strong>.&lt;/p>
&lt;h2 id="diagram-of-the-connected-reference-oss-stack">Diagram of the connected reference OSS stack&lt;/h2>
&lt;p>The catalogue makes sense once you see how the pieces connect into a single coherent architecture, the one this blog has been describing throughout the series. The boxes do not float; they talk to each other over stable contracts (HTTP, gRPC, OTel, Kafka, S3/MinIO API).&lt;/p>
&lt;div class="diagram" style="max-width:820px;margin:1rem auto;">
&lt;svg viewBox="0 0 820 460" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="reference OSS LLMOps stack with connected boxes">
&lt;style>.b{stroke:#333;stroke-width:1.4;rx:6;fill:#eef2f7}.serv{fill:#ff8a4c;stroke:#a44}.data{fill:#dfe9f5;stroke:#356}.obs{fill:#d8eecf;stroke:#373}.ctrl{fill:#f5e3d8;stroke:#763}.bg{fill:#fafafa;stroke:#ccc;rx:8}.lbl{font:600 12px sans-serif;fill:#222}.sm{font:11px sans-serif;fill:#222}.tiny{font:600 10px sans-serif;fill:#222}.arr{stroke:#666;stroke-width:1.4;fill:none;marker-end:url(#a)}.otel{stroke:#1a73e8;stroke-width:1.4;fill:none;stroke-dasharray:3 2;marker-end:url(#ab)}&lt;/style>
&lt;defs>&lt;marker id="a" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#666"/>&lt;/marker>&lt;marker id="ab" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#1a73e8"/>&lt;/marker>&lt;/defs>
&lt;text x="410" y="20" text-anchor="middle" class="lbl">Connected OSS LLMOps stack: serving, data, observability and control plane&lt;/text>
&lt;rect x="20" y="40" width="780" height="80" class="b bg"/>
&lt;text x="30" y="58" class="tiny">SERVING PLANE&lt;/text>
&lt;rect x="40" y="68" width="120" height="40" class="b serv"/>&lt;text x="100" y="93" text-anchor="middle" class="sm">Envoy AI Gateway&lt;/text>
&lt;rect x="180" y="68" width="120" height="40" class="b serv"/>&lt;text x="240" y="93" text-anchor="middle" class="sm">vLLM (LoRA hot-swap)&lt;/text>
&lt;rect x="320" y="68" width="120" height="40" class="b serv"/>&lt;text x="380" y="93" text-anchor="middle" class="sm">KServe / Operator&lt;/text>
&lt;rect x="460" y="68" width="120" height="40" class="b serv"/>&lt;text x="520" y="93" text-anchor="middle" class="sm">Triton (multi-model)&lt;/text>
&lt;rect x="600" y="68" width="180" height="40" class="b serv"/>&lt;text x="690" y="93" text-anchor="middle" class="sm">Kubernetes (RKE2 + Cilium)&lt;/text>
&lt;path class="arr" d="M160,88 L180,88"/>&lt;path class="arr" d="M300,88 L320,88"/>
&lt;rect x="20" y="140" width="380" height="170" class="b bg"/>
&lt;text x="30" y="158" class="tiny">DATA PLANE&lt;/text>
&lt;rect x="40" y="168" width="160" height="36" class="b data"/>&lt;text x="120" y="190" text-anchor="middle" class="sm">PostgreSQL + pgvector&lt;/text>
&lt;rect x="220" y="168" width="160" height="36" class="b data"/>&lt;text x="300" y="190" text-anchor="middle" class="sm">Qdrant (RAG)&lt;/text>
&lt;rect x="40" y="214" width="160" height="36" class="b data"/>&lt;text x="120" y="236" text-anchor="middle" class="sm">MinIO / Ceph (S3)&lt;/text>
&lt;rect x="220" y="214" width="160" height="36" class="b data"/>&lt;text x="300" y="236" text-anchor="middle" class="sm">Kafka + Debezium&lt;/text>
&lt;rect x="40" y="260" width="160" height="36" class="b data"/>&lt;text x="120" y="282" text-anchor="middle" class="sm">DVC + lakeFS&lt;/text>
&lt;rect x="220" y="260" width="160" height="36" class="b data"/>&lt;text x="300" y="282" text-anchor="middle" class="sm">Flink / Spark&lt;/text>
&lt;path class="arr" d="M380,186 L460,186 L460,88 L460,108"/>
&lt;rect x="420" y="140" width="380" height="170" class="b bg"/>
&lt;text x="430" y="158" class="tiny">OBSERVABILITY PLANE&lt;/text>
&lt;rect x="440" y="168" width="160" height="36" class="b obs"/>&lt;text x="520" y="190" text-anchor="middle" class="sm">OTel Collector&lt;/text>
&lt;rect x="620" y="168" width="160" height="36" class="b obs"/>&lt;text x="700" y="190" text-anchor="middle" class="sm">Langfuse&lt;/text>
&lt;rect x="440" y="214" width="160" height="36" class="b obs"/>&lt;text x="520" y="236" text-anchor="middle" class="sm">Tempo (traces)&lt;/text>
&lt;rect x="620" y="214" width="160" height="36" class="b obs"/>&lt;text x="700" y="236" text-anchor="middle" class="sm">Phoenix Arize OSS&lt;/text>
&lt;rect x="440" y="260" width="160" height="36" class="b obs"/>&lt;text x="520" y="282" text-anchor="middle" class="sm">Prometheus + Grafana&lt;/text>
&lt;rect x="620" y="260" width="160" height="36" class="b obs"/>&lt;text x="700" y="282" text-anchor="middle" class="sm">Loki + Tetragon&lt;/text>
&lt;path class="otel" d="M240,108 L240,130 L460,130 L460,168"/>
&lt;text x="350" y="146" class="tiny" fill="#1a73e8">OTel spans (gen_ai.*)&lt;/text>
&lt;rect x="20" y="330" width="780" height="110" class="b bg"/>
&lt;text x="30" y="348" class="tiny">CONTROL PLANE (Tune + Eval + Retrain + Prompt versioning)&lt;/text>
&lt;rect x="40" y="358" width="140" height="36" class="b ctrl"/>&lt;text x="110" y="380" text-anchor="middle" class="sm">Axolotl + PEFT&lt;/text>
&lt;rect x="200" y="358" width="140" height="36" class="b ctrl"/>&lt;text x="270" y="380" text-anchor="middle" class="sm">MLflow Tracking&lt;/text>
&lt;rect x="360" y="358" width="140" height="36" class="b ctrl"/>&lt;text x="430" y="380" text-anchor="middle" class="sm">Promptfoo + RAGAS&lt;/text>
&lt;rect x="520" y="358" width="140" height="36" class="b ctrl"/>&lt;text x="590" y="380" text-anchor="middle" class="sm">Argo / Kubeflow Pipelines&lt;/text>
&lt;rect x="680" y="358" width="100" height="36" class="b ctrl"/>&lt;text x="730" y="380" text-anchor="middle" class="sm">Argilla&lt;/text>
&lt;rect x="40" y="402" width="140" height="30" class="b ctrl"/>&lt;text x="110" y="420" text-anchor="middle" class="sm">Langfuse Prompts&lt;/text>
&lt;rect x="200" y="402" width="140" height="30" class="b ctrl"/>&lt;text x="270" y="420" text-anchor="middle" class="sm">Feast&lt;/text>
&lt;rect x="360" y="402" width="140" height="30" class="b ctrl"/>&lt;text x="430" y="420" text-anchor="middle" class="sm">NeMo Guardrails&lt;/text>
&lt;rect x="520" y="402" width="140" height="30" class="b ctrl"/>&lt;text x="590" y="420" text-anchor="middle" class="sm">OpenLineage + DataHub&lt;/text>
&lt;rect x="680" y="402" width="100" height="30" class="b ctrl"/>&lt;text x="730" y="420" text-anchor="middle" class="sm">Presidio&lt;/text>
&lt;path class="arr" d="M110,358 L110,300 L110,300"/>&lt;path class="arr" d="M110,300 L110,260 L120,260"/>
&lt;/svg>
&lt;/div>
&lt;p>Solid arrows mark data / control flow; the dashed blue ones are OTel traces. The K8s plane holds everything up. The control plane at the bottom is where the retraining pipelines, the evals in CI, the versioned prompts and the lineage live. The data plane on the left feeds both the serving side (RAG, configs) and the control plane (datasets, lineage). The observability plane receives from serving and from everything else.&lt;/p>
&lt;p>Now we go stage by stage. Each one opens with a context paragraph, then cards for the core tools (about 150 words each), bullets with relevant alternatives, and a specific decision matrix at the end.&lt;/p>
&lt;h2 id="stage-1--data--cross-cutting-data-versioning">Stage 1 — Data + cross-cutting Data versioning&lt;/h2>
&lt;p>The Data stage solves three distinct problems that beginners confuse: &lt;strong>versioning&lt;/strong> datasets (so that &lt;code>(dataset_id, version, hash)&lt;/code> exists and propagates), &lt;strong>storing and serving&lt;/strong> the operational corpus (object store + vector index + structured text), and &lt;strong>moving it&lt;/strong> between systems with CDC and stable schemas. Covered in detail in the posts on &lt;a href="https://blog.lo0.es/en/posts/data-versioning-llmops-dvc-lakefs-reproducible-golden-dataset/">data versioning with DVC and lakeFS&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/postgresql-qdrant-rag-ingestion-postman-syncing-two-worlds/">PostgreSQL + Qdrant in ingestion&lt;/a> and &lt;a href="https://blog.lo0.es/en/posts/rag-on-kafka-reference-architecture-streaming-datalakes/">RAG over Kafka&lt;/a>.&lt;/p>
&lt;h3 id="dvc-data-version-control">DVC (Data Version Control)&lt;/h3>
&lt;p>DVC puts datasets under version control with the same discipline that git applies to code. The &lt;code>.dvc&lt;/code> pointers live in git (plain text, about 200 bytes per dataset), the bulk content lives in a remote object store (S3, MinIO, Azure Blob, GCS). Each &lt;code>dvc add&lt;/code> computes a SHA-256 hash of the dataset, uploads it to the remote and stores the pointer. The key line: the &lt;code>dataset_hash&lt;/code> becomes the luggage tag that travels to the trainer, to experiment tracking and to lineage. The same dataset retrained twice produces the same hash, and therefore reproducible experiments. DVC integrates with MLflow and W&amp;amp;B as an input artefact. &lt;strong>Gotcha:&lt;/strong> it works well for datasets that change by replacement (I swap &lt;code>train.jsonl&lt;/code> for a new version) and worse for datasets with thousands of small files that change individually. For that case, combine it with lakeFS. Licence &lt;strong>Apache 2.0&lt;/strong>, maintained by &lt;strong>Iterative.ai&lt;/strong> since 2017. There is DVC Studio (managed) and &lt;code>dvc data&lt;/code> (pure CLI) on different planes.&lt;/p>
&lt;h3 id="lakefs">lakeFS&lt;/h3>
&lt;p>lakeFS brings git semantics (branch, commit, merge, rollback) to an entire S3/MinIO/ADLS bucket. Where DVC versions individual files as pointers in git, lakeFS versions &lt;strong>the whole bucket&lt;/strong>: you can branch the corpus, ingest new data into the branch, validate that it passes checks (recall@10 over golden queries for embeddings, completeness for a tabular corpus), and only then merge into &lt;code>main&lt;/code>. It is the piece that makes continuous RAG safe: the production corpus is always on &lt;code>main&lt;/code>, updates are tested on branches. It offers hooks (pre-merge, pre-commit) that fire automatic validations, and time-travel to reproduce the state of the bucket at a past date. &lt;strong>Gotcha:&lt;/strong> the manifest overhead on huge buckets (hundreds of millions of objects) deserves sizing; lakeFS keeps metadata in its own Postgres, not in the bucket. Licence &lt;strong>Apache 2.0&lt;/strong>, maintained by &lt;strong>Treeverse&lt;/strong> since 2020. Managed offering: &lt;strong>lakeFS Cloud&lt;/strong>.&lt;/p>
&lt;h3 id="minio">MinIO&lt;/h3>
&lt;p>MinIO is the S3-compatible object store that fills the &amp;ldquo;S3 on-premise&amp;rdquo; gap without surprises. API identical to S3 (the AWS SDKs work by pointing them at a different endpoint), its own CLI client (&lt;code>mc&lt;/code>), erasure-coded mode for fault tolerance, bucket-to-bucket replication, encryption at rest. It is the base on which the other data plane components are built: DVC remote, lakeFS underlying storage, Postgres snapshots, MLflow artefacts, eval datasets, saved models, distributed KV cache fabric. In small deployments it runs single-node multi-disk; in serious ones, distributed clusters. &lt;strong>Gotcha:&lt;/strong> the licence changed to &lt;strong>AGPLv3&lt;/strong> in 2021 (it was Apache 2.0 before), which means distributing software connected to MinIO obliges you to open the code that connects to it. For internal on-premise use this is not a problem; for a vendor packaging MinIO inside a commercial product, it is. Maintained by &lt;strong>MinIO Inc.&lt;/strong> with a SUBNET enterprise offering and a community fork called &lt;strong>AIStor&lt;/strong> launched in 2025.&lt;/p>
&lt;h3 id="qdrant">Qdrant&lt;/h3>
&lt;p>Qdrant is the OSS vector database most aligned with this blog&amp;rsquo;s &amp;ldquo;RAG corpus per tenant with strict ACLs&amp;rdquo; pattern. Written in Rust, it exposes a REST + gRPC API, indexes with HNSW + scalar/binary quantisation to cut memory, supports efficient payload filtering (it is not post-filtering: it integrates the filter into the HNSW search), and allows collections isolated per tenant. For the &lt;a href="https://blog.lo0.es/en/posts/anatomy-llm-request-production-tour-six-stages/">multi-tenant chatbot&lt;/a> scenario, Qdrant is where the &lt;code>tenant_&amp;lt;id&amp;gt;_kb_v3&lt;/code> collections with strict ACL live. It scales well horizontally (sharding by payload) and vertically (millions of chunks on a node with 64GB RAM). &lt;strong>Gotcha:&lt;/strong> binary quantisation is aggressive, it cuts VRAM by 32× but degrades recall by 10-20 %; enabling it without re-tuning the threshold breaks retrieval silently. Licence &lt;strong>Apache 2.0&lt;/strong>, maintained by &lt;strong>Qdrant Solutions GmbH&lt;/strong> (Germany). There is Qdrant Cloud (managed) and EU-only support for ENS cases.&lt;/p>
&lt;h3 id="postgresql--pgvector">PostgreSQL + pgvector&lt;/h3>
&lt;p>Postgres 18 with the &lt;code>pgvector&lt;/code> extension is the stack&amp;rsquo;s &amp;ldquo;hidden vector database&amp;rdquo;: when the corpus is small (under a million embeddings) and Postgres is already in production for operational data, running a separate Qdrant is expensive operations. pgvector adds a &lt;code>vector(dim)&lt;/code> type, HNSW and IVF indexes, and the operators &lt;code>&amp;lt;-&amp;gt;&lt;/code>, &lt;code>&amp;lt;#&amp;gt;&lt;/code>, &lt;code>&amp;lt;=&amp;gt;&lt;/code> for cosine, L2 and dot product. Combined with &lt;code>tsvector&lt;/code> (Postgres full-text search) it allows &lt;strong>hybrid search&lt;/strong>, dense + sparse, in a single SQL query. Version 0.8 (2025) introduced halfvec and bit support to reduce size by 4×-8×. &lt;strong>Gotcha:&lt;/strong> HNSW in pgvector consumes a fair amount of RAM to build the index (roughly 2× the size of the embeddings) and blocks inserts during the build; in production you build on a secondary, promote it, and discard the primary. Licence &lt;strong>PostgreSQL License&lt;/strong> (permissive BSD-style) for both the core and pgvector. Maintained by the &lt;strong>PostgreSQL Development Group&lt;/strong> plus pgvector by &lt;strong>Andrew Kane&lt;/strong> + Crunchy Data + Neon.&lt;/p>
&lt;h3 id="apache-kafka--debezium">Apache Kafka + Debezium&lt;/h3>
&lt;p>Kafka is the event bus where &amp;ldquo;everything that happens in the company is a stream&amp;rdquo; becomes real. For LLMOps in production it serves two functions: &lt;strong>CDC from source systems&lt;/strong> (Debezium captures changes in Postgres / MySQL / MongoDB and publishes them as topics) and &lt;strong>LLM event buffer&lt;/strong> (every request, every piece of feedback, every eval result ends up in a topic with the &lt;code>trace_id&lt;/code> propagated). As the &lt;a href="https://blog.lo0.es/en/posts/rag-on-kafka-reference-architecture-streaming-datalakes/">post on RAG over Kafka&lt;/a> explains, the RAG corpus is kept fresh by capturing changes from the CMS / source system as CDC, running the embedding in Flink streaming, and ingesting into Qdrant continuously. &lt;strong>Gotcha:&lt;/strong> a badly sized Kafka with long retention plus multi-client topics turns into a fast disk sink; measuring throughput per topic and key cardinality before production is mandatory. Kafka licence &lt;strong>Apache 2.0&lt;/strong> (&lt;strong>ASF&lt;/strong> project); Debezium &lt;strong>Apache 2.0&lt;/strong> (project incubated by &lt;strong>Red Hat&lt;/strong>). Kafka-compatible drop-in alternative: &lt;strong>Redpanda&lt;/strong> (BSL, restricted commercial use).&lt;/p>
&lt;h3 id="apache-flink-brief-mention">Apache Flink (brief mention)&lt;/h3>
&lt;p>Flink processes streams with sub-second latency and exactly-once semantics. On the LLM plane it is used to: run embeddings in streaming (over CDC topics), aggregate online metrics, materialise features for retraining. Licence Apache 2.0, ASF. Common alternative: &lt;strong>Spark Structured Streaming&lt;/strong> (also ASF, micro-batch latency).&lt;/p>
&lt;p>&lt;strong>More options for Data&lt;/strong>, mentioned on the blog:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Ceph&lt;/strong> — object store for large clusters with geo-distributed replication. LGPL/Apache licence, &lt;strong>Red Hat / IBM&lt;/strong>.&lt;/li>
&lt;li>&lt;strong>Milvus&lt;/strong> — C++ vector database, an alternative to Qdrant; better for corpora of billions. Apache 2.0, &lt;strong>Zilliz&lt;/strong>.&lt;/li>
&lt;li>&lt;strong>Karapace&lt;/strong> — Confluent-compatible OSS Schema Registry. Apache 2.0, &lt;strong>Aiven&lt;/strong>.&lt;/li>
&lt;li>&lt;strong>DataHub / Apache Atlas / OpenMetadata&lt;/strong> — catalogue + lineage. Apache 2.0, &lt;strong>Acryl Data / ASF / Collate&lt;/strong> respectively.&lt;/li>
&lt;li>&lt;strong>OpenLineage&lt;/strong> — cross-system lineage event standard. Apache 2.0, &lt;strong>Linux Foundation AI&amp;amp;Data&lt;/strong>.&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Decision matrix — Data:&lt;/strong>&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>If your case is&lt;/th>
&lt;th>Choose&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Corpus &amp;lt; 1M embeddings, you already have Postgres&lt;/td>
&lt;td>&lt;strong>pgvector&lt;/strong> (one component fewer)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Corpus 1M-100M, multi-tenant with ACL&lt;/td>
&lt;td>&lt;strong>Qdrant&lt;/strong> (integrated filtering, ACLs per collection)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Corpus &amp;gt; 100M, aggressive sharding&lt;/td>
&lt;td>&lt;strong>Milvus&lt;/strong> (scales linearly better into the billions)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Training datasets + experiment tracking&lt;/td>
&lt;td>&lt;strong>DVC&lt;/strong> over MinIO + MLflow integration&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>RAG corpus with controlled releases&lt;/td>
&lt;td>&lt;strong>lakeFS&lt;/strong> over MinIO + pre-merge hooks&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>You want both&lt;/td>
&lt;td>&lt;strong>DVC + lakeFS&lt;/strong> as complements (the blog&amp;rsquo;s recommendation)&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 id="stage-2--tune">Stage 2 — Tune&lt;/h2>
&lt;p>The Tune stage produces a new &lt;code>model_id, model_version&lt;/code>, typically a LoRA adapter over a stable base, with lineage back to the dataset and experiment tracking to reproduce it. Detail in the &lt;a href="https://blog.lo0.es/en/posts/continuous-fine-tuning-production-real-traffic-deployed-adapter/">post on continuous fine-tuning&lt;/a>.&lt;/p>
&lt;h3 id="huggingface-transformers--peft">HuggingFace Transformers + PEFT&lt;/h3>
&lt;p>&lt;code>transformers&lt;/code> is the canonical library for loading and training models of the decoder-only family (Llama, Mistral, Qwen, Gemma…) and encoder-decoder. &lt;code>peft&lt;/code> (Parameter-Efficient Fine-Tuning) is the complement that adds declarative support for LoRA, QLoRA, IA3 and assorted adapters. Together they form the &lt;strong>mandatory core&lt;/strong> of the OSS Tune stack: any higher-level framework (Axolotl, LLaMA-Factory) uses them underneath. PEFT allows you to train an adapter of about 280 MB (order of magnitude) instead of a full model of about 140 GB, with a functionally equivalent result on most style / domain adjustment tasks. &lt;strong>Gotcha:&lt;/strong> PEFT with a badly configured &lt;code>target_modules&lt;/code> trains an adapter that covers only Q and V of the attention, leaving out key, output proj and MLP. The result looks trained but performs poorly; adding &lt;code>target_modules=[&amp;quot;all-linear&amp;quot;]&lt;/code> fixes it (at the cost of a larger adapter). Licence &lt;strong>Apache 2.0&lt;/strong>, maintained by &lt;strong>Hugging Face SAS&lt;/strong> (a French company); open governance model with active external maintainers.&lt;/p>
&lt;h3 id="bitsandbytes">bitsandbytes&lt;/h3>
&lt;p>bitsandbytes implements weight quantisation to 8-bit and 4-bit with NF4 for models loaded with &lt;code>transformers&lt;/code>. It reduces the 140 GB of Llama 3 70B FP16 to about 40 GB in NF4, allowing QLoRA training on a single H100 80GB. The trick is that the weights stay quantised in memory while the sensitive computations (attention, gradient updates in the adapter) are done in FP16/BF16 with on-the-fly dequantisation. Ideal for fine-tuning on limited hardware and for serving with vLLM when you want to cut VRAM. &lt;strong>Gotcha:&lt;/strong> NF4 quantisation is lossy; on small models (&amp;lt; 7B) the quality degradation is noticeable. For production serving of models under 7B, INT8 is preferred (more memory, less loss) or FP8 if the hardware supports it (the H100 does). Licence &lt;strong>MIT&lt;/strong>, maintained by &lt;strong>Tim Dettmers&lt;/strong> (originally at U. Washington, now with support from Anthropic and HuggingFace).&lt;/p>
&lt;h3 id="mlflow-tracking">MLflow Tracking&lt;/h3>
&lt;p>MLflow is the reference OSS experiment tracking tool: each trainer run records parameters (lr, batch size, epochs, target_modules), metrics (loss curves, eval scores), artefacts (model, tokeniser, configs) and, crucially, &lt;strong>input artefacts&lt;/strong> (dataset_id, dataset_hash, parent_run). The model registry associates each &lt;code>model_version&lt;/code> with a reproducible &lt;code>run_id&lt;/code>. The line of continuity between Tune and Deploy passes through here: the deployment reads the model to serve from the registry, with its lineage made explicit. MLflow 2.x integrates &lt;strong>MLflow Prompts&lt;/strong> (prompt registry) and &lt;strong>MLflow Tracing&lt;/strong> (OTel-compatible spans), cutting the number of components needed. &lt;strong>Gotcha:&lt;/strong> the default backend store is SQLite, which works for personal experiments and breaks on a shared cluster. In production: Postgres as the backend store + MinIO/S3 as the artefact store. Licence &lt;strong>Apache 2.0&lt;/strong>, maintained by &lt;strong>LF AI &amp;amp; Data&lt;/strong> (donated by Databricks in 2020).&lt;/p>
&lt;h3 id="axolotl">Axolotl&lt;/h3>
&lt;p>Axolotl wraps &lt;code>transformers + PEFT + bitsandbytes + DeepSpeed + FSDP&lt;/code> in a declarative YAML configuration: instead of writing a script of about 300 lines to configure a fine-tuning run, you define a &lt;code>config.yml&lt;/code> with base model, dataset path, LoRA config and training hyperparameters, and run it in one line. It supports Llama, Mistral, Qwen, Gemma, Phi… loads. It keeps compatibility with the HuggingFace Hub to download models and datasets, and with MLflow / W&amp;amp;B for tracking. It is the convenience framework this blog cites when it talks about &amp;ldquo;productive fine-tuning without reinventing the wheel&amp;rdquo;. &lt;strong>Gotcha:&lt;/strong> the pace of change in the community is fast; a &lt;code>config.yml&lt;/code> that worked six months ago can break with a current version because of internal refactors. Pinning the exact Axolotl version in the environment mitigates this. Licence &lt;strong>Apache 2.0&lt;/strong>, maintained by the &lt;strong>OpenAccess AI Collective&lt;/strong> (community-driven). A very similar alternative, more widely used in China: &lt;strong>LLaMA-Factory&lt;/strong> (Apache 2.0, Beihang U.).&lt;/p>
&lt;h3 id="ray-train">Ray Train&lt;/h3>
&lt;p>Ray Train scales fine-tuning to multiple nodes by distributing workers across a Ray cluster. While DeepSpeed and FSDP are &lt;strong>intra-job parallelism&lt;/strong> (several GPUs collaborating on one job), Ray Train is the &lt;strong>orchestration plane&lt;/strong> that builds the cluster, launches workers, manages checkpoints, recovers from node failures, and integrates with Slurm or Kubernetes. For training runs beyond 8 GPUs on changing clusters, Ray Train avoids the operational burden of &amp;ldquo;manually launching N torchrun processes with NCCL&amp;rdquo;. It combines with MLflow for tracking. &lt;strong>Gotcha:&lt;/strong> the Ray learning curve is real; for a single node with 4-8 GPUs, &lt;code>torchrun&lt;/code> or Hugging Face Accelerate are simpler. Ray Train shines when there are N changing nodes. Licence &lt;strong>Apache 2.0&lt;/strong>, maintained by &lt;strong>Anyscale Inc.&lt;/strong> (commercial backer) + community. A more K8s-native alternative: &lt;strong>Kubeflow Training Operator&lt;/strong> (Apache 2.0, LF AI &amp;amp; Data).&lt;/p>
&lt;p>&lt;strong>More options for Tune:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;strong>DeepSpeed&lt;/strong> — ZeRO parallelism in 3 stages, mixed precision, CPU/NVMe offload. MIT, &lt;strong>Microsoft&lt;/strong>.&lt;/li>
&lt;li>&lt;strong>FSDP&lt;/strong> (Fully Sharded Data Parallel) — native PyTorch parallelism, an alternative to DeepSpeed. BSD, &lt;strong>Meta&lt;/strong>.&lt;/li>
&lt;li>&lt;strong>LLaMA-Factory&lt;/strong> — equivalent to Axolotl with a focus on the Llama family. Apache 2.0, &lt;strong>Beihang University&lt;/strong>.&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Decision matrix — Tune:&lt;/strong>&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>If your case is&lt;/th>
&lt;th>Choose&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Fine-tune on 1 GPU with 24GB (RTX 4090)&lt;/td>
&lt;td>&lt;strong>QLoRA with bitsandbytes NF4&lt;/strong> + Axolotl&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Fine-tune on 1 H100 80GB, models &amp;lt; 13B&lt;/td>
&lt;td>&lt;strong>LoRA bf16&lt;/strong> + Axolotl&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Fine-tune on 4-8 GPUs, single node&lt;/td>
&lt;td>&lt;strong>transformers + PEFT + Accelerate&lt;/strong> + MLflow&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Multi-node fine-tune on a K8s cluster&lt;/td>
&lt;td>&lt;strong>Kubeflow Training Operator&lt;/strong> or &lt;strong>Ray Train&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Reproducible tracking is mandatory&lt;/td>
&lt;td>&lt;strong>MLflow + DVC input artefact&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>You want the minimum viable&lt;/td>
&lt;td>&lt;strong>Axolotl + MLflow&lt;/strong>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 id="stage-3--eval--guardrails">Stage 3 — Eval + Guardrails&lt;/h2>
&lt;p>Eval validates candidates pre and post promotion against a golden set with operational metrics; Guardrails runs safety online. Detailed in the posts on &lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">evals&lt;/a> and &lt;a href="https://blog.lo0.es/en/posts/llm-guardrails-safety-four-lines-of-defence/">guardrails&lt;/a>.&lt;/p>
&lt;h3 id="deepeval">DeepEval&lt;/h3>
&lt;p>DeepEval is the &amp;ldquo;pytest-style&amp;rdquo; OSS eval suite: you define tests with assertions over faithfulness, answer relevancy, contextual precision, hallucination rate, summarisation quality… and run them in CI. Each metric is an evaluator: some rule-based, others LLM-as-judge with auditable prompts. The philosophy is &amp;ldquo;evals as unit tests&amp;rdquo;: parameterisable by dataset, failable in CI, integrable with GitHub Actions. &lt;strong>Gotcha:&lt;/strong> LLM-as-judge metrics vary between judge model versions, so if the judge moves up a version, the thresholds lose their earlier statistical meaning. Explicit pinning of the judge model in config plus periodic threshold recalibration is mandatory discipline. Licence &lt;strong>Apache 2.0&lt;/strong>, maintained by &lt;strong>Confident AI&lt;/strong> (a company); parallel commercial SaaS offering. Comparable: &lt;strong>TruLens&lt;/strong> (MIT, &lt;strong>TruEra&lt;/strong>) and &lt;strong>G-Eval&lt;/strong> (academic).&lt;/p>
&lt;h3 id="ragas-rag-assessment">RAGAS (RAG Assessment)&lt;/h3>
&lt;p>RAGAS specialises in evaluating RAG pipelines. It defines four canonical metrics: &lt;strong>faithfulness&lt;/strong> (the answer is supported by the retrieved chunks), &lt;strong>answer relevancy&lt;/strong> (the answer addresses the query), &lt;strong>context precision&lt;/strong> (the retrieved chunks are relevant), &lt;strong>context recall&lt;/strong> (all the relevant chunks were retrieved). Each metric is computed with LLM-as-judge over a dataset of (query, context, expected answer). For a RAG system, RAGAS is the evaluator that measures whether retrieval is aligned with generation. It integrates with Langfuse and MLflow to store results. &lt;strong>Gotcha:&lt;/strong> RAGAS works well with golden sets of under 1000 examples; over huge golden sets the cost of the LLM judge per evaluation explodes, and the practice is to sample. Licence &lt;strong>Apache 2.0&lt;/strong>, maintained by &lt;strong>Exploding Gradients&lt;/strong> (the authors&amp;rsquo; company).&lt;/p>
&lt;h3 id="promptfoo">Promptfoo&lt;/h3>
&lt;p>Promptfoo is the declarative, CI-oriented evaluator: in &lt;code>promptfooconfig.yaml&lt;/code> you define a set of prompts and a set of assertions (contains text X, does not contain Y, faithfulness &amp;gt; 0.8, judge approves…), point at a provider (OpenAI compatible, vLLM, Ollama…), and &lt;code>promptfoo eval&lt;/code> runs the matrix of prompts × providers × assertions, returns a diff against the baseline and fails CI if anything regresses. It is the most &amp;ldquo;DevOps-friendly&amp;rdquo; piece of the evals ecosystem: it integrates trivially with GitHub Actions, GitLab CI or Jenkins. &lt;strong>Gotcha:&lt;/strong> assertion thresholds have to be calibrated with real data; starting at a default &lt;code>&amp;gt; 0.5&lt;/code> produces false positives that erode the team&amp;rsquo;s trust. Calibrate after the first week. Licence &lt;strong>MIT&lt;/strong>, maintained by &lt;strong>Promptfoo, Inc.&lt;/strong> (a company); a commercial Promptfoo Cloud SaaS offering exists but the OSS version is complete.&lt;/p>
&lt;h3 id="nemo-guardrails">NeMo Guardrails&lt;/h3>
&lt;p>NeMo Guardrails is NVIDIA&amp;rsquo;s framework for defining and enforcing policies in LLM systems through a DSL called &lt;strong>Colang&lt;/strong>. It lets you express rules such as &amp;ldquo;if the user asks about topic X, answer with template Y&amp;rdquo; or &amp;ldquo;if the model tries to do Z, block it&amp;rdquo; in a conversational-script syntax rather than in Python. It runs as middleware between the app and the model: input rails (validate what comes in), output rails (validate what goes out), dialog rails (control the flow). Designed for complex multi-turn systems where the policies are nontrivial. &lt;strong>Gotcha:&lt;/strong> Colang adds latency per turn (roughly 50-200 ms depending on the policy graph); for high-throughput conversational chat, dialog rails are disabled and only input + output remain. Licence &lt;strong>Apache 2.0&lt;/strong>, maintained by &lt;strong>NVIDIA&lt;/strong>.&lt;/p>
&lt;h3 id="microsoft-presidio">Microsoft Presidio&lt;/h3>
&lt;p>Presidio is the most mature OSS PII (Personally Identifiable Information) detector in the ecosystem. It detects DNI, NIE, IBAN, phone numbers, emails, physical addresses, credit card numbers, personal names, dates of birth… with recognisers based on regex + NER (spaCy) + custom validators. It supports &lt;strong>redaction&lt;/strong> (replace with placeholders), &lt;strong>masking&lt;/strong> (asterisks) or &lt;strong>deterministic anonymisation&lt;/strong> (repeatable hash). For ENS/NIS2 scenarios, it is the piece placed in front (on input) and behind (on output) the LLM to guarantee that no PII is processed or emitted. &lt;strong>Gotcha:&lt;/strong> the built-in recognisers cover English well and the rest badly; for Spanish, Catalan and Basque you have to add custom recognisers, which is disciplined work but doable. Licence &lt;strong>MIT&lt;/strong>, maintained by &lt;strong>Microsoft&lt;/strong>.&lt;/p>
&lt;p>&lt;strong>More options for Eval:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Phoenix Arize OSS&lt;/strong> — combines tracing + evals, an alternative to Langfuse Evals. ELv2, &lt;strong>Arize AI&lt;/strong>.&lt;/li>
&lt;li>&lt;strong>lm-eval-harness&lt;/strong> — academic suite with standard benchmarks (MMLU, HellaSwag…). MIT, &lt;strong>EleutherAI&lt;/strong>.&lt;/li>
&lt;li>&lt;strong>HELM&lt;/strong> — holistic academic evals. Apache 2.0, &lt;strong>Stanford CRFM&lt;/strong>.&lt;/li>
&lt;li>&lt;strong>Guardrails AI&lt;/strong> — a pythonic alternative to NeMo Guardrails. Apache 2.0, &lt;strong>Guardrails AI Inc.&lt;/strong>.&lt;/li>
&lt;li>&lt;strong>LlamaGuard / PromptGuard / ShieldGemma&lt;/strong> — safety models, not frameworks. Open weights, Meta / Google.&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Decision matrix — Eval + Guardrails:&lt;/strong>&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>If your case is&lt;/th>
&lt;th>Choose&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Eval in CI, &amp;ldquo;pytest for LLMs&amp;rdquo; style&lt;/td>
&lt;td>&lt;strong>Promptfoo + GitHub Actions&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Eval specific to a RAG pipeline&lt;/td>
&lt;td>&lt;strong>RAGAS + Langfuse datasets&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>General eval with custom metrics&lt;/td>
&lt;td>&lt;strong>DeepEval + MLflow dataset&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Dialog policy with declarative rules&lt;/td>
&lt;td>&lt;strong>NeMo Guardrails (Colang)&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>PII redaction in/out only&lt;/td>
&lt;td>&lt;strong>Presidio&lt;/strong> (you do not need NeMo)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Open safety model in Spanish&lt;/td>
&lt;td>&lt;strong>LlamaGuard 3&lt;/strong> or &lt;strong>ShieldGemma&lt;/strong>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 id="stage-4--deploy">Stage 4 — Deploy&lt;/h2>
&lt;p>Deploy serves tokens to the user with predictable throughput and latency, adapter hot-swap and multi-tenancy where it applies. Covered in the posts on &lt;a href="https://blog.lo0.es/en/posts/vllm-kubernetes-llm-inference-that-scales/">vLLM on K8s&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/llm-inference-operators-kubernetes/">LLM operators&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/gpu-cluster-as-multi-tenant-platform/">multi-tenant cluster&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/kv-cache-working-memory-llm-inference/">KV cache&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/pagedattention-vllm-block-manager/">PagedAttention&lt;/a> and &lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">disaggregated serving&lt;/a>.&lt;/p>
&lt;h3 id="vllm">vLLM&lt;/h3>
&lt;p>vLLM is &lt;strong>the&lt;/strong> reference OSS inference engine. It implements &lt;strong>PagedAttention&lt;/strong> (KV cache paging in the style of virtual memory, avoiding fragmentation), &lt;strong>continuous batching&lt;/strong> (requests join the batch as they arrive, rather than waiting for the next batch), &lt;strong>prefix caching&lt;/strong> (common prefixes, system prompts, do not recompute the KV cache), &lt;strong>LoRA hot-swap&lt;/strong> (&lt;code>--enable-lora&lt;/code> allows loading and unloading adapters without restarting the engine), an &lt;strong>OpenAI-compatible&lt;/strong> API, and &lt;strong>disaggregated prefill/decode&lt;/strong> support since 2025. It covers almost everything from Llama 3 / Mistral / Qwen / DeepSeek. &lt;strong>Gotcha:&lt;/strong> maximum throughput is only reached with &lt;code>--max-num-seqs&lt;/code> and &lt;code>--gpu-memory-utilization&lt;/code> tuned for the specific model and hardware; the defaults are conservative. The initial tuning session pays off: 2-3× throughput. Licence &lt;strong>Apache 2.0&lt;/strong>, originated at UC Berkeley, today maintained by the &lt;strong>vLLM Project / LF AI &amp;amp; Data&lt;/strong> plus a broad community (Red Hat, NVIDIA, AWS, IBM contribute). Serious alternatives in the same bucket: &lt;strong>TGI&lt;/strong> (Apache 2.0, &lt;strong>Hugging Face&lt;/strong>), &lt;strong>SGLang&lt;/strong> (Apache 2.0, &lt;strong>LMSys&lt;/strong>), &lt;strong>TensorRT-LLM&lt;/strong> (Apache 2.0, &lt;strong>NVIDIA&lt;/strong>, requires conversion).&lt;/p>
&lt;h3 id="kserve">KServe&lt;/h3>
&lt;p>KServe is the Kubernetes operator for serving ML models, LLMs included, in a declarative pattern: you define an &lt;code>InferenceService&lt;/code> YAML with the model and predictor (which can be vLLM, TGI, Triton, or a custom container) and KServe handles scheduling onto GPU nodes, autoscaling (scale-to-zero included), traffic splitting for canary, and model registry integration. It is the layer that standardises &amp;ldquo;how a model is deployed on K8s&amp;rdquo; across multiple engines, instead of inventing engine-specific YAML. It supports multi-model with &lt;strong>Inference Graphs&lt;/strong> (chaining preprocessor → model → postprocessor) and integrates with KEDA/Karpenter for GPU pool autoscaling. &lt;strong>Gotcha:&lt;/strong> scale-to-zero on GPU works badly in practice because the warm-up (loading weights into VRAM) takes tens of seconds; &lt;code>minReplicas: 1&lt;/code> is better. Licence &lt;strong>Apache 2.0&lt;/strong>, maintained by &lt;strong>Kubeflow / LF AI &amp;amp; Data&lt;/strong>. Alternatives: &lt;strong>KubeRay&lt;/strong> (Apache 2.0, &lt;strong>Anyscale&lt;/strong>), &lt;strong>llm-d&lt;/strong> (Apache 2.0, &lt;strong>CNCF&lt;/strong>), &lt;strong>KAITO&lt;/strong> (MIT, &lt;strong>Microsoft Azure&lt;/strong>).&lt;/p>
&lt;h3 id="triton-inference-server">Triton Inference Server&lt;/h3>
&lt;p>Triton serves heterogeneous models on a single backend: LLMs (via the vLLM or TensorRT-LLM backend), traditional models (ONNX, TorchScript, TensorFlow), custom models. For systems that mix LLM inference with traditional classifiers, embedding encoders, reranking models, OCR and so on, Triton avoids having N different engines in N pods. It supports ensemble models (chaining models in a single request), dynamic batching, model versioning, model warmup. &lt;strong>Gotcha:&lt;/strong> Triton is flexible but heavy to operate; for systems serving only LLMs, vLLM directly is simpler and more optimised. Triton shines when there is real heterogeneity. Licence &lt;strong>BSD-3-Clause&lt;/strong>, maintained by &lt;strong>NVIDIA&lt;/strong>.&lt;/p>
&lt;h3 id="envoy-ai-gateway">Envoy AI Gateway&lt;/h3>
&lt;p>Envoy AI Gateway is the CNCF ecosystem&amp;rsquo;s &amp;ldquo;LLM-aware API gateway&amp;rdquo;. Built on Envoy Proxy, it adds knowledge of the OpenAI-compatible APIs (chat completions, embeddings, etc.), routing across multiple backends (local vLLM + OpenAI + Anthropic + Bedrock), &lt;strong>token-based rate limiting&lt;/strong> (limits by tokens per minute, not by requests), intelligent retries, fallback between providers, and built-in OTel observability. It is the piece that makes &amp;ldquo;AI Gateway&amp;rdquo; real as an architectural category. &lt;strong>Gotcha:&lt;/strong> integration with authentication (OIDC, JWT) is flexible but requires detailed Envoy configuration; an &amp;ldquo;out of the box&amp;rdquo; AI Gateway with no configuration produces an Envoy that passes everything through. Licence &lt;strong>Apache 2.0&lt;/strong>, maintained by &lt;strong>CNCF&lt;/strong> since the initial donation from Tetrate. Alternatives: &lt;strong>LiteLLM Proxy&lt;/strong> (MIT, &lt;strong>BerriAI&lt;/strong>), &lt;strong>Portkey&lt;/strong> (MIT, &lt;strong>Portkey AI&lt;/strong>), &lt;strong>Kong AI Gateway&lt;/strong> (Apache 2.0 base + EE, &lt;strong>Kong Inc.&lt;/strong>).&lt;/p>
&lt;h3 id="llamacpp">llama.cpp&lt;/h3>
&lt;p>llama.cpp serves LLMs on CPUs (and Apple Silicon, GPUs via Vulkan/Metal/CUDA) with very aggressive quantisation (GGUF format, down to 2-bit). It is the canonical option for inference on hardware without a dedicated GPU: edge devices, workstations, development machines. It covers everything from small models (Phi-3, Gemma 2B) to Llama 70B on hardware with enough RAM. &lt;strong>Gotcha:&lt;/strong> latency on CPU is orders of magnitude worse than on a dedicated GPU, so it is useful for offline evals, drift checks and local development, not for production serving under real load. Licence &lt;strong>MIT&lt;/strong>, maintained by &lt;strong>Georgi Gerganov&lt;/strong> + community.&lt;/p>
&lt;p>&lt;strong>More options for Deploy:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;strong>TensorRT-LLM&lt;/strong> — maximum optimisation on NVIDIA Hopper/Ada. Apache 2.0, NVIDIA.&lt;/li>
&lt;li>&lt;strong>SGLang&lt;/strong> — good for workloads with structured generation and JSON. Apache 2.0, LMSys.&lt;/li>
&lt;li>&lt;strong>TGI&lt;/strong> — a mature alternative, focused on the HuggingFace ecosystem. Apache 2.0, HuggingFace.&lt;/li>
&lt;li>&lt;strong>NVIDIA Dynamo&lt;/strong> — multi-node disaggregated serving. Apache 2.0, NVIDIA.&lt;/li>
&lt;li>&lt;strong>llm-d&lt;/strong> — K8s operator specific to LLMs. Apache 2.0, CNCF.&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Decision matrix — Deploy:&lt;/strong>&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>If your case is&lt;/th>
&lt;th>Choose&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Production serving on NVIDIA H100/A100&lt;/td>
&lt;td>&lt;strong>vLLM&lt;/strong> (the safe default)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Absolute throughput squeezing on Hopper&lt;/td>
&lt;td>&lt;strong>TensorRT-LLM&lt;/strong> + vLLM plugin or standalone&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Edge / local dev without GPU&lt;/td>
&lt;td>&lt;strong>llama.cpp&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Multi-model (LLM + classifiers + encoders)&lt;/td>
&lt;td>&lt;strong>Triton&lt;/strong> with the vLLM backend&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Declarative K8s with autoscaling&lt;/td>
&lt;td>&lt;strong>KServe&lt;/strong> + vLLM as predictor&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>AI Gateway with token rate limiting&lt;/td>
&lt;td>&lt;strong>Envoy AI Gateway&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Multi-node disaggregated GPU cluster&lt;/td>
&lt;td>&lt;strong>NVIDIA Dynamo&lt;/strong> over vLLM&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 id="stage-5--observe">Stage 5 — Observe&lt;/h2>
&lt;p>Observe propagates &lt;code>trace_id&lt;/code> end-to-end, emits runtime metrics, runs an LLM judge over sampling and detects drift. Detailed in &lt;a href="https://blog.lo0.es/en/posts/agentsight-llm-tracing-ebpf-zero-instrumentation/">tracing with AgentSight&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/mcp-deep-observability-opentelemetry/">MCP observability with OTel&lt;/a> and &lt;a href="https://blog.lo0.es/en/posts/ebpf-local-inference-statistical-drift-detection/">eBPF + drift&lt;/a>.&lt;/p>
&lt;h3 id="opentelemetry-collector">OpenTelemetry Collector&lt;/h3>
&lt;p>The OTel Collector is the agent that receives traces, metrics and logs in OTel format (or in any other via receivers), processes them (filters, sampling, attribute enrichment, PII redaction), and routes them to one or several backends (Tempo, Jaeger, Prometheus, Loki, Langfuse…). It is &lt;strong>the piece that decouples the apps from the observability backend&lt;/strong>: moving from Tempo to Jaeger means changing the Collector&amp;rsquo;s exporter, not the app. For LLMOps it matters especially because the &lt;strong>OTel GenAI semantic conventions&lt;/strong> spec defines the attributes &lt;code>gen_ai.request.model&lt;/code>, &lt;code>gen_ai.prompt.version&lt;/code>, &lt;code>gen_ai.response.tokens&lt;/code> and so on, which stitch the &lt;code>trace_id&lt;/code> to the system&amp;rsquo;s lineage. &lt;strong>Gotcha:&lt;/strong> the Collector configuration tends to grow; without discipline and periodic review it ends up as an 800-line YAML that nobody understands. Modularising with &lt;code>extensions&lt;/code> helps. Licence &lt;strong>Apache 2.0&lt;/strong>, maintained by the &lt;strong>CNCF / OpenTelemetry Project&lt;/strong>.&lt;/p>
&lt;h3 id="tempo-traces--jaeger">Tempo (traces) + Jaeger&lt;/h3>
&lt;p>Grafana Tempo is the distributed trace backend optimised for cost: it uses an object store (S3/MinIO) instead of Elasticsearch, deduplicates by &lt;code>trace_id&lt;/code>, and integrates natively with Grafana for visualisation. For LLMOps, where a real request generates 10-30 spans (gateway, prompt pull, RAG retrieval, prefill, decode N times, scoring), Tempo copes with high volumes at a reasonable cost. &lt;strong>Jaeger&lt;/strong> is the more established CNCF alternative, better for cases under 100k traces per day, worse for native object store. &lt;strong>Gotcha:&lt;/strong> Tempo has no traditional indexing; searches like &amp;ldquo;traces that took more than 5s and touched tenant X&amp;rdquo; require &lt;strong>TraceQL&lt;/strong> + Grafana and are not as fast as Jaeger with Elasticsearch. For immediate ad-hoc diagnosis it is worth keeping a parallel Jaeger with aggressive sampling. Licences &lt;strong>AGPL 3.0&lt;/strong> (Tempo) and &lt;strong>Apache 2.0&lt;/strong> (Jaeger), maintained by &lt;strong>Grafana Labs&lt;/strong> and &lt;strong>CNCF&lt;/strong> respectively.&lt;/p>
&lt;h3 id="prometheus--grafana">Prometheus + Grafana&lt;/h3>
&lt;p>Prometheus is the time-series metrics foundation of the ecosystem. Pull model (it scrapes &lt;code>/metrics&lt;/code> endpoints), PromQL for queries, exporters for everything (Postgres, Kafka, NVIDIA GPU via &lt;code>dcgm-exporter&lt;/code>, vLLM natively). Grafana visualises Prometheus + Tempo + Loki on a single plane. For LLMOps, the critical metrics are &lt;code>gpu_utilization&lt;/code>, &lt;code>kv_cache_usage_pct&lt;/code>, &lt;code>tokens_per_second&lt;/code>, &lt;code>prefill_latency_p95&lt;/code>, &lt;code>decode_latency_p95&lt;/code>, &lt;code>queue_depth&lt;/code>, aggregated by tenant. &lt;strong>Gotcha:&lt;/strong> Prometheus is very good up to about 1M active series; above that it is worth moving to &lt;strong>Thanos&lt;/strong> or &lt;strong>Mimir&lt;/strong> for long retention and horizontal scalability. For the blog&amp;rsquo;s typical LLM cluster (4-8 H100), Prometheus alone is enough. Licences &lt;strong>Apache 2.0&lt;/strong> (Prometheus, &lt;strong>CNCF&lt;/strong>) and &lt;strong>AGPL 3.0&lt;/strong> (Grafana 10+, &lt;strong>Grafana Labs&lt;/strong>).&lt;/p>
&lt;h3 id="langfuse">Langfuse&lt;/h3>
&lt;p>Langfuse is the LLM-specific OSS observability + prompt management tool. It captures spans with LLM semantic conventions (input, output, model, tokens, latency, score, user_id, session_id), visualises them as &lt;strong>conversational traces&lt;/strong> (not just span trees), manages &lt;strong>prompts versioned with a &lt;code>production&lt;/code> label&lt;/strong> and allows &lt;strong>curated datasets + evals&lt;/strong> from the same UI. For serious LLMOps, Langfuse fills the gap that neither Tempo nor Jaeger covers: a tracing UI designed to be LLM-first. &lt;strong>Gotcha:&lt;/strong> Langfuse maintains its own store (Postgres + ClickHouse for high volume); on large clusters the operational side of ClickHouse deserves attention. To get started, Postgres alone copes. Licence &lt;strong>MIT&lt;/strong> for the OSS core, &lt;strong>EE Enterprise Edition&lt;/strong> with additional features (SSO, audit logs, advanced RBAC). Maintained by &lt;strong>Langfuse GmbH&lt;/strong> (Berlin, German). There is Langfuse Cloud (SaaS).&lt;/p>
&lt;h3 id="phoenix-arize-oss">Phoenix Arize OSS&lt;/h3>
&lt;p>Phoenix is Arize AI&amp;rsquo;s OSS for LLM observability + evals, an alternative to Langfuse with a different emphasis: more oriented to evaluation and visual debugging (embedding drift, cluster analysis), less to prompt management. A good pairing with Langfuse when you want a dual approach: Langfuse for &amp;ldquo;production conversational traces&amp;rdquo;, Phoenix for &amp;ldquo;exploratory investigation of model behaviour&amp;rdquo;. &lt;strong>Gotcha:&lt;/strong> Phoenix duplicates functionality with Langfuse and with MLflow; having all three in production multiplies the operational burden. Pick one as the main tool and the others as complements. Licence &lt;strong>Elastic License 2.0&lt;/strong> (not strictly OSI), maintained by &lt;strong>Arize AI&lt;/strong>.&lt;/p>
&lt;h3 id="cilium-tetragon--hubble">Cilium Tetragon + Hubble&lt;/h3>
&lt;p>Tetragon (eBPF runtime security observer) and Hubble (eBPF network observer) are the low-level pieces that give real runtime visibility into the cluster: which processes run in which pods, what syscalls they make, what network connections they open, in real time. For ENS/NIS2 environments that demand &amp;ldquo;prove what ran in production&amp;rdquo;, Tetragon is the irrefutable audit layer: every process execution with its parent, its capabilities, its K8s context. Hubble visualises network flows by pod, namespace, service. &lt;strong>Gotcha:&lt;/strong> the volume of events generated is high; without kernel-side filtering (which Tetragon supports with &lt;code>TracingPolicy&lt;/code>), it saturates the observability plane fast. Discipline in policies. Licence &lt;strong>Apache 2.0&lt;/strong> for both, maintained by &lt;strong>Cilium / CNCF / Isovalent&lt;/strong>.&lt;/p>
&lt;h3 id="evidently-ai">Evidently AI&lt;/h3>
&lt;p>Evidently is the OSS library for &lt;strong>drift detection&lt;/strong>: it compares input and output distributions between two time windows (training vs production, current week vs previous week), applies statistical tests (KS, PSI, Wasserstein, chi-square) and generates HTML reports. For LLMOps it detects when the distribution of prompts changes (new topics, new lengths, new languages) or when the model starts answering shorter / longer / differently. &lt;strong>Gotcha:&lt;/strong> Evidently is oriented to tabular data and embeddings; for raw text it is best combined with an encoder embedder that produces vectors before applying the tests. Licence &lt;strong>Apache 2.0&lt;/strong>, maintained by &lt;strong>Evidently AI&lt;/strong> (a company). Alternatives: &lt;strong>NannyML&lt;/strong> (Apache 2.0, &lt;strong>NannyML BV&lt;/strong>), &lt;strong>Alibi Detect&lt;/strong> (Apache 2.0, &lt;strong>Seldon&lt;/strong>).&lt;/p>
&lt;p>&lt;strong>More options for Observe:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Loki&lt;/strong> — Prometheus-style logs backend for Grafana. AGPL 3.0, Grafana Labs.&lt;/li>
&lt;li>&lt;strong>Pixie&lt;/strong> — auto-instrumented eBPF observability. Apache 2.0, CNCF.&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Decision matrix — Observe:&lt;/strong>&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>If your case is&lt;/th>
&lt;th>Choose&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Minimum viable stack&lt;/td>
&lt;td>&lt;strong>OTel Collector + Tempo + Prometheus + Grafana + Langfuse&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Traces with strong ad-hoc search&lt;/td>
&lt;td>Add &lt;strong>Jaeger&lt;/strong> with aggressive sampling&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>ENS / NIS2 compliance runtime audit&lt;/td>
&lt;td>&lt;strong>Tetragon + Hubble&lt;/strong> + mandated retention&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Exploratory investigation of the model&lt;/td>
&lt;td>&lt;strong>Phoenix Arize OSS&lt;/strong> alongside Langfuse&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Statistical drift detection&lt;/td>
&lt;td>&lt;strong>Evidently&lt;/strong> over embeddings + inputs&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Cluster beyond 1M Prometheus series&lt;/td>
&lt;td>&lt;strong>Mimir&lt;/strong> (Grafana Labs) or &lt;strong>Thanos&lt;/strong>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 id="stage-6--retrain--cross-cutting-pieces">Stage 6 — Retrain + cross-cutting pieces&lt;/h2>
&lt;p>Retrain closes the loop feedback → triage → enriched dataset → new adapter. Prompt versioning and data versioning stitch lineage across stages. Detailed in &lt;a href="https://blog.lo0.es/en/posts/retrain-closing-the-loop-feedback-dataset-adapter/">retrain&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/prompt-versioning-contract-five-word-change/">prompt versioning&lt;/a> and &lt;a href="https://blog.lo0.es/en/posts/data-versioning-llmops-dvc-lakefs-reproducible-golden-dataset/">data versioning&lt;/a>.&lt;/p>
&lt;h3 id="apache-airflow">Apache Airflow&lt;/h3>
&lt;p>Airflow is the most established OSS DAG scheduler. You define workflows as Python code (DAGs), each DAG with tasks (operators) that run according to declared dependencies plus a cron schedule. For retraining: a weekly DAG that extracts feedback from Postgres, triages it with an LLM-as-classifier, enriches the enriched dataset in DVC, launches the fine-tuning job on Kubernetes, runs evals against the golden set, and promotes if it passes the gates. There is a huge ecosystem of operators for everything (S3, Postgres, Kafka, Slack, K8s, Spark…). &lt;strong>Gotcha:&lt;/strong> Airflow 2.x improved a great deal over the chaos of 1.x, but the scheduler is still a component that deserves operational attention (Postgres backend, executor pool, sidecar workers); for simple pipelines it is over-engineering. Licence &lt;strong>Apache 2.0&lt;/strong>, maintained by the &lt;strong>ASF&lt;/strong>.&lt;/p>
&lt;h3 id="argo-workflows">Argo Workflows&lt;/h3>
&lt;p>Argo Workflows is the K8s-native equivalent of Airflow: each step is a container, the DAGs are defined as K8s YAML, the executor is Kubernetes itself. For environments where &lt;strong>everything is K8s&lt;/strong>, Argo fits without an extra component to maintain. Long tasks (a six-hour fine-tuning run) execute as Pods that survive control plane failures. It integrates trivially with Kubeflow Pipelines (which is built on top). &lt;strong>Gotcha:&lt;/strong> Argo&amp;rsquo;s YAML syntax is verbose; for complex DAGs, Argo feels less productive than Airflow in Python. Solutions: &lt;strong>Hera&lt;/strong> (Python DSL for Argo, a &lt;strong>DataBricks contribution&lt;/strong>) or &lt;strong>Argo + custom CRDs&lt;/strong>. Licence &lt;strong>Apache 2.0&lt;/strong>, maintained by &lt;strong>CNCF&lt;/strong>.&lt;/p>
&lt;h3 id="kubeflow-pipelines">Kubeflow Pipelines&lt;/h3>
&lt;p>Kubeflow Pipelines is the layer above Argo Workflows oriented specifically to ML: artefact tracking, experiment tracking, reusable pipeline templates, versioned components. Built on Argo, it adds the ML conceptual model (input artefact, output artefact, metrics) that raw Argo does not have. For cyclical retraining on a K8s cluster, it is the most &amp;ldquo;ML-ready&amp;rdquo; option in the OSS ecosystem. &lt;strong>Gotcha:&lt;/strong> Kubeflow as a full suite is heavy (10+ components); many organisations install only Pipelines + Training Operator + Katib and skip Notebook Server / legacy KFServing. Licence &lt;strong>Apache 2.0&lt;/strong>, maintained by &lt;strong>CNCF / LF AI &amp;amp; Data&lt;/strong>.&lt;/p>
&lt;h3 id="feast">Feast&lt;/h3>
&lt;p>Feast is the most widely used OSS feature store. It defines &lt;strong>feature views&lt;/strong> over batch sources (BigQuery, Postgres, Parquet) and online sources (Redis, DynamoDB, Postgres with an extension), exposes a consistent API for read-during-training and read-during-inference (point-in-time correctness), and guarantees that the features of the model in production are the same ones it was trained with. For LLMOps where the model needs consistent user / session / context features (latest plan, tenure as a customer, recent tickets), Feast provides the discipline. &lt;strong>Gotcha:&lt;/strong> for many pure LLM systems (a RAG chatbot with no complex features), Feast is over-engineering, Postgres is enough. When there are real features (recommendation, scoring, ranking), Feast shines. Licence &lt;strong>Apache 2.0&lt;/strong>, maintained by &lt;strong>LF AI &amp;amp; Data&lt;/strong>.&lt;/p>
&lt;h3 id="argilla">Argilla&lt;/h3>
&lt;p>Argilla is the OSS annotation + HiL (human-in-the-loop) platform most aligned with modern LLMOps. It creates annotation projects with templates (classification, ranking, span annotation, RLHF preference, free-form text), connects to HuggingFace datasets, and integrates with Langfuse to import traces from production as cases to annotate. It supports multiple annotators with reconciliation, kappa scoring and quality control. To enrich retrain datasets with cases from the &amp;ldquo;blunt tone&amp;rdquo; cluster of the &lt;a href="https://blog.lo0.es/en/posts/retrain-closing-the-loop-feedback-dataset-adapter/">Retrain post&lt;/a>, Argilla is the front end. &lt;strong>Gotcha:&lt;/strong> Argilla requires Elasticsearch for production performance; for small experiments SQLite is enough. Licence &lt;strong>Apache 2.0&lt;/strong>, maintained by &lt;strong>Argilla, Inc.&lt;/strong> (acquired by &lt;strong>Hugging Face&lt;/strong> in 2024). Alternative: &lt;strong>Label Studio&lt;/strong> (Apache 2.0, &lt;strong>HumanSignal&lt;/strong>), more generalist, less LLM-first.&lt;/p>
&lt;h3 id="langfuse-prompts--mlflow-prompt-registry">Langfuse Prompts + MLflow Prompt Registry&lt;/h3>
&lt;p>Langfuse Prompts manages prompts as versioned entities with labels (production, staging, experiment). The client reads the active prompt from Langfuse on the request path (with a local cache of a few seconds) and propagates &lt;code>prompt_id, prompt_version&lt;/code> to the OTel span, exactly as the &lt;a href="https://blog.lo0.es/en/posts/anatomy-llm-request-production-tour-six-stages/">forensic post&lt;/a> does. MLflow Prompt Registry does the same with a slightly different conceptual model (no labels-as-pointers; it uses stages, like the Models registry). Both are valid; the choice depends on which tracking tool is already in place. &lt;strong>Gotcha (Langfuse):&lt;/strong> labels are mutable, so changing &lt;code>production&lt;/code> points at another version with no explicit audit; prompts are better deployed via PR against the configs repo, not manually in the UI. Licences and governance covered above.&lt;/p>
&lt;p>&lt;strong>More options for Retrain + cross-cutting pieces:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Prefect&lt;/strong> — &amp;ldquo;modern&amp;rdquo; Python DAGs, an alternative to Airflow. Apache 2.0, &lt;strong>Prefect Tech&lt;/strong>.&lt;/li>
&lt;li>&lt;strong>Dagster&lt;/strong> — DAGs with a strong focus on data assets. Apache 2.0, &lt;strong>Dagster Labs&lt;/strong>.&lt;/li>
&lt;li>&lt;strong>Label Studio&lt;/strong> — generalist annotation. Apache 2.0, &lt;strong>HumanSignal&lt;/strong>.&lt;/li>
&lt;li>&lt;strong>OpenLineage&lt;/strong> — cross-system lineage event standard. Apache 2.0, &lt;strong>LF AI &amp;amp; Data&lt;/strong>.&lt;/li>
&lt;li>&lt;strong>DataHub / Apache Atlas / OpenMetadata&lt;/strong> — catalogue + lineage with a UI. Apache 2.0.&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Decision matrix — Retrain + cross-cutting pieces:&lt;/strong>&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>If your case is&lt;/th>
&lt;th>Choose&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Simple pipelines with a catalogue of operators&lt;/td>
&lt;td>&lt;strong>Airflow&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Everything is K8s, minimal components&lt;/td>
&lt;td>&lt;strong>Argo Workflows&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>ML pipelines with artefact tracking&lt;/td>
&lt;td>&lt;strong>Kubeflow Pipelines&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>HiL annotation for LLM retraining&lt;/td>
&lt;td>&lt;strong>Argilla&lt;/strong> + Langfuse integration&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Features shared between training and inference&lt;/td>
&lt;td>&lt;strong>Feast&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>No complex features, only prompts + LLM&lt;/td>
&lt;td>Skip Feast&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Lightweight prompt registry&lt;/td>
&lt;td>&lt;strong>Langfuse Prompts&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>MLflow is already centralised&lt;/td>
&lt;td>&lt;strong>MLflow Prompt Registry&lt;/strong>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 id="master-table-licence-governance-and-enterprise-offering">Master table: licence, governance and enterprise offering&lt;/h2>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Tool&lt;/th>
&lt;th>Licence&lt;/th>
&lt;th>Governance / maintainer&lt;/th>
&lt;th>Commercial EE / SaaS&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>DVC&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>Iterative.ai&lt;/td>
&lt;td>DVC Studio&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>lakeFS&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>Treeverse&lt;/td>
&lt;td>lakeFS Cloud&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>MinIO&lt;/strong>&lt;/td>
&lt;td>AGPL v3&lt;/td>
&lt;td>MinIO Inc.&lt;/td>
&lt;td>SUBNET / AIStor&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Qdrant&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>Qdrant GmbH&lt;/td>
&lt;td>Qdrant Cloud&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>pgvector&lt;/strong>&lt;/td>
&lt;td>PostgreSQL License&lt;/td>
&lt;td>Andrew Kane + community&lt;/td>
&lt;td>— (built-in Postgres clouds)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>PostgreSQL&lt;/strong>&lt;/td>
&lt;td>PostgreSQL License&lt;/td>
&lt;td>PostgreSQL Global Dev Group&lt;/td>
&lt;td>several managed (Crunchy, Neon, Aiven, EDB)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Apache Kafka&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>ASF&lt;/td>
&lt;td>Confluent Cloud&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Debezium&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>Red Hat / ASF&lt;/td>
&lt;td>Debezium Server / Confluent Connectors&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Apache Flink&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>ASF&lt;/td>
&lt;td>Ververica Platform, Aiven&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>HF Transformers&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>Hugging Face SAS&lt;/td>
&lt;td>HF Inference Endpoints / Enterprise Hub&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>PEFT&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>Hugging Face SAS&lt;/td>
&lt;td>— (part of the HF offering)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>bitsandbytes&lt;/strong>&lt;/td>
&lt;td>MIT&lt;/td>
&lt;td>Tim Dettmers + community&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>MLflow&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>LF AI &amp;amp; Data&lt;/td>
&lt;td>Databricks MLflow&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Axolotl&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>OpenAccess AI Collective&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Ray (Train)&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>Anyscale + community&lt;/td>
&lt;td>Anyscale Platform&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>DeepSpeed&lt;/strong>&lt;/td>
&lt;td>MIT&lt;/td>
&lt;td>Microsoft&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>DeepEval&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>Confident AI&lt;/td>
&lt;td>Confident AI SaaS&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>RAGAS&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>Exploding Gradients&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Promptfoo&lt;/strong>&lt;/td>
&lt;td>MIT&lt;/td>
&lt;td>Promptfoo, Inc.&lt;/td>
&lt;td>Promptfoo Cloud&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>NeMo Guardrails&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>NVIDIA&lt;/td>
&lt;td>NeMo Microservices&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Presidio&lt;/strong>&lt;/td>
&lt;td>MIT&lt;/td>
&lt;td>Microsoft&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Phoenix (Arize)&lt;/strong>&lt;/td>
&lt;td>Elastic v2&lt;/td>
&lt;td>Arize AI&lt;/td>
&lt;td>Arize Platform&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>vLLM&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>vLLM Project / LF AI &amp;amp; Data&lt;/td>
&lt;td>several (Red Hat, AWS, IBM, NVIDIA)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>TGI&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>Hugging Face SAS&lt;/td>
&lt;td>HF Inference Endpoints&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>SGLang&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>LMSys + community&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>TensorRT-LLM&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>NVIDIA&lt;/td>
&lt;td>NVIDIA AI Enterprise&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>llama.cpp&lt;/strong>&lt;/td>
&lt;td>MIT&lt;/td>
&lt;td>Georgi Gerganov + community&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Triton Inference Server&lt;/strong>&lt;/td>
&lt;td>BSD-3&lt;/td>
&lt;td>NVIDIA&lt;/td>
&lt;td>NVIDIA AI Enterprise&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>KServe&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>LF AI &amp;amp; Data (Kubeflow)&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Envoy AI Gateway&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>CNCF / Tetrate&lt;/td>
&lt;td>Tetrate Service Bridge&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>LiteLLM&lt;/strong>&lt;/td>
&lt;td>MIT&lt;/td>
&lt;td>BerriAI&lt;/td>
&lt;td>LiteLLM Cloud&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>OpenTelemetry&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>CNCF&lt;/td>
&lt;td>several vendors (Honeycomb, Datadog, Grafana)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Tempo&lt;/strong>&lt;/td>
&lt;td>AGPL 3.0&lt;/td>
&lt;td>Grafana Labs&lt;/td>
&lt;td>Grafana Cloud Tempo&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Jaeger&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>CNCF&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Prometheus&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>CNCF&lt;/td>
&lt;td>Grafana Cloud, AMP, GCP Managed Prom, Azure&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Grafana&lt;/strong>&lt;/td>
&lt;td>AGPL 3.0&lt;/td>
&lt;td>Grafana Labs&lt;/td>
&lt;td>Grafana Cloud, Grafana Enterprise&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Loki&lt;/strong>&lt;/td>
&lt;td>AGPL 3.0&lt;/td>
&lt;td>Grafana Labs&lt;/td>
&lt;td>Grafana Cloud Loki&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Langfuse&lt;/strong>&lt;/td>
&lt;td>MIT (core) / EE&lt;/td>
&lt;td>Langfuse GmbH&lt;/td>
&lt;td>Langfuse Cloud&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Tetragon&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>Cilium / CNCF / Isovalent&lt;/td>
&lt;td>Isovalent Enterprise&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Hubble&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>Cilium / CNCF&lt;/td>
&lt;td>Isovalent Enterprise&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Evidently AI&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>Evidently AI&lt;/td>
&lt;td>Evidently Cloud&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Apache Airflow&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>ASF&lt;/td>
&lt;td>Astronomer, MWAA, Cloud Composer&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Argo Workflows&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>CNCF&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Kubeflow Pipelines&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>CNCF / LF AI &amp;amp; Data&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Feast&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>LF AI &amp;amp; Data&lt;/td>
&lt;td>Tecton (commercial)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Argilla&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>Hugging Face&lt;/td>
&lt;td>HF Hub features&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>OpenLineage&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>LF AI &amp;amp; Data&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>DataHub&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>Acryl Data&lt;/td>
&lt;td>Acryl Cloud&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>&lt;strong>The pattern to watch for when reading the table:&lt;/strong> &lt;strong>AGPL 3.0&lt;/strong> and &lt;strong>Elastic v2&lt;/strong> are the ones that add the most friction in companies with strict licensing policies (legal asks for a specific review). The &lt;strong>Apache 2.0&lt;/strong> ones pass compliance without argument. Those with an &amp;ldquo;EE Enterprise&amp;rdquo; tier or equivalent hide a decision: the OSS version is functionally complete for production, but team features (SSO, audit, advanced RBAC) live in the commercial version. For ENS customers under a HIGH declaration, the EE features (SSO with corporate SAML/OIDC, immutable audit logs) are usually mandatory, so it is worth knowing the price beforehand.&lt;/p>
&lt;h2 id="when-to-move-from-the-minimum-stack-to-the-full-stack">When to move from the &amp;ldquo;minimum stack&amp;rdquo; to the &amp;ldquo;full stack&amp;rdquo;&lt;/h2>
&lt;p>The whole catalogue can be intimidating. But you do not build all of it on day one. There is a reasonable order that this blog has been validating in posts throughout the series. The &lt;strong>minimum viable stack&lt;/strong> that serves an LLM API with acceptable discipline:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Serving&lt;/strong>: vLLM on Kubernetes plus an Envoy AI Gateway in front.&lt;/li>
&lt;li>&lt;strong>Data&lt;/strong>: Postgres + pgvector (no Qdrant), MinIO for object store, no Kafka.&lt;/li>
&lt;li>&lt;strong>Tune&lt;/strong>: Axolotl + MLflow, no Ray Train.&lt;/li>
&lt;li>&lt;strong>Eval&lt;/strong>: Promptfoo in CI, no RAGAS and no judge in production.&lt;/li>
&lt;li>&lt;strong>Observe&lt;/strong>: OTel Collector + Prometheus + Grafana + Langfuse, no Phoenix and no Tetragon.&lt;/li>
&lt;li>&lt;strong>Retrain&lt;/strong>: feedback in Postgres + crontab scripts, no Airflow.&lt;/li>
&lt;li>&lt;strong>Versioning&lt;/strong>: prompts in Langfuse + datasets in DVC over MinIO, no lakeFS.&lt;/li>
&lt;/ul>
&lt;p>That is &lt;strong>about 8-10 components&lt;/strong> and it serves a reasonable LLM system for a single tenant with moderate traffic. As the system grows, there are identifiable moments where adding each piece pays off:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Trigger&lt;/th>
&lt;th>Component to add&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Multi-tenant with isolated corpora&lt;/td>
&lt;td>&lt;strong>Qdrant&lt;/strong> (collections per tenant, ACL)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>The corpus is refreshed often and periodically breaks&lt;/td>
&lt;td>&lt;strong>lakeFS&lt;/strong> (branches with pre-merge hooks)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>The embedding pipeline needs streaming&lt;/td>
&lt;td>&lt;strong>Kafka + Debezium + Flink&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Retraining moves from monthly to weekly&lt;/td>
&lt;td>&lt;strong>Airflow&lt;/strong> or &lt;strong>Argo Workflows&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Shared features appear (customer profile, scoring)&lt;/td>
&lt;td>&lt;strong>Feast&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Annotation outgrows informal capacity&lt;/td>
&lt;td>&lt;strong>Argilla&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>RAG eval needs specific metrics&lt;/td>
&lt;td>&lt;strong>RAGAS&lt;/strong> + Langfuse datasets&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>ENS compliance demands runtime audit&lt;/td>
&lt;td>&lt;strong>Tetragon + Hubble&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Drift is invisible and shows up late&lt;/td>
&lt;td>&lt;strong>Evidently&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>A single stack stops covering multi-model&lt;/td>
&lt;td>&lt;strong>Triton&lt;/strong> or &lt;strong>KServe&lt;/strong> with several predictors&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Multiple simultaneous multi-tenant adapters&lt;/td>
&lt;td>&lt;strong>vLLM Production Stack&lt;/strong> + a dedicated Operator&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Each jump adds 1-2 components and is worth the cost only when the trigger is clear. Adding Kafka &amp;ldquo;just in case&amp;rdquo; when the corpus is updated once a month is net negative work.&lt;/p>
&lt;h2 id="what-we-have-not-covered-yet">What we have not covered (yet)&lt;/h2>
&lt;p>Some pieces still deserve a post of their own:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Schema Registry&lt;/strong> for LLM data and prompts (Confluent OSS, Karapace, JSON Schema Registry).&lt;/li>
&lt;li>&lt;strong>Catalogue + lineage&lt;/strong> in depth: DataHub vs Atlas vs OpenMetadata + OpenLineage taken seriously.&lt;/li>
&lt;li>&lt;strong>Federated learning&lt;/strong> over OSS (Flower, FedML) for scenarios where the data is not centralised.&lt;/li>
&lt;li>&lt;strong>OSS MCP Servers&lt;/strong> and their place in the stack as a tools / actions layer.&lt;/li>
&lt;li>&lt;strong>&amp;ldquo;Agentic&amp;rdquo; evals&lt;/strong> specific to multi-step systems with tool use.&lt;/li>
&lt;li>&lt;strong>Upgrade best practices&lt;/strong> for each component (vLLM every 6 weeks, Kafka major every 18 months, etc.).&lt;/li>
&lt;/ul>
&lt;h2 id="see-also">See also&lt;/h2>
&lt;ul>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/anatomy-llm-request-production-tour-six-stages/">Anatomy of an LLM request in production&lt;/a> — the forensic piece that follows one request through the six stages; this catalogue is the list of tools that appeared along that route.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/parallel-catalogue-llmops-stages-open-source-hyperscalers/">The parallel catalogue: OSS vs hyperscalers&lt;/a> — the horizontal cut that shows, for each stage, what each OSS tool does and what its equivalent is on AWS, GCP and Azure.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/">The six-stage LLMOps pipeline&lt;/a> — the master map of the pipeline to which this catalogue puts concrete OSS names.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/mlops-for-llms-landscape-2026/">MLOps specific to LLMs in 2026&lt;/a> — general context on LLMOps.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/data-versioning-llmops-dvc-lakefs-reproducible-golden-dataset/">Data versioning with DVC and lakeFS&lt;/a> — the deep-dive on the two OSS protagonists of the Data stage + cross-cutting piece.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/prompt-versioning-contract-five-word-change/">Prompt versioning with Langfuse and MLflow&lt;/a> — the deep-dive on the Prompt cross-cutting piece.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/continuous-fine-tuning-production-real-traffic-deployed-adapter/">Continuous fine-tuning in production&lt;/a> — the Tune stage in real operations.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">Evals: the layer after tracing&lt;/a> and &lt;a href="https://blog.lo0.es/en/posts/llm-guardrails-safety-four-lines-of-defence/">Guardrails and safety in LLMs&lt;/a> — the deep-dives on Eval + safety.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/llm-guard-anatomy-scanners-langfuse-vllm-litellm/">LLM Guard: the sworn translator with a notebook of equivalences&lt;/a> — a specific zoom on the Protect AI tool with its Anonymize + Vault + Deanonymize pattern, the 36 composable scanners and the four deployment modes (lib, FastAPI API, OTel sidecar, AI Gateway plugin).&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/kv-cache-working-memory-llm-inference/">KV cache&lt;/a> · &lt;a href="https://blog.lo0.es/en/posts/pagedattention-vllm-block-manager/">PagedAttention&lt;/a> · &lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">Disaggregated serving&lt;/a> · &lt;a href="https://blog.lo0.es/en/posts/vllm-kubernetes-llm-inference-that-scales/">vLLM on K8s&lt;/a> · &lt;a href="https://blog.lo0.es/en/posts/llm-inference-operators-kubernetes/">LLM K8s operators&lt;/a> · &lt;a href="https://blog.lo0.es/en/posts/gpu-cluster-as-multi-tenant-platform/">Multi-tenant GPU cluster&lt;/a> — Deploy in all its layers.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/agentsight-llm-tracing-ebpf-zero-instrumentation/">AgentSight LLM tracing&lt;/a> · &lt;a href="https://blog.lo0.es/en/posts/mcp-deep-observability-opentelemetry/">MCP observability with OTel&lt;/a> · &lt;a href="https://blog.lo0.es/en/posts/ebpf-local-inference-statistical-drift-detection/">eBPF + drift&lt;/a> — Observe from its three angles.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/retrain-closing-the-loop-feedback-dataset-adapter/">Retrain: closing the loop&lt;/a> — the Retrain stage in detail.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/langfuse-inside-sorting-centre-bottleneck/">Langfuse from the inside: v3 architecture and the 10 backend knobs&lt;/a> — the operational deep-dive on the star observability tool of this catalogue: a six-service architecture, asynchronous ingestion and self-hosted tuning on the example cluster.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/isolating-ai-agents-workstation-to-cluster/">Isolating AI agents: overview&lt;/a> and &lt;a href="https://blog.lo0.es/en/posts/runbook-caging-ai-agent-bubblewrap-tetragon/">runbook&lt;/a> — the runtime security layer for agents that execute code: bubblewrap/ai-jail on the client and Tetragon (eBPF) on the cluster, with its Kata &lt;code>RuntimeClass&lt;/code>.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/kserve-open-inference-protocol-control-plane/">Model chain of trust (1/4): KServe and the Open Inference Protocol&lt;/a> — the deep-dive on the control plane of the Deploy stage: InferenceService, ServingRuntime and the API contract that this catalogue only enumerates.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://blog.lo0.es/en/posts/model-chain-of-trust-where-the-bytes-live-registry-oci-artefacts/">Model chain of trust (2/4): registry, OCI artefacts and distribution&lt;/a> — the missing piece between Tune and Deploy: where the weights live (OCI artefacts with ORAS, Harbor, MLflow) and how they reach the GPU node.&lt;/p>
&lt;/li>
&lt;/ul>
&lt;h2 id="references">References&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://docs.vllm.ai/">vLLM&lt;/a> · &lt;a href="https://github.com/vllm-project/production-stack">vLLM Production Stack&lt;/a> · &lt;a href="https://huggingface.co/docs/text-generation-inference/">TGI&lt;/a> · &lt;a href="https://docs.sglang.ai/">SGLang&lt;/a> · &lt;a href="https://nvidia.github.io/TensorRT-LLM/">TensorRT-LLM&lt;/a> · &lt;a href="https://github.com/ggerganov/llama.cpp">llama.cpp&lt;/a> — OSS inference engines.&lt;/li>
&lt;li>&lt;a href="https://docs.nvidia.com/deeplearning/triton-inference-server/">Triton Inference Server&lt;/a> · &lt;a href="https://kserve.github.io/website/">KServe&lt;/a> · &lt;a href="https://aigateway.envoyproxy.io/">Envoy AI Gateway&lt;/a> · &lt;a href="https://docs.litellm.ai/">LiteLLM&lt;/a> — orchestration and AI gateway.&lt;/li>
&lt;li>&lt;a href="https://qdrant.tech/documentation/">Qdrant&lt;/a> · &lt;a href="https://github.com/pgvector/pgvector">pgvector&lt;/a> · &lt;a href="https://milvus.io/docs">Milvus&lt;/a> — vector databases.&lt;/li>
&lt;li>&lt;a href="https://dvc.org/doc">DVC&lt;/a> · &lt;a href="https://docs.lakefs.io/">lakeFS&lt;/a> · &lt;a href="https://min.io/docs/">MinIO&lt;/a> — versioning and object store.&lt;/li>
&lt;li>&lt;a href="https://kafka.apache.org/documentation/">Apache Kafka&lt;/a> · &lt;a href="https://debezium.io/documentation/">Debezium&lt;/a> · &lt;a href="https://flink.apache.org/">Apache Flink&lt;/a> — streams and CDC.&lt;/li>
&lt;li>&lt;a href="https://huggingface.co/docs/transformers">Hugging Face Transformers&lt;/a> · &lt;a href="https://huggingface.co/docs/peft">PEFT&lt;/a> · &lt;a href="https://huggingface.co/docs/bitsandbytes">bitsandbytes&lt;/a> · &lt;a href="https://docs.axolotl.ai/">Axolotl&lt;/a> — fine-tuning.&lt;/li>
&lt;li>&lt;a href="https://mlflow.org/docs/">MLflow&lt;/a> · &lt;a href="https://docs.ray.io/en/latest/train/">Ray Train&lt;/a> · &lt;a href="https://www.kubeflow.org/docs/components/trainer/">Kubeflow Training Operator&lt;/a> — training orchestration.&lt;/li>
&lt;li>&lt;a href="https://docs.confident-ai.com/">DeepEval&lt;/a> · &lt;a href="https://docs.ragas.io/">RAGAS&lt;/a> · &lt;a href="https://promptfoo.dev/docs/">Promptfoo&lt;/a> · &lt;a href="https://docs.nvidia.com/nemo/guardrails/">NeMo Guardrails&lt;/a> · &lt;a href="https://microsoft.github.io/presidio/">Presidio&lt;/a> — evals and guardrails.&lt;/li>
&lt;li>&lt;a href="https://opentelemetry.io/docs/">OpenTelemetry&lt;/a> · &lt;a href="https://opentelemetry.io/docs/specs/semconv/gen-ai/">OTel GenAI semconv&lt;/a> · &lt;a href="https://grafana.com/docs/tempo/">Tempo&lt;/a> · &lt;a href="https://prometheus.io/docs/">Prometheus&lt;/a> · &lt;a href="https://grafana.com/docs/">Grafana&lt;/a> · &lt;a href="https://grafana.com/docs/loki/">Loki&lt;/a> — observability foundation.&lt;/li>
&lt;li>&lt;a href="https://langfuse.com/docs">Langfuse&lt;/a> · &lt;a href="https://docs.arize.com/phoenix">Phoenix Arize&lt;/a> · &lt;a href="https://docs.evidentlyai.com/">Evidently AI&lt;/a> — LLM observability and drift.&lt;/li>
&lt;li>&lt;a href="https://docs.cilium.io/">Cilium&lt;/a> · &lt;a href="https://tetragon.io/">Tetragon&lt;/a> · &lt;a href="https://docs.cilium.io/en/stable/observability/hubble/">Hubble&lt;/a> — eBPF runtime.&lt;/li>
&lt;li>&lt;a href="https://airflow.apache.org/docs/">Apache Airflow&lt;/a> · &lt;a href="https://argo-workflows.readthedocs.io/">Argo Workflows&lt;/a> · &lt;a href="https://www.kubeflow.org/docs/components/pipelines/">Kubeflow Pipelines&lt;/a> · &lt;a href="https://docs.feast.dev/">Feast&lt;/a> · &lt;a href="https://docs.argilla.io/">Argilla&lt;/a> — orchestration + retrain + annotation.&lt;/li>
&lt;/ul></description></item><item><title>The parallel catalogue: the six LLMOps stages in open source and on the hyperscalers (AWS, GCP, Azure)</title><link>https://blog.lo0.es/en/posts/parallel-catalogue-llmops-stages-open-source-hyperscalers/</link><pubDate>Sat, 23 May 2026 07:00:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/parallel-catalogue-llmops-stages-open-source-hyperscalers/</guid><description>&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>The &lt;a href="https://blog.lo0.es/en/posts/anatomy-llm-request-production-tour-six-stages/">previous forensic post&lt;/a> used a single request to walk the six stages of the LLMOps pipeline and the two cross-cutting components. This post walks the same stages but crosses them with three extra columns: how each stage is built in &lt;strong>open source on-premise&lt;/strong>, and what the equivalent services are on &lt;strong>AWS&lt;/strong>, &lt;strong>GCP&lt;/strong> and &lt;strong>Azure&lt;/strong>. It is not a migration guide nor a cost benchmark: it is a &lt;strong>catalogue of equivalences&lt;/strong> with its gaps. The general pattern you will see: OSS gives you control, sovereignty and free composition in exchange for expensive operations; the hyperscalers give you integration and time-to-market in exchange for lock-in on margins, data contracts and political dependency. For scenarios subject to ENS / NIS2 with critical customer data, OSS wins by default; for discovery projects where time-to-market is the deciding metric, the hyperscaler wins by default. The interesting part is in the middle. As a concrete thread, at the end we take the multi-tenant chatbot from the previous post and port it to AWS piece by piece to show what disappears, what appears, and where the lock-in materialises.&lt;/p>
&lt;h2 id="you-are-here-the-same-six-stages-but-by-column">You are here: the same six stages, but by column&lt;/h2>
&lt;p>This post shares a map with the previous one, the six stages and the two cross-cutting pieces are all active, but it changes the cut: instead of following a request horizontally, it makes the vertical cut and shows which tools live in each stage depending on the deployment model.&lt;/p>
&lt;div class="diagram" style="max-width:840px;margin:1rem auto;">
&lt;svg viewBox="0 0 840 310" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="the six LLMOps stages with their OSS and hyperscaler equivalents">
&lt;style>.box{stroke:#444;stroke-width:1.4;rx:6}.active{fill:#ff8a4c;stroke-width:2}.cross{fill:#ffe9d6;stroke:#c66;stroke-width:1.4;rx:6}.lbl{font:600 12px sans-serif;fill:#222}.sm{font:10px sans-serif;fill:#333}.tiny{font:9px sans-serif;fill:#222}.row{font:600 10px sans-serif;fill:#333}.oss{fill:#dfe9f5;stroke:#356}.aws{fill:#fde6c8;stroke:#a65}.gcp{fill:#dceaf8;stroke:#369}.azu{fill:#dde2f8;stroke:#447}.foot{font:9px sans-serif;fill:#666}&lt;/style>
&lt;text x="420" y="20" text-anchor="middle" class="lbl">Parallel catalogue: open source on-premise vs managed hyperscalers&lt;/text>
&lt;rect x="60" y="35" width="125" height="30" class="box active"/>&lt;text x="122.5" y="54" text-anchor="middle" class="lbl">1 · Data&lt;/text>
&lt;rect x="190" y="35" width="125" height="30" class="box active"/>&lt;text x="252.5" y="54" text-anchor="middle" class="lbl">2 · Tune&lt;/text>
&lt;rect x="320" y="35" width="125" height="30" class="box active"/>&lt;text x="382.5" y="54" text-anchor="middle" class="lbl">3 · Eval&lt;/text>
&lt;rect x="450" y="35" width="125" height="30" class="box active"/>&lt;text x="512.5" y="54" text-anchor="middle" class="lbl">4 · Deploy&lt;/text>
&lt;rect x="580" y="35" width="125" height="30" class="box active"/>&lt;text x="642.5" y="54" text-anchor="middle" class="lbl">5 · Observe&lt;/text>
&lt;rect x="710" y="35" width="125" height="30" class="box active"/>&lt;text x="772.5" y="54" text-anchor="middle" class="lbl">6 · Retrain&lt;/text>
&lt;text x="52" y="98" text-anchor="end" class="row">OSS&lt;/text>
&lt;rect x="60" y="80" width="125" height="30" class="box oss"/>&lt;text x="122.5" y="99" text-anchor="middle" class="tiny">DVC · lakeFS · Qdrant&lt;/text>
&lt;rect x="190" y="80" width="125" height="30" class="box oss"/>&lt;text x="252.5" y="99" text-anchor="middle" class="tiny">PEFT · MLflow · Ray&lt;/text>
&lt;rect x="320" y="80" width="125" height="30" class="box oss"/>&lt;text x="382.5" y="99" text-anchor="middle" class="tiny">DeepEval · Promptfoo&lt;/text>
&lt;rect x="450" y="80" width="125" height="30" class="box oss"/>&lt;text x="512.5" y="99" text-anchor="middle" class="tiny">vLLM · KServe · Operators&lt;/text>
&lt;rect x="580" y="80" width="125" height="30" class="box oss"/>&lt;text x="642.5" y="99" text-anchor="middle" class="tiny">OTel · Tempo · Langfuse&lt;/text>
&lt;rect x="710" y="80" width="125" height="30" class="box oss"/>&lt;text x="772.5" y="99" text-anchor="middle" class="tiny">Airflow · Argo · Kubeflow&lt;/text>
&lt;text x="52" y="138" text-anchor="end" class="row">AWS&lt;/text>
&lt;rect x="60" y="120" width="125" height="30" class="box aws"/>&lt;text x="122.5" y="139" text-anchor="middle" class="tiny">S3 · OpenSearch · MSK&lt;/text>
&lt;rect x="190" y="120" width="125" height="30" class="box aws"/>&lt;text x="252.5" y="139" text-anchor="middle" class="tiny">SageMaker · Bedrock&lt;/text>
&lt;rect x="320" y="120" width="125" height="30" class="box aws"/>&lt;text x="382.5" y="139" text-anchor="middle" class="tiny">Bedrock Eval · Guardrails&lt;/text>
&lt;rect x="450" y="120" width="125" height="30" class="box aws"/>&lt;text x="512.5" y="139" text-anchor="middle" class="tiny">Bedrock · SM Endpoints&lt;/text>
&lt;rect x="580" y="120" width="125" height="30" class="box aws"/>&lt;text x="642.5" y="139" text-anchor="middle" class="tiny">CloudWatch · X-Ray · ADOT&lt;/text>
&lt;rect x="710" y="120" width="125" height="30" class="box aws"/>&lt;text x="772.5" y="139" text-anchor="middle" class="tiny">SM Pipelines · GT&lt;/text>
&lt;text x="52" y="178" text-anchor="end" class="row">GCP&lt;/text>
&lt;rect x="60" y="160" width="125" height="30" class="box gcp"/>&lt;text x="122.5" y="179" text-anchor="middle" class="tiny">GCS · BQ · Vertex VS&lt;/text>
&lt;rect x="190" y="160" width="125" height="30" class="box gcp"/>&lt;text x="252.5" y="179" text-anchor="middle" class="tiny">Vertex Training · Tuning&lt;/text>
&lt;rect x="320" y="160" width="125" height="30" class="box gcp"/>&lt;text x="382.5" y="179" text-anchor="middle" class="tiny">Vertex Eval · Model Armor&lt;/text>
&lt;rect x="450" y="160" width="125" height="30" class="box gcp"/>&lt;text x="512.5" y="179" text-anchor="middle" class="tiny">Vertex Pred · Gemini API&lt;/text>
&lt;rect x="580" y="160" width="125" height="30" class="box gcp"/>&lt;text x="642.5" y="179" text-anchor="middle" class="tiny">Cloud Trace · Monitoring&lt;/text>
&lt;rect x="710" y="160" width="125" height="30" class="box gcp"/>&lt;text x="772.5" y="179" text-anchor="middle" class="tiny">Vertex Pipelines&lt;/text>
&lt;text x="52" y="218" text-anchor="end" class="row">Azure&lt;/text>
&lt;rect x="60" y="200" width="125" height="30" class="box azu"/>&lt;text x="122.5" y="219" text-anchor="middle" class="tiny">ADLS · AI Search · ADF&lt;/text>
&lt;rect x="190" y="200" width="125" height="30" class="box azu"/>&lt;text x="252.5" y="219" text-anchor="middle" class="tiny">Azure ML · AOAI tuning&lt;/text>
&lt;rect x="320" y="200" width="125" height="30" class="box azu"/>&lt;text x="382.5" y="219" text-anchor="middle" class="tiny">AI Eval · Content Safety&lt;/text>
&lt;rect x="450" y="200" width="125" height="30" class="box azu"/>&lt;text x="512.5" y="219" text-anchor="middle" class="tiny">AOAI · ML Endpoints&lt;/text>
&lt;rect x="580" y="200" width="125" height="30" class="box azu"/>&lt;text x="642.5" y="219" text-anchor="middle" class="tiny">App Insights · Monitor&lt;/text>
&lt;rect x="710" y="200" width="125" height="30" class="box azu"/>&lt;text x="772.5" y="219" text-anchor="middle" class="tiny">Azure ML Pipelines&lt;/text>
&lt;rect x="60" y="245" width="385" height="26" class="cross"/>
&lt;text x="252.5" y="262" text-anchor="middle" class="sm">Prompt versioning: Langfuse · MLflow ↔ Bedrock · Vertex · Foundry&lt;/text>
&lt;rect x="450" y="245" width="385" height="26" class="cross"/>
&lt;text x="642.5" y="262" text-anchor="middle" class="sm">Data versioning: DVC · lakeFS · OpenLineage ↔ S3 · Dataplex · Purview&lt;/text>
&lt;text x="420" y="295" text-anchor="middle" class="foot">The OSS stack runs on-premise; AWS / GCP / Azure show the managed equivalents per stage.&lt;/text>
&lt;/svg>
&lt;/div>
&lt;h2 id="the-analogy-your-own-bakery-and-the-franchise">The analogy: your own bakery and the franchise&lt;/h2>
&lt;p>A baker opens a business. There are two possible models.&lt;/p>
&lt;p>He can open &lt;strong>his own bakery&lt;/strong>: rent the premises, buy the oven, choose the flour suppliers, hire his master baker, write his recipes, set the prices, dress the shop window. The day he wants to launch an organic rye sourdough loaf, he asks nobody for permission. The day the price of flour goes up, he finds another supplier. But he pays for all of it: the initial investment, the risk, the daily operations, the months when he misreads the neighbourhood. The bakery is his.&lt;/p>
&lt;p>Or he can join a &lt;strong>franchise&lt;/strong>: the franchisor hands over the turnkey premises, the oven with a maintenance contract, the suppliers already negotiated, the operating manuals, the written recipes, the centralised marketing, the loyalty app, the POS system. The learning curve is weeks, not years. But the recipes belong to the franchisor, so do the suppliers, the price of bread is in the catalogue, and the day the croissant formula changes he gets an informational email, not a business decision.&lt;/p>
&lt;p>Both bakeries turn out bread. Both meet health regulations and generate income. The operational difference is enormous and it is not about technology: it is about &lt;strong>ownership, control and timescale&lt;/strong>.&lt;/p>
&lt;p>The parallel with LLMOps is direct. The on-premise OSS stack is the bakery you own. The managed stack on the hyperscalers is the franchise. The &lt;strong>pieces&lt;/strong> that appear in each stage are functionally equivalent, at the end of the day both solve the same technical problem, but the governance model, the operational cost, the lock-in and the compliance guarantees are different. This post builds the parallel catalogue so that the choice is not made by default.&lt;/p>
&lt;h2 id="quick-recap-of-the-previous-post">Quick recap of the previous post&lt;/h2>
&lt;p>In the &lt;a href="https://blog.lo0.es/en/posts/anatomy-llm-request-production-tour-six-stages/">forensic post&lt;/a> we followed one specific request: a premium-es user of an insurance company asking &lt;em>&amp;ldquo;How do I cancel my premium subscription?&amp;rdquo;&lt;/em> to the multi-tenant support chatbot of the SaaS provider that hosts it. The route crossed the &lt;strong>six stages of the LLMOps pipeline&lt;/strong>, Data, Tune, Eval, Deploy, Observe, Retrain, plus the &lt;strong>two cross-cutting components&lt;/strong>, prompt versioning and data versioning, over an on-premise infrastructure: RKE2 with Cilium BGP, a 4×H100 SXM cluster, an RTX 4090 for development, vLLM on Kubernetes, Langfuse + OTel + Prometheus + Tempo, Postgres + Qdrant, DVC + lakeFS + MinIO, Kafka and MLflow. The system meets ENS / NIS2 and keeps &lt;code>trace_id&lt;/code> propagated end to end.&lt;/p>
&lt;p>What comes now is that same system, piece by piece, showing for each box which tool does the job if you are on public cloud, because the integrator&amp;rsquo;s question is rarely &amp;ldquo;OSS yes or no?&amp;rdquo;: it is &amp;ldquo;what do I lose and what do I gain if I take this box managed?&amp;rdquo;. And the answer differs box by box.&lt;/p>
&lt;h2 id="stage-1--data">Stage 1 — Data&lt;/h2>
&lt;p>&lt;strong>The problem.&lt;/strong> There are three sub-problems the Data stage solves, frequently confused with one another. First, &lt;strong>versioning and identity&lt;/strong> of the corpus and of the training datasets (making sure a &lt;code>dataset_id, dataset_version&lt;/code> exists and propagates). Second, &lt;strong>storage and serving&lt;/strong> of the operational corpus (object store + vector index + structured text). Third, &lt;strong>streams and ingestion&lt;/strong> from source systems with CDC, transformation and stable schemas (Schema Registry).&lt;/p>
&lt;p>&lt;strong>Reference OSS stack.&lt;/strong> Versioning lives in &lt;strong>DVC&lt;/strong> (pointers in git, content in an object store) combined with &lt;strong>lakeFS&lt;/strong> for branch/merge semantics over data. The &lt;a href="https://blog.lo0.es/en/posts/data-versioning-llmops-dvc-lakefs-reproducible-golden-dataset/">post on data versioning&lt;/a> goes into the functional difference. The object store is &lt;strong>MinIO&lt;/strong> or &lt;strong>Ceph&lt;/strong>. The vector index is &lt;strong>Qdrant&lt;/strong> or &lt;strong>Milvus&lt;/strong> for large corpora (millions of chunks) and &lt;strong>pgvector on Postgres 18&lt;/strong> for small cases where having one component fewer pays off operationally. The stream layer is &lt;strong>Kafka&lt;/strong> (pure Apache or &lt;strong>Redpanda&lt;/strong>) with a &lt;strong>Schema Registry&lt;/strong> (Confluent or &lt;strong>Karapace&lt;/strong> OSS), CDC with &lt;strong>Debezium&lt;/strong> or &lt;strong>Flink CDC&lt;/strong>, transformation with &lt;strong>Flink&lt;/strong> or &lt;strong>Spark Structured Streaming&lt;/strong>. The catalogue / lineage is &lt;strong>DataHub&lt;/strong>, &lt;strong>Apache Atlas&lt;/strong> or &lt;strong>OpenMetadata&lt;/strong> with &lt;strong>OpenLineage&lt;/strong> events between systems. The &lt;a href="https://blog.lo0.es/en/posts/postgresql-qdrant-rag-ingestion-postman-syncing-two-worlds/">post on PostgreSQL + Qdrant ingestion&lt;/a> and the &lt;a href="https://blog.lo0.es/en/posts/rag-on-kafka-reference-architecture-streaming-datalakes/">post on RAG over Kafka&lt;/a> cover the detailed operations.&lt;/p>
&lt;p>&lt;strong>Hyperscaler equivalents.&lt;/strong> On &lt;strong>AWS&lt;/strong>, the corpus lives in &lt;strong>S3&lt;/strong> (with versioning enabled, which is the cheap substitute for serious data versioning), tabular queries in &lt;strong>Athena&lt;/strong> or &lt;strong>Redshift&lt;/strong>, the vector index in &lt;strong>Amazon OpenSearch&lt;/strong> with the vector plug-in or in &lt;strong>Amazon Aurora pgvector&lt;/strong>. The stream layer is &lt;strong>MSK&lt;/strong> (managed Kafka) or &lt;strong>Kinesis Data Streams&lt;/strong>, CDC with &lt;strong>AWS DMS&lt;/strong>, transformation with &lt;strong>Glue Streaming&lt;/strong> or &lt;strong>MSK Connect&lt;/strong>. The catalogue is &lt;strong>AWS Glue Data Catalog&lt;/strong> + &lt;strong>AWS Lake Formation&lt;/strong> for data governance. And for the RAG case there is also &lt;strong>Amazon Bedrock Knowledge Bases&lt;/strong>, the managed shortcut: you give it S3, it indexes into OpenSearch or Aurora pgvector, exposes a retrieval API and the operations end there, in exchange for paying per indexed chunk and per query.&lt;/p>
&lt;p>On &lt;strong>GCP&lt;/strong>, the corpus lives in &lt;strong>Cloud Storage&lt;/strong> (with object versioning), the analytical warehouse is &lt;strong>BigQuery&lt;/strong> (with &lt;strong>BigQuery Vector Search&lt;/strong> already integrated), the dedicated vector store is &lt;strong>Vertex AI Vector Search&lt;/strong> (formerly Matching Engine). The stream layer is &lt;strong>Pub/Sub&lt;/strong> + &lt;strong>Dataflow&lt;/strong>, CDC with &lt;strong>Datastream&lt;/strong>. Catalogue and lineage are &lt;strong>Dataplex&lt;/strong> (which in 2024-2025 absorbed Data Catalog and added automatic lineage). The managed equivalent of Knowledge Bases is &lt;strong>Vertex AI Search&lt;/strong> (formerly Discovery Engine).&lt;/p>
&lt;p>On &lt;strong>Azure&lt;/strong>, the corpus lives in &lt;strong>ADLS Gen2&lt;/strong>, tabular queries in &lt;strong>Microsoft Fabric&lt;/strong> / &lt;strong>Azure Synapse&lt;/strong>, the vector index in &lt;strong>Azure AI Search&lt;/strong> (vector mode) or &lt;strong>Azure Cosmos DB for PostgreSQL&lt;/strong> with pgvector. The stream layer is &lt;strong>Event Hubs&lt;/strong> + &lt;strong>Stream Analytics&lt;/strong> or &lt;strong>Microsoft Fabric Real-Time Intelligence&lt;/strong>, CDC with &lt;strong>Azure Data Factory&lt;/strong>. The catalogue is &lt;strong>Microsoft Purview&lt;/strong>, which covers catalogue, lineage and data governance integrated with Entra ID.&lt;/p>
&lt;p>&lt;strong>Summary table — Data stage.&lt;/strong>&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Functional piece&lt;/th>
&lt;th>OSS on-premise&lt;/th>
&lt;th>AWS&lt;/th>
&lt;th>GCP&lt;/th>
&lt;th>Azure&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Object store&lt;/td>
&lt;td>MinIO, Ceph&lt;/td>
&lt;td>S3&lt;/td>
&lt;td>Cloud Storage&lt;/td>
&lt;td>ADLS Gen2&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Dataset versioning&lt;/td>
&lt;td>DVC, lakeFS&lt;/td>
&lt;td>S3 Versioning (limited), Lake Formation&lt;/td>
&lt;td>GCS Versioning, Dataplex&lt;/td>
&lt;td>ADLS versioning, Purview&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Vector index&lt;/td>
&lt;td>Qdrant, Milvus, pgvector&lt;/td>
&lt;td>OpenSearch, Aurora pgvector, Bedrock KB&lt;/td>
&lt;td>Vertex Vector Search, BigQuery VS&lt;/td>
&lt;td>Azure AI Search, Cosmos pgvector&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Stream + CDC&lt;/td>
&lt;td>Kafka + Debezium + Flink&lt;/td>
&lt;td>MSK / Kinesis + DMS + Glue&lt;/td>
&lt;td>Pub/Sub + Datastream + Dataflow&lt;/td>
&lt;td>Event Hubs + ADF&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Schema Registry&lt;/td>
&lt;td>Karapace, Confluent OSS&lt;/td>
&lt;td>Glue Schema Registry&lt;/td>
&lt;td>Pub/Sub schemas&lt;/td>
&lt;td>Schema Registry (Event Hubs)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Catalogue + lineage&lt;/td>
&lt;td>DataHub, Atlas, OpenLineage&lt;/td>
&lt;td>Glue Catalog + Lake Formation&lt;/td>
&lt;td>Dataplex&lt;/td>
&lt;td>Purview&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Managed end-to-end RAG&lt;/td>
&lt;td>— (you build it)&lt;/td>
&lt;td>Bedrock Knowledge Bases&lt;/td>
&lt;td>Vertex AI Search&lt;/td>
&lt;td>Azure AI Studio Knowledge&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>&lt;strong>Where the names mislead.&lt;/strong> &lt;em>S3 Versioning&lt;/em> is not DVC. It keeps object versions but has no notion of a &lt;strong>dataset&lt;/strong> (which objects together make up version 3 of the enriched set?), does not propagate &lt;code>dataset_hash&lt;/code> to the trainer, does not integrate with experiment tracking, and does not fail a CI run if a dataset breaks schema. Covering that properly on AWS requires combining it with Lake Formation, Glue Data Catalog and your own records in SageMaker Experiments. The same applies on GCP with Dataplex and on Azure with Purview. The gap is real and is paid for in operations or in broken lineage.&lt;/p>
&lt;h2 id="stage-2--tune">Stage 2 — Tune&lt;/h2>
&lt;p>&lt;strong>The problem.&lt;/strong> Producing a new &lt;code>model_id, model_version&lt;/code>, typically a LoRA adapter over a stable base, as the &lt;a href="https://blog.lo0.es/en/posts/continuous-fine-tuning-production-real-traffic-deployed-adapter/">post on continuous fine-tuning&lt;/a> explains, with lineage back to the dataset that trained it and experiment tracking that lets you reproduce it six months later.&lt;/p>
&lt;p>&lt;strong>OSS stack.&lt;/strong> Technical core: &lt;strong>HuggingFace Transformers + PEFT&lt;/strong> (LoRA, QLoRA), &lt;strong>bitsandbytes&lt;/strong> for quantisation, &lt;strong>DeepSpeed&lt;/strong> or &lt;strong>FSDP&lt;/strong> for parallelism. Experiment tracking: &lt;strong>MLflow&lt;/strong> (authoritative) or &lt;strong>Weights &amp;amp; Biases self-hosted&lt;/strong>. Convenience frameworks: &lt;strong>Axolotl&lt;/strong> and &lt;strong>Llama Factory&lt;/strong> wrap the machinery above in declarative configuration. Distributed orchestration: &lt;strong>Kubeflow Training Operator&lt;/strong> or &lt;strong>Ray Train&lt;/strong>. On small infrastructures, direct scripts with &lt;strong>Slurm&lt;/strong> or &lt;strong>K8s Jobs&lt;/strong> over GPU pools. The lineage chain &lt;code>dataset → run → model&lt;/code> is closed by registering the dataset as an MLflow input artefact.&lt;/p>
&lt;p>&lt;strong>Hyperscaler equivalents.&lt;/strong> On &lt;strong>AWS&lt;/strong>, &lt;strong>SageMaker Training Jobs&lt;/strong> covers most workloads, &lt;strong>SageMaker HyperPod&lt;/strong> covers large training runs with resilience to node failures, and &lt;strong>SageMaker JumpStart&lt;/strong> offers click-to-train fine-tuning over a catalogue of pre-curated models. For fine-tuning Bedrock models (hosted Claude, Llama, Mistral) there is &lt;strong>Bedrock Custom Models&lt;/strong>: you upload the dataset to S3, Bedrock trains, and it returns a private endpoint with provisioned throughput. The equivalent experiment tracking is &lt;strong>SageMaker Experiments&lt;/strong> or &lt;strong>managed MLflow in SageMaker&lt;/strong> (yes, AWS has officially hosted MLflow since 2024).&lt;/p>
&lt;p>On &lt;strong>GCP&lt;/strong>, &lt;strong>Vertex AI Custom Training&lt;/strong> runs any container with GPUs or TPUs; &lt;strong>Vertex AI Tuning&lt;/strong> is the managed API for fine-tuning Gemini and Model Garden models. Experiment tracking in &lt;strong>Vertex AI Experiments&lt;/strong> (with MLflow compatibility).&lt;/p>
&lt;p>On &lt;strong>Azure&lt;/strong>, &lt;strong>Azure ML Training Jobs&lt;/strong> on your own clusters or managed compute; &lt;strong>Azure OpenAI fine-tuning&lt;/strong> for fine-tuning GPT and the o-series; &lt;strong>Azure ML Experiments&lt;/strong> with MLflow natively integrated since 2022.&lt;/p>
&lt;p>&lt;strong>Summary table — Tune stage.&lt;/strong>&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Functional piece&lt;/th>
&lt;th>OSS on-premise&lt;/th>
&lt;th>AWS&lt;/th>
&lt;th>GCP&lt;/th>
&lt;th>Azure&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Training framework&lt;/td>
&lt;td>HF Transformers + PEFT&lt;/td>
&lt;td>SageMaker SDK&lt;/td>
&lt;td>Vertex AI SDK&lt;/td>
&lt;td>Azure ML SDK&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Quantisation / parallelism&lt;/td>
&lt;td>bitsandbytes, DeepSpeed, FSDP&lt;/td>
&lt;td>SageMaker libs + HF support&lt;/td>
&lt;td>Vertex + HF support&lt;/td>
&lt;td>Azure ML + HF support&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Managed fine-tuning (black box)&lt;/td>
&lt;td>—&lt;/td>
&lt;td>Bedrock Custom Models, JumpStart&lt;/td>
&lt;td>Vertex Tuning (Gemini)&lt;/td>
&lt;td>Azure OpenAI fine-tuning&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Distributed on a cluster&lt;/td>
&lt;td>Kubeflow, Ray Train, Slurm&lt;/td>
&lt;td>SageMaker HyperPod&lt;/td>
&lt;td>Vertex AI Training (multi-node)&lt;/td>
&lt;td>Azure ML compute clusters&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Experiment tracking&lt;/td>
&lt;td>MLflow, W&amp;amp;B self-hosted&lt;/td>
&lt;td>SageMaker Experiments, managed MLflow&lt;/td>
&lt;td>Vertex Experiments&lt;/td>
&lt;td>Azure ML + MLflow&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Access to the base model&lt;/td>
&lt;td>Whatever you download (Llama, Mistral, Qwen)&lt;/td>
&lt;td>Bedrock catalog + HF Hub&lt;/td>
&lt;td>Vertex Model Garden + HF Hub&lt;/td>
&lt;td>Azure ML model catalog + HF Hub&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>&lt;strong>Where the names mislead.&lt;/strong> The &lt;em>managed&lt;/em> fine-tunings (Bedrock Custom, Vertex Tuning, AOAI fine-tuning) are a &lt;strong>black box&lt;/strong>: you do not choose hyperparameters beyond a handful, you do not see the trainer&amp;rsquo;s detailed logs, and you cannot inspect the dataset once it is inside their pipeline. The experiment tracking they offer is not comparable to MLflow sitting next to the trainer, where you can capture any metric and artefact. For scenarios where &lt;em>operationally&lt;/em> you do not need inspection this is liberating; for ENS / NIS2 scenarios where you have to prove what trained what, the black box fails by construction.&lt;/p>
&lt;h2 id="stage-3--eval">Stage 3 — Eval&lt;/h2>
&lt;p>&lt;strong>The problem.&lt;/strong> Validating candidates before and after promotion against a golden set, with operational metrics (faithfulness to the RAG, tone, format compliance, toxicity, jailbreak resistance, PII leakage) run as gates in CI and as online sampling. Covered in the &lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">post on evals&lt;/a> and the one on &lt;a href="https://blog.lo0.es/en/posts/llm-guardrails-safety-four-lines-of-defence/">guardrails&lt;/a>.&lt;/p>
&lt;p>&lt;strong>OSS stack.&lt;/strong> Eval suites: &lt;strong>DeepEval&lt;/strong>, &lt;strong>RAGAS&lt;/strong> (specialised in RAG), &lt;strong>Promptfoo&lt;/strong> (declarative, ideal for CI), &lt;strong>lm-eval-harness&lt;/strong> (academic), &lt;strong>HELM&lt;/strong>. Evals integrated with tracing: &lt;strong>Langfuse Evals&lt;/strong>, &lt;strong>Phoenix Arize OSS&lt;/strong>. LLM-as-judge judges: any local OSS model; in serious systems, two different judges to reduce bias. Safety and guardrails: &lt;strong>NeMo Guardrails&lt;/strong> (NVIDIA), &lt;strong>Guardrails AI&lt;/strong>, &lt;strong>LlamaGuard&lt;/strong> + &lt;strong>PromptGuard&lt;/strong> (Meta), &lt;strong>ShieldGemma&lt;/strong> (Google, open weights), &lt;strong>PII detectors&lt;/strong> such as &lt;strong>Presidio&lt;/strong> (Microsoft) on-prem.&lt;/p>
&lt;p>&lt;strong>Hyperscaler equivalents.&lt;/strong> On &lt;strong>AWS&lt;/strong>, &lt;strong>Bedrock Model Evaluation&lt;/strong> offers automatic evals (toxicity, accuracy, robustness) and human-in-the-loop, &lt;strong>Bedrock Guardrails&lt;/strong> covers the safety layer (denied topics, PII, prompt injection, contextual grounding check), and &lt;strong>SageMaker Clarify&lt;/strong> adds bias and explainability over general models.&lt;/p>
&lt;p>On &lt;strong>GCP&lt;/strong>, &lt;strong>Vertex AI Evaluation Service&lt;/strong> runs evals with automatic metrics and an LLM judge, &lt;strong>Vertex AI Model Armor&lt;/strong> and the &lt;strong>safety filters&lt;/strong> built into the Gemini API cover the guardrails layer. &lt;strong>Vertex AI Studio&lt;/strong> exposes interactive Eval for prompt iteration.&lt;/p>
&lt;p>On &lt;strong>Azure&lt;/strong>, the &lt;strong>Azure AI Evaluation SDK&lt;/strong> runs offline evals against datasets, &lt;strong>Azure AI Content Safety&lt;/strong> covers safety (Prompt Shields against jailbreak, &lt;strong>Groundedness detection&lt;/strong>, content categories, &lt;strong>PII detection&lt;/strong>). All accessible from &lt;strong>Azure AI Foundry&lt;/strong>.&lt;/p>
&lt;p>&lt;strong>Summary table — Eval stage.&lt;/strong>&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Functional piece&lt;/th>
&lt;th>OSS on-premise&lt;/th>
&lt;th>AWS&lt;/th>
&lt;th>GCP&lt;/th>
&lt;th>Azure&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Automatic eval suite&lt;/td>
&lt;td>DeepEval, RAGAS, Promptfoo&lt;/td>
&lt;td>Bedrock Model Evaluation&lt;/td>
&lt;td>Vertex AI Evaluation Service&lt;/td>
&lt;td>Azure AI Evaluation SDK&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>LLM-as-judge&lt;/td>
&lt;td>Any OSS model&lt;/td>
&lt;td>Bedrock judge models&lt;/td>
&lt;td>Vertex judge (Gemini)&lt;/td>
&lt;td>Azure OpenAI judges&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Golden set management&lt;/td>
&lt;td>Langfuse datasets, manual&lt;/td>
&lt;td>SageMaker Ground Truth datasets&lt;/td>
&lt;td>Vertex Datasets&lt;/td>
&lt;td>Azure ML Datasets&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Guardrails (jailbreak, PII, prompt injection)&lt;/td>
&lt;td>NeMo Guardrails, LlamaGuard, Presidio&lt;/td>
&lt;td>Bedrock Guardrails&lt;/td>
&lt;td>Vertex Model Armor + Gemini safety&lt;/td>
&lt;td>Azure AI Content Safety (Prompt Shields, Groundedness)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Eval in CI&lt;/td>
&lt;td>Promptfoo + GitHub Actions&lt;/td>
&lt;td>Bedrock Eval API + CodeBuild&lt;/td>
&lt;td>Vertex Eval API + Cloud Build&lt;/td>
&lt;td>Azure AI Eval + Azure Pipelines&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>&lt;strong>Where the names mislead.&lt;/strong> Managed guardrails are convenient but &lt;strong>opaque&lt;/strong>: the Bedrock Guardrails rules are configurable but the detection implementation cannot be inspected; the same goes for Azure AI Content Safety. In OSS, NeMo Guardrails shows you the Colang graph and Presidio shows you the recognisers, auditable and modifiable. For regulated systems where an auditor asks &lt;em>&amp;ldquo;how exactly does it detect PII?&amp;rdquo;&lt;/em>, OSS answers with code; the cloud answers with documentation.&lt;/p>
&lt;h2 id="stage-4--deploy">Stage 4 — Deploy&lt;/h2>
&lt;p>&lt;strong>The problem.&lt;/strong> Serving tokens to the end user with predictable latency and throughput, a decent cost / token ratio, hot-swap adapter support, and multi-tenancy if the business demands it. Covered in the posts on &lt;a href="https://blog.lo0.es/en/posts/kv-cache-working-memory-llm-inference/">KV cache&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/pagedattention-vllm-block-manager/">PagedAttention&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">disaggregated serving&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/vllm-kubernetes-llm-inference-that-scales/">vLLM on K8s&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/llm-inference-operators-kubernetes/">LLM operators&lt;/a> and &lt;a href="https://blog.lo0.es/en/posts/gpu-cluster-as-multi-tenant-platform/">multi-tenant cluster&lt;/a>.&lt;/p>
&lt;p>&lt;strong>OSS stack.&lt;/strong> Inference engine: &lt;strong>vLLM&lt;/strong> (PagedAttention, prefix caching, LoRA hot-swap, OpenAI-compatible API) as the reference, &lt;strong>TensorRT-LLM&lt;/strong> for maximum optimisation on Hopper / Ada, &lt;strong>SGLang&lt;/strong> for workloads with heavy prompt restructuring, &lt;strong>TGI&lt;/strong> (Hugging Face) as a mature alternative, &lt;strong>llama.cpp&lt;/strong> for edge and CPUs, &lt;strong>NVIDIA Dynamo&lt;/strong> for multi-node disaggregated serving on large clusters. Orchestration on Kubernetes: &lt;strong>KServe&lt;/strong>, &lt;strong>KubeRay&lt;/strong>, dedicated operators such as &lt;strong>llm-d&lt;/strong>, &lt;strong>vLLM Production Stack&lt;/strong> and &lt;strong>KAITO&lt;/strong>. Gateway / control plane: &lt;strong>Envoy AI Gateway&lt;/strong>, &lt;strong>LiteLLM Proxy&lt;/strong>, &lt;strong>Portkey AI Gateway&lt;/strong>, &lt;strong>Kong AI Gateway&lt;/strong>. Triton Inference Server covers mixed workloads (LLM + traditional) where a single backend matters.&lt;/p>
&lt;p>&lt;strong>Hyperscaler equivalents.&lt;/strong> On &lt;strong>AWS&lt;/strong>, two different routes. The &lt;em>managed-by-model&lt;/em> route is &lt;strong>Amazon Bedrock&lt;/strong>: a catalogue of hosted models (Claude, Llama, Mistral, Cohere, Titan), pay per token or &lt;strong>Provisioned Throughput&lt;/strong> with an SLA, &lt;strong>Bedrock Prompt Caching&lt;/strong> as the conceptual equivalent of vLLM&amp;rsquo;s prefix caching, and integrated &lt;strong>Bedrock Agents&lt;/strong> and &lt;strong>Bedrock Knowledge Bases&lt;/strong>. The &lt;em>managed-by-infrastructure&lt;/em> route is &lt;strong>SageMaker Endpoints&lt;/strong> (real-time, async, serverless, batch) with &lt;strong>Inference Components&lt;/strong> to densify multiple models on one instance. Own hardware: &lt;strong>AWS Inferentia&lt;/strong> and &lt;strong>Trainium&lt;/strong> via the &lt;strong>Neuron&lt;/strong> chip, an alternative to NVIDIA with a better cost / token on stable workloads if you compile your model.&lt;/p>
&lt;p>On &lt;strong>GCP&lt;/strong>, &lt;strong>Vertex AI Prediction Endpoints&lt;/strong> runs your containers or models from the &lt;strong>Model Garden&lt;/strong>, the &lt;strong>Gemini API&lt;/strong> via Vertex AI offers the managed Gemini models, and &lt;strong>Cloud TPU v5e / v5p / Trillium (v6)&lt;/strong> is the in-house hardware competing with the H100 for training and inference. For sovereignty there is &lt;strong>Google Distributed Cloud air-gapped&lt;/strong>, which brings Vertex AI to a certifiable on-premise rack.&lt;/p>
&lt;p>On &lt;strong>Azure&lt;/strong>, &lt;strong>Azure OpenAI Service&lt;/strong> serves OpenAI models (GPT-4.1, o-series, GPT-image), &lt;strong>Azure ML Managed Online Endpoints&lt;/strong> runs any model (OSS included, via container), and &lt;strong>Azure AI Foundry models&lt;/strong> absorbed in 2025 the catalogue of open models served as-a-service. Hardware: &lt;strong>Azure ND H100 v5&lt;/strong>, &lt;strong>ND H200 v5&lt;/strong>, &lt;strong>ND GB200 v6&lt;/strong> and the in-house bet &lt;strong>Microsoft Maia 100&lt;/strong> for internal inference.&lt;/p>
&lt;p>&lt;strong>Summary table — Deploy stage.&lt;/strong>&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Functional piece&lt;/th>
&lt;th>OSS on-premise&lt;/th>
&lt;th>AWS&lt;/th>
&lt;th>GCP&lt;/th>
&lt;th>Azure&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Inference engine&lt;/td>
&lt;td>vLLM, TensorRT-LLM, SGLang, TGI&lt;/td>
&lt;td>Bedrock (managed model), SM Endpoints (your container)&lt;/td>
&lt;td>Vertex Prediction, Gemini API&lt;/td>
&lt;td>Azure OpenAI, Azure ML Endpoints&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Prefix / prompt caching&lt;/td>
&lt;td>vLLM native&lt;/td>
&lt;td>Bedrock Prompt Caching&lt;/td>
&lt;td>Vertex AI context caching&lt;/td>
&lt;td>Azure OpenAI prompt caching&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Adapter hot-swap (LoRA)&lt;/td>
&lt;td>vLLM &lt;code>--enable-lora&lt;/code>, S-LoRA&lt;/td>
&lt;td>Bedrock Custom Models endpoints&lt;/td>
&lt;td>Vertex Tuning endpoints&lt;/td>
&lt;td>Azure OpenAI fine-tuned deployments&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Disaggregated serving&lt;/td>
&lt;td>NVIDIA Dynamo, vLLM PD-disagg&lt;/td>
&lt;td>— (managed internally, not exposed)&lt;/td>
&lt;td>— (managed internally, not exposed)&lt;/td>
&lt;td>— (managed internally, not exposed)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Accelerator hardware&lt;/td>
&lt;td>NVIDIA H100/H200/B200, AMD MI300&lt;/td>
&lt;td>Inferentia, Trainium, NVIDIA&lt;/td>
&lt;td>TPU v5/v6, NVIDIA&lt;/td>
&lt;td>Maia, NVIDIA&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>AI Gateway / proxy&lt;/td>
&lt;td>Envoy AI Gateway, LiteLLM, Portkey, Kong&lt;/td>
&lt;td>API Gateway + Bedrock&lt;/td>
&lt;td>Vertex AI + Apigee&lt;/td>
&lt;td>Azure API Management + AOAI&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>K8s orchestration&lt;/td>
&lt;td>KServe, KubeRay, llm-d, KAITO&lt;/td>
&lt;td>EKS + SageMaker Operators&lt;/td>
&lt;td>GKE + Vertex AI&lt;/td>
&lt;td>AKS + KAITO&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>&lt;strong>Where the names mislead.&lt;/strong> Bedrock Prompt Caching and Vertex context caching &lt;strong>sound&lt;/strong> equivalent to vLLM&amp;rsquo;s prefix caching, but operationally they are different: the cache lives on the hyperscaler&amp;rsquo;s plane, its eviction policy is opaque, its cost is billed separately, and you cannot easily see the hit ratio per tenant. In vLLM you see the hit ratio in Prometheus metrics and you decide the policy. The same applies to disaggregated serving: the hyperscalers implement it internally to cut their own cost of serving, but they &lt;strong>do not expose&lt;/strong> prefill/decode control to the user. If you need your workload&amp;rsquo;s TTFT to be controlled separately from TPS, that lever is not available.&lt;/p>
&lt;h2 id="stage-5--observe">Stage 5 — Observe&lt;/h2>
&lt;p>&lt;strong>The problem.&lt;/strong> End-to-end LLM traces with &lt;code>trace_id&lt;/code> propagated through every component, runtime metrics per tenant, online scoring (LLM judge over sampling), statistical drift, and safety / guardrails monitoring. Covered in the posts on &lt;a href="https://blog.lo0.es/en/posts/agentsight-llm-tracing-ebpf-zero-instrumentation/">AgentSight tracing&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/mcp-deep-observability-opentelemetry/">MCP observability with OTel&lt;/a> and &lt;a href="https://blog.lo0.es/en/posts/ebpf-local-inference-statistical-drift-detection/">eBPF + drift&lt;/a>.&lt;/p>
&lt;p>&lt;strong>OSS stack.&lt;/strong> Base standard: &lt;strong>OpenTelemetry&lt;/strong> (specification + collector + SDKs) with the &lt;strong>gen_ai semantic conventions&lt;/strong> that stabilised in 2025. Backends: &lt;strong>Tempo&lt;/strong> or &lt;strong>Jaeger&lt;/strong> for traces, &lt;strong>Prometheus&lt;/strong> for metrics, &lt;strong>Loki&lt;/strong> for logs, &lt;strong>Grafana&lt;/strong> as the common UI. LLM-specific layer: &lt;strong>Langfuse&lt;/strong> (self-hosted with an optional EE licence) and &lt;strong>Phoenix Arize OSS&lt;/strong>. eBPF layer for low-level observability: &lt;strong>Pixie&lt;/strong>, &lt;strong>Hubble&lt;/strong>, and &lt;strong>Cilium Tetragon&lt;/strong> for runtime security. Drift: &lt;strong>Evidently AI&lt;/strong>, &lt;strong>NannyML&lt;/strong>, &lt;strong>Alibi Detect&lt;/strong>.&lt;/p>
&lt;p>&lt;strong>Hyperscaler equivalents.&lt;/strong> On &lt;strong>AWS&lt;/strong>, &lt;strong>CloudWatch&lt;/strong> (metrics + logs) + &lt;strong>AWS X-Ray&lt;/strong> (traces) form the base, &lt;strong>CloudWatch Application Signals&lt;/strong> adds OTel-compatible APM, and &lt;strong>Amazon Managed Prometheus&lt;/strong> and &lt;strong>Amazon Managed Grafana&lt;/strong> serve the plane if you want to keep Prom + Grafana without operating them. &lt;strong>Bedrock logging&lt;/strong> integrates with CloudWatch and S3. &lt;strong>ADOT&lt;/strong> (AWS Distro for OpenTelemetry) is the official collector.&lt;/p>
&lt;p>On &lt;strong>GCP&lt;/strong>, &lt;strong>Cloud Monitoring&lt;/strong> + &lt;strong>Cloud Logging&lt;/strong> + &lt;strong>Cloud Trace&lt;/strong> + &lt;strong>Cloud Profiler&lt;/strong> form the quintet, all OTel compatible. &lt;strong>Vertex AI Model Monitoring&lt;/strong> offers drift detection (feature skew, prediction drift) integrated with runs.&lt;/p>
&lt;p>On &lt;strong>Azure&lt;/strong>, &lt;strong>Azure Monitor&lt;/strong> + &lt;strong>Application Insights&lt;/strong> + &lt;strong>Log Analytics&lt;/strong> cover the APM stack with native OTel, &lt;strong>Azure ML Model Monitor&lt;/strong> adds drift and data quality, and &lt;strong>Azure OpenAI diagnostic logs&lt;/strong> enrich the traces with token and model metadata.&lt;/p>
&lt;p>&lt;strong>Summary table — Observe stage.&lt;/strong>&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Functional piece&lt;/th>
&lt;th>OSS on-premise&lt;/th>
&lt;th>AWS&lt;/th>
&lt;th>GCP&lt;/th>
&lt;th>Azure&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Traces (OTel)&lt;/td>
&lt;td>OTel + Tempo / Jaeger&lt;/td>
&lt;td>X-Ray + ADOT, App Signals&lt;/td>
&lt;td>Cloud Trace&lt;/td>
&lt;td>App Insights + Azure Monitor&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Metrics&lt;/td>
&lt;td>Prometheus + Grafana&lt;/td>
&lt;td>CloudWatch + AMP / AMG&lt;/td>
&lt;td>Cloud Monitoring&lt;/td>
&lt;td>Azure Monitor Metrics&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Logs&lt;/td>
&lt;td>Loki, ELK&lt;/td>
&lt;td>CloudWatch Logs&lt;/td>
&lt;td>Cloud Logging&lt;/td>
&lt;td>Log Analytics&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>LLM-specific (prompt, scores, sessions)&lt;/td>
&lt;td>Langfuse, Phoenix Arize OSS&lt;/td>
&lt;td>Bedrock logging + CW + custom&lt;/td>
&lt;td>Vertex AI tracing + custom&lt;/td>
&lt;td>App Insights + AOAI logs + custom&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Drift detection&lt;/td>
&lt;td>Evidently, NannyML, Alibi Detect&lt;/td>
&lt;td>SageMaker Model Monitor&lt;/td>
&lt;td>Vertex AI Model Monitoring&lt;/td>
&lt;td>Azure ML Model Monitor&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>eBPF / runtime&lt;/td>
&lt;td>Pixie, Hubble, Tetragon&lt;/td>
&lt;td>— (no direct equivalent)&lt;/td>
&lt;td>GKE Dataplane v2 / Cloud Service Mesh&lt;/td>
&lt;td>Azure CNI + Defender for Cloud&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>&lt;strong>Where the names mislead.&lt;/strong> The classic cloud APM tools (X-Ray, Cloud Trace, App Insights) do not understand &lt;strong>prompt versioning&lt;/strong> or &lt;strong>adapter id&lt;/strong> as native concepts. They accept the &lt;code>gen_ai.*&lt;/code> attributes as dimensions, but the UIs do not prioritise those views. Langfuse and Phoenix do, because they are designed for LLM. In cloud, the usual pattern is to send dual: APM to the managed service for infrastructure + self-hosted Langfuse / Phoenix for the LLM plane. That pays off.&lt;/p>
&lt;h2 id="stage-6--retrain--cross-cutting-pieces">Stage 6 — Retrain + cross-cutting pieces&lt;/h2>
&lt;p>&lt;strong>The problem (Retrain).&lt;/strong> Closing the loop feedback → triage → enriched dataset → new adapter, with a mixed cadence (quarterly + incident-driven). Covered in the &lt;a href="https://blog.lo0.es/en/posts/retrain-closing-the-loop-feedback-dataset-adapter/">Retrain post&lt;/a>.&lt;/p>
&lt;p>&lt;strong>OSS Retrain stack.&lt;/strong> Orchestration: &lt;strong>Apache Airflow&lt;/strong>, &lt;strong>Prefect&lt;/strong>, &lt;strong>Dagster&lt;/strong> or &lt;strong>Argo Workflows&lt;/strong> and &lt;strong>Kubeflow Pipelines&lt;/strong> for K8s-native. Feature store where applicable: &lt;strong>Feast&lt;/strong>. Annotation and human-in-the-loop: &lt;strong>Argilla&lt;/strong>, &lt;strong>Label Studio&lt;/strong>, &lt;strong>Trubrics&lt;/strong>. Structured feedback capture: your own &lt;strong>Postgres&lt;/strong> table + &lt;strong>Langfuse scores&lt;/strong> + &lt;strong>Phoenix annotations&lt;/strong>. Closed-loop lineage: &lt;strong>OpenLineage&lt;/strong> tying dataset → run → model → deployment → feedback → next dataset.&lt;/p>
&lt;p>&lt;strong>Hyperscaler Retrain equivalents.&lt;/strong> On &lt;strong>AWS&lt;/strong>, &lt;strong>SageMaker Pipelines&lt;/strong> orchestrates the cycle, &lt;strong>SageMaker Ground Truth&lt;/strong> and &lt;strong>A2I&lt;/strong> (Augmented AI) manage annotation and HiL, and &lt;strong>SageMaker Model Monitor&lt;/strong> fires alerts that can invoke retrain pipelines. &lt;strong>AWS Step Functions&lt;/strong> serves as a more general alternative orchestrator.&lt;/p>
&lt;p>On &lt;strong>GCP&lt;/strong>, &lt;strong>Vertex AI Pipelines&lt;/strong> (based on Kubeflow Pipelines, compatible) orchestrates, &lt;strong>Vertex AI Data Labeling Service&lt;/strong> annotates, &lt;strong>Vertex AI Feature Store&lt;/strong> manages features, and &lt;strong>Workflows&lt;/strong> or &lt;strong>Cloud Composer&lt;/strong> (managed Airflow) act as orchestration alternatives.&lt;/p>
&lt;p>On &lt;strong>Azure&lt;/strong>, &lt;strong>Azure ML Pipelines&lt;/strong> orchestrates, &lt;strong>Azure ML Data Labeling&lt;/strong> annotates, &lt;strong>Azure ML Feature Store&lt;/strong> manages features.&lt;/p>
&lt;p>&lt;strong>The problem (cross-cutting: prompt + data versioning).&lt;/strong> Making sure &lt;code>prompt_id, prompt_version&lt;/code> and &lt;code>dataset_id, dataset_version&lt;/code> propagate through the whole system and show up in spans, runs and metrics. Covered in the posts on &lt;a href="https://blog.lo0.es/en/posts/prompt-versioning-contract-five-word-change/">prompt versioning&lt;/a> and &lt;a href="https://blog.lo0.es/en/posts/data-versioning-llmops-dvc-lakefs-reproducible-golden-dataset/">data versioning&lt;/a>.&lt;/p>
&lt;p>&lt;strong>Prompt versioning equivalents.&lt;/strong> OSS: &lt;strong>Langfuse Prompts&lt;/strong>, &lt;strong>MLflow Prompt Registry&lt;/strong>. AWS: &lt;strong>Bedrock Prompt Management&lt;/strong> (catalogue, versions, labels, integrated A/B testing) and &lt;strong>SageMaker Prompt Hub&lt;/strong>. GCP: &lt;strong>Vertex AI Prompt Management&lt;/strong> inside Vertex AI Studio. Azure: &lt;strong>Azure AI Foundry Prompt flow&lt;/strong> and prompt versioning in &lt;strong>Azure OpenAI deployments&lt;/strong>.&lt;/p>
&lt;p>&lt;strong>Data versioning equivalents.&lt;/strong> OSS: DVC + lakeFS (already covered under Data). AWS: S3 Versioning + Lake Formation + Glue Catalog (they are not DVC but together they cover part of it). GCP: Cloud Storage versioning + Dataplex (same). Azure: ADLS Gen2 versioning + Purview (same). The &lt;strong>real gap&lt;/strong> here is that no hyperscaler offers DVC natively, so dataset-as-first-class-citizen operations still require a layer of your own.&lt;/p>
&lt;p>&lt;strong>Summary table — Retrain stage + cross-cutting pieces.&lt;/strong>&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Functional piece&lt;/th>
&lt;th>OSS on-premise&lt;/th>
&lt;th>AWS&lt;/th>
&lt;th>GCP&lt;/th>
&lt;th>Azure&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>ML pipeline orchestration&lt;/td>
&lt;td>Airflow, Dagster, Argo, Kubeflow&lt;/td>
&lt;td>SageMaker Pipelines, Step Functions&lt;/td>
&lt;td>Vertex AI Pipelines, Cloud Composer&lt;/td>
&lt;td>Azure ML Pipelines&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Feature store&lt;/td>
&lt;td>Feast&lt;/td>
&lt;td>SageMaker Feature Store&lt;/td>
&lt;td>Vertex AI Feature Store&lt;/td>
&lt;td>Azure ML Feature Store&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Annotation / HiL&lt;/td>
&lt;td>Argilla, Label Studio&lt;/td>
&lt;td>SageMaker Ground Truth, A2I&lt;/td>
&lt;td>Vertex Data Labeling&lt;/td>
&lt;td>Azure ML Data Labeling&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Feedback capture&lt;/td>
&lt;td>Postgres + Langfuse scores&lt;/td>
&lt;td>Bedrock + custom + Ground Truth&lt;/td>
&lt;td>Vertex + custom&lt;/td>
&lt;td>App Insights + custom&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Prompt versioning&lt;/td>
&lt;td>Langfuse Prompts, MLflow Prompts&lt;/td>
&lt;td>Bedrock Prompt Management&lt;/td>
&lt;td>Vertex Prompt Management&lt;/td>
&lt;td>Azure AI Foundry Prompt flow&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Data versioning&lt;/td>
&lt;td>DVC + lakeFS + OpenLineage&lt;/td>
&lt;td>S3 Versioning + Lake Formation&lt;/td>
&lt;td>GCS + Dataplex&lt;/td>
&lt;td>ADLS + Purview&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Cross-system lineage&lt;/td>
&lt;td>OpenLineage + DataHub&lt;/td>
&lt;td>SageMaker Lineage Tracking&lt;/td>
&lt;td>Dataplex lineage&lt;/td>
&lt;td>Purview&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 id="the-chatbot-from-the-previous-post-ported-to-aws">The chatbot from the previous post ported to AWS&lt;/h2>
&lt;p>To stop the catalogue being abstract, we take the full scenario from the &lt;a href="https://blog.lo0.es/en/posts/anatomy-llm-request-production-tour-six-stages/">previous post&lt;/a>, the multi-tenant support chatbot for insurers on an on-premise OSS stack, and describe it component by component with an AWS stack. It is not an executable migration; it is the &lt;strong>map of what disappears, what appears and where the lock-in shows up&lt;/strong>.&lt;/p>
&lt;p>&lt;strong>The network plane.&lt;/strong> Edge LB and WAF: &lt;strong>AWS WAF + CloudFront&lt;/strong>. Ingress to the cluster: &lt;strong>AWS Load Balancer Controller&lt;/strong> over &lt;strong>EKS&lt;/strong>. What was Cilium BGP + RKE2 is replaced by EKS with &lt;strong>VPC CNI&lt;/strong> (or Cilium on EKS, which is possible). The conceptual equivalent of Tetragon is &lt;strong>Amazon GuardDuty for EKS&lt;/strong> + optional &lt;strong>Falco&lt;/strong>. Moderate lock-in: network control couples to VPC.&lt;/p>
&lt;p>&lt;strong>The chat gateway and auth.&lt;/strong> What was a bespoke API gateway with JWT verification materialises as &lt;strong>Amazon API Gateway&lt;/strong> + &lt;strong>Amazon Cognito&lt;/strong> (or IAM Identity Center if it is B2B). The gateway&amp;rsquo;s AI-aware routing is covered with &lt;strong>Bedrock&lt;/strong> + per-customer tags, or with &lt;strong>AWS API Gateway custom authorizers&lt;/strong> invoking a Lambda for tenant resolution. High lock-in on the identity layer if Cognito is chosen.&lt;/p>
&lt;p>&lt;strong>The inference engine.&lt;/strong> Three different options, with a clear trade-off.&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Bedrock with a managed model&lt;/strong> (Claude / Llama / Mistral): all the operations of vLLM, K8s Operators, KV cache and disaggregated serving disappear. You move to &lt;strong>Provisioned Throughput&lt;/strong> for a latency guarantee. You gain time-to-market; you lose control over prefill/decode, over custom LoRA adapters (Bedrock accepts Bedrock-managed fine-tunes but not arbitrary LoRAs), and you enter model lock-in (moving from Claude to Llama means changing API).&lt;/li>
&lt;li>&lt;strong>SageMaker Endpoints with your own vLLM container&lt;/strong>: you keep vLLM and its optimisations, but K8s disappears and SageMaker replaces it as the orchestration plane. Inference Components allow you to densify multiple adapters. KV cache, prefix caching and LoRA hot-swap work the same. Moderate lock-in on the SageMaker SDK and on the Inference Components format.&lt;/li>
&lt;li>&lt;strong>EKS with vLLM&lt;/strong> (the minimalist option): basically the OSS stack but with EKS instead of RKE2 and EBS/EFS instead of Ceph. Low lock-in, limited benefit from the cloud.&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Data layer.&lt;/strong> The corpus moves to &lt;strong>S3&lt;/strong> with versioning, the embeddings to &lt;strong>Amazon OpenSearch Service&lt;/strong> or to &lt;strong>Aurora pgvector&lt;/strong>. The radical managed option is &lt;strong>Bedrock Knowledge Bases&lt;/strong>: you upload documents to S3, it indexes them, it exposes a retrieval API. We remove Qdrant, we remove manual embedding pipelines, we remove part of Kafka + Flink. But control over custom reranking, fine-grained per-chunk ACL and the possibility of re-embedding with a new encoder of your own disappears. Bedrock KB uses the Titan or Cohere embedders available in Bedrock, and changing them means changing the whole index. ENS compliance: you have to validate that the buckets and the index live in EU regions and that the embedding model does too.&lt;/p>
&lt;p>&lt;strong>Stream + CDC.&lt;/strong> Kafka + Debezium is replaced by &lt;strong>MSK&lt;/strong> + &lt;strong>MSK Connect&lt;/strong> or by &lt;strong>Kinesis + DMS&lt;/strong>. Schema Registry: &lt;strong>Glue Schema Registry&lt;/strong>. The events remain functionally equivalent. Moderate lock-in if you go to Kinesis (Kinesis is not Kafka), low if you go to MSK (Kafka compatibility).&lt;/p>
&lt;p>&lt;strong>Data versioning.&lt;/strong> Here the gap is clear. S3 Versioning + Lake Formation + Glue Catalog &lt;strong>is not DVC&lt;/strong>. To preserve the discipline of the previous post, &lt;code>(dataset_id, dataset_version, sha256_hash)&lt;/code> propagated as an input artefact to the trainer, you can keep DVC over S3 (DVC works perfectly with S3 as a remote) or accept the limitation and register lineage manually in SageMaker Lineage Tracking. The first option preserves the practice; the second accepts degradation.&lt;/p>
&lt;p>&lt;strong>Tune stage.&lt;/strong> The LoRA adapter &lt;code>customer_support_v7&lt;/code> is trained with &lt;strong>SageMaker Training Jobs&lt;/strong> on &lt;strong>ml.p5.48xlarge&lt;/strong> instances (8× H100), using a standard HuggingFace + PEFT container. MLflow managed by SageMaker or your own MLflow on EC2 covers tracking. Alternative: if the black box is acceptable, &lt;strong>Bedrock Custom Models&lt;/strong> with a dataset in S3 produces a fine-tuned Bedrock model without instantiating a GPU manually, at the cost of not being able to inspect the run.&lt;/p>
&lt;p>&lt;strong>Eval stage.&lt;/strong> Promptfoo + RAGAS in CI runs the same over &lt;strong>CodeBuild&lt;/strong>. &lt;strong>Bedrock Model Evaluation&lt;/strong> replaces a good part of the automatic eval suite. &lt;strong>Bedrock Guardrails&lt;/strong> replaces NeMo Guardrails + Presidio + LlamaGuard, with the loss of transparency noted earlier.&lt;/p>
&lt;p>&lt;strong>Deploy stage.&lt;/strong> If Bedrock was chosen as the engine, this stage vanishes: Bedrock serves. If SageMaker Endpoints + vLLM was chosen, KServe is replaced by SageMaker Operators (or KServe is kept over EKS). The AI Gateway that in OSS was Envoy AI Gateway or LiteLLM becomes &lt;strong>API Gateway&lt;/strong> + &lt;strong>Bedrock&lt;/strong> or &lt;strong>API Gateway&lt;/strong> + &lt;strong>Lambda&lt;/strong> + &lt;strong>SageMaker&lt;/strong>.&lt;/p>
&lt;p>&lt;strong>Observe stage.&lt;/strong> The OTel Collector remains the standard. Traces to &lt;strong>AWS X-Ray&lt;/strong> + &lt;strong>CloudWatch Application Signals&lt;/strong>. Metrics to &lt;strong>Amazon Managed Prometheus&lt;/strong>. Logs to &lt;strong>CloudWatch Logs&lt;/strong> + optionally &lt;strong>OpenSearch&lt;/strong> for search. &lt;strong>Langfuse&lt;/strong> is hosted on &lt;strong>ECS Fargate&lt;/strong> or &lt;strong>EKS&lt;/strong> because the cloud has no native equivalent of integrated prompt + traces + scores. Drift: &lt;strong>SageMaker Model Monitor&lt;/strong> replaces Evidently / NannyML. eBPF (Pixie / Hubble / Tetragon) has &lt;strong>no direct equivalent&lt;/strong> in managed AWS, so Falco or installing Tetragon on EKS is still the route.&lt;/p>
&lt;p>&lt;strong>Retrain stage.&lt;/strong> &lt;strong>SageMaker Pipelines&lt;/strong> orchestrates the quarterly cycle. &lt;strong>SageMaker Ground Truth&lt;/strong> + &lt;strong>A2I&lt;/strong> replace Argilla. The &lt;code>feedback_signals&lt;/code> table in Postgres stays as it is (RDS Postgres) or moves to DynamoDB for large scales.&lt;/p>
&lt;p>&lt;strong>How much the lock-in weighs.&lt;/strong> The component with the highest lock-in is Bedrock + Bedrock Knowledge Bases + Bedrock Guardrails: leaving that requires rewriting the inference plane and reindexing the whole RAG. Next is the SageMaker SDK (Pipelines, Endpoints, Training), where leaving costs but means rewriting scripts, not data. Data in S3 is portable (S3 → MinIO with &lt;code>rclone&lt;/code> works). OTel observability is portable at almost no cost if the collector is kept as the abstraction. The auth gateway is the other high lock-in point if it uses Cognito.&lt;/p>
&lt;p>&lt;strong>What you gain.&lt;/strong> A dramatic reduction in GPU infrastructure operations, K8s patching, CUDA driver management, prefill/decode sizing, Ceph / MinIO management. A very short start-up curve: one request served in less than a sprint versus several weeks of bring-up for the OSS stack. Explicit provider SLAs.&lt;/p>
&lt;p>&lt;strong>What you lose.&lt;/strong> Contractual data sovereignty (the data stays in EU regions if configured that way, but the operator is a US third party under the Cloud Act). Visibility of the whole stack (Bedrock is a black box from the model downwards). Roadmap independence (the decision to discontinue a model, raise prices or change guardrails is not controlled by the customer). Fine-grained cost-per-token optimisation (the levers are the ones the provider exposes). For ENS customers under a HIGH declaration or NIS2 essential category, several of these points are &lt;strong>non-compliance&lt;/strong>, not preference.&lt;/p>
&lt;h2 id="master-table-the-entire-parallel-catalogue">Master table: the entire parallel catalogue&lt;/h2>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Stage / component&lt;/th>
&lt;th>OSS on-premise (the blog&amp;rsquo;s reference)&lt;/th>
&lt;th>AWS&lt;/th>
&lt;th>GCP&lt;/th>
&lt;th>Azure&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>Data&lt;/strong>&lt;/td>
&lt;td>DVC + lakeFS + MinIO + Qdrant + Kafka + Debezium&lt;/td>
&lt;td>S3 + Lake Formation + OpenSearch / Aurora pgvector + MSK + DMS&lt;/td>
&lt;td>GCS + Dataplex + Vertex Vector Search + Pub/Sub + Datastream&lt;/td>
&lt;td>ADLS Gen2 + Purview + Azure AI Search + Event Hubs + ADF&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Data versioning (cross-cutting)&lt;/strong>&lt;/td>
&lt;td>DVC + lakeFS + OpenLineage&lt;/td>
&lt;td>S3 Versioning + Lake Formation + Glue Catalog&lt;/td>
&lt;td>GCS Versioning + Dataplex lineage&lt;/td>
&lt;td>ADLS versioning + Purview&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Tune&lt;/strong>&lt;/td>
&lt;td>HF Transformers + PEFT + bitsandbytes + MLflow + Ray/Kubeflow&lt;/td>
&lt;td>SageMaker Training + HyperPod + Bedrock Custom + SM Experiments&lt;/td>
&lt;td>Vertex AI Training + Vertex Tuning + Vertex Experiments&lt;/td>
&lt;td>Azure ML Training + Azure OpenAI fine-tuning + Azure ML + MLflow&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Eval&lt;/strong>&lt;/td>
&lt;td>DeepEval + RAGAS + Promptfoo + Langfuse Evals + NeMo Guardrails&lt;/td>
&lt;td>Bedrock Model Evaluation + Bedrock Guardrails + SageMaker Clarify&lt;/td>
&lt;td>Vertex AI Evaluation Service + Model Armor + Gemini safety&lt;/td>
&lt;td>Azure AI Evaluation SDK + Content Safety (Prompt Shields, Groundedness)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Deploy&lt;/strong>&lt;/td>
&lt;td>vLLM + KServe + LLM Operators + Envoy AI Gateway&lt;/td>
&lt;td>Bedrock + SageMaker Endpoints (+ Inferentia / Trainium)&lt;/td>
&lt;td>Vertex AI Prediction + Gemini API (+ TPU)&lt;/td>
&lt;td>Azure OpenAI + Azure ML Endpoints (+ Maia)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Observe&lt;/strong>&lt;/td>
&lt;td>OTel + Tempo + Prometheus + Loki + Langfuse + Phoenix + Hubble&lt;/td>
&lt;td>CloudWatch + X-Ray + ADOT + AMP/AMG + SM Model Monitor&lt;/td>
&lt;td>Cloud Monitoring + Cloud Trace + Vertex Model Monitoring&lt;/td>
&lt;td>Azure Monitor + App Insights + Azure ML Model Monitor&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Retrain&lt;/strong>&lt;/td>
&lt;td>Airflow / Argo / Kubeflow Pipelines + Argilla + Feast&lt;/td>
&lt;td>SageMaker Pipelines + Ground Truth + A2I + SM Feature Store&lt;/td>
&lt;td>Vertex AI Pipelines + Data Labeling + Vertex Feature Store&lt;/td>
&lt;td>Azure ML Pipelines + Data Labeling + Azure ML Feature Store&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Prompt versioning (cross-cutting)&lt;/strong>&lt;/td>
&lt;td>Langfuse Prompts + MLflow Prompt Registry&lt;/td>
&lt;td>Bedrock Prompt Management + SM Prompt Hub&lt;/td>
&lt;td>Vertex AI Prompt Management&lt;/td>
&lt;td>Azure AI Foundry Prompt flow&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 id="when-to-choose-each-side--the-real-decision">When to choose each side — the real decision&lt;/h2>
&lt;p>The right question is not &lt;em>&amp;ldquo;OSS or cloud?&amp;rdquo;&lt;/em>. It is stage by stage.&lt;/p>
&lt;p>The &lt;strong>OSS side wins by default&lt;/strong> when there is:&lt;/p>
&lt;ul>
&lt;li>Data subject to ENS HIGH category, NIS2 essential sectors or equivalents (identifiable health data, regulated banking, critical infrastructure). Here provider traceability and the processing contract are not negotiable; using a service whose operator is subject to the Cloud Act, FISA 702 or equivalent compromises the legal basis.&lt;/li>
&lt;li>A requirement for auditable inspection of the model, the guardrails and the whole pipeline. If a regulator asks &lt;em>&amp;ldquo;how exactly does it detect PII?&amp;rdquo;&lt;/em> and an answer that ends in open code is mandatory.&lt;/li>
&lt;li>Large volumes with stable workloads. Above a certain threshold of tokens per month, the cost of Bedrock / AOAI / Vertex diverges from the amortised cost of your own GPU cluster. The threshold depends on the workload, but it typically sits between 5 and 50 billion tokens per month for models in the Llama 70B range.&lt;/li>
&lt;li>Roadmap independence as a priority. The day the provider discontinues a model or raises the price by 40 %, the organisation has to be able to ignore it.&lt;/li>
&lt;/ul>
&lt;p>The &lt;strong>hyperscaler side wins by default&lt;/strong> when there is:&lt;/p>
&lt;ul>
&lt;li>Critical time-to-market, an MVP in weeks. The operational weight of the OSS stack is too much for a project that has not yet proved product-market fit.&lt;/li>
&lt;li>A small team with no SREs / MLEs specialised in GPU inference. Operating KServe + vLLM + KV cache + multi-tenancy is not trivial; if the team cannot sustain it, hosting is the way.&lt;/li>
&lt;li>Variable workloads / unpredictable spikes. Bedrock on-demand and SageMaker serverless charge for what you use; your own cluster pays for the GPU whether it is busy or not.&lt;/li>
&lt;li>A need for specific proprietary models (Claude, GPT-4.1, Gemini Pro) with no acceptable OSS equivalent for the case.&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Mixed stages&lt;/strong> are frequent and reasonable. In practice, a common pattern in 2026 is: data, observe and retrain in self-hosted OSS (lineage and sovereignty), tune in OSS on your own cluster, eval in OSS + managed guardrails depending on the safety profile, deploy managed for proprietary models and self-hosted for open models. The question to ask for each stage is: &lt;em>&amp;ldquo;if the provider raises prices by 50 % or discontinues a component tomorrow, how much does it cost to move it?&amp;rdquo;&lt;/em>. The parallel catalogue in this post gives the answer for each box.&lt;/p>
&lt;h2 id="what-we-have-not-covered-yet">What we have not covered (yet)&lt;/h2>
&lt;p>Some pieces still deserve a post of their own:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>OpenAI / Anthropic API directly&lt;/strong> (not through Bedrock or AOAI): another level of managed, another contract.&lt;/li>
&lt;li>&lt;strong>Serious hybrids&lt;/strong>: AWS Outposts, GCP Distributed Cloud, Azure Stack HCI / Azure Local, the hyperscaler in your own room.&lt;/li>
&lt;li>&lt;strong>Per-tenant cost accounting&lt;/strong> compared OSS vs cloud: how the bill is built and where attribution breaks.&lt;/li>
&lt;li>&lt;strong>A real migration&lt;/strong> OSS → cloud or cloud → OSS: steps, scripts, gotchas.&lt;/li>
&lt;li>&lt;strong>Concrete European sovereignty&lt;/strong>: GAIA-X, EuroHPC, the European cloud offering (OVHcloud, Scaleway, IONOS, Aruba), compared with the big three for ENS / NIS2 cases.&lt;/li>
&lt;li>&lt;strong>AWS Inferentia / Trainium, GCP TPU v6 Trillium, Azure Maia&lt;/strong>: in-house chips and how they change the cost / token calculation.&lt;/li>
&lt;/ul>
&lt;h2 id="see-also">See also&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/anatomy-llm-request-production-tour-six-stages/">Anatomy of an LLM request in production&lt;/a> — the forensic walk of a request through the six stages, the thread from which this post makes the vertical cut.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/oss-catalogue-llmops-six-stages-tool-by-tool/">The OSS catalogue for LLMOps in six stages: tool by tool&lt;/a> — the zoom into the open source side of this post&amp;rsquo;s master table: a card of about 150 words per core OSS tool (vLLM, Langfuse, DVC, Qdrant, Airflow, NeMo Guardrails, Presidio…), licence and governance, a decision matrix per stage and a diagram of the connected OSS stack.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/">The six-stage LLMOps pipeline&lt;/a> — the master map that this catalogue complements.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/mlops-for-llms-landscape-2026/">MLOps specific to LLMs in 2026&lt;/a> — general context on why LLMOps is not classic MLOps.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/data-versioning-llmops-dvc-lakefs-reproducible-golden-dataset/">Data versioning with DVC and lakeFS&lt;/a> — the deep-dive on the Data cross-cutting piece.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/prompt-versioning-contract-five-word-change/">Prompt versioning with Langfuse and MLflow&lt;/a> — the deep-dive on the Prompt cross-cutting piece.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/continuous-fine-tuning-production-real-traffic-deployed-adapter/">Continuous fine-tuning in production&lt;/a> — Tune in detail.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">Evals: the layer after tracing&lt;/a> — Eval in detail.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/llm-guardrails-safety-four-lines-of-defence/">Guardrails and safety in LLMs&lt;/a> — the safety layer in detail.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/kv-cache-working-memory-llm-inference/">KV cache&lt;/a> · &lt;a href="https://blog.lo0.es/en/posts/pagedattention-vllm-block-manager/">PagedAttention&lt;/a> · &lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">Disaggregated serving&lt;/a> — Deploy from the inside.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/vllm-kubernetes-llm-inference-that-scales/">vLLM on Kubernetes&lt;/a> · &lt;a href="https://blog.lo0.es/en/posts/llm-inference-operators-kubernetes/">LLM operators on K8s&lt;/a> · &lt;a href="https://blog.lo0.es/en/posts/gpu-cluster-as-multi-tenant-platform/">Multi-tenant GPU cluster&lt;/a> — Deploy in operation.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/agentsight-llm-tracing-ebpf-zero-instrumentation/">AgentSight LLM tracing&lt;/a> · &lt;a href="https://blog.lo0.es/en/posts/mcp-deep-observability-opentelemetry/">MCP observability with OTel&lt;/a> · &lt;a href="https://blog.lo0.es/en/posts/ebpf-local-inference-statistical-drift-detection/">eBPF + drift&lt;/a> — Observe in its layers.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/retrain-closing-the-loop-feedback-dataset-adapter/">Retrain: closing the loop feedback → dataset → adapter&lt;/a> — Retrain in detail.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/iso-42001-aims-on-premise-llm-platform/">ISO/IEC 42001: the operations manual of the AI system&lt;/a> — the lock-in and contractual sovereignty analysis in this post feeds directly into Annex A.10 (third parties and customer relationships) of the AIMS; the AI supplier register demands documenting exactly what is compared here column by column.&lt;/li>
&lt;/ul>
&lt;h2 id="references">References&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://docs.vllm.ai/">vLLM documentation&lt;/a> and &lt;a href="https://github.com/vllm-project/production-stack">vLLM Production Stack&lt;/a> — the reference OSS inference engine.&lt;/li>
&lt;li>&lt;a href="https://docs.aws.amazon.com/bedrock/">Amazon Bedrock documentation&lt;/a> — AWS managed model catalogue, Knowledge Bases, Guardrails and Prompt Management.&lt;/li>
&lt;li>&lt;a href="https://docs.aws.amazon.com/sagemaker/">Amazon SageMaker AI&lt;/a> — training, endpoints, pipelines, model monitoring.&lt;/li>
&lt;li>&lt;a href="https://cloud.google.com/vertex-ai/docs">Google Vertex AI documentation&lt;/a> — training, prediction, evaluation, model monitoring.&lt;/li>
&lt;li>&lt;a href="https://learn.microsoft.com/azure/ai-foundry/">Azure AI Foundry documentation&lt;/a> — Microsoft&amp;rsquo;s unified plane for AI applications.&lt;/li>
&lt;li>&lt;a href="https://learn.microsoft.com/azure/ai-services/openai/">Azure OpenAI Service documentation&lt;/a> — OpenAI models hosted on Azure.&lt;/li>
&lt;li>&lt;a href="https://opentelemetry.io/docs/specs/semconv/gen-ai/">OpenTelemetry GenAI semantic conventions&lt;/a> — the standard that stitches observability across the OSS / cloud boundary.&lt;/li>
&lt;li>&lt;a href="https://langfuse.com/docs">Langfuse documentation&lt;/a> and &lt;a href="https://docs.arize.com/phoenix">Arize Phoenix&lt;/a> — the reference OSS LLM observability tools.&lt;/li>
&lt;li>&lt;a href="https://dvc.org/">DVC&lt;/a> and &lt;a href="https://lakefs.io/">lakeFS&lt;/a> — OSS data versioning.&lt;/li>
&lt;li>&lt;a href="https://docs.nvidia.com/nemo/guardrails/">NeMo Guardrails&lt;/a> — OSS safety + dialog policy.&lt;/li>
&lt;li>ENS (Esquema Nacional de Seguridad) and NIS2 (Network and Information Security Directive 2) — the compliance frameworks that have the last word in the OSS vs cloud choice for regulated EU customers.&lt;/li>
&lt;/ul></description></item><item><title>Data versioning for LLMOps: DVC, lakeFS and the reproducible golden dataset challenge</title><link>https://blog.lo0.es/en/posts/data-versioning-llmops-dvc-lakefs-reproducible-golden-dataset/</link><pubDate>Fri, 22 May 2026 11:00:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/data-versioning-llmops-dvc-lakefs-reproducible-golden-dataset/</guid><description>&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>The Data stage of the &lt;a href="https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/">six-stage LLMOps pipeline&lt;/a> has a silent link on which everything else depends: &lt;strong>versioning the datasets&lt;/strong> with the same discipline the code is versioned with. It is not optional. An LLM system in production consumes at least four distinct types of dataset (training/fine-tuning, RAG corpus, golden eval set, enriched dataset from the Retrain loop) and each has its own demands. Git solves code but fails on data for two technical reasons (size and a useless binary diff) and one operational one (it does not propagate lineage as far as the weights bucket of the trained model). The two dominant OSS tools, &lt;strong>DVC&lt;/strong> and &lt;strong>lakeFS&lt;/strong>, &lt;strong>unified in November 2025&lt;/strong> under a single organisation with a roadmap oriented towards LLM training and RAG datalakes; they are still complementary projects (file-level vs whole-bucket branching) but now under common governance. The productive pattern the market has consolidated on: identify each artefact with an immutable &lt;code>(dataset_id, version)&lt;/code>, propagate the pair as far as the experiment tracking (MLflow / W&amp;amp;B), version the dataset&amp;rsquo;s schema too (not just its content), apply a strict holdout to the golden eval set so you are not measuring memorisation, and maintain bidirectional traceability &lt;code>dataset_version ↔ model_version ↔ deployment ↔ trace_id&lt;/code>. Without this, the promise of &amp;ldquo;we can audit which model answered what&amp;rdquo; collapses at the first serious incident.&lt;/p>
&lt;h2 id="you-are-here-data-with-a-cross-cutting-effect-on-tune-eval-and-retrain">You are here: Data (with a cross-cutting effect on Tune, Eval and Retrain)&lt;/h2>
&lt;p>This post goes into the detail of the versioning link inside stage &lt;strong>1 · Data&lt;/strong>. Versioning belongs operationally to Data, but the artefacts it produces travel to Tune (training set), Eval (golden set) and Retrain (enriched dataset). That is why the diagram marks Data as active and shows a cross-cutting band indicating end-to-end lineage.&lt;/p>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 135" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="you are here: Data with cross-cutting lineage">
&lt;style>.box{stroke:#444;stroke-width:1.4;rx:6}.active{fill:#ff8a4c;stroke-width:3}.idle{fill:#f4f4f4}.cross{fill:#ffe9d6;stroke-width:1.4;stroke:#c66;rx:6}.lbl{font:600 12px sans-serif;fill:#222}.sm{font:11px sans-serif;fill:#444}.arr{stroke:#666;stroke-width:1.4;fill:none;marker-end:url(#dvm)}.cyc{stroke:#888;stroke-width:1.2;fill:none;stroke-dasharray:4 2;marker-end:url(#dvm)}&lt;/style>
&lt;defs>&lt;marker id="dvm" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#666"/>&lt;/marker>&lt;/defs>
&lt;text x="390" y="20" text-anchor="middle" class="lbl">You are here: DATA · dataset versioning with lineage to the production trace&lt;/text>
&lt;rect x="30" y="35" width="110" height="35" class="box active"/>&lt;text x="85" y="58" text-anchor="middle" class="lbl">1 · Data&lt;/text>
&lt;rect x="155" y="35" width="110" height="35" class="box idle"/>&lt;text x="210" y="58" text-anchor="middle" class="lbl">2 · Tune&lt;/text>
&lt;rect x="280" y="35" width="110" height="35" class="box idle"/>&lt;text x="335" y="58" text-anchor="middle" class="lbl">3 · Eval&lt;/text>
&lt;rect x="405" y="35" width="110" height="35" class="box idle"/>&lt;text x="460" y="58" text-anchor="middle" class="lbl">4 · Deploy&lt;/text>
&lt;rect x="530" y="35" width="110" height="35" class="box idle"/>&lt;text x="585" y="58" text-anchor="middle" class="lbl">5 · Observe&lt;/text>
&lt;rect x="655" y="35" width="110" height="35" class="box idle"/>&lt;text x="710" y="58" text-anchor="middle" class="lbl">6 · Retrain&lt;/text>
&lt;path class="arr" d="M140,52 L155,52"/>&lt;path class="arr" d="M265,52 L280,52"/>&lt;path class="arr" d="M390,52 L405,52"/>&lt;path class="arr" d="M515,52 L530,52"/>&lt;path class="arr" d="M640,52 L655,52"/>
&lt;path class="cyc" d="M710,72 L710,82 L85,82 L85,72"/>
&lt;rect x="30" y="98" width="735" height="25" class="cross"/>
&lt;text x="397" y="115" text-anchor="middle" class="sm">Dataset lineage: training set → Tune · golden set → Eval · enriched set → Retrain (back to Data)&lt;/text>
&lt;/svg>
&lt;/div>
&lt;h2 id="the-master-analogy-batch-traceability-in-a-serious-factory">The master analogy: batch traceability in a serious factory&lt;/h2>
&lt;p>A serious pharmaceutical factory does not produce without &lt;strong>batch traceability&lt;/strong>. Every box of pills carries a printed batch number; that batch is associated with manufacturing dates, with the specific batches of each raw material used, with the quality tests it passed, and with the technicians who signed off each step. If a patient reports an adverse effect, the factory can rewind within hours: this package → this batch → these raw materials → this shift → this production line → this quality control result. Without that chain, the incident is a permanent mystery.&lt;/p>
&lt;p>A serious LLM system works the same way. The &amp;ldquo;package&amp;rdquo; is the answer a user saw in production. The &amp;ldquo;batch&amp;rdquo; is the combination of model, adapter, prompt, context and configuration that generated it. And the &amp;ldquo;raw materials&amp;rdquo; are the datasets: the training set the base model was trained on, the adapter&amp;rsquo;s fine-tuning dataset, the RAG corpus that feeds retrieval, the golden eval set that validates promotion. If a customer says &lt;em>&amp;ldquo;what data was the model trained on that answered X to my question Y on 14 March?&amp;rdquo;&lt;/em>, without batch traceability the answer is &lt;em>&amp;ldquo;we do not know&amp;rdquo;&lt;/em>. And that, with a customer under compliance pressure, kills the contract.&lt;/p>
&lt;p>Git versions the recipe (the code). Data versioning versions the ingredients. Without both, there is no auditable factory.&lt;/p>
&lt;h2 id="the-four-artefacts-worth-versioning-with-differentiated-demands">The four artefacts worth versioning (with differentiated demands)&lt;/h2>
&lt;p>Not all datasets are versioned the same way or at the same frequency. The typical LLM system in production handles four artefacts worth governing separately.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Artefact&lt;/th>
&lt;th>What it is&lt;/th>
&lt;th>Typical size&lt;/th>
&lt;th>New-version frequency&lt;/th>
&lt;th>Who consumes it&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>Training / fine-tuning dataset&lt;/strong>&lt;/td>
&lt;td>Input/output pairs (or conversations) that train the adapter or the model.&lt;/td>
&lt;td>10⁴ – 10⁷ examples · 1 – 100 GB&lt;/td>
&lt;td>Per Tune experiment&lt;/td>
&lt;td>Trainer (Axolotl, TRL, Unsloth)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>RAG corpus&lt;/strong>&lt;/td>
&lt;td>Indexed documents that feed retrieval.&lt;/td>
&lt;td>10⁵ – 10⁹ chunks · 10 GB – 10 TB&lt;/td>
&lt;td>Almost continuous (streaming ingest)&lt;/td>
&lt;td>Indexer + vector store&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Golden eval set&lt;/strong>&lt;/td>
&lt;td>Curated examples with an expected answer to measure quality.&lt;/td>
&lt;td>10² – 10⁴ examples · MB&lt;/td>
&lt;td>Per product release&lt;/td>
&lt;td>Eval gates in CI&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Enriched retrain dataset&lt;/strong>&lt;/td>
&lt;td>Cases where the system failed + the human correction.&lt;/td>
&lt;td>Hundreds to thousands per quarter&lt;/td>
&lt;td>Per &lt;a href="https://blog.lo0.es/en/posts/retrain-closing-the-loop-feedback-dataset-adapter/">retrain&lt;/a> cycle&lt;/td>
&lt;td>Next Tune&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>All four have common requirements (immutable identity, lineage, schema) and relevant differences:&lt;/p>
&lt;ul>
&lt;li>The &lt;strong>training set&lt;/strong> tends to be large, stable per experiment, and the cost of an error is a lost experiment (expensive but bounded).&lt;/li>
&lt;li>The &lt;strong>RAG corpus&lt;/strong> is enormous, in continuous change, and its versioning is handled through periodic snapshots of the index (not of the raw text). Usually lakeFS or bucket branches; DVC is not the best fit.&lt;/li>
&lt;li>The golden eval set is small but critical: errors here contaminate the whole promotion chain. Here the rigidity of the versioning matters more than anywhere else.&lt;/li>
&lt;li>The &lt;strong>enriched retrain dataset&lt;/strong> is incremental by nature: each Retrain cycle contributes a delta over the previous one. The new version does not overwrite; it inherits and adds.&lt;/li>
&lt;/ul>
&lt;p>Confusing them, treating the RAG corpus as if it were the training set, or the golden eval as if it were just another dataset, is the source of half the operational problems in data versioning.&lt;/p>
&lt;h2 id="why-git-is-not-enough">Why Git is not enough&lt;/h2>
&lt;p>The obvious question: if Git already solves code, why does it not solve data too? Three reasons, two technical and one operational.&lt;/p>
&lt;p>&lt;strong>Reason 1: size.&lt;/strong> A Git repository with a 50 GB dataset becomes unmanageable. &lt;code>git clone&lt;/code> pulls the entire history; &lt;code>git status&lt;/code> walks every file; the pack file in &lt;code>.git/objects&lt;/code> bloats to up to twice the size of the dataset. Git LFS solves the first part (the binary leaves the pack) but introduces its own complexity without addressing the other two reasons.&lt;/p>
&lt;p>&lt;strong>Reason 2: useless binary diff.&lt;/strong> Git assumes text diffs are useful. When a column changes in an 8 GB parquet, the diff is opaque, because the file is binary, compressed and columnar. You cannot do code review on a dataset change the way you do on a function change. You need a semantic diff: how many rows changed, which columns changed, which distribution moved. No native Git gives you that.&lt;/p>
&lt;p>&lt;strong>Reason 3: lineage that crosses repository boundaries.&lt;/strong> This is the most important and the most subtle. The training dataset lives in a bucket. The trainer code lives in a Git repo. The trained model is published to a model registry. Inference in production generates traces in an observability system. Connecting &lt;code>dataset_v3 → adapter_v7 → deployment_d2 → trace t_x9&lt;/code> requires propagating identifiers &lt;strong>across four different systems&lt;/strong>, not inside one repo. Git has no opinion on this.&lt;/p>
&lt;p>Data versioning tools (DVC, lakeFS, Pachyderm, Quilt) exist because they solve the three problems at once: they hang the data outside the Git repo, they offer some form of semantic diff, and they expose stable identities that can be propagated towards experiment tracking and the model registry.&lt;/p>
&lt;h2 id="dvc-vs-lakefs-before-the-unification">DVC vs lakeFS before the unification&lt;/h2>
&lt;p>Until November 2025, the two dominant OSS tools coexisted as complementary approaches.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Axis&lt;/th>
&lt;th>DVC&lt;/th>
&lt;th>lakeFS&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Mental model&lt;/td>
&lt;td>&amp;ldquo;Git for data&amp;rdquo;&lt;/td>
&lt;td>&amp;ldquo;Branching for the data lake&amp;rdquo;&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Granularity&lt;/td>
&lt;td>Individual file&lt;/td>
&lt;td>Whole bucket (with per-branch namespacing)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Storage&lt;/td>
&lt;td>Remote-agnostic (S3, GCS, Azure, MinIO, SSH)&lt;/td>
&lt;td>S3-compatible (S3, MinIO, Ceph)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Workflow&lt;/td>
&lt;td>&lt;code>dvc add&lt;/code> + &lt;code>dvc push&lt;/code> + &lt;code>dvc.yaml&lt;/code> pipelines&lt;/td>
&lt;td>&lt;code>lakectl commit&lt;/code> + branches/merges over the bucket&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Diff&lt;/td>
&lt;td>File hash + external metadata&lt;/td>
&lt;td>Object-level diff + commit log&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Strong cases&lt;/td>
&lt;td>Discrete training datasets, model files, reproducible pipelines&lt;/td>
&lt;td>Large RAG corpora, branching a shared data lake, parallel experiments without duplicating data&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Git integration&lt;/td>
&lt;td>Deep (the &lt;code>.dvc&lt;/code> files are committed to Git)&lt;/td>
&lt;td>Tangential (lakeFS lives alongside)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Who operates it&lt;/td>
&lt;td>MLE team&lt;/td>
&lt;td>Data engineering team&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>In practice, many teams used them at the same time: DVC for the discrete datasets that fed an experiment (they fit in a Git repo thanks to the indirection of the &lt;code>.dvc&lt;/code> pointers), and lakeFS for the large RAG corpus bucket they wanted to branch without duplicating terabytes.&lt;/p>
&lt;h2 id="what-changed-with-the-november-2025-acquisition">What changed with the November 2025 acquisition&lt;/h2>
&lt;p>&lt;a href="https://medium.com/the-modern-scientist/reproducible-ai-versioning-models-prompts-and-data-96dd0337af65">lakeFS acquired DVC&lt;/a> in November 2025. The operational consequence as of May 2026 is modest but relevant:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>There is (as yet) no technical merger of the projects.&lt;/strong> DVC is still DVC and lakeFS is still lakeFS. The current CLIs, formats and workflows have not changed.&lt;/li>
&lt;li>&lt;strong>An explicit combined roadmap towards LLM training and RAG datalakes.&lt;/strong> The merged organisation has stated specific priorities: consistent branching between the dataset and the trained model, native integrations with MLflow / W&amp;amp;B / Langfuse, support for the typical LLM formats (jsonl, parquet with embedded tokenisation), and branch-aware vector indexing.&lt;/li>
&lt;li>&lt;strong>Convergence expected in 2026-2027.&lt;/strong> The market anticipates a single registry with two operating modes (file-level + bucket-branching) under a unified CLI. As of today, teams still combine both.&lt;/li>
&lt;/ul>
&lt;p>The practical reading for 2026: &lt;strong>adopt DVC for discrete training/eval datasets and lakeFS for the RAG corpus&lt;/strong>, but design the lineage so that a future unified registry can absorb both without re-versioning everything. Concretely: use stable identifiers (&lt;code>dataset_id&lt;/code>, &lt;code>version&lt;/code>, &lt;code>commit_hash&lt;/code>) that can be propagated regardless of the tool.&lt;/p>
&lt;h2 id="the-operational-pattern-four-hop-lineage">The operational pattern: four-hop lineage&lt;/h2>
&lt;p>Once you accept that datasets have to be versioned, the question is not &amp;ldquo;which tool&amp;rdquo; but &amp;ldquo;which chain of identifiers connects production to the source data&amp;rdquo;. The pattern the market has consolidated on has four hops:&lt;/p>
&lt;pre tabindex="0">&lt;code>(dataset_id, dataset_version)
│ versioned in DVC or lakeFS
▼
(model_id, model_version)
│ registered in MLflow / W&amp;amp;B with the dataset as input
▼
(deployment_id, prompt_version)
│ registered in the model registry + prompt registry
▼
(trace_id)
│ emitted by the inference engine with OTel
▼
answer visible to the user
&lt;/code>&lt;/pre>&lt;p>Each arrow is a metadata write that crosses the boundary between two systems. If a single arrow is missing, the lineage breaks and the promise of auditability evaporates.&lt;/p>
&lt;p>A concrete example of the flow, using DVC + MLflow:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Data stage: version the dataset&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">dvc add data/finetune_v3.jsonl
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">git add data/finetune_v3.jsonl.dvc data/.gitignore
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">git commit -m &lt;span class="s2">&amp;#34;data: finetune dataset v3&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">dvc push &lt;span class="c1"># uploads the binary to the remote (MinIO/S3)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Tune stage: train while recording lineage&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">mlflow run train.py &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -P &lt;span class="nv">dataset_id&lt;/span>&lt;span class="o">=&lt;/span>finetune &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -P &lt;span class="nv">dataset_version&lt;/span>&lt;span class="o">=&lt;/span>v3 &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -P &lt;span class="nv">dataset_hash&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="k">$(&lt;/span>dvc get-url data/finetune_v3.jsonl &lt;span class="p">|&lt;/span> sha256sum&lt;span class="k">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># The run records: input dataset + model output&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Eval stage: validate while recording lineage&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">mlflow run eval.py &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -P &lt;span class="nv">model_id&lt;/span>&lt;span class="o">=&lt;/span>adapter_customer_v7 &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -P &lt;span class="nv">golden_set_id&lt;/span>&lt;span class="o">=&lt;/span>customer_support &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -P &lt;span class="nv">golden_set_version&lt;/span>&lt;span class="o">=&lt;/span>v12
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Deploy stage: the deployment inherits the dataset + golden ids&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Every trace in Observe carries model_version + prompt_version&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># which rewind back to dataset_version&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The equivalent version with lakeFS over the RAG corpus:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Branch for the new corpus embeddings&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">lakectl branch create lakefs://corpus/embed-2026q2 --source main
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Index the corpus on that branch&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">python index_corpus.py --branch embed-2026q2
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Validate before merging to main&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">python eval_retrieval.py --branch embed-2026q2 &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --metric recall@10 --threshold 0.78
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># If it passes, merge (changes the corpus that serves production)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">lakectl commit lakefs://corpus/embed-2026q2 -m &lt;span class="s2">&amp;#34;embed: corpus 2026q2&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">lakectl merge lakefs://corpus/embed-2026q2 lakefs://corpus/main
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The virtue of the second flow: while the new corpus is being validated, the production system keeps serving from &lt;code>main&lt;/code> with no interference. The parallel branch works as a real staging area over the whole bucket.&lt;/p>
&lt;h2 id="schema-contracts-data-versioning-without-them-is-an-illusion">Schema contracts: data versioning without them is an illusion&lt;/h2>
&lt;p>Versioning a dataset&amp;rsquo;s content without versioning its &lt;strong>schema&lt;/strong> is a frequent mistake. The problem: a versioned dataset with an implicit schema still breaks silently when a producer (the ingestion team, the annotation team, an ad-hoc script) changes a field.&lt;/p>
&lt;p>A concrete case: a customer support golden eval set, 1000 examples, an &lt;code>expected_output&lt;/code> field originally &lt;code>string&lt;/code>. Someone decides they need to capture several valid answers and changes the field to &lt;code>list[string]&lt;/code>. The eval loader accepts both formats by chance (Python is lax) but the downstream LLM judge receives a different object. The eval keeps passing but now it measures something else.&lt;/p>
&lt;p>Productive pattern: the dataset is versioned with DVC/lakeFS and its schema is versioned with a &lt;a href="https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/">Schema Registry&lt;/a> (Confluent or Apicurio) or, in less mature systems, with a JSON Schema embedded alongside the dataset. CI blocks any PR that breaks the contract without a version bump.&lt;/p>
&lt;p>A minimal schema for a golden eval entry (illustrative):&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-yaml" data-lang="yaml">&lt;span class="line">&lt;span class="cl">&lt;span class="nt">$schema&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">https://json-schema.org/draft/2020-12/schema&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">$id&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">https://example.org/schemas/golden_eval_entry/v3.json&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">type&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">object&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">required&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="l">example_id, input, expected_outputs, rubric, segment]&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">properties&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">example_id&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>{&lt;span class="nt">type: string, format&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">uuid}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">input&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">type&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">object&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">required&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="l">user_query, retrieved_context]&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">properties&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">user_query&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>{&lt;span class="nt">type&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">string}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">retrieved_context&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>{&lt;span class="nt">type: array, items&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>{&lt;span class="nt">type&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">string}}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">expected_outputs&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">type&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">array&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">minItems&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">1&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">items&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>{&lt;span class="nt">type&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">string}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">rubric&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">type&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">object&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">required&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="l">must_include, must_not_include, format]&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">properties&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">must_include&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>{&lt;span class="nt">type: array, items&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>{&lt;span class="nt">type&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">string}}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">must_not_include&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>{&lt;span class="nt">type: array, items&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>{&lt;span class="nt">type&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">string}}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">format&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>{&lt;span class="nt">enum&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="l">text, json, markdown]}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">segment&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>{&lt;span class="nt">type&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">string}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">difficulty&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>{&lt;span class="nt">enum&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="l">easy, medium, hard]}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">added_at&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>{&lt;span class="nt">type: string, format&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">date-time}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">curated_by&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>{&lt;span class="nt">type&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">string}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Operational rules:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Explicit forward/backward compatibility&lt;/strong>: adding an optional field is backward-compatible; removing a required one is breaking. The policy is enforced with a compatibility check in CI.&lt;/li>
&lt;li>&lt;strong>The schema version embedded&lt;/strong> in every row of the dataset (a &lt;code>_schema_version&lt;/code> field). The loader validates that the version matches what the consuming code expects.&lt;/li>
&lt;li>&lt;strong>The schema registry as the single source of truth&lt;/strong>, not as an optional copy of the JSON Schema in four repos.&lt;/li>
&lt;/ul>
&lt;p>Without this level of discipline, &amp;ldquo;we have data versioning&amp;rdquo; means &amp;ldquo;we store the bytes but we do not control what they mean&amp;rdquo;.&lt;/p>
&lt;h2 id="golden-eval-set-the-most-critical-version">Golden eval set: the most critical version&lt;/h2>
&lt;p>Of the four artefacts, the &lt;strong>golden eval set&lt;/strong> is the one that demands the most rigour. A failure here contaminates the whole promotion chain: if the eval lies, the gates approve models that should not pass.&lt;/p>
&lt;p>Three extra disciplines over the golden set:&lt;/p>
&lt;p>&lt;strong>Annotation with measured quality.&lt;/strong> Each example is labelled by a human, and a percentage (10-20 %) is annotated by two independent people. The &lt;strong>inter-annotator agreement&lt;/strong> (Cohen&amp;rsquo;s kappa or pairwise F1) is measured and published; a golden set with kappa &amp;lt; 0.7 is measuring human noise, not model behaviour. Argilla and Label Studio provide the mechanics; what matters is the discipline, not the tool.&lt;/p>
&lt;p>&lt;strong>A strict holdout against contamination.&lt;/strong> The golden set must &lt;strong>never&lt;/strong> enter the training set. The concrete mechanism: hash each golden set &lt;code>input&lt;/code> (sha256 normalised by lowercasing + stripping trivial punctuation) → check in CI against all the training set hashes. If there is an intersection, CI blocks until it is resolved. Without this check, the model passes the eval by memorisation, not by capability. The consequence in production is disastrous: the &amp;ldquo;validated&amp;rdquo; model fails on cases analogous to the golden set that it had not memorised.&lt;/p>
&lt;p>&lt;strong>Additive versioning, never destructive.&lt;/strong> When the golden set grows (each retrain cycle adds cases), &lt;code>golden_v3 = golden_v2 ∪ new_examples&lt;/code>. Never &lt;code>golden_v3 = a different new set&lt;/code>. Only that way can you compare two models trained months apart over the same base + the new delta. If you rewrite the golden set, you cannot tell whether the March model was worse than the May one or whether you were simply measuring different things.&lt;/p>
&lt;p>Summary table of the discipline per artefact:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Practice&lt;/th>
&lt;th>Training set&lt;/th>
&lt;th>RAG corpus&lt;/th>
&lt;th>Golden eval set&lt;/th>
&lt;th>Enriched retrain&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Immutable versioning&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes (snapshots)&lt;/td>
&lt;td>&lt;strong>Yes, critical&lt;/strong>&lt;/td>
&lt;td>Yes&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Schema with a contract&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Recommended&lt;/td>
&lt;td>&lt;strong>Yes, critical&lt;/strong>&lt;/td>
&lt;td>Yes&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Double annotation&lt;/td>
&lt;td>No&lt;/td>
&lt;td>Not applicable&lt;/td>
&lt;td>&lt;strong>Yes (10-20 %)&lt;/strong>&lt;/td>
&lt;td>Yes (10-20 %)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Holdout vs other datasets&lt;/td>
&lt;td>N/A&lt;/td>
&lt;td>N/A&lt;/td>
&lt;td>&lt;strong>Yes, hash check&lt;/strong>&lt;/td>
&lt;td>Yes (vs golden)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Drift check vs previous version&lt;/td>
&lt;td>Recommended&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Recommended&lt;/td>
&lt;td>Yes&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Lineage to deployment&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 id="promotion-gates-the-dataset-is-promoted-like-the-model">Promotion gates: the dataset is promoted like the model&lt;/h2>
&lt;p>A candidate dataset (a freshly enriched &lt;code>golden_v13&lt;/code>, an &lt;code>enriched_retrain_2026_q2&lt;/code> resulting from the Retrain cycle) does not enter production just by being in the bucket. It goes through gates equivalent to the model&amp;rsquo;s or the prompt&amp;rsquo;s:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Schema validation&lt;/strong> — the contract is met. Blocked in CI if not.&lt;/li>
&lt;li>&lt;strong>Quality validation&lt;/strong> — a random 5-10 % sample reviewed by a human with a quality score ≥ 4/5. Blocked if the sample fails.&lt;/li>
&lt;li>&lt;strong>Holdout segregation check&lt;/strong> — for golden sets and enriched datasets, a hash check against all the other active datasets. Blocked if there is overlap.&lt;/li>
&lt;li>&lt;strong>Drift check vs previous version&lt;/strong> — a KS test over the distribution of the input embeddings, or simpler metrics (mean length, segment distribution, the ratio of each label). A warning if the drift is high with no documented cause; a block if it is very high.&lt;/li>
&lt;li>&lt;strong>Lineage check&lt;/strong> — the dataset explicitly declares which version it inherits from and what changed. Without that metadata, it does not go in.&lt;/li>
&lt;/ol>
&lt;p>Only when all five gates pass is the dataset tagged &lt;code>production-ready&lt;/code> and the downstream pipelines that depend on it unblocked (the next Tune, the next product release, the next eval cycle).&lt;/p>
&lt;h2 id="the-on-premise-stack-applied">The on-premise stack applied&lt;/h2>
&lt;p>On a generic infrastructure with an &lt;strong>RTX 4090&lt;/strong> (24 GB VRAM, a development / small-batch profile) and a &lt;strong>4×H100 SXM cluster&lt;/strong> (80 GB VRAM each, NVLink, training and production inference), data versioning fits without a dedicated GPU for the versioning itself, since versioning lives on CPU + storage, but it does touch the GPU for the drift checks that require embeddings.&lt;/p>
&lt;p>Typical topology:&lt;/p>
&lt;pre tabindex="0">&lt;code>┌────────────────────────────────────────────────────────────┐
│ Object store (MinIO or Ceph) │
│ buckets: /training-sets /corpus-rag │
│ /golden-evals /enriched-retrain │
└────────────────────────┬───────────────────────────────────┘
│
┌─────────────────┼──────────────────┐
│ │ │
┌───▼────┐ ┌────▼────┐ ┌────▼─────┐
│ DVC │ │ lakeFS │ │ MLflow │
│ remote │ │ branches│ │ Tracking │
└───┬────┘ └────┬────┘ └────┬─────┘
│ │ │
└─────────────────┴──────────────────┘
│
┌──────▼──────┐
│ CI/CD gates │
│ (Forgejo / │
│ GitLab) │
└──────┬──────┘
│
┌──────────┴───────────┐
│ │
┌─────▼──────┐ ┌─────▼─────┐
│ RTX 4090 │ │ 4×H100 │
│ (drift │ │ (training │
│ embeds, │ │ + │
│ validates)│ │ serving) │
└────────────┘ └───────────┘
&lt;/code>&lt;/pre>&lt;p>Operational notes:&lt;/p>
&lt;ul>
&lt;li>The &lt;strong>object store&lt;/strong> (MinIO or Ceph) serves both as the DVC remote and as lakeFS storage. One storage plane, two views.&lt;/li>
&lt;li>The &lt;strong>schema checks&lt;/strong> and &lt;strong>holdout hashing&lt;/strong> are fast CPU-bound tasks; the CI runner executes them without a GPU.&lt;/li>
&lt;li>The &lt;strong>embedding drift check&lt;/strong> needs an encoder; the RTX 4090 handles this without touching the production cluster. A small encoder (BGE-small, E5-small, ~100M parameters) processes 10⁴ examples in a few minutes.&lt;/li>
&lt;li>The &lt;strong>H100 cluster&lt;/strong> stays free for training and serving, with no contamination from versioning jobs.&lt;/li>
&lt;/ul>
&lt;h3 id="when-do-you-not-need-dvclakefs">When do you NOT need DVC/lakeFS?&lt;/h3>
&lt;p>There is an opposite position defended with figures in the &lt;a href="https://blog.lo0.es/en/posts/continuous-fine-tuning-production-real-traffic-deployed-adapter/">continuous fine-tuning post&lt;/a>: for small systems with a single team, datasets &amp;lt; 1 GB and a handful of adapters, &lt;strong>Postgres + pgvector + an S3 bucket + hashed filenames&lt;/strong> are enough. The operational complexity of DVC/lakeFS does not pay for itself.&lt;/p>
&lt;p>The dividing line is reasonable:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>You do not need DVC/lakeFS&lt;/strong>: a single team, small datasets, few adapters, no multiple products sharing data.&lt;/li>
&lt;li>&lt;strong>You do need it&lt;/strong>: multiple teams, datasets &amp;gt; 10 GB, several products sharing a golden eval set, external compliance demanding batch traceability, or an institutionalised quarterly retrain cycle.&lt;/li>
&lt;/ul>
&lt;p>Adopting DVC + lakeFS before you need them is overhead. Adopting them six months late is losing six months of lineage irrecoverably.&lt;/p>
&lt;h2 id="seven-pitfalls-that-turn-data-versioning-into-theatre">Seven pitfalls that turn data versioning into theatre&lt;/h2>
&lt;ol>
&lt;li>
&lt;p>&lt;strong>Versioning the data but not the schemas.&lt;/strong> The content is versioned, the contract changes silently, the system breaks without the versioning capturing it. A Schema Registry is not optional; it is half the problem.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>The same S3 path overwritten.&lt;/strong> &amp;ldquo;Upload &lt;code>training.jsonl&lt;/code> to the bucket&amp;rdquo; and the next experiment rewrites the file. S3 versioning (if it is enabled) saves your skin, but without an immutable identifier propagated to MLflow you cannot rewind. The correct pattern: &lt;code>training_v3.jsonl&lt;/code> or &lt;code>training/2026q2/&amp;lt;sha&amp;gt;.jsonl&lt;/code>, never the same name.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>A golden eval set without a strict holdout.&lt;/strong> Without a hash check against training, the model memorises the eval and passes without having learned. It is the LLM equivalent of an exam the teacher announces in advance: everyone passes, nothing has been measured.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Not recording dataset → model lineage.&lt;/strong> When an incident requires knowing what data a certain model was trained on, the correct answer is a query to MLflow / W&amp;amp;B. If the answer is &amp;ldquo;let&amp;rsquo;s ask whoever trained it&amp;rdquo; (assuming they are still on the team), the lineage does not exist.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>DVC added six months late.&lt;/strong> Adopting versioning in month 1 = a nuisance. Adopting it in month 6 = an irrecoverable loss of six months of datasets that can no longer be reconstructed. The curse of &amp;ldquo;we&amp;rsquo;ll add it later&amp;rdquo;.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>lakeFS with branches that never get merged.&lt;/strong> Parallel branches over the corpus are useful for experimenting; kept indefinitely without merging, operations turn into a graveyard of half-updated branches. Explicit policy: merge or destroy within N weeks.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Schema validation only in production.&lt;/strong> The contract is validated when the dataset is already in production and the model already trained. By then, the incident has already happened. The validation has to be &lt;strong>in CI&lt;/strong>, before the merge, over the delta the PR introduces.&lt;/p>
&lt;/li>
&lt;/ol>
&lt;h2 id="a-datasets-cycle-on-one-screen">A dataset&amp;rsquo;s cycle on one screen&lt;/h2>
&lt;pre tabindex="0">&lt;code>┌─────────────────────────────────────────────────────────────┐
│ Producer (ingest / annotation / retrain loop) │
└────────────────┬────────────────────────────────────────────┘
│
▼ (commit a candidate version)
┌─────────────────────────┐
│ CI gates │
│ - Schema validation │
│ - Quality sampled │
│ - Holdout hash check │ ── fails → PR blocked
│ - Drift vs previous │
│ - Lineage declared │
└────────────┬────────────┘
│ passes
▼
┌─────────────────────────┐
│ DVC tag or lakeFS commit│
│ + MLflow registry │ ← immutable version
│ + Schema Registry │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ Downstream pipeline │
│ Tune / Eval / Deploy │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ Production trace │
│ → rewinds to dataset │
└─────────────────────────┘
&lt;/code>&lt;/pre>&lt;h2 id="what-we-have-not-covered">What we have not covered&lt;/h2>
&lt;p>At top level, this post leaves out:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Vector store versioning&lt;/strong> proper: an embedding index is not versioned like a raw dataset because it depends on the embedding model. Changing the embedder rewrites the whole index. It is a different animal and deserves separate treatment (recall, ANN parameters, index branching vs full re-embedding).&lt;/li>
&lt;li>&lt;strong>Standardised lineage tooling&lt;/strong> (OpenLineage, Marquez): how to emit and consume lineage events interoperably between systems.&lt;/li>
&lt;li>&lt;strong>Data quality frameworks&lt;/strong> (Great Expectations, Soda, Deequ): how to write suites of &amp;ldquo;expectations&amp;rdquo; over a dataset and enforce them on every version.&lt;/li>
&lt;li>&lt;strong>Privacy-preserving versioning&lt;/strong>: federated learning without centralising the dataset, differential privacy applied to the version that gets distributed.&lt;/li>
&lt;li>&lt;strong>Contamination between third-party golden sets&lt;/strong> (HumanEval, MMLU, etc.) and the training datasets of open models: the problem of &amp;ldquo;the model passes HumanEval because HumanEval is in its pretraining&amp;rdquo;.&lt;/li>
&lt;/ul>
&lt;p>Each one is worth a post of its own when the field justifies it.&lt;/p>
&lt;h2 id="see-also">See also&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/">The six-stage LLMOps pipeline&lt;/a> — the master map where this piece fits, the Data section.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/retrain-closing-the-loop-feedback-dataset-adapter/">Retrain: closing the loop&lt;/a> — how the enriched dataset produced by Retrain returns to Data; this post details how to version it properly.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/prompt-versioning-contract-five-word-change/">Prompt versioning with Langfuse and MLflow&lt;/a> — the other cross-cutting piece of the lineage; the &lt;code>prompt_version&lt;/code> travels alongside the &lt;code>dataset_version&lt;/code> in every trace.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/continuous-fine-tuning-production-real-traffic-deployed-adapter/">Continuous fine-tuning in production&lt;/a> — argues for a minimalist stack (Postgres + pgvector + S3) without DVC/lakeFS for small systems; this post explains when you cross the line to the other side.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">Evals for LLMs: the layer after tracing&lt;/a> — the main consumer of the golden eval set.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/mlops-for-llms-landscape-2026/">LLM-specific MLOps in 2026&lt;/a> — market context for the complete LLMOps stack.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/postgresql-qdrant-rag-ingestion-postman-syncing-two-worlds/">PostgreSQL + Qdrant for ingestion&lt;/a> — how the ingestion that precedes versioning is materialised.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/iso-42001-aims-on-premise-llm-platform/">ISO/IEC 42001: the AI system&amp;rsquo;s operations manual&lt;/a> — the versioning discipline described here materialises the five controls of Annex A.7 (data quality, acquisition, provenance, preparation) directly, with no additional work.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/eu-ai-act-technical-dossier-on-premise-llm-architecture/">EU AI Act: the technical file article by article&lt;/a> — Art. 10 (data and data governance) requires the four datasets versioned + bias analysis + lineage + representativeness. This post covers the technical mechanics; that one covers the legal obligations and the auditable checklist.&lt;/li>
&lt;/ul>
&lt;h2 id="references">References&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://dvc.org/doc">DVC documentation&lt;/a> — versioning workflows, pipelines and remotes.&lt;/li>
&lt;li>&lt;a href="https://docs.lakefs.io/">lakeFS documentation&lt;/a> — branching, merging and commits over the bucket.&lt;/li>
&lt;li>&lt;a href="https://medium.com/the-modern-scientist/reproducible-ai-versioning-models-prompts-and-data-96dd0337af65">lakeFS acquires DVC, November 2025&lt;/a> — announcement and combined roadmap.&lt;/li>
&lt;li>&lt;a href="https://docs.confluent.io/platform/current/schema-registry/index.html">Confluent Schema Registry&lt;/a> and &lt;a href="https://www.apicur.io/registry/">Apicurio&lt;/a> — schema contracts for streaming data.&lt;/li>
&lt;li>&lt;a href="https://openlineage.io/">OpenLineage&lt;/a> and &lt;a href="https://marquezproject.ai/">Marquez&lt;/a> — open standard for lineage events.&lt;/li>
&lt;li>&lt;a href="https://greatexpectations.io/">Great Expectations&lt;/a> — data quality expectations in CI.&lt;/li>
&lt;li>&lt;a href="https://mlflow.org/docs/latest/tracking.html">MLflow Tracking&lt;/a> — input datasets as first-class artefacts since MLflow 2.4.&lt;/li>
&lt;li>&lt;a href="https://www.pachyderm.com/">Pachyderm&lt;/a> and &lt;a href="https://quiltdata.com/">Quilt&lt;/a> — historical alternatives to DVC/lakeFS.&lt;/li>
&lt;li>On eval set contamination: &lt;em>&amp;ldquo;Stop Uploading Test Data in Plain Text&amp;rdquo;&lt;/em> (Magar &amp;amp; Schwartz, 2022) and later work on detecting contamination in pretraining corpora.&lt;/li>
&lt;/ul></description></item><item><title>Retrain: closing the loop between the production incident and the adapter that fixes it</title><link>https://blog.lo0.es/en/posts/retrain-closing-the-loop-feedback-dataset-adapter/</link><pubDate>Fri, 22 May 2026 07:45:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/retrain-closing-the-loop-feedback-dataset-adapter/</guid><description>&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>The &lt;strong>Retrain&lt;/strong> stage of the &lt;a href="https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/">six-stage LLMOps pipeline&lt;/a> is the one that closes the cycle. Without it, the deployed system is a project that ends; with it, it is a living practice that improves every quarter. The mechanics at the top level fit into five sequential sub-processes: capture feedback (explicit via thumbs + implicit via latency, abandonment, retries), triage incidents by root cause (model issue, retrieval issue, prompt issue, infra issue), enrich the dataset with the cases where the system failed plus the correct answer labelled by a human, decide the cadence (quarterly scheduled by default + incident-driven when a pattern crosses a threshold), and promote the candidate by taking it through Tune → Eval → Deploy with gates against the model in production. The tools the market has consolidated on in 2026: Langfuse for feedback collection in the UI, Argilla and Label Studio for human annotation of the enriched dataset, MLflow stages for promotion. The most lethal trap, and the most common, is the &lt;strong>open loop&lt;/strong>: having all the pieces but no structured channel connecting them, so the Retrain stage boils down to &amp;ldquo;we will retrain when we need to&amp;rdquo; and therefore never.&lt;/p>
&lt;h2 id="you-are-here-retrain-closes-the-cycle-back-to-data">You are here: Retrain (closes the cycle back to Data)&lt;/h2>
&lt;p>This post goes into the detail of stage 6 of the LLMOps pipeline. What follows takes apart the five Retrain sub-processes at complete top level, without descending into the internal mechanics of Tune (covered in the &lt;a href="https://blog.lo0.es/en/posts/continuous-fine-tuning-production-real-traffic-deployed-adapter/">continuous fine-tuning post&lt;/a>) or into the implementation of the eval suites (covered in the &lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">evals post&lt;/a>).&lt;/p>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 90" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="you are here: Retrain">
&lt;style>.box{stroke:#444;stroke-width:1.4;rx:6}.active{fill:#ffd24a;stroke-width:3}.idle{fill:#f4f4f4}.lbl{font:600 12px sans-serif;fill:#222}.arr{stroke:#666;stroke-width:1.4;fill:none;marker-end:url(#rtm)}.cyc{stroke:#c66;stroke-width:2;fill:none;stroke-dasharray:4 2;marker-end:url(#rtm)}&lt;/style>
&lt;defs>&lt;marker id="rtm" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#c66"/>&lt;/marker>&lt;/defs>
&lt;text x="390" y="20" text-anchor="middle" class="lbl">You are here: RETRAIN · closes the cycle from Observe to Data&lt;/text>
&lt;rect x="30" y="35" width="110" height="35" class="box idle"/>&lt;text x="85" y="58" text-anchor="middle" class="lbl">1 · Data&lt;/text>
&lt;rect x="155" y="35" width="110" height="35" class="box idle"/>&lt;text x="210" y="58" text-anchor="middle" class="lbl">2 · Tune&lt;/text>
&lt;rect x="280" y="35" width="110" height="35" class="box idle"/>&lt;text x="335" y="58" text-anchor="middle" class="lbl">3 · Eval&lt;/text>
&lt;rect x="405" y="35" width="110" height="35" class="box idle"/>&lt;text x="460" y="58" text-anchor="middle" class="lbl">4 · Deploy&lt;/text>
&lt;rect x="530" y="35" width="110" height="35" class="box idle"/>&lt;text x="585" y="58" text-anchor="middle" class="lbl">5 · Observe&lt;/text>
&lt;rect x="655" y="35" width="110" height="35" class="box active"/>&lt;text x="710" y="58" text-anchor="middle" class="lbl">6 · Retrain&lt;/text>
&lt;path class="arr" d="M140,52 L155,52"/>&lt;path class="arr" d="M265,52 L280,52"/>&lt;path class="arr" d="M390,52 L405,52"/>&lt;path class="arr" d="M515,52 L530,52"/>&lt;path class="arr" d="M640,52 L655,52"/>
&lt;path class="cyc" d="M710,72 L710,82 L85,82 L85,72"/>
&lt;/svg>
&lt;/div>
&lt;h2 id="the-master-analogy-the-hospital-mortality-committee">The master analogy: the hospital mortality committee&lt;/h2>
&lt;p>A serious hospital holds periodic &lt;strong>morbidity &amp;amp; mortality&lt;/strong> (M&amp;amp;M) meetings: the doctors review, without blame but without omitting anything, the cases where a patient died or had a serious complication. They look for root cause, identify patterns, adjust protocols, and leave a record. The committee does not meet when someone &amp;ldquo;remembers&amp;rdquo;; it is scheduled and mandatory. And when there is a catastrophic incident outside the cycle, an extraordinary M&amp;amp;M is convened within 48 h.&lt;/p>
&lt;p>The &lt;strong>Retrain&lt;/strong> stage is exactly that for an LLM system:&lt;/p>
&lt;ul>
&lt;li>The morbidity is the minor incidents: answers the user marked with a thumbs-down, sessions where they retried the same question three times, examples where the eval score dropped but not below the alert threshold.&lt;/li>
&lt;li>The mortality is the serious incidents: the system gave a dangerous answer, a key customer cancelled over a string of errors, the agent executed a tool it should not have.&lt;/li>
&lt;li>The periodic meetings are the quarterly &lt;strong>scheduled retrain&lt;/strong>: you look at the accumulated feedback, prioritise, and decide what goes into the enriched dataset for the next training run.&lt;/li>
&lt;li>The extraordinary M&amp;amp;Ms are the &lt;strong>incident-driven retrains&lt;/strong>: faced with a problematic pattern that crosses a threshold, a mini-cycle is fired off outside the cadence.&lt;/li>
&lt;/ul>
&lt;p>Without this discipline, incidents are anecdotes that get forgotten and the system does not learn.&lt;/p>
&lt;h2 id="sub-process-1--feedback-capture">Sub-process 1 — Feedback capture&lt;/h2>
&lt;p>The first link in the loop is observing what the system does badly. There are two families of feedback, and they complement each other.&lt;/p>
&lt;h3 id="explicit-feedback">Explicit feedback&lt;/h3>
&lt;p>The user tells you directly that the answer was bad. Mechanisms:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Thumbs up/down&lt;/strong> in the UI: the classic, low latency (1 click). Coverage: typically 1-5 % of traffic. Bias: users vote more when they are annoyed than when they are happy.&lt;/li>
&lt;li>&lt;strong>Annotation by power users&lt;/strong>: internal customers or experts who leave structured comments (&amp;ldquo;the answer is correct but the format does not follow our style guide&amp;rdquo;). Far lower coverage but high quality.&lt;/li>
&lt;li>&lt;strong>&amp;ldquo;What went wrong?&amp;rdquo; forms&lt;/strong> when the thumbs-down is clicked: predefined options (hallucination, format, tone, incomplete, off-topic) + optional free text. Enables automated triaging.&lt;/li>
&lt;li>&lt;strong>Re-editing&lt;/strong>: if the system writes a draft (an email, some code) and the user edits it before sending, that edit is rich feedback. The diff between what was generated and what was sent is an explicit signal of the failure.&lt;/li>
&lt;/ul>
&lt;p>All explicit feedback travels labelled with &lt;code>trace_id&lt;/code>, &lt;code>prompt_version&lt;/code>, &lt;code>model&lt;/code>, &lt;code>user_id&lt;/code> (anonymised where required), &lt;code>timestamp&lt;/code>, and enters the feedback store. Langfuse, Phoenix and LangSmith have built-in UI for this; what matters is that &lt;strong>every thumbs-down materialises as a row in a table&lt;/strong>, not as an event that gets lost.&lt;/p>
&lt;h3 id="implicit-feedback">Implicit feedback&lt;/h3>
&lt;p>The user tells you nothing but their behaviour gives the problem away. Typical signals:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Anomalous latency&lt;/strong>: the system&amp;rsquo;s TTFT was 8 s when the average is 800 ms. Indicates overload, heavy retrieval, an unexpectedly large prefill. Covered at top level in &lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">evals&lt;/a> and &lt;a href="https://blog.lo0.es/en/posts/ebpf-local-inference-statistical-drift-detection/">ebpf+drift&lt;/a>.&lt;/li>
&lt;li>&lt;strong>Abandonment rate&lt;/strong>: the user leaves the session before reading the full answer. If the ratio goes from 5 % to 15 % in one segment, something is wrong.&lt;/li>
&lt;li>&lt;strong>User retries&lt;/strong>: the user asks the same question (or a very similar one) 2-3 times. Indicates the first answer was no use to them.&lt;/li>
&lt;li>&lt;strong>Aborted sessions&lt;/strong>: the user closes the chat before the model finishes generating. In streaming, a high abort ratio is a strong indicator.&lt;/li>
&lt;li>&lt;strong>Workflow exit&lt;/strong>: in an agent, the user cancels the plan before execution. The agent&amp;rsquo;s trajectory did not convince them.&lt;/li>
&lt;li>&lt;strong>Statistical drift&lt;/strong> in the distribution of inputs or outputs (KS test, PSI, embedding-space shift). Covered at top level in &lt;a href="https://blog.lo0.es/en/posts/ebpf-local-inference-statistical-drift-detection/">eBPF + drift&lt;/a>.&lt;/li>
&lt;/ul>
&lt;p>Implicit signals are noisier but cover 100 % of traffic, not the 1-5 % of explicit feedback. Combining them with explicit feedback gives the full picture.&lt;/p>
&lt;h3 id="typical-storage-pattern">Typical storage pattern&lt;/h3>
&lt;p>All the feedback, explicit and implicit, ends up in a common table with a minimal schema:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-sql" data-lang="sql">&lt;span class="line">&lt;span class="cl">&lt;span class="k">CREATE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">TABLE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">feedback_signals&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">signal_id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">UUID&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">PRIMARY&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">KEY&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">trace_id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">UUID&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">NOT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">NULL&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">request_id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">UUID&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">NOT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">NULL&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">signal_type&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">VARCHAR&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">NOT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">NULL&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c1">-- &amp;#39;thumbs&amp;#39;, &amp;#39;retry&amp;#39;, &amp;#39;abandon&amp;#39;, &amp;#39;drift&amp;#39;, ...
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">signal_value&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">JSONB&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c1">-- feedback payload (thumbs-down text, latency, etc.)
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">prompt_id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">VARCHAR&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">prompt_version&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">INT&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">model&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">VARCHAR&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">user_segment&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">VARCHAR&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c1">-- tenant, plan, geo
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">occurred_at&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">TIMESTAMPTZ&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">NOT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">NULL&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">triaged&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">BOOLEAN&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">DEFAULT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">FALSE&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">triage_label&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">VARCHAR&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c1">-- filled in by sub-process 2
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Postgres is more than enough for reasonable volumes (millions of rows a month). Langfuse uses Postgres underneath. For high volumes you can divert to ClickHouse or BigQuery, but it is rarely worth the extra complexity.&lt;/p>
&lt;h2 id="sub-process-2--triage-by-root-cause">Sub-process 2 — Triage by root cause&lt;/h2>
&lt;p>Having feedback is not enough. You have to categorise each incident by its root cause before deciding what to do with it. Without triage, the enriched dataset is a junk drawer and the next retrain fixes nothing in particular.&lt;/p>
&lt;p>The four canonical categories:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Category&lt;/th>
&lt;th>Means&lt;/th>
&lt;th>Typical action&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>Model issue&lt;/strong>&lt;/td>
&lt;td>The model answered badly to something that was within its theoretical capability.&lt;/td>
&lt;td>Candidate case for the enriched dataset for the next Tune.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Retrieval issue&lt;/strong>&lt;/td>
&lt;td>The RAG did not retrieve the right context. The model answered reasonably from poor context.&lt;/td>
&lt;td>Adjust reranker, chunking, indexing — the Data stage, not Tune.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Prompt issue&lt;/strong>&lt;/td>
&lt;td>The system prompt does not cover the case, or covers it badly.&lt;/td>
&lt;td>New version of the prompt (the cross-cutting stage of &lt;a href="https://blog.lo0.es/en/posts/prompt-versioning-contract-five-word-change/">prompt versioning&lt;/a>).&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Infra issue&lt;/strong>&lt;/td>
&lt;td>Latency, timeout, 5xx error, overload.&lt;/td>
&lt;td>Adjust capacity / autoscaler — the Deploy stage.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Triage can be done:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Manually&lt;/strong>: a human (typically: the MLE team / data scientist) reviews the feedback in the Langfuse / Phoenix / LangSmith UI, looks at the complete trace, labels it. Cost: 2-5 min per incident. Sustainable up to around 50-100 incidents/week per person.&lt;/li>
&lt;li>&lt;strong>Assisted by LLM-as-classifier&lt;/strong>: an LLM classifies the incident into one of the four categories with a structured prompt. 80-90 % coverage automated, the rest escalated to a human. State of the art in 2026: GPT-5, Claude 4, Llama 3 70B-instruct with a careful prompt give F1 &amp;gt; 0.85 against calibrated internal rubrics.&lt;/li>
&lt;li>&lt;strong>Heuristic rules for the obvious ones&lt;/strong>: a 5xx error is always infra; latency &amp;gt; 5σ is always infra; a thumbs-down over RAG with &lt;code>context_relevance &amp;lt; 0.3&lt;/code> is retrieval. Captures 30-50 % of the volume at zero cost.&lt;/li>
&lt;/ul>
&lt;p>The productive pattern is: &lt;strong>rules → LLM classifier → human&lt;/strong>, cascaded, escalating only what the previous level does not resolve with confidence.&lt;/p>
&lt;pre tabindex="0">&lt;code>New feedback
│
▼
[heuristic rules]
│
├── high confidence → automatic label
│
▼ (rest)
[LLM-as-classifier]
│
├── high confidence → suggested label
│
▼ (rest, or disagreement with the rules)
[human review]
│
└── final label → feedback_signals.triage_label
&lt;/code>&lt;/pre>&lt;h2 id="sub-process-3--dataset-enrichment">Sub-process 3 — Dataset enrichment&lt;/h2>
&lt;p>Once the incidents are triaged with a &lt;code>model issue&lt;/code> label, those cases are candidates to enter the enriched dataset that will feed the next Tune. But they do not go in as they are: you need &lt;strong>the correct answer labelled by a human&lt;/strong>.&lt;/p>
&lt;h3 id="how-an-enriched-case-is-built">How an enriched case is built&lt;/h3>
&lt;p>Each enriched case is a minimal tuple:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-yaml" data-lang="yaml">&lt;span class="line">&lt;span class="cl">&lt;span class="nt">case_id&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">enrich-2026-05-22-0142&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">source_trace_id&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">trace-xyz&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">prompt_input&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">system&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;You are a support assistant...&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">user&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;I cancelled my order on Tuesday but I can still see the charge&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">prompt_version_at_failure&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">customer_support_v3@v2&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">model_at_failure&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">llama-3-70b-instruct&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">failure_response&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;Sorry for the inconvenience. The charge should be reversed within 5-7 business days.&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">human_corrected_response&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;Sorry for the inconvenience. I have checked your account and I can see the refund was processed on Wednesday. It will show in your account within a further 24-48 h depending on your bank. Here is the refund ID: ABC123.&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">labeler&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;support_agent_M3&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">labeled_at&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;2026-05-22T09:30:00Z&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">quality_score&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">4&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># 1-5, eval by a second human before promoting to the dataset&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">notes&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;The model gave a generic answer without checking the real state of the refund. It needs the account_lookup tool.&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>What matters is that the enriched case has enough context to be reproduced: original prompt, prompt version, model, failed answer, correct answer. Without this, the case is a loose data point, useless for training.&lt;/p>
&lt;h3 id="annotation-tools">Annotation tools&lt;/h3>
&lt;p>Three dominant options in 2026:&lt;/p>
&lt;p>&lt;a href="https://argilla.io/">Argilla&lt;/a> (OSS, maintained by Hugging Face since 2024). Designed specifically for LLM datasets: annotation of (input, output) pairs, preference data (DPO/RLHF), instruction tuning. Python-friendly UI. Native integration with HuggingFace datasets and with MLflow.&lt;/p>
&lt;p>&lt;a href="https://labelstud.io/">Label Studio&lt;/a> (OSS from Heartex). More generalist, also works for LLM. Rich, configurable, multi-modal UI. Better when the team already uses it for other tasks.&lt;/p>
&lt;p>Langfuse built-in UI. Lets you annotate existing traces directly with thumbs + text + categorical labels. Useful for lightweight feedback; for building serious preference or instruction tuning datasets, Argilla and Label Studio are a better fit.&lt;/p>
&lt;p>Typical pattern: Langfuse for traffic feedback + Argilla to build the formal enriched dataset that goes into the Tune pipeline. The traces marked as candidates in Langfuse are exported periodically to Argilla, where a human produces the correct answer and validates quality.&lt;/p>
&lt;h3 id="quality-validation-before-promoting">Quality validation before promoting&lt;/h3>
&lt;p>Not every annotated case enters the dataset. Good discipline requires:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Double annotation&lt;/strong> on at least 10-20 % of the critical cases (two independent annotators; if they disagree, a third resolves it).&lt;/li>
&lt;li>&lt;strong>Quality score&lt;/strong> per case (1-5 or equivalent): only cases with a score ≥ 4 enter the dataset.&lt;/li>
&lt;li>&lt;strong>Dataset versioning&lt;/strong> with &lt;a href="https://blog.lo0.es/en/posts/data-versioning-llmops-dvc-lakefs-reproducible-golden-dataset/">DVC + lakeFS&lt;/a> or equivalent, just like the rest of the Data stage datasets.&lt;/li>
&lt;li>&lt;strong>Reserved holdout&lt;/strong>: a portion of the enriched dataset is set aside to evaluate the retrained adapter, without it entering training. If the dataset is enriched with cases where the model failed and the same dataset is used to evaluate, you are measuring memorisation, not learning.&lt;/li>
&lt;/ul>
&lt;h2 id="sub-process-4--cadences-scheduled-vs-incident-driven">Sub-process 4 — Cadences: scheduled vs incident-driven&lt;/h2>
&lt;p>Once enriched dataset accumulates, it remains to decide when the retrain is launched. There are two complementary cadences.&lt;/p>
&lt;h3 id="scheduled-retrain-quarterly-by-default">Scheduled retrain (quarterly by default)&lt;/h3>
&lt;p>A process fixed in the calendar. Every quarter, in a specific week, the team:&lt;/p>
&lt;ol>
&lt;li>Closes the accumulated feedback capture cycle.&lt;/li>
&lt;li>Counts the enriched cases available (typically tens to hundreds per quarter).&lt;/li>
&lt;li>Launches the fine-tuning pipeline with the aggregated dataset (golden dataset + the quarter&amp;rsquo;s enriched cases).&lt;/li>
&lt;li>Evaluates the candidate against the full suite + the enriched holdout.&lt;/li>
&lt;li>Promotes it if it passes the eval gates.&lt;/li>
&lt;/ol>
&lt;p>Advantages: predictable capacity planning, a closed budget, controlled risk, a team that is not burnt out. The default.&lt;/p>
&lt;h3 id="incident-driven-retrain">Incident-driven retrain&lt;/h3>
&lt;p>When a serious incident crosses a threshold, a mini-cycle fires off outside the cadence. Typical triggers:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Drift detected&lt;/strong> in the input/output distribution over threshold (KS p-value &amp;lt; 0.01, PSI &amp;gt; 0.25, embedding-space shift &amp;gt; 2σ).&lt;/li>
&lt;li>&lt;strong>A failing segment&lt;/strong>: a cluster of users or a type of question shows a 3× error rate over baseline for &amp;gt; 48 h.&lt;/li>
&lt;li>&lt;strong>A successful prompt injection or jailbreak attack&lt;/strong> that crosses the severity threshold (covered in &lt;a href="https://blog.lo0.es/en/posts/llm-guardrails-safety-four-lines-of-defence/">guardrails&lt;/a>).&lt;/li>
&lt;li>&lt;strong>External domain change&lt;/strong>: the customer changes policy, a new regulation comes out, and so on. The model trained against the old version stops being valid.&lt;/li>
&lt;/ul>
&lt;p>A typical mini-cycle: feedback from the last 7-14 days, a dataset focused on the problematic segment, fast fine-tuning on top of the existing adapter (not a full retrain), a segment-specific eval gate, canary deployment, promotion if it passes.&lt;/p>
&lt;p>Cost: around 3-7 days of team work depending on severity. &lt;strong>It is not optional for critical cases&lt;/strong>: if the failing segment is regulatory or reputational, the cost of not responding quickly is far higher than that of the mini-cycle.&lt;/p>
&lt;h3 id="anti-pattern-we-will-retrain-when-we-need-to">Anti-pattern: &amp;ldquo;we will retrain when we need to&amp;rdquo;&lt;/h3>
&lt;p>The most lethal phrase in LLMOps. Without explicit scheduling, the scheduled retrain never arrives; without explicit thresholds, the incident-driven one never fires either. The system accumulates silent debt until a catastrophic incident forces a retrain that is already late.&lt;/p>
&lt;p>The minimum discipline: a date in the calendar for the next scheduled run + 3-5 explicit incident-driven thresholds in writing. Without this, the Retrain stage is theatre.&lt;/p>
&lt;h2 id="sub-process-5--promotion-the-candidate-enters-production">Sub-process 5 — Promotion: the candidate enters production&lt;/h2>
&lt;p>Once the candidate adapter exists, it does not go straight into production. It goes through the same flow as any release: Tune → Eval → Deploy with gates.&lt;/p>
&lt;pre tabindex="0">&lt;code>Candidate adapter (from Tune)
│
▼
[full eval suite]
- historical golden dataset
- the quarter&amp;#39;s enriched holdout
- regression vs production
│
passes? → no → block + alert
│
yes
▼
[non-regression eval gate]
- make sure it does not degrade
segments that already worked
│
passes? → no → block + alert
│
yes
▼
[canary deployment]
- 5-10% of traffic to the new
adapter for 24-72 h
- online metrics vs production
│
metrics OK? → no → rollback
│
yes
▼
[full promotion]
- move the label in the model registry
- MLflow stages: Staging → Production
- The previous one goes to Archived (preserves
historical reproducibility)
&lt;/code>&lt;/pre>&lt;p>The registry tools:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>MLflow Model Registry stages&lt;/strong> (Staging, Production, Archived) is the canonical pattern. Promotion is an API call: &lt;code>mlflow.models.transition_stage(name, version, &amp;quot;Production&amp;quot;)&lt;/code>. Audited, revertible.&lt;/li>
&lt;li>&lt;strong>A private Hugging Face Hub&lt;/strong> with a repo per adapter is the &amp;ldquo;Git for models&amp;rdquo; equivalent: versioned by commit hash, branches for staging/production, deploy via PR.&lt;/li>
&lt;li>&lt;strong>vLLM multi-LoRA hot-swap&lt;/strong> (described in &lt;a href="https://blog.lo0.es/en/posts/continuous-fine-tuning-production-real-traffic-deployed-adapter/">continuous fine-tuning&lt;/a>) loads the new adapter without restarting the server, so the physical promotion takes seconds.&lt;/li>
&lt;/ul>
&lt;h2 id="applied-to-typical-on-premise-hardware">Applied to typical on-premise hardware&lt;/h2>
&lt;p>Retrain as a stage does not need big hardware. The calculation:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Feedback collection&lt;/strong>: a small table in Postgres. Trivial on any node.&lt;/li>
&lt;li>&lt;strong>Manual / assisted triage&lt;/strong>: the LLM-as-classifier runs on the same inference engine that serves production, during low-demand hours, at spot priority. Tens of thousands of incidents a month consume on the order of minutes of GPU per day.&lt;/li>
&lt;li>&lt;strong>Dataset enrichment&lt;/strong>: human annotation, no GPU cost. Negligible storage.&lt;/li>
&lt;li>&lt;strong>Tune (mini-cycle or quarterly)&lt;/strong>: here there is a cost. Fine-tuning a LoRA adapter over Llama 3 70B with a dataset of a few thousand examples costs on the order of 2-8 hours on a single H100. On 4 H100s with tensor parallel: 30-90 min. It fits comfortably into any low-demand overnight window.&lt;/li>
&lt;li>&lt;strong>Full eval suite&lt;/strong>: minutes on an engine with prefix caching active (covered in &lt;a href="https://blog.lo0.es/en/posts/pagedattention-vllm-block-manager/">pagedattention deep-dive&lt;/a>).&lt;/li>
&lt;li>&lt;strong>Canary deployment&lt;/strong>: zero additional cost, since the new adapter coexists in the same engine via multi-LoRA hot-swap.&lt;/li>
&lt;/ul>
&lt;p>For an &lt;strong>RTX 4090&lt;/strong> serving Llama 3 8B with a small team: a monthly or quarterly scheduled retrain overnight, an enriched dataset of 50-100 cases per cycle, annotation with self-hosted Argilla on the same node. Plenty.&lt;/p>
&lt;p>For a &lt;strong>4×H100 SXM cluster&lt;/strong> serving several tenants: an enriched dataset segregated by tenant (each with its own holdout and eval suite), a retrain pipeline orchestrated with Argo Workflows or equivalent, a centralised MLflow registry, multi-LoRA hot-swap per tenant.&lt;/p>
&lt;h2 id="common-operational-traps">Common operational traps&lt;/h2>
&lt;p>&lt;strong>The open loop.&lt;/strong> The system captures feedback, saves it to a table, and there it dies. Nobody triages, nobody enriches, nobody retrains. The deployed model ages silently. Fix: an explicit internal SLO (for example, &amp;ldquo;any feedback more than a week old without triage gets reported in standup&amp;rdquo;), with an assigned owner.&lt;/p>
&lt;p>&lt;strong>Human feedback that gets lost.&lt;/strong> Thumbs-downs with no structured capture (the event is logged but the reason is not), or the reason is logged but nobody indexes it for queries. Fix: an explicit schema like the one above, a weekly dashboard of &amp;ldquo;top thumbs-down reasons&amp;rdquo;.&lt;/p>
&lt;p>&lt;strong>Undefined cadence.&lt;/strong> &amp;ldquo;We will retrain when we need to&amp;rdquo; — never. Fix: a date in the calendar + 3-5 written thresholds.&lt;/p>
&lt;p>&lt;strong>No holdout test set.&lt;/strong> The enriched dataset is mixed with the golden dataset both to train AND to evaluate. The adapter looks like it improved because it &amp;ldquo;memorised&amp;rdquo; the enriched cases, but it generalises badly to new similar cases. Fix: a holdout reserved before training; the eval against the holdout is the metric that decides promotion.&lt;/p>
&lt;p>&lt;strong>Ad-hoc triage by one person.&lt;/strong> The senior data scientist triages when they can; while they are on holiday it piles up; they come back and give up because there are 400 incidents waiting. Fix: automate 70-80 % with an LLM-as-classifier, leave only the hard part to a human; rotate the &amp;ldquo;triage oncall&amp;rdquo; so one person does not get saturated.&lt;/p>
&lt;p>&lt;strong>Promotion without canary.&lt;/strong> The adapter passes the offline eval and is deployed to 100 % directly. A regression in production takes a while to be detected, until the online metrics show it, and by then the damage is done. Fix: a mandatory 5-10 % canary for 24-72 h.&lt;/p>
&lt;p>&lt;strong>No reproducibility of the original incident.&lt;/strong> The team goes to investigate why the model failed in the 22 May incident and discovers the prompt was different (it was changed two weeks ago), the model was too, and the logs did not keep the RAG context. Fix: strong traceability (covered in &lt;a href="https://blog.lo0.es/en/posts/prompt-versioning-contract-five-word-change/">prompt versioning&lt;/a> and &lt;a href="https://blog.lo0.es/en/posts/mcp-deep-observability-opentelemetry/">MCP observability&lt;/a>). Without reproducibility, retrain is guesswork.&lt;/p>
&lt;p>&lt;strong>The enriched dataset contaminates the Eval data.&lt;/strong> The team confuses &amp;ldquo;cases where it failed&amp;rdquo; (which go into the enriched training set) with &amp;ldquo;the golden regression dataset&amp;rdquo; (which has to stay stable to detect drift). Mixing them invalidates the eval. Fix: two different datasets, two different routes.&lt;/p>
&lt;h2 id="recommended-operational-pattern-the-quarterly-cycle-on-one-screen">Recommended operational pattern: the quarterly cycle on one screen&lt;/h2>
&lt;p>A serious team with Retrain properly implemented has this flow every 3 months:&lt;/p>
&lt;p>&lt;strong>Week 1 (cycle close)&lt;/strong>: new capture is frozen for the cycle, a snapshot is taken of the accumulated feedback. Automated report: how many thumbs-downs, how many incidents triaged, the distribution by category, top patterns.&lt;/p>
&lt;p>&lt;strong>Week 2 (triage and annotation)&lt;/strong>: the MLE team plus annotators process the untriaged &lt;code>model issue&lt;/code> cases. Human annotation in Argilla. Cross-validation on samples.&lt;/p>
&lt;p>&lt;strong>Week 3 (training and eval)&lt;/strong>: the pipeline is launched with dataset = golden + this_quarter&amp;rsquo;s_enriched - holdout. Fine-tuning the adapter overnight. Eval against the full suite + holdout. If it passes the gates, candidate &lt;code>v_new&lt;/code>.&lt;/p>
&lt;p>&lt;strong>Week 4 (canary and promotion)&lt;/strong>: deploy the candidate as an alternative adapter in vLLM, route 5-10 % of traffic to the candidate for 48-72 h. Online metrics: latency, complaint rate, implicit eval in production. If everything is OK, full promotion; if not, rollback and analysis.&lt;/p>
&lt;p>&lt;strong>Week 5+ (next cycle)&lt;/strong>: the &lt;code>v_new&lt;/code> adapter is now &lt;code>production&lt;/code>. Feedback capture for the next quarter begins. The previous &lt;code>v_old&lt;/code> goes to &lt;code>Archived&lt;/code> but stays accessible for historical reproducibility.&lt;/p>
&lt;p>Quarterly, that cycle plus whatever incident-driven mini-cycles show up in between. Operational, predictable, auditable.&lt;/p>
&lt;h2 id="what-we-have-not-covered-upcoming-posts">What we have not covered (upcoming posts)&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Online DPO and continuous on-policy learning&lt;/strong>: how the cycle shortens to hours or days (Fast-Slow Chasing, iterative RLOO). 2026 state of the art, still emerging in production.&lt;/li>
&lt;li>&lt;strong>Machine unlearning for GDPR&lt;/strong>: when a user exercises the right to be forgotten and their interactions formed part of the enriched dataset of an adapter in production. Negative LoRA, selective retraining.&lt;/li>
&lt;li>&lt;strong>Constitutional AI runtime&lt;/strong>: continuous alignment that replaces or complements periodic retraining.&lt;/li>
&lt;li>&lt;strong>Eval gates with metamorphic testing&lt;/strong>: evaluating robustness against input perturbations (typos, paraphrasing, language) as part of the promotion gate.&lt;/li>
&lt;/ul>
&lt;h2 id="see-also">See also&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/">The six-stage LLMOps pipeline&lt;/a> — the master map where Retrain is stage 6. This post goes into the detail of that box.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/continuous-fine-tuning-production-real-traffic-deployed-adapter/">Continuous fine-tuning in production&lt;/a> — the Tune mechanics that produce the new adapter of the cycle described here.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">Evals: the layer after tracing&lt;/a> — the eval suites that act as the gate in promotion sub-process 5.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/prompt-versioning-contract-five-word-change/">Prompt versioning with Langfuse and MLflow Prompts&lt;/a> — the cross-cutting component that guarantees reproducibility of the original incident when it comes to be triaged.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/data-versioning-llmops-dvc-lakefs-reproducible-golden-dataset/">Data versioning for LLMOps: DVC, lakeFS and a reproducible golden dataset&lt;/a> — Retrain sub-process 3 enriches a dataset; this post goes into the detail of how to version it, its schema and its lineage.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/ebpf-local-inference-statistical-drift-detection/">eBPF in local inference and statistical drift detection&lt;/a> — the drift signals that fire the incident-driven retrain.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/llm-guardrails-safety-four-lines-of-defence/">Guardrails and safety in LLMs&lt;/a> — the safety / jailbreak incidents that also fire an incident-driven retrain.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/mcp-deep-observability-opentelemetry/">MCP from the inside and its deep observability&lt;/a> — the OTel &lt;code>gen_ai.*&lt;/code> tracing that ties each piece of feedback to its complete trace, a necessary condition for triaging well.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/modern-alignment-dpo-kto-orpo-simpo/">Modern alignment: DPO, KTO, ORPO and SimPO&lt;/a> — the methods that consume the enriched dataset of sub-process 3 to produce the new adapter. KTO fits directly with binary 👍/👎 feedback; DPO with regenerate-as-rejected.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/llm-as-judge-exam-marker-not-oracle/">LLM-as-judge: the exam marker&lt;/a> — the mechanism that automates the triaging and prioritisation of sub-process 1 (incident classification) without depending on complete human labelling.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/multi-lora-serving-shared-base-concurrent-adapters-sgmv-kernel/">Multi-LoRA serving: the single translator with a thousand glossaries&lt;/a> — the last mile of the cycle: the adapter produced by retraining is served with SGMV/S-LoRA alongside the other N-1 concurrent adapters without touching the base or restarting the server.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/iso-42001-aims-on-premise-llm-platform/">ISO/IEC 42001: the AI system&amp;rsquo;s operations manual&lt;/a> — the incident-driven retrain loop described here materialises clause 10 (improvement) of the AIMS: severity HIGH incidents → non-conformity → root cause → correction → documented verification of effectiveness.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/eu-ai-act-technical-dossier-on-premise-llm-architecture/">EU AI Act: the technical file article by article&lt;/a> — the incident-driven loop is the operational piece that closes Arts. 72 (post-market monitoring) and 73 (reporting of serious incidents within legal deadlines of 2-15 days); without it, the Regulation&amp;rsquo;s deadlines are unreachable.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/canary-blue-green-shadow-llm-models/">Canary, blue-green and shadow for LLM models&lt;/a> — the adapter produced by Retrain sub-process 4 enters the cluster through the progressive rollout; without a canary, an incident-driven correction can introduce a regression that passes the offline gates but not the real-traffic ones.&lt;/li>
&lt;/ul>
&lt;h2 id="references">References&lt;/h2>
&lt;ul>
&lt;li>Argilla documentation, &lt;em>Building Datasets for LLM Fine-Tuning&lt;/em>: &lt;a href="https://argilla.io/docs">https://argilla.io/docs&lt;/a>.&lt;/li>
&lt;li>Label Studio documentation, &lt;em>LLM Annotation&lt;/em>: &lt;a href="https://labelstud.io/templates/llm">https://labelstud.io/templates/llm&lt;/a>.&lt;/li>
&lt;li>Langfuse documentation, &lt;em>User Feedback and Dataset Management&lt;/em>: &lt;a href="https://langfuse.com/docs/scores/user-feedback">https://langfuse.com/docs/scores/user-feedback&lt;/a>.&lt;/li>
&lt;li>MLflow Model Registry stages: &lt;a href="https://mlflow.org/docs/latest/model-registry.html">https://mlflow.org/docs/latest/model-registry.html&lt;/a>.&lt;/li>
&lt;li>Ethayarajh et al., &lt;em>KTO: Model Alignment as Prospect Theoretic Optimization&lt;/em> (2024) — reference for the feedback cycle as an alignment signal.&lt;/li>
&lt;li>Google Cloud, &lt;em>Continuous Training and MLOps for GenAI&lt;/em> (2025).&lt;/li>
&lt;li>DataRobot, &lt;em>MLOps Best Practices: Closing the Loop&lt;/em> (2025).&lt;/li>
&lt;li>Eugene Yan, &lt;em>Feedback Loops in LLM Systems&lt;/em> (blog, 2025).&lt;/li>
&lt;/ul></description></item><item><title>Prompt versioning: the contract that stops a five-word change sinking your system</title><link>https://blog.lo0.es/en/posts/prompt-versioning-contract-five-word-change/</link><pubDate>Fri, 22 May 2026 07:30:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/prompt-versioning-contract-five-word-change/</guid><description>&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>In a classic software system, the most dangerous line a team can change is a SQL migration. In an LLM system, it is a line of prompt. The prompt determines the output as much as the model or more, it does not show up in unit tests, it does not appear in the logs by default, and if it is changed without leaving a trail there is no way to know which version generated which response. &lt;strong>Prompt versioning is the discipline that turns the prompt into a first-class artefact&lt;/strong>: with a unique identifier, history, deployment labels, an associated eval suite, and per-request traceability. The field has settled on three primitives (immutable version, mutable label, read cache) and two dominant tools (Langfuse OSS with a built-in UI, MLflow Prompts integrated into the registry since MLflow 3.10). This article covers the pattern at first level: why it matters, how it is implemented, which tool to choose, and how it fits with Eval, Deploy and Observe.&lt;/p>
&lt;h2 id="you-are-here-cross-cutting-touches-data-tune-eval-deploy-and-observe">You are here: cross-cutting (touches Data, Tune, Eval, Deploy and Observe)&lt;/h2>
&lt;p>Prompt versioning does not live in one stage, it &lt;strong>cuts across five&lt;/strong>. It appears as a cross-cutting component in the master map of the &lt;a href="https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/">six-stage LLMOps pipeline&lt;/a> precisely for that reason: the prompt version is necessary metadata at every stage, not the responsibility of a single one.&lt;/p>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 130" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="you are here: cross-cutting prompt versioning">
&lt;style>.box{stroke:#444;stroke-width:1.4;rx:6}.cross{fill:#ffe9d6;stroke-width:3;stroke:#c66;rx:6}.idle{fill:#f4f4f4}.lbl{font:600 12px sans-serif;fill:#222}.sm{font:11px sans-serif;fill:#444}.arr{stroke:#666;stroke-width:1.4;fill:none;marker-end:url(#pvm)}.cyc{stroke:#888;stroke-width:1.2;fill:none;stroke-dasharray:4 2;marker-end:url(#pvm)}&lt;/style>
&lt;defs>&lt;marker id="pvm" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#666"/>&lt;/marker>&lt;/defs>
&lt;text x="390" y="20" text-anchor="middle" class="lbl">You are here: CROSS-CUTTING · prompt versioning cuts across every active stage&lt;/text>
&lt;rect x="30" y="35" width="110" height="35" class="box idle"/>&lt;text x="85" y="58" text-anchor="middle" class="lbl">1 · Data&lt;/text>
&lt;rect x="155" y="35" width="110" height="35" class="box idle"/>&lt;text x="210" y="58" text-anchor="middle" class="lbl">2 · Tune&lt;/text>
&lt;rect x="280" y="35" width="110" height="35" class="box idle"/>&lt;text x="335" y="58" text-anchor="middle" class="lbl">3 · Eval&lt;/text>
&lt;rect x="405" y="35" width="110" height="35" class="box idle"/>&lt;text x="460" y="58" text-anchor="middle" class="lbl">4 · Deploy&lt;/text>
&lt;rect x="530" y="35" width="110" height="35" class="box idle"/>&lt;text x="585" y="58" text-anchor="middle" class="lbl">5 · Observe&lt;/text>
&lt;rect x="655" y="35" width="110" height="35" class="box idle"/>&lt;text x="710" y="58" text-anchor="middle" class="lbl">6 · Retrain&lt;/text>
&lt;path class="arr" d="M140,52 L155,52"/>&lt;path class="arr" d="M265,52 L280,52"/>&lt;path class="arr" d="M390,52 L405,52"/>&lt;path class="arr" d="M515,52 L530,52"/>&lt;path class="arr" d="M640,52 L655,52"/>
&lt;path class="cyc" d="M710,72 L710,82 L85,82 L85,72"/>
&lt;rect x="30" y="95" width="735" height="25" class="cross"/>
&lt;text x="397" y="112" text-anchor="middle" class="sm">Prompt registry (Langfuse / MLflow Prompts) · versioning · labels · cache · trace per request&lt;/text>
&lt;/svg>
&lt;/div>
&lt;h2 id="the-master-analogy-the-prompt-is-an-invisible-sql-migration">The master analogy: the prompt is an invisible SQL migration&lt;/h2>
&lt;p>A serious backend team would never accept someone modifying a column directly in production without going through a versioned migration. Even if the change &amp;ldquo;works&amp;rdquo; at the time, without a migration there is no way to:&lt;/p>
&lt;ul>
&lt;li>Reproduce the previous state if something fails.&lt;/li>
&lt;li>Know who applied the change and when.&lt;/li>
&lt;li>Apply the same change in staging before prod.&lt;/li>
&lt;li>Test the new version against an automated suite before promoting.&lt;/li>
&lt;li>Know, two months later, why the table has the shape it has.&lt;/li>
&lt;/ul>
&lt;p>The LLM prompt occupies exactly that position in an inference system. Changing &lt;code>&amp;quot;You are a helpful assistant.&amp;quot;&lt;/code> to &lt;code>&amp;quot;You are a helpful, concise assistant. Answer in fewer than 3 sentences.&amp;quot;&lt;/code> can:&lt;/p>
&lt;ul>
&lt;li>Cut the average cost per response by 30 % (the responses are shorter).&lt;/li>
&lt;li>Or degrade quality in a segment where concision breaks necessary nuance.&lt;/li>
&lt;li>Or change the distribution of tools the agent decides to invoke.&lt;/li>
&lt;li>Or alter the behaviour of the downstream LLM judge that assumes a certain length.&lt;/li>
&lt;/ul>
&lt;p>And most importantly: if the change is made by &lt;strong>editing a constant in the app code and deploying&lt;/strong>, when two weeks later someone asks &lt;em>&amp;ldquo;why did the complaint rate go up in the finance segment?&amp;rdquo;&lt;/em>, &lt;strong>there is no way to know which prompt was being served at each moment&lt;/strong>. The logs store the response and, with luck, the model invoked; the prompt is rarely stored explicitly.&lt;/p>
&lt;p>Prompt versioning solves the same problem Flyway/Liquibase/Alembic solved for SQL: turning an invisible change into an auditable artefact.&lt;/p>
&lt;h2 id="the-three-primitives-of-the-pattern">The three primitives of the pattern&lt;/h2>
&lt;p>Whatever the tool, the systems that work in 2026 share three operational primitives worth fixing before looking at products.&lt;/p>
&lt;h3 id="1-immutable-version">1. Immutable version&lt;/h3>
&lt;p>Every time the prompt content changes (template, system message, available variables, recommended model parameters such as temperature), &lt;strong>a new version&lt;/strong> is generated with a unique identifier. The version is &lt;strong>immutable&lt;/strong>: once created, it is not overwritten; if something needs changing, v+1 is created.&lt;/p>
&lt;pre tabindex="0">&lt;code>prompt_id: customer_support_v3
versions:
v1 (2026-03-12): &amp;#34;Eres un asistente de soporte...&amp;#34;
v2 (2026-04-08): &amp;#34;Eres un asistente de soporte... formato JSON...&amp;#34;
v3 (2026-05-21): &amp;#34;Eres un asistente de soporte... formato JSON... 3 frases máx...&amp;#34;
&lt;/code>&lt;/pre>&lt;p>Immutability is what allows a trace from two months ago to be reproduced: if the trace says &amp;ldquo;&lt;code>customer_support_v3@v2&lt;/code> was served&amp;rdquo;, version v2 exists &lt;strong>literally&lt;/strong> and can be reloaded.&lt;/p>
&lt;h3 id="2-mutable-label-deployment-alias">2. Mutable label (deployment alias)&lt;/h3>
&lt;p>Versions are immutable, but &lt;strong>which version is in production changes&lt;/strong>. That decision is materialised in &lt;strong>labels&lt;/strong>: pointers with a semantic name (&lt;code>production&lt;/code>, &lt;code>staging&lt;/code>, &lt;code>canary&lt;/code>) that point at a specific version and can be re-pointed.&lt;/p>
&lt;pre tabindex="0">&lt;code>prompt_id: customer_support_v3
labels:
production → v2 (servida al 100% del tráfico)
canary → v3 (servida al 5% del tráfico via gateway)
staging → v3
&lt;/code>&lt;/pre>&lt;p>Promoting a version is &lt;strong>moving a label&lt;/strong>, not editing the prompt. Rollback is &lt;strong>moving the label back&lt;/strong>, not copying text. The operation reduces to an atomic mutation of a &lt;code>(label, version)&lt;/code> tuple.&lt;/p>
&lt;h3 id="3-read-cache">3. Read cache&lt;/h3>
&lt;p>The prompt is read on &lt;strong>every request to the model&lt;/strong>. If every read calls the prompt registry service, you add latency and a dependency. The standard solution is a &lt;strong>local cache&lt;/strong> in the client (TTL on the order of minutes) that invalidates when the label changes or when the TTL expires.&lt;/p>
&lt;p>Langfuse implements a native client cache with configurable TTL and lazy invalidation; MLflow Prompts leaves the responsibility to the client or to a gateway layer. In both cases, in production the client serves the prompt from memory with negligible overhead (&amp;lt;1 ms), and only goes to the registry when it refreshes.&lt;/p>
&lt;pre tabindex="0">&lt;code>┌──────────────────┐
│ Client (app) │
│ - local cache TTL=60s
│ - lookup label &amp;#34;production&amp;#34;
│ - gets template
│ - renders variables
│ - sends to LLM
└─────────┬────────┘
│ (when the TTL expires or a change event arrives)
▼
┌──────────────────┐
│ Prompt registry │
│ - Langfuse / MLflow
│ - GET label=&amp;#34;production&amp;#34;
│ - response: version_id + template
└──────────────────┘
&lt;/code>&lt;/pre>&lt;p>With these three primitives, &lt;strong>any reasonable tool is equivalent&lt;/strong> in the essentials. What distinguishes one from another is UI, integrations, RBAC, eval integration, and so on.&lt;/p>
&lt;h2 id="the-two-dominant-tools-in-2026">The two dominant tools in 2026&lt;/h2>
&lt;p>The field has converged on two main options. Any serious production deployment uses one of the two (sometimes both, for different teams).&lt;/p>
&lt;h3 id="langfuse-oss-prompt-management-ui-built-in">Langfuse (OSS, prompt-management UI built in)&lt;/h3>
&lt;p>Langfuse is the &lt;strong>prompt-first&lt;/strong> system: it was born for tracing and observability, and prompt management is one of its core layers. Key features for versioning:&lt;/p>
&lt;ul>
&lt;li>Built-in UI to create, edit and version prompts. Versions are generated automatically on save; the history is visible and diffable.&lt;/li>
&lt;li>Arbitrary labels beyond the usual ones (&lt;code>production&lt;/code>, &lt;code>latest&lt;/code>). You can define &lt;code>eu-prod&lt;/code>, &lt;code>internal-only&lt;/code>, &lt;code>customer-a&lt;/code> for fine-grained routing.&lt;/li>
&lt;li>Native client cache in the official SDKs (Python, JS), with configurable TTL, event-driven invalidation and fallback to the last-known-good if the registry is down.&lt;/li>
&lt;li>Native tracing integration: when you record a call to the LLM, Langfuse automatically associates the &lt;code>prompt_id@version&lt;/code> that served it. In the UI you see: this trace, this span, this prompt version X.&lt;/li>
&lt;li>Eval integration: Langfuse lets you register eval suites that fire when a new prompt version is created. The results stay linked to the &lt;code>prompt_id@version&lt;/code> and are the natural gating for promoting &lt;code>staging → production&lt;/code>.&lt;/li>
&lt;li>Self-hosted or cloud: the core is OSS (MIT), runs on Docker compose or Helm; the cloud version adds SLA, SSO and support.&lt;/li>
&lt;/ul>
&lt;p>When Langfuse suits:&lt;/p>
&lt;ul>
&lt;li>Teams that want a rich UI so product/PM/analyst can manage prompts without touching code.&lt;/li>
&lt;li>OSS-first deployments where control of the runtime and of persistence is a requirement (on-premise, ENS).&lt;/li>
&lt;li>When LLM observability is already in Langfuse: prompt management is marginal in setup.&lt;/li>
&lt;/ul>
&lt;h3 id="mlflow-prompts-included-in-mlflow-310-march-2026">MLflow Prompts (included in MLflow 3.10, March 2026)&lt;/h3>
&lt;p>MLflow Prompts is the classic MLOps ecosystem&amp;rsquo;s answer for LLMs. Features:&lt;/p>
&lt;ul>
&lt;li>Integrated into the MLflow Model Registry: prompts are first-class registry artefacts, with the same stage semantics (&lt;code>Staging&lt;/code>, &lt;code>Production&lt;/code>, &lt;code>Archived&lt;/code>) MLOps teams already know.&lt;/li>
&lt;li>API consistent with the rest of MLflow: &lt;code>mlflow.register_prompt()&lt;/code>, &lt;code>mlflow.load_prompt(name, stage=&amp;quot;Production&amp;quot;)&lt;/code>. The learning curve for teams already using MLflow for models is nil.&lt;/li>
&lt;li>Automatic versioning with a numeric &lt;code>version_id&lt;/code> (1, 2, 3, &amp;hellip;) and optional comments on promotion.&lt;/li>
&lt;li>No built-in UI dedicated to prompts (the MLflow UI does the job, but it is designed for models; the flow is less polished than in Langfuse).&lt;/li>
&lt;li>No native GenAI-aware tracing (MLflow Tracing in the 3.10 GenAI dashboard provides it, but the trace↔prompt integration is more manual than in Langfuse).&lt;/li>
&lt;li>Compatible with any model registry backend MLflow supports (filesystem, Postgres, MySQL, S3, GCS, Azure Blob).&lt;/li>
&lt;/ul>
&lt;p>When MLflow Prompts suits:&lt;/p>
&lt;ul>
&lt;li>Teams already operating MLflow for classic ML who want to extend the same discipline to LLMs without adding vendors.&lt;/li>
&lt;li>Deployments where the centre of gravity is the model registry and the prompt is one more artefact.&lt;/li>
&lt;li>CI/CD pipelines that already speak MLflow (CLI, REST API).&lt;/li>
&lt;/ul>
&lt;h3 id="comparison">Comparison&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Feature&lt;/th>
&lt;th>Langfuse&lt;/th>
&lt;th>MLflow Prompts&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Core licence&lt;/td>
&lt;td>MIT (OSS)&lt;/td>
&lt;td>Apache 2.0 (OSS)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Prompt-first UI&lt;/td>
&lt;td>✅&lt;/td>
&lt;td>⚠️ via Model Registry&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Immutable versioning&lt;/td>
&lt;td>✅&lt;/td>
&lt;td>✅&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Mutable labels&lt;/td>
&lt;td>✅ (arbitrary)&lt;/td>
&lt;td>✅ (Staging/Production/Archived)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Native client cache&lt;/td>
&lt;td>✅&lt;/td>
&lt;td>❌ (DIY)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Integrated tracing&lt;/td>
&lt;td>✅ native&lt;/td>
&lt;td>⚠️ via MLflow Tracing&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Eval gating on promotion&lt;/td>
&lt;td>✅&lt;/td>
&lt;td>⚠️ DIY with MLflow Recipes&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Easy self-hosting&lt;/td>
&lt;td>✅ Docker/Helm&lt;/td>
&lt;td>✅ standard MLflow&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Curve if you come from MLOps&lt;/td>
&lt;td>medium&lt;/td>
&lt;td>nil&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Curve if you come from DevOps&lt;/td>
&lt;td>nil&lt;/td>
&lt;td>medium&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>In May 2026, the most widespread hybrid pattern is to use MLflow for the models+adapters registry and Langfuse for prompts+tracing, connected by &lt;code>trace_id&lt;/code> and &lt;code>prompt_id&lt;/code> travelling in the OpenTelemetry span attributes. Covered in &lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">evals&lt;/a> and &lt;a href="https://blog.lo0.es/en/posts/mcp-deep-observability-opentelemetry/">MCP observability&lt;/a>.&lt;/p>
&lt;h2 id="minimum-schema-of-a-versioned-prompt">Minimum schema of a versioned prompt&lt;/h2>
&lt;p>Whatever the tool, what the registry stores in each version has a reasonable minimum schema:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-yaml" data-lang="yaml">&lt;span class="line">&lt;span class="cl">&lt;span class="c"># prompt_id: customer_support_v3, version: 3&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">template&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">system&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">|&lt;/span>&lt;span class="sd">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="sd"> Eres un asistente de soporte de {{company_name}}.
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="sd"> Responde en español neutral, máximo 3 frases.
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="sd"> Formato de respuesta: JSON {&amp;#34;answer&amp;#34;: &amp;#34;...&amp;#34;, &amp;#34;needs_human&amp;#34;: bool}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">user&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">|&lt;/span>&lt;span class="sd">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="sd"> Pregunta del cliente: {{user_message}}
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="sd"> Contexto del ticket: {{ticket_context}}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">variables&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">required&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="l">company_name, user_message, ticket_context]&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">defaults&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>{}&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">recommended_params&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">model&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;llama-3-70b-instruct&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">temperature&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">0.3&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">max_tokens&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">300&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">response_format&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;json_object&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">metadata&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">author&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;mlops@empresa.com&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">created_at&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;2026-05-21T14:23:00Z&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">commit_message&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;Añade límite de 3 frases tras feedback ticket #1842&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">eval_suite&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;customer_support_v3_evals&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">related_traces&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s2">&amp;#34;trace_id_x&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;trace_id_y&amp;#34;&lt;/span>&lt;span class="p">]&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>This is &lt;strong>the minimum contract&lt;/strong>. What sets a serious deployment apart:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>&lt;code>variables.required&lt;/code>&lt;/strong> is validated in the client before sending to the model. A missing variable blows up at client time, not in a confusing model response.&lt;/li>
&lt;li>&lt;strong>&lt;code>recommended_params.model&lt;/code>&lt;/strong> ties the prompt version to a model. Changing model opens a debate (does the new version work with Llama 3 70B and with GPT-4o?). If it is not tied, the model is one more variable that wrecks reproducibility.&lt;/li>
&lt;li>&lt;strong>&lt;code>metadata.eval_suite&lt;/code>&lt;/strong> is what the eval suites hook into: on creating v3, MLflow/Langfuse fires &lt;code>customer_support_v3_evals&lt;/code> automatically.&lt;/li>
&lt;/ul>
&lt;h2 id="integration-with-eval-gates-governed-promotion">Integration with eval gates: governed promotion&lt;/h2>
&lt;p>The real value of prompt versioning appears when it is integrated with eval. The canonical pattern:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Developer edits the prompt in the UI&lt;/strong> (Langfuse) or via the &lt;strong>API&lt;/strong> (MLflow). &lt;code>v4&lt;/code> is created.&lt;/li>
&lt;li>&lt;strong>Automatic trigger&lt;/strong>: the &lt;code>prompt_created&lt;/code> event fires the associated eval suite (the &lt;code>eval_suite&lt;/code> in the metadata).&lt;/li>
&lt;li>&lt;strong>The suite runs&lt;/strong> against the golden dataset (questions+answers labelled by a human). Covered at first level in &lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">the evals post&lt;/a>.&lt;/li>
&lt;li>&lt;strong>Results are attached to the version&lt;/strong>: &lt;code>v4&lt;/code> now has &lt;code>eval_score: 0.84, regression_vs_v3: -0.03&lt;/code>.&lt;/li>
&lt;li>&lt;strong>Promotion gate&lt;/strong>: if &lt;code>eval_score &amp;gt;= threshold&lt;/code> and &lt;code>regression &amp;lt; tolerance&lt;/code>, the &lt;code>staging&lt;/code> label moves to &lt;code>v4&lt;/code> automatically. If not, it alerts the developer.&lt;/li>
&lt;li>&lt;strong>Manual promotion to &lt;code>production&lt;/code>&lt;/strong>: with the eval passed, someone with permission moves &lt;code>production&lt;/code> from &lt;code>v3&lt;/code> to &lt;code>v4&lt;/code>. Atomic, auditable, reversible.&lt;/li>
&lt;/ol>
&lt;pre tabindex="0">&lt;code>Developer edits prompt → v4 created
│
▼
[eval suite trigger]
│
▼
Golden dataset 200 examples
│
▼
score = 0.84 (vs 0.87 for v3)
│
├── If it passes the threshold → label staging → v4
│ └── Manual promotion to production after review
└── If it does not pass → block + alert the developer
&lt;/code>&lt;/pre>&lt;p>This flow turns the prompt change from &amp;ldquo;someone touched the code and we prayed&amp;rdquo; into &amp;ldquo;a prompt change is a PR that passes CI&amp;rdquo;. It is the same discipline classic MLOps applied to models.&lt;/p>
&lt;h2 id="per-request-traceability-which-version-served-each-response">Per-request traceability: which version served each response&lt;/h2>
&lt;p>The last piece is &lt;strong>operational traceability&lt;/strong>: given a model response in production, which prompt version generated it?&lt;/p>
&lt;p>The pattern is to propagate the version as a &lt;strong>span attribute&lt;/strong> in OpenTelemetry, following the &lt;code>gen_ai.*&lt;/code> semantic conventions we covered in &lt;a href="https://blog.lo0.es/en/posts/mcp-deep-observability-opentelemetry/">MCP observability&lt;/a>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-python" data-lang="python">&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># In the client (common pseudo-code)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">prompt&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">registry&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">load&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;customer_support_v3&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">label&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s2">&amp;#34;production&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="c1"># v3 → v_id=14&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">with&lt;/span> &lt;span class="n">tracer&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">start_as_current_span&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;llm_call&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="k">as&lt;/span> &lt;span class="n">span&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">span&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">set_attribute&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;gen_ai.prompt.id&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s2">&amp;#34;customer_support_v3&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">span&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">set_attribute&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;gen_ai.prompt.version&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s2">&amp;#34;14&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">span&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">set_attribute&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;gen_ai.prompt.label&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s2">&amp;#34;production&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">span&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">set_attribute&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;gen_ai.request.model&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">prompt&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">params&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">model&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">response&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">llm&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">complete&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">prompt&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">render&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">user_message&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="n">msg&lt;/span>&lt;span class="p">),&lt;/span> &lt;span class="o">**&lt;/span>&lt;span class="n">prompt&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">params&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">span&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">set_attribute&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;gen_ai.usage.input_tokens&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">response&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">usage&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">input&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">span&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">set_attribute&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;gen_ai.usage.output_tokens&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">response&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">usage&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">output&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>In any trace (Langfuse, Phoenix, Jaeger, Honeycomb) you can see which exact version served that response. In an incident (&amp;ldquo;customer X received this on 22 May&amp;rdquo;) you reproduce &lt;strong>literally&lt;/strong> the version and the model that generated the output.&lt;/p>
&lt;p>Without that traceability, the incident stays an anecdote; with it, it is debuggable.&lt;/p>
&lt;h2 id="applied-to-typical-on-premise-hardware">Applied to typical on-premise hardware&lt;/h2>
&lt;p>Prompt versioning is a &lt;strong>computationally light&lt;/strong> layer compared with the inference engine or the fine-tuning pipeline. Its requirements:&lt;/p>
&lt;ul>
&lt;li>Storage: the prompt registry typically weighs megabytes (hundreds to thousands of prompts with their versions). Postgres with a &lt;code>prompts(id, version, template, params jsonb, metadata jsonb, created_at)&lt;/code> schema is more than enough. Langfuse uses Postgres by default; MLflow uses it for metadata (the blobs go to object storage or the filesystem).&lt;/li>
&lt;li>Registry compute: a small instance (1-2 vCPU, 2 GB RAM) serves tens of thousands of reads per minute if the client cache is enabled. Without a cache, it scales linearly with QPS but is still trivial.&lt;/li>
&lt;li>Triggered eval compute: here there is a real cost. Every time a new version is created, the eval suite runs. If the suite does LLM-as-judge over 200 examples and each eval costs 4 K tokens, one promotion costs on the order of 1 M tokens, minutes on a decent cluster, seconds if the suite already has its hot prefix cache.&lt;/li>
&lt;/ul>
&lt;p>For an &lt;strong>RTX 4090&lt;/strong> serving Llama 3 8B with a self-hosted prompt registry (Langfuse or MLflow): the registry runs on the same node in a sidecar container, the local app caches in RAM, the eval triggers run against the same inference engine at low priority. Full setup in a morning.&lt;/p>
&lt;p>For a &lt;strong>4×H100 SXM cluster&lt;/strong> serving a large model to several tenants: registry in a dedicated K8s pod with replicated Postgres, eval suites running in pods with the &lt;code>spot&lt;/code> priority class (covered in &lt;a href="https://blog.lo0.es/en/posts/gpu-cluster-as-multi-tenant-platform/">the cluster as a platform&lt;/a>), OTel tracing propagating &lt;code>prompt_id+version&lt;/code> to a central Langfuse.&lt;/p>
&lt;h2 id="traps-and-things-that-are-not-what-they-look-like">Traps and things that are not what they look like&lt;/h2>
&lt;p>&lt;strong>Prompts hardcoded in the app code.&lt;/strong> The most common antipattern. The prompt lives in a &lt;code>prompts.py&lt;/code> file or &lt;code>templates/customer.txt&lt;/code> that gets deployed with the app. There is no real versioning (git history is not a substitute: it does not tie commit ↔ production trace operationally). Migrating to a registry is 1-2 sprints of work; it is worth every hour.&lt;/p>
&lt;p>&lt;strong>Badly calibrated cache.&lt;/strong> A TTL of hours with a mutable label means a rollback takes time to propagate. A TTL of seconds overloads the registry. The reasonable default is &lt;strong>60-300 seconds&lt;/strong> with event-driven invalidation (the registry emits a message to Kafka/Redis when a label changes, and clients invalidate immediately).&lt;/p>
&lt;p>&lt;strong>Unvalidated variables.&lt;/strong> The template uses &lt;code>{{user_name}}&lt;/code> but the app passes &lt;code>{{username}}&lt;/code>. The render produces a prompt with a literal &lt;code>{{user_name}}&lt;/code>. The model answers something bizarre and nobody knows why. Validating &lt;strong>required variables in the client&lt;/strong> before sending to the model is the minimum discipline.&lt;/p>
&lt;p>&lt;strong>Prompts inside chains evaluated at runtime.&lt;/strong> If your stack uses LangChain, LlamaIndex or similar with chains that compose prompts at runtime, the &lt;strong>final&lt;/strong> prompt the model sees may not be in the registry because it was composed from several fragments. Solutions: either register the chains as artefacts, or log the effective composed prompt in every trace.&lt;/p>
&lt;p>&lt;strong>Eval suite not hooked to the &lt;code>prompt_id&lt;/code>.&lt;/strong> Without that link, a prompt change gets promoted without passing evals. The integration has to be &lt;strong>a field in the prompt metadata&lt;/strong> (&lt;code>eval_suite: ...&lt;/code>) that the system reads and fires automatically. If it depends on the developer &amp;ldquo;remembering&amp;rdquo;, the pattern will fail.&lt;/p>
&lt;p>&lt;strong>Non-existent RBAC roles.&lt;/strong> Anyone with access to the UI can move &lt;code>production&lt;/code> to any version. Without separating &lt;code>editor&lt;/code> (creates versions) from &lt;code>releaser&lt;/code> (moves production labels), a junior developer can break production with an accidental promotion. Langfuse Enterprise has granular RBAC; MLflow has it via the server backend with per-experiment/registry permissions.&lt;/p>
&lt;p>&lt;strong>Prompts with sensitive data inline.&lt;/strong> The prompt template includes few-shot examples with real names, addresses, customer IDs. The registry stores that indefinitely. Under GDPR, the right to erasure applies to the registry too. Good practice: &lt;strong>variables for sensitive data&lt;/strong>, not inline; periodic audit of the registry content.&lt;/p>
&lt;h2 id="recommended-operational-pattern-the-cycle-on-one-screen">Recommended operational pattern: the cycle on one screen&lt;/h2>
&lt;p>A serious team with prompt versioning properly set up has the following cycle, repeatable and cheap:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Developer opens a PR in the repo&lt;/strong>: changes the app code if necessary, but &lt;strong>does not touch the prompt&lt;/strong> there.&lt;/li>
&lt;li>&lt;strong>Edits the prompt in the Langfuse/MLflow UI&lt;/strong>: creates &lt;code>v_new&lt;/code>. Adds a commit message (&amp;ldquo;adds a 3-sentence limit after feedback on ticket #1842&amp;rdquo;).&lt;/li>
&lt;li>&lt;strong>The eval suite fires automatically&lt;/strong>: it runs against the golden dataset, results appear in the UI within minutes.&lt;/li>
&lt;li>&lt;strong>If it passes eval&lt;/strong>: the &lt;code>staging&lt;/code> label moves to &lt;code>v_new&lt;/code> automatically. The developer can test staging with controlled traffic.&lt;/li>
&lt;li>&lt;strong>Human review&lt;/strong> (1-2 people, optional depending on severity): approval.&lt;/li>
&lt;li>&lt;strong>Promotion to &lt;code>production&lt;/code>&lt;/strong>: move the label, atomic. The client caches for 60-300 s, then serves the new version.&lt;/li>
&lt;li>&lt;strong>Observe&lt;/strong>: in Langfuse/Phoenix, production metrics and eval scores are segmented by prompt version. If the score drops with &lt;code>v_new&lt;/code>, alert.&lt;/li>
&lt;li>&lt;strong>If there is a serious regression&lt;/strong>: rollback is &lt;strong>moving the label back&lt;/strong>. A 5-second operation.&lt;/li>
&lt;/ol>
&lt;p>Every step is audited, every decision leaves a trail, every rollback is an atomic operation. This is what separates a GenAI system from &amp;ldquo;demos that worked once&amp;rdquo; and makes it operable for years.&lt;/p>
&lt;h2 id="what-we-have-not-covered-upcoming-posts">What we have not covered (upcoming posts)&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Automatic prompt optimisation&lt;/strong>: techniques such as DSPy, TextGrad, PromptBreeder that generate prompt candidates and optimise them against a measurable objective. The extension of versioning where the &amp;ldquo;developer&amp;rdquo; can be an optimiser.&lt;/li>
&lt;li>&lt;strong>Prompt injection and red teaming&lt;/strong>: integrating versioning with the adversarial evaluation flow. Partially covered in &lt;a href="https://blog.lo0.es/en/posts/llm-guardrails-safety-four-lines-of-defence/">guardrails&lt;/a>.&lt;/li>
&lt;li>&lt;strong>Different versions per tenant&lt;/strong>: when the same &lt;code>prompt_id&lt;/code> needs variants per customer (i18n, branding, domain). Fork + override pattern.&lt;/li>
&lt;/ul>
&lt;h2 id="see-also">See also&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/">The six-stage LLMOps pipeline&lt;/a> — the master map where prompt versioning appears as a cross-cutting component in the &amp;ldquo;all stages&amp;rdquo; band. This post goes into the detail of that component.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/mlops-for-llms-landscape-2026/">MLOps specific to LLMs in 2026: the landscape&lt;/a> — the opening of the series with the tooling context and the structural differences from classic MLOps.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">Evals: the layer after tracing that decides whether your LLM performs or only looks like it&lt;/a> — the eval suites that hook into &lt;code>prompt_id&lt;/code> for the promotion gate described here.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/mcp-deep-observability-opentelemetry/">MCP from the inside and its deep observability&lt;/a> — the &lt;code>gen_ai.*&lt;/code> semantic conventions and the trace context propagation that carry &lt;code>prompt_id+version&lt;/code> across every span.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/agentsight-llm-tracing-ebpf-zero-instrumentation/">AgentSight and the new LLM tracing&lt;/a> — how tracing observes prompts at runtime, including prompts composed in chains.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/continuous-fine-tuning-production-real-traffic-deployed-adapter/">Continuous fine-tuning in production&lt;/a> — the Tune+Retrain cycle produces adapters whose system prompt coexists with the versioning described here.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/llm-as-judge-exam-marker-not-oracle/">LLM-as-judge: the exam marker&lt;/a> — the judge&amp;rsquo;s prompt is versioned here too. A &amp;ldquo;minor&amp;rdquo; change in the rubric invalidates the κ calibration and, as a consequence, every gate that depends on the judge.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/llm-tracing-opentelemetry-genai/">LLM tracing with OpenTelemetry GenAI&lt;/a> — the full OTel pipeline (Collector → Langfuse + Tempo + Prometheus) over which &lt;code>gen_ai.prompt.id+version&lt;/code> travels as a span attribute. Here we cover prompt versioning; there, the substrate that transports it.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/langfuse-inside-sorting-centre-bottleneck/">Langfuse from the inside: v3 architecture and the 10 backend knobs&lt;/a> — the prompt management layer described here lives in Postgres inside Langfuse&amp;rsquo;s six-service architecture; that post opens the box and explains how to operate it self-hosted.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/llm-guardrails-safety-four-lines-of-defence/">Guardrails and safety in LLMs&lt;/a> — the system prompt is part of the perimeter to protect against leakage (OWASP LLM07). The versioning described here plus the GR output detectors are the two pieces that stop accidental prompt changes opening breaches in silence.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/langfuse-v4-what-goes-into-a-trace/">Langfuse v4: what goes into a trace&lt;/a> — the version 4 data model and the five score types.&lt;/li>
&lt;/ul>
&lt;h2 id="references">References&lt;/h2>
&lt;ul>
&lt;li>Langfuse documentation, &lt;em>Prompt Management&lt;/em>: &lt;a href="https://langfuse.com/docs/prompts/get-started">https://langfuse.com/docs/prompts/get-started&lt;/a>.&lt;/li>
&lt;li>MLflow 3.10 release notes, &lt;em>Prompts in Model Registry&lt;/em> (marzo 2026): &lt;a href="https://mlflow.org/releases/3.10">https://mlflow.org/releases/3.10&lt;/a>.&lt;/li>
&lt;li>OpenTelemetry, &lt;em>Semantic Conventions for Generative AI&lt;/em> (estables desde 1.36 de OTel): &lt;a href="https://opentelemetry.io/docs/specs/semconv/gen-ai/">https://opentelemetry.io/docs/specs/semconv/gen-ai/&lt;/a>.&lt;/li>
&lt;li>Google Cloud, &lt;em>Prompt Management: Best Practices for Production LLM Systems&lt;/em> (2025).&lt;/li>
&lt;li>Chip Huyen, &lt;em>Designing Machine Learning Systems&lt;/em> — capítulo sobre model registry y prompt-as-artifact (2ª edición, marzo 2026).&lt;/li>
&lt;li>Eugene Yan, &lt;em>Prompt Engineering as Software Engineering&lt;/em> (blog, 2025).&lt;/li>
&lt;/ul></description></item><item><title>Continuous fine-tuning in production: from real traffic to the deployed adapter</title><link>https://blog.lo0.es/en/posts/continuous-fine-tuning-production-real-traffic-deployed-adapter/</link><pubDate>Thu, 21 May 2026 10:00:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/continuous-fine-tuning-production-real-traffic-deployed-adapter/</guid><description>&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>Continuous fine-tuning is not &amp;ldquo;training the model every so often&amp;rdquo;. It is a &lt;strong>closed loop&lt;/strong> where real production traffic generates the datasets, a short pipeline trains a LoRA adapter, a battery of evaluations decides whether it is promoted, and vLLM loads it &lt;strong>without restarting&lt;/strong>. The state of the art in May 2026 has fragmented the stack: it is no longer DPO against everything, but a choice between SFT, DPO, KTO, ORPO and SimPO according to the type of signal your product captures. What has consolidated the pattern is the combination of PostgreSQL 18 + pgvector 0.8 as the &lt;strong>nervous system of the pipeline&lt;/strong>, traffic capture, dataset versioning, eval results, adapter registry, together with vLLM multi-LoRA hot-swap, which turns deployment into an HTTP call. This article takes the cycle apart with concrete schemas, real queries, and the numbers it costs on an RTX 4090 against a 4×H100 cluster.&lt;/p>
&lt;h2 id="you-are-here-tune--retrain">You are here: Tune + Retrain&lt;/h2>
&lt;p>This post crosses two stages of the &lt;a href="https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/">six-stage LLMOps pipeline&lt;/a>: the decision to &lt;strong>train a new adapter&lt;/strong> (the &lt;strong>Tune&lt;/strong> stage) is triggered by the signals from &lt;strong>Observe&lt;/strong> that travel through the &lt;strong>Retrain&lt;/strong> stage until the loop closes. The post takes apart the complete circuit between the two boxes.&lt;/p>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 90" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="you are here: Tune + Retrain">
&lt;style>.box{stroke:#444;stroke-width:1.4;rx:6}.active{fill:#ff8a4c;stroke-width:3}.active2{fill:#fff5b0;stroke-width:3}.idle{fill:#f4f4f4}.lbl{font:600 12px sans-serif;fill:#222}.arr{stroke:#666;stroke-width:1.4;fill:none;marker-end:url(#ftm)}.cyc{stroke:#888;stroke-width:1.2;fill:none;stroke-dasharray:4 2;marker-end:url(#ftm)}&lt;/style>
&lt;defs>&lt;marker id="ftm" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#666"/>&lt;/marker>&lt;/defs>
&lt;text x="390" y="20" text-anchor="middle" class="lbl">You are here: TUNE + RETRAIN · continuous adapter cycle driven by real traffic&lt;/text>
&lt;rect x="30" y="35" width="110" height="35" class="box idle"/>&lt;text x="85" y="58" text-anchor="middle" class="lbl">1 · Data&lt;/text>
&lt;rect x="155" y="35" width="110" height="35" class="box active"/>&lt;text x="210" y="58" text-anchor="middle" class="lbl">2 · Tune&lt;/text>
&lt;rect x="280" y="35" width="110" height="35" class="box idle"/>&lt;text x="335" y="58" text-anchor="middle" class="lbl">3 · Eval&lt;/text>
&lt;rect x="405" y="35" width="110" height="35" class="box idle"/>&lt;text x="460" y="58" text-anchor="middle" class="lbl">4 · Deploy&lt;/text>
&lt;rect x="530" y="35" width="110" height="35" class="box idle"/>&lt;text x="585" y="58" text-anchor="middle" class="lbl">5 · Observe&lt;/text>
&lt;rect x="655" y="35" width="110" height="35" class="box active2"/>&lt;text x="710" y="58" text-anchor="middle" class="lbl">6 · Retrain&lt;/text>
&lt;path class="arr" d="M140,52 L155,52"/>&lt;path class="arr" d="M265,52 L280,52"/>&lt;path class="arr" d="M390,52 L405,52"/>&lt;path class="arr" d="M515,52 L530,52"/>&lt;path class="arr" d="M640,52 L655,52"/>
&lt;path class="cyc" d="M710,72 L710,82 L85,82 L85,72"/>
&lt;/svg>
&lt;/div>
&lt;h2 id="the-analogy-the-restaurant-that-tunes-its-menu">The analogy: the restaurant that tunes its menu&lt;/h2>
&lt;p>Picture a neighbourhood restaurant with a signature dish that works, but the chef knows it can be tuned. Every night things happen:&lt;/p>
&lt;ul>
&lt;li>Some diners &lt;strong>leave part of the dish&lt;/strong>: a weak signal that something did not quite land.&lt;/li>
&lt;li>Others ask for &lt;strong>another version&lt;/strong> (&amp;ldquo;could you put less salt in it?&amp;rdquo;): an explicit, directional signal.&lt;/li>
&lt;li>Others &lt;strong>finish the dish and come back the following week&lt;/strong>: the only signal that really matters, but it arrives late.&lt;/li>
&lt;li>And a select group offers an opinion without being asked, usually a negative one.&lt;/li>
&lt;/ul>
&lt;p>The chef does not redo the menu every night. He does something more interesting: he writes down in a notebook the dishes served, the returns, the changes requested, the tips. Every so often, he &lt;strong>reads the whole notebook&lt;/strong>, decides on minimal adjustments to a recipe, tries the new version at a private table with his staff, and only if they take to it does he add it to the next day&amp;rsquo;s menu. Sometimes he even serves two different versions of the dish to different tables for a week, measures what happens, and picks one.&lt;/p>
&lt;p>That is &lt;strong>continuous fine-tuning&lt;/strong>. The notebook is Postgres. The dish is the base model. The notes are feedback signals, explicit and implicit. The &amp;ldquo;minimal adjustment&amp;rdquo; is a 30 MB LoRA adapter. The private table is the battery of automated evaluations. The next day&amp;rsquo;s menu is vLLM with multi-LoRA hot-swap, which loads the new adapter without restarting the service. Serving two versions to different tables is A/B testing with real traffic.&lt;/p>
&lt;p>The analogy is exact on one critical point: &lt;strong>the chef does not throw away the original recipe&lt;/strong>. He keeps the base recipe and holds a separate notebook with the &amp;ldquo;modifications that work well for the neighbourhood regulars&amp;rdquo;. That notebook is the LoRA adapter: on top of the base model, not in its place.&lt;/p>
&lt;h2 id="the-cycle-taken-apart">The cycle, taken apart&lt;/h2>
&lt;p>Before going into components, it helps to fix the complete flow. These seven steps are what any serious team replicates with variations:&lt;/p>
&lt;div class="diagram" style="max-width: 720px; margin: 1.5rem auto;">
&lt;svg viewBox="0 0 720 420" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Closed loop of continuous fine-tuning">
&lt;style>
.node { fill: #f4f4f4; stroke: #333; stroke-width: 1.5; }
.n-serve { fill: #d6eaff; }
.n-data { fill: #ffe9d6; }
.n-train { fill: #d9f5d6; }
.n-eval { fill: #f4e1ff; }
.lbl { font: 600 12px sans-serif; fill: #222; }
.lbl-sm { font: 10.5px sans-serif; fill: #444; }
.arr { stroke: #444; stroke-width: 1.4; fill: none; marker-end: url(#ah2); }
.arr-dim { stroke: #888; stroke-width: 1.2; fill: none; stroke-dasharray: 4,3; marker-end: url(#ah2); }
&lt;/style>
&lt;defs>
&lt;marker id="ah2" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">
&lt;path d="M0,0 L10,5 L0,10 z" fill="#444"/>
&lt;/marker>
&lt;/defs>
&lt;text x="360" y="22" text-anchor="middle" class="lbl">The closed loop of continuous fine-tuning&lt;/text>
&lt;rect x="280" y="40" width="160" height="50" rx="8" class="node n-serve"/>
&lt;text x="360" y="62" text-anchor="middle" class="lbl">1 · vLLM serving&lt;/text>
&lt;text x="360" y="78" text-anchor="middle" class="lbl-sm">base + active adapters&lt;/text>
&lt;rect x="500" y="120" width="170" height="50" rx="8" class="node n-data"/>
&lt;text x="585" y="142" text-anchor="middle" class="lbl">2 · Traffic capture&lt;/text>
&lt;text x="585" y="158" text-anchor="middle" class="lbl-sm">prompts, responses, feedback&lt;/text>
&lt;rect x="500" y="210" width="170" height="50" rx="8" class="node n-data"/>
&lt;text x="585" y="232" text-anchor="middle" class="lbl">3 · Curation&lt;/text>
&lt;text x="585" y="248" text-anchor="middle" class="lbl-sm">dedup, PII, balancing, snapshot&lt;/text>
&lt;rect x="280" y="290" width="160" height="50" rx="8" class="node n-train"/>
&lt;text x="360" y="312" text-anchor="middle" class="lbl">4 · LoRA training&lt;/text>
&lt;text x="360" y="328" text-anchor="middle" class="lbl-sm">SFT / DPO / KTO / ORPO / SimPO&lt;/text>
&lt;rect x="50" y="210" width="170" height="50" rx="8" class="node n-eval"/>
&lt;text x="135" y="232" text-anchor="middle" class="lbl">5 · Eval gates&lt;/text>
&lt;text x="135" y="248" text-anchor="middle" class="lbl-sm">3 stages: PR, full, canary&lt;/text>
&lt;rect x="50" y="120" width="170" height="50" rx="8" class="node n-train"/>
&lt;text x="135" y="142" text-anchor="middle" class="lbl">6 · Adapter registry&lt;/text>
&lt;text x="135" y="158" text-anchor="middle" class="lbl-sm">status: canary | prod | retired&lt;/text>
&lt;rect x="50" y="40" width="170" height="50" rx="8" class="node n-serve"/>
&lt;text x="135" y="62" text-anchor="middle" class="lbl">7 · Hot-swap&lt;/text>
&lt;text x="135" y="78" text-anchor="middle" class="lbl-sm">POST /v1/load_lora_adapter&lt;/text>
&lt;path class="arr" d="M440,75 C480,80 495,100 510,120"/>
&lt;path class="arr" d="M585,170 L585,210"/>
&lt;path class="arr" d="M500,250 C460,270 440,280 440,300"/>
&lt;path class="arr" d="M280,315 C240,290 230,275 220,260"/>
&lt;path class="arr" d="M135,210 L135,170"/>
&lt;path class="arr" d="M135,120 L135,90"/>
&lt;path class="arr" d="M220,65 L280,65"/>
&lt;rect x="280" y="170" width="160" height="80" rx="10" fill="#fffae6" stroke="#d4a52a" stroke-width="2"/>
&lt;text x="360" y="200" text-anchor="middle" class="lbl">PostgreSQL 18&lt;/text>
&lt;text x="360" y="218" text-anchor="middle" class="lbl-sm">+ pgvector 0.8&lt;/text>
&lt;text x="360" y="234" text-anchor="middle" class="lbl-sm">single source of truth&lt;/text>
&lt;path class="arr-dim" d="M500,145 L440,180"/>
&lt;path class="arr-dim" d="M500,235 L440,225"/>
&lt;path class="arr-dim" d="M280,225 L220,235"/>
&lt;path class="arr-dim" d="M280,200 L220,160"/>
&lt;path class="arr-dim" d="M360,290 L360,250"/>
&lt;/svg>
&lt;/div>
&lt;p>The cycle lasts between 1 and 4 weeks in real production. What changes between teams is the tempo (faster in assistant chat, slower in regulated banking) and the details of each step. The structure is the same.&lt;/p>
&lt;h2 id="why-continuous-fine-tuning-and-why-it-is-not-rag">Why continuous fine-tuning (and why it is not RAG)&lt;/h2>
&lt;p>Before going deeper, a distinction that people still confuse. &lt;strong>Fine-tuning is for form, not for facts.&lt;/strong> If your problem is that the model does not know the customer&amp;rsquo;s rates or the updated catalogue, do not fine-tune: use RAG. If your problem is that the model responds in a tone that does not fit, does not respect your JSON format, refuses legitimate cases or invents structure, then fine-tuning is the answer.&lt;/p>
&lt;p>In 2026 the boundary is well established by community practice:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Observed problem&lt;/th>
&lt;th>Solution&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>The model does not know X (X changes weekly)&lt;/td>
&lt;td>RAG&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>The model knows X but responds badly in tone or format&lt;/td>
&lt;td>SFT fine-tuning&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>There are two ways of responding and I prefer one over the other&lt;/td>
&lt;td>Fine-tuning with preferences (DPO/KTO/ORPO/SimPO)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>The model reasons badly in a verifiable domain (code, maths)&lt;/td>
&lt;td>RL with verifiable reward (GRPO/DAPO)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>The model is competent, it just needs a memory of facts&lt;/td>
&lt;td>RAG, not fine-tuning&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Continuous fine-tuning is the disciplined version of the second and third cases. The key word is &lt;strong>continuous&lt;/strong>: it is not a one-off &amp;ldquo;we aligned the model&amp;rdquo; event, it is a process that runs every time the traffic distribution drifts far enough, or new use cases appear.&lt;/p>
&lt;h2 id="the-four-techniques-according-to-the-signal-you-capture">The four techniques according to the signal you capture&lt;/h2>
&lt;p>The most important change of the last 12 months has been the end of DPO&amp;rsquo;s monopoly. In 2024 every team doing alignment used DPO with &lt;code>(chosen, rejected)&lt;/code> pairs. In 2026 the choice is finer and depends on &lt;strong>what the signal you collect in your product looks like&lt;/strong>:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Real signal in the product&lt;/th>
&lt;th>Recommended technique&lt;/th>
&lt;th>Why&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Labelled correct examples (input → expected output)&lt;/td>
&lt;td>&lt;strong>SFT + LoRA&lt;/strong>&lt;/td>
&lt;td>Still the baseline. 500-5,000 examples are enough for style.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Explicit &lt;code>(chosen, rejected)&lt;/code> pairs&lt;/td>
&lt;td>&lt;strong>DPO&lt;/strong> or &lt;strong>SimPO&lt;/strong>&lt;/td>
&lt;td>SimPO removes the reference model → 50 % less VRAM in training.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Loose 👍 / 👎 on responses&lt;/td>
&lt;td>&lt;strong>KTO&lt;/strong>&lt;/td>
&lt;td>The method that fits real telemetry most naturally.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>SFT and preferences in a single pass&lt;/td>
&lt;td>&lt;strong>ORPO&lt;/strong>&lt;/td>
&lt;td>A single model in memory, avoids drift between phases.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Verifiable reward (tests, solutions)&lt;/td>
&lt;td>&lt;strong>GRPO&lt;/strong> / &lt;strong>DAPO&lt;/strong>&lt;/td>
&lt;td>Reasoning, not chat. A different world.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The practical rule: &lt;strong>design the feedback capture in the product thinking about which method you will be able to use afterwards&lt;/strong>. If your UI only has 👍/👎, you force the path to KTO. If you add a &amp;ldquo;regenerate response&amp;rdquo; button, you unlock DPO from regenerate-as-rejected (we will see it below). If you add an &amp;ldquo;edit response&amp;rdquo; button, the edited response becomes high-quality direct SFT.&lt;/p>
&lt;p>There is a cost detail that gets little publicity. DPO needs to keep &lt;strong>two models&lt;/strong> in memory: the one you are training and the reference one. SimPO removes that second model. ORPO does too. For a Llama 3 8B in BF16 this is the difference between needing ~32 GB of active VRAM during training (DPO) or ~16 GB (SimPO/ORPO). It is the difference between the training fitting on an RTX 4090 with aggressive QLoRA, or not fitting without offload.&lt;/p>
&lt;h2 id="postgres-as-the-nervous-system-of-the-pipeline">Postgres as the nervous system of the pipeline&lt;/h2>
&lt;p>Here is the strong technical opinion of this article, and it is one worth defending with data: &lt;strong>Postgres 18 + pgvector 0.8 + an S3/MinIO bucket for the weights is enough for the whole pipeline&lt;/strong>. You do not need MLflow, you do not need lakeFS, you do not need DVC.&lt;/p>
&lt;p>This is not ideological minimalism. It is about three concrete advantages that no alternative stack matches in the on-premise scenario with compliance:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>A single source of truth, a single authorisation model.&lt;/strong> The ACLs you already have for Postgres cover the training data, the eval results, the adapter registry and the audit log. You do not multiply control planes.&lt;/li>
&lt;li>&lt;strong>SQL as the pipeline&amp;rsquo;s universal language.&lt;/strong> The query that generates the dataset, the eval gate predicate, the A/B traffic assignment, the promotion decision: it is all SQL. Your team already knows SQL.&lt;/li>
&lt;li>&lt;strong>Audit and cryptographic reproducibility for free.&lt;/strong> The &lt;code>pg_audit&lt;/code> and &lt;code>pgcrypto&lt;/code> extensions, combined with &lt;code>set_hash&lt;/code> over the dataset, give you cryptographic traceability with no additional code. It is a subject that would fill an article of its own.&lt;/li>
&lt;/ol>
&lt;h3 id="a-concrete-schema">A concrete schema&lt;/h3>
&lt;p>We start with the traffic table, partitioned by week so that &lt;code>DROP PARTITION&lt;/code> is cheap:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-sql" data-lang="sql">&lt;span class="line">&lt;span class="cl">&lt;span class="k">CREATE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">TABLE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">obs&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">inference_log&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">BIGSERIAL&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">request_id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">UUID&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">NOT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">NULL&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">tenant_id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">INT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">NOT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">NULL&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">user_hash&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">BYTEA&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c1">-- GDPR pseudonymisation
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">adapter_id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">TEXT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">NOT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">NULL&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c1">-- e.g. &amp;#34;support-es-v4.1&amp;#34;
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">experiment&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">TEXT&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c1">-- e.g. &amp;#34;rerank-v2-canary&amp;#34;
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">variant&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">CHAR&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">1&lt;/span>&lt;span class="p">),&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c1">-- &amp;#39;A&amp;#39; | &amp;#39;B&amp;#39; | NULL
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">messages&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">JSONB&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">NOT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">NULL&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">completion&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">TEXT&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">ttft_ms&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">INT&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">tokens_in&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">INT&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">tokens_out&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">INT&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">-- feedback signals
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">fb_explicit&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">SMALLINT&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c1">-- -1/0/+1 (KTO-ready)
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">fb_regen&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">BOOLEAN&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">DEFAULT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">false&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c1">-- user regenerated -&amp;gt; DPO-rejected
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">fb_edited&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">BOOLEAN&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">DEFAULT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">false&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c1">-- user edited -&amp;gt; SFT golden
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">parent_id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">BIGINT&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c1">-- self-reference for regenerate
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c1">-- vector and meta
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">embedding&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">HALFVEC&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">1024&lt;/span>&lt;span class="p">),&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c1">-- pgvector 0.8, half the RAM
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">pii_flags&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">SMALLINT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">DEFAULT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c1">-- bitmask
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">created_at&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">TIMESTAMPTZ&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">DEFAULT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">now&lt;/span>&lt;span class="p">()&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">PARTITION&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">BY&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">RANGE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">created_at&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">CREATE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">TABLE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">obs&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">inference_log_2026w21&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">PARTITION&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">OF&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">obs&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">inference_log&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">FOR&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">VALUES&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">FROM&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;2026-05-18&amp;#39;&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">TO&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;2026-05-25&amp;#39;&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">CREATE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">INDEX&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">ON&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">obs&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">inference_log_2026w21&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">USING&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">hnsw&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">embedding&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">halfvec_cosine_ops&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">CREATE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">INDEX&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">ON&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">obs&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">inference_log_2026w21&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">tenant_id&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">adapter_id&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">created_at&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Three decisions deserve a note:&lt;/p>
&lt;p>&lt;strong>&lt;code>HALFVEC(1024)&lt;/code>.&lt;/strong> Native FP16 vectors in pgvector 0.8. Half the RAM and disk, with a loss of precision that is irrelevant for semantic deduplication. This alone, at a scale of millions of rows, saves between 4 and 8 GB.&lt;/p>
&lt;p>&lt;strong>Weekly partitioning by time range.&lt;/strong> At 90 days, &lt;code>DROP TABLE obs.inference_log_2026wXX&lt;/code> frees space in milliseconds without a prolonged lock. Autovacuum never touches frozen partitions again.&lt;/p>
&lt;p>&lt;strong>Self-referencing &lt;code>parent_id&lt;/code>.&lt;/strong> The user regenerates the response → a new row is inserted with &lt;code>parent_id&lt;/code> pointing at the previous one. That will give us a DPO dataset without touching the UX.&lt;/p>
&lt;h3 id="the-adapter-registry">The adapter registry&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-sql" data-lang="sql">&lt;span class="line">&lt;span class="cl">&lt;span class="k">CREATE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">TABLE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">serve&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">adapter&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">TEXT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">PRIMARY&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">KEY&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">base_model&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">TEXT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">NOT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">NULL&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">rank&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">INT&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">alpha&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">INT&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">target_modules&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">JSONB&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">method&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">TEXT&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c1">-- &amp;#39;sft&amp;#39;|&amp;#39;dpo&amp;#39;|&amp;#39;kto&amp;#39;|&amp;#39;orpo&amp;#39;|&amp;#39;simpo&amp;#39;
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">training_run_id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">UUID&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">dataset_snapshot_id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">UUID&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">weights_uri&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">TEXT&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c1">-- s3://.../v4.2.safetensors
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">eval_summary&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">JSONB&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">status&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">TEXT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">NOT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">NULL&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c1">-- &amp;#39;training&amp;#39;|&amp;#39;canary&amp;#39;|&amp;#39;prod&amp;#39;|&amp;#39;retired&amp;#39;
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">traffic_pct&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">NUMERIC&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">5&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="mi">2&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">DEFAULT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">promoted_at&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">TIMESTAMPTZ&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The vLLM router reads this table with a TTL of a few seconds. An &lt;code>UPDATE serve.adapter SET status='prod', traffic_pct=100 WHERE id='v4.2'&lt;/code> is a promotion. An &lt;code>UPDATE ... SET status='retired'&lt;/code> is a rollback. The audit of who did what and when comes from &lt;code>pg_audit&lt;/code> without writing a single additional line of code.&lt;/p>
&lt;h2 id="generating-dpo-and-kto-datasets-from-real-traffic">Generating DPO and KTO datasets from real traffic&lt;/h2>
&lt;p>This is where the elegance of the schema pays off. The dataset is not a static file: it is a &lt;strong>materialised view&lt;/strong> built with SQL over &lt;code>obs.inference_log&lt;/code>.&lt;/p>
&lt;h3 id="kto-dataset-from-">KTO dataset from 👍/👎&lt;/h3>
&lt;p>KTO is the method that best fits the signal any decent chat product captures. The query:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-sql" data-lang="sql">&lt;span class="line">&lt;span class="cl">&lt;span class="k">CREATE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">MATERIALIZED&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">VIEW&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">train&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">kto_v3_candidate&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">SELECT&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">messages&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">prompt&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">completion&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">response&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">CASE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">WHEN&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">fb_explicit&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">&amp;gt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">THEN&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">true&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">ELSE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">false&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">END&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">label&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">adapter_id&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">created_at&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">FROM&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">obs&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">inference_log&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">WHERE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">fb_explicit&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">!=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">AND&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">created_at&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">&amp;gt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">now&lt;/span>&lt;span class="p">()&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">-&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">interval&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;60 days&amp;#39;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">AND&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">pii_flags&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">AND&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">tenant_id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">IN&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">SELECT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">FROM&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">tenant&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">WHERE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">consent_training&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Simple. Every row with explicit feedback becomes an example &lt;code>(prompt, response, desirable_yes_no)&lt;/code>. KTO trains directly on this signal, with no need to build pairs.&lt;/p>
&lt;h3 id="dpo-dataset-from-regenerate">DPO dataset from &amp;ldquo;regenerate&amp;rdquo;&lt;/h3>
&lt;p>The trick that is worth this article on its own. When the user presses &amp;ldquo;regenerate response&amp;rdquo;, they are giving an extraordinarily strong signal: the first response was no good to them. If the second is neither regenerated nor rated negatively, we assume it was. That is a DPO pair without a single extra click in the UI:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-sql" data-lang="sql">&lt;span class="line">&lt;span class="cl">&lt;span class="k">CREATE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">MATERIALIZED&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">VIEW&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">train&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">dpo_v3_candidate&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">SELECT&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">rej&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">messages&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">prompt&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">cho&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="k">completion&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">chosen&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">rej&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="k">completion&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">rejected&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">rej&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">adapter_id&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">FROM&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">obs&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">inference_log&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">rej&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">JOIN&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">obs&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">inference_log&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">cho&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">ON&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">cho&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">parent_id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">rej&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">id&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">WHERE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">rej&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">fb_regen&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">true&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">AND&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">cho&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">fb_explicit&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">&amp;gt;=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">-- length bias mitigation in classic DPO
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AND&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">cho&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">tokens_out&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">BETWEEN&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">rej&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">tokens_out&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">*&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="mi">5&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">AND&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">rej&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">tokens_out&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">*&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">2&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="mi">5&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The clause on lengths is the cheap cure for the &lt;strong>length bias&lt;/strong> documented in DPO. Without it, the model learns that &amp;ldquo;longer = better&amp;rdquo; because the responses the user accepts tend to be slightly longer. With SimPO or ORPO this filter is optional; with classic DPO it is necessary.&lt;/p>
&lt;h3 id="semantic-deduplication-with-pgvector">Semantic deduplication with pgvector&lt;/h3>
&lt;p>Before training, dedup. Two almost identical prompts in the dataset are noise that biases the model:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-sql" data-lang="sql">&lt;span class="line">&lt;span class="cl">&lt;span class="k">WITH&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ranked&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">SELECT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">id&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">embedding&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">row_number&lt;/span>&lt;span class="p">()&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">OVER&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">PARTITION&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">BY&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">hashtext&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">messages&lt;/span>&lt;span class="p">::&lt;/span>&lt;span class="nb">text&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">ORDER&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">BY&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">fb_explicit&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">DESC&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">created_at&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">DESC&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">rn&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">FROM&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">obs&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">inference_log&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">WHERE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">created_at&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">&amp;gt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">now&lt;/span>&lt;span class="p">()&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">-&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">interval&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;60 days&amp;#39;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">DELETE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">FROM&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">train&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">kto_v3_candidate&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">kto&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">USING&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ranked&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">r&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">WHERE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">r&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">rn&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">&amp;gt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">1&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AND&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">kto&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">r&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">id&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>And for the semantic duplicates (paraphrases) we use pgvector 0.8 directly with an &lt;code>iterative index scan&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-sql" data-lang="sql">&lt;span class="line">&lt;span class="cl">&lt;span class="c1">-- Find near-duplicates of any given example
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="k">SELECT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">id&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">messages&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">embedding&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">&amp;lt;=&amp;gt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="err">$&lt;/span>&lt;span class="mi">1&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">dist&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">FROM&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">obs&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">inference_log&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">WHERE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">created_at&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">&amp;gt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">now&lt;/span>&lt;span class="p">()&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">-&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">interval&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;60 days&amp;#39;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">AND&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">embedding&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">&amp;lt;=&amp;gt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="err">$&lt;/span>&lt;span class="mi">1&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">&amp;lt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="mi">05&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">ORDER&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">BY&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">embedding&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">&amp;lt;=&amp;gt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="err">$&lt;/span>&lt;span class="mi">1&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">LIMIT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">50&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The &lt;code>iterative scan&lt;/code> is a key improvement in pgvector 0.8: before, the HNSW index could return fewer results than requested when there were additional filters (&lt;code>WHERE&lt;/code>); now it iterates until it meets the limit. Without that improvement, curation queries over datasets of millions of rows were unworkable without a brutal pre-filter.&lt;/p>
&lt;h2 id="eval-gates-three-stages-all-sql">Eval gates: three stages, all SQL&lt;/h2>
&lt;p>The most common mistake when implementing continuous fine-tuning is skipping or watering down the eval gates. That turns the cycle into a roulette wheel. The pattern that works in 2026 is &lt;strong>three stages&lt;/strong>, each with a different latency/coverage trade-off:&lt;/p>
&lt;div class="diagram" style="max-width: 720px; margin: 1.5rem auto;">
&lt;svg viewBox="0 0 720 200" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Three stages of eval gates">
&lt;style>
.stage { stroke: #333; stroke-width: 1.5; }
.s1 { fill: #d6eaff; }
.s2 { fill: #d9f5d6; }
.s3 { fill: #ffe9d6; }
.lbl { font: 600 13px sans-serif; fill: #222; }
.lbl-sm { font: 11px sans-serif; fill: #444; }
.arr { stroke: #444; stroke-width: 1.6; fill: none; marker-end: url(#ah3); }
&lt;/style>
&lt;defs>
&lt;marker id="ah3" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">
&lt;path d="M0,0 L10,5 L0,10 z" fill="#444"/>
&lt;/marker>
&lt;/defs>
&lt;text x="360" y="22" text-anchor="middle" class="lbl">Three stages of eval gates&lt;/text>
&lt;rect x="30" y="50" width="200" height="110" rx="10" class="stage s1"/>
&lt;text x="130" y="78" text-anchor="middle" class="lbl">Stage 1 · PR&lt;/text>
&lt;text x="130" y="98" text-anchor="middle" class="lbl-sm">&amp;lt; 90 seconds&lt;/text>
&lt;text x="130" y="118" text-anchor="middle" class="lbl-sm">schema-lint + prompt-lint&lt;/text>
&lt;text x="130" y="135" text-anchor="middle" class="lbl-sm">+ 50 mini-eval cases&lt;/text>
&lt;rect x="260" y="50" width="200" height="110" rx="10" class="stage s2"/>
&lt;text x="360" y="78" text-anchor="middle" class="lbl">Stage 2 · pre-merge&lt;/text>
&lt;text x="360" y="98" text-anchor="middle" class="lbl-sm">&amp;lt; 20 minutes&lt;/text>
&lt;text x="360" y="118" text-anchor="middle" class="lbl-sm">200-500 golden cases&lt;/text>
&lt;text x="360" y="135" text-anchor="middle" class="lbl-sm">+ LLM-as-judge&lt;/text>
&lt;rect x="490" y="50" width="200" height="110" rx="10" class="stage s3"/>
&lt;text x="590" y="78" text-anchor="middle" class="lbl">Stage 3 · canary&lt;/text>
&lt;text x="590" y="98" text-anchor="middle" class="lbl-sm">24-72 hours&lt;/text>
&lt;text x="590" y="118" text-anchor="middle" class="lbl-sm">1-5 % real traffic&lt;/text>
&lt;text x="590" y="135" text-anchor="middle" class="lbl-sm">online metrics + feedback&lt;/text>
&lt;path class="arr" d="M230,105 L260,105"/>
&lt;path class="arr" d="M460,105 L490,105"/>
&lt;/svg>
&lt;/div>
&lt;p>And this is where Postgres shines again: the promotion gate is expressed as an SQL predicate. Nothing more:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-sql" data-lang="sql">&lt;span class="line">&lt;span class="cl">&lt;span class="k">CREATE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">TABLE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">train&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">eval_result&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">adapter_id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">TEXT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">REFERENCES&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">serve&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">adapter&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">id&lt;/span>&lt;span class="p">),&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">suite_id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">TEXT&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c1">-- &amp;#39;safety-es&amp;#39;, &amp;#39;support-helpfulness&amp;#39;
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">metric&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">TEXT&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">score&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">NUMERIC&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">judge_model&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">TEXT&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">judged_at&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">TIMESTAMPTZ&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">DEFAULT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">now&lt;/span>&lt;span class="p">(),&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">PRIMARY&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">KEY&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">adapter_id&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">suite_id&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">metric&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">CREATE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">OR&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">REPLACE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">FUNCTION&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">serve&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">can_promote&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">candidate&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">TEXT&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">current&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">TEXT&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">RETURNS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">BOOLEAN&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="err">$$&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">SELECT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">NOT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">EXISTS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">SELECT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">1&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">FROM&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">train&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">eval_result&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">c&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">JOIN&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">train&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">eval_result&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">p&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">USING&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">suite_id&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">metric&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">WHERE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">c&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">adapter_id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">candidate&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">AND&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">p&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">adapter_id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">current&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">AND&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">suite_id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">IN&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;safety-es&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="s1">&amp;#39;support-helpfulness&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="s1">&amp;#39;refusal-rate&amp;#39;&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">AND&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">c&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">score&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">&amp;lt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">p&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">score&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">*&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="mi">98&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c1">-- 2 % tolerance
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="err">$$&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">LANGUAGE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">sql&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">STABLE&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>An SQL function as the gate. Usable from CI with &lt;code>psql -c &amp;quot;SELECT serve.can_promote('v4.2','v4.1')&amp;quot;&lt;/code> and an exit code of 0/1. No orchestrator needed, no specific UI needed. The audit stays in the Postgres log.&lt;/p>
&lt;h2 id="vllm-multi-lora-the-deploy-is-an-http-post">vLLM multi-LoRA: the deploy is an HTTP POST&lt;/h2>
&lt;p>Two years ago, deploying a new fine-tune meant rotating inference pods. Today it is an HTTP call. vLLM 0.7+ supports loading and unloading LoRA adapters &lt;strong>hot&lt;/strong>, keeping several resident in VRAM and choosing the right one per request.&lt;/p>
&lt;p>Server configuration:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">vllm serve meta-llama/Llama-3.1-8B-Instruct &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --enable-lora &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --max-loras &lt;span class="m">4&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --max-lora-rank &lt;span class="m">64&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --env &lt;span class="nv">VLLM_ALLOW_RUNTIME_LORA_UPDATING&lt;/span>&lt;span class="o">=&lt;/span>True
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Deploying a new adapter:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">curl -X POST http://localhost:8000/v1/load_lora_adapter &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -H &lt;span class="s2">&amp;#34;Content-Type: application/json&amp;#34;&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -d &lt;span class="s1">&amp;#39;{
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s1"> &amp;#34;lora_name&amp;#34;: &amp;#34;support-es-v4.2&amp;#34;,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s1"> &amp;#34;lora_path&amp;#34;: &amp;#34;/mnt/adapters/support-es-v4.2&amp;#34;
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s1"> }&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>From that moment on, requests including &lt;code>&amp;quot;model&amp;quot;: &amp;quot;support-es-v4.2&amp;quot;&lt;/code> are served with that adapter applied on top of the base model. Switching between adapters has negligible latency (the most recent research on Activated LoRA takes this to levels where the switching cost is invisible).&lt;/p>
&lt;p>This changes operations substantially. &lt;strong>Deploying a new fine-tune stops being an infrastructure event and becomes a state change in Postgres&lt;/strong>. The router queries the &lt;code>serve.adapter&lt;/code> table, sees that &lt;code>v4.2&lt;/code> is in &lt;code>canary&lt;/code> with &lt;code>traffic_pct=5&lt;/code>, and directs 5 % of requests to the new adapter. The exact route of that 5 % is decided with deterministic hashing of the &lt;code>user_id&lt;/code> so that the same user always sees the same variant (sticky):&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-sql" data-lang="sql">&lt;span class="line">&lt;span class="cl">&lt;span class="c1">-- No assignment table, no additional state
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">-- the variant is computed in-place in SQL or in the router:
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="k">SELECT&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">CASE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">WHEN&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">hashtext&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="err">$&lt;/span>&lt;span class="n">user_id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">||&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="err">$&lt;/span>&lt;span class="n">experiment&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">%&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">100&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="o">&amp;lt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">SELECT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">traffic_pct&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">FROM&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">serve&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">adapter&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">WHERE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="err">$&lt;/span>&lt;span class="n">candidate&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">THEN&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="err">$&lt;/span>&lt;span class="n">candidate&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">ELSE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="err">$&lt;/span>&lt;span class="k">current&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">END&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">adapter_id&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="ab-with-real-traffic-measure-or-live-deceived">A/B with real traffic: measure or live deceived&lt;/h2>
&lt;p>The eval gates measure against fixed benchmarks. That is necessary but insufficient. Reality is only measured with real traffic. Once the adapter is in canary, what matters are the &lt;strong>online metrics&lt;/strong> measured over &lt;code>obs.inference_log&lt;/code> for each variant:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-sql" data-lang="sql">&lt;span class="line">&lt;span class="cl">&lt;span class="k">SELECT&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">adapter_id&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">COUNT&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="o">*&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">n&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">AVG&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">fb_explicit&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">mean_score&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">STDDEV&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">fb_explicit&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">/&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">SQRT&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">COUNT&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="o">*&lt;/span>&lt;span class="p">))&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">sem&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">AVG&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">ttft_ms&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ttft_avg&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">percentile_cont&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="mi">5&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">WITHIN&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">GROUP&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">ORDER&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">BY&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ttft_ms&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ttft_p50&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">percentile_cont&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="mi">95&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">WITHIN&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">GROUP&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">ORDER&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">BY&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ttft_ms&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ttft_p95&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">AVG&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">CASE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">WHEN&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">fb_regen&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">THEN&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">1&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">ELSE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">END&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">regen_rate&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">FROM&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">obs&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">inference_log&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">WHERE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">experiment&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="err">$&lt;/span>&lt;span class="mi">1&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">AND&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">created_at&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">&amp;gt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">now&lt;/span>&lt;span class="p">()&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">-&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">interval&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;7 days&amp;#39;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">GROUP&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">BY&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">adapter_id&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>What to look at: explicit feedback, latency (TTFT, p50, p95), regeneration rate. An adapter that raises the mean feedback but also raises the regeneration rate is suspicious, probably it is responding in a flashier but less useful way. An adapter that lowers latency but lowers feedback may be worth studying: it may be being more concise than it should.&lt;/p>
&lt;p>Promotion to &lt;code>prod&lt;/code> happens when, after 24-72 hours in canary, the candidate adapter beats the current one on at least one key metric without degrading the others. Again: it is an &lt;code>UPDATE&lt;/code> in Postgres.&lt;/p>
&lt;h2 id="applied-to-typical-on-premise-hardware">Applied to typical on-premise hardware&lt;/h2>
&lt;p>Let us come down to two representative configurations, one for iteration and one for production.&lt;/p>
&lt;h3 id="case-1--rtx-4090-24-gb-for-development-iteration">Case 1 — RTX 4090 (24 GB) for development iteration&lt;/h3>
&lt;p>An RTX 4090 with 4-bit QLoRA can train adapters on an 8B model without trouble. The VRAM budget combines four components; the &lt;a href="https://blog.lo0.es/en/posts/kv-cache-working-memory-llm-inference/">KV cache&lt;/a> during the intermediate evaluations is not negligible and deserves an explicit margin:&lt;/p>
&lt;pre tabindex="0">&lt;code>8B base model in 4-bit: ~5 GB
Activations + gradients: ~8 GB (depends on batch and context)
Optimizer state (LoRA r=16): ~0.5 GB
KV cache during eval: ~2 GB
Safety margin: ~8 GB
&lt;/code>&lt;/pre>&lt;p>Typical times (an estimate based on community benchmarks; measure in the lab before promising anything):&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Dataset&lt;/th>
&lt;th>Technique&lt;/th>
&lt;th style="text-align:right">Adapter rank&lt;/th>
&lt;th style="text-align:right">Approximate time&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>1,000 SFT examples&lt;/td>
&lt;td>LoRA r=16&lt;/td>
&lt;td style="text-align:right">16&lt;/td>
&lt;td style="text-align:right">20-40 min&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>5,000 SFT examples&lt;/td>
&lt;td>LoRA r=32&lt;/td>
&lt;td style="text-align:right">32&lt;/td>
&lt;td style="text-align:right">2-4 h&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>2,000 DPO pairs&lt;/td>
&lt;td>LoRA r=16&lt;/td>
&lt;td style="text-align:right">16&lt;/td>
&lt;td style="text-align:right">1-2 h&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>5,000 KTO examples&lt;/td>
&lt;td>LoRA r=32&lt;/td>
&lt;td style="text-align:right">32&lt;/td>
&lt;td style="text-align:right">3-5 h&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>This puts the iteration cycle, a change in the dataset, retrain, eval, look at the number, in the range of a &lt;strong>working day&lt;/strong>. Enough to validate a hypothesis before moving anything to the production cluster.&lt;/p>
&lt;h3 id="case-2--4h100-sxm-cluster-320-gb-nvlink-for-production">Case 2 — 4×H100 SXM cluster (320 GB, NVLink) for production&lt;/h3>
&lt;p>With a cluster of this order the whole picture changes. You can:&lt;/p>
&lt;ul>
&lt;li>Train &lt;strong>LoRA on a 70B in BF16 with no quantisation&lt;/strong> with tensor parallel = 4.&lt;/li>
&lt;li>Do &lt;strong>full DPO with a resident reference model&lt;/strong> when the reference is quantised to FP8, or move to &lt;strong>SimPO / ORPO&lt;/strong>, which remove that intermediate model and simplify VRAM planning (see the table of techniques above).&lt;/li>
&lt;li>Support &lt;strong>multi-tenant fine-tuning&lt;/strong>: several customer adapters training in parallel in separate logical pipelines, each isolated in a different Postgres partition with its own ACLs.&lt;/li>
&lt;li>Serve &lt;strong>multi-LoRA with &lt;code>--max-loras 8&lt;/code>&lt;/strong> on top of the base model without concurrency lowering throughput perceptibly.&lt;/li>
&lt;/ul>
&lt;p>The practical budgeting rule: over a 12-month horizon, a team with this cluster can run &lt;strong>~150-200 continuous fine-tuning cycles&lt;/strong> (training + eval + canary + promotion or discard) if the discipline around the dataset and the eval gates is strict. If it is not, it will run twice as many but with half the usefulness.&lt;/p>
&lt;h2 id="position-within-the-architecture-what-this-article-covers-and-what-it-does-not">Position within the architecture: what this article covers and what it does not&lt;/h2>
&lt;p>To place the scope: the cycle drawn at the start has seven boxes, all of them covered here in their mechanics. Three cross-cutting layers are &lt;strong>deliberately left out&lt;/strong>, and they are the ones that end up separating a pipeline that works technically from one that survives an audit:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Cryptographic provenance and traceability.&lt;/strong> We have mentioned &lt;code>dataset_snapshot&lt;/code> and &lt;code>pg_audit&lt;/code>, but the complete mechanics, the &lt;code>set_hash&lt;/code> over the examples, the integration with the EU AI Act, the frozen &lt;code>query_sql&lt;/code> as proof of what trained the model, is enough for a whole analysis.&lt;/li>
&lt;li>&lt;strong>Judge calibration.&lt;/strong> We have assumed LLM-as-judge works. It needs calibrating against a human rubric on at least 100 cases per critical suite before trusting it. Without that calibration, the eval gates are theatre.&lt;/li>
&lt;li>&lt;strong>The forgetting problem.&lt;/strong> What happens if a user exercises their GDPR right to be forgotten and their interactions were part of the dataset of an adapter already in production? There is no clean solution. There are options, incremental retrain, sample-level machine unlearning, negative LoRA, and it is worth knowing them before a customer asks.&lt;/li>
&lt;/ol>
&lt;h2 id="what-we-have-not-covered-upcoming-articles">What we have not covered (upcoming articles)&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Cryptographic provenance on Postgres&lt;/strong>: how &lt;code>set_hash&lt;/code> and a frozen &lt;code>query_sql&lt;/code> compose an auditable chain of custody under the EU AI Act.&lt;/li>
&lt;li>&lt;strong>Honest judge calibration&lt;/strong>: why &lt;code>score &amp;gt; 0.85&lt;/code> means nothing without a human baseline, and how to build that baseline without it costing a month of work.&lt;/li>
&lt;li>&lt;strong>The forgetting problem in adapters&lt;/strong>: sample-level machine unlearning, incremental retrain and other techniques for answering GDPR without throwing the adapter away.&lt;/li>
&lt;li>&lt;strong>Online DPO and on-policy continual learning&lt;/strong>: the state of 2026 research (Fast-Slow Chasing, RLOO, iterative on-policy) and why it is not production yet.&lt;/li>
&lt;/ul>
&lt;h2 id="see-also">See also&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/">The six-stage LLMOps pipeline&lt;/a> — the master map the Tune and Retrain stages belong to. This post is the operational deep-dive of that cycle.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/mlops-for-llms-landscape-2026/">LLM-specific MLOps in 2026: the landscape&lt;/a> — the opening of the series. It places continuous fine-tuning within the framework of three modalities (fine-tuning, RAG, agents) and seven structural differences from classic MLOps.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/postgresql-qdrant-rag-ingestion-postman-syncing-two-worlds/">PostgreSQL + Qdrant in the ingestion stage&lt;/a> — the Data stage that feeds this cycle: how events enter Postgres and embeddings enter Qdrant, which this post would then curate as a dataset.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">Evals: the layer after tracing&lt;/a> — the Eval stage of the pipeline. The eval gates described here as SQL predicates are the materialisation of that post&amp;rsquo;s generic framework.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/gpu-cluster-as-multi-tenant-platform/">The GPU cluster as a multi-tenant platform&lt;/a> — the Deploy stage where the multi-LoRA hot-swap described here coexists with quotas, gateway and isolation.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/kv-cache-working-memory-llm-inference/">KV cache: the working memory that holds up LLM inference&lt;/a> — the fundamentals of the cache that comes into play in every intermediate eval of the training and in every deployment of the resulting adapter.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/pagedattention-vllm-block-manager/">PagedAttention from the inside&lt;/a> — the mechanics of the KV cache and the landscape of optimisations (vAttention, EvicPress, RadixAttention) that hold up the throughput of the intermediate evals in the fine-tuning pipeline.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">Disaggregated serving: prefill and decode in specialised pods&lt;/a> — the serving pattern the multi-LoRA hot-swap described here connects to: each specialised pod loads its adapters separately.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/data-versioning-llmops-dvc-lakefs-reproducible-golden-dataset/">Data versioning for LLMOps: DVC, lakeFS and a reproducible golden dataset&lt;/a> — the opposite position. This post defends a minimalist stack (Postgres + pgvector + S3) with no DVC/lakeFS; the other explains when the line is crossed and why.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/modern-alignment-dpo-kto-orpo-simpo/">Modern alignment: DPO, KTO, ORPO and SimPO&lt;/a> — the mathematical foundations behind each of the preference optimisation methods this post uses operationally. Derivation of DPO from RLHF, a numerical example, biases.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/llm-as-judge-exam-marker-not-oracle/">LLM-as-judge: the exam marker that evaluates other models&lt;/a> — the mechanism that generates the &lt;code>(chosen, rejected)&lt;/code> pairs that then feed DPO/SimPO/ORPO in this cycle.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/quantization-llm-inference-fp8-int4-gguf/">Quantisation for LLM inference: FP8, INT4 and GGUF&lt;/a> — the QLoRA with NF4 that holds up the training on an RTX 4090 is the quantisation family seen in detail there. And the DPO reference model is quantised with the same formats to free VRAM.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/multi-lora-serving-shared-base-concurrent-adapters-sgmv-kernel/">Multi-LoRA serving: the single translator with a thousand glossaries&lt;/a> — the other side of the loop. This post trains the adapters; multi-LoRA serving (SGMV, S-LoRA, vLLM/LoRAX) is what puts hundreds of them to work concurrently against a single base without replicating the base.&lt;/li>
&lt;/ul>
&lt;h2 id="references">References&lt;/h2>
&lt;ul>
&lt;li>Hu et al., &lt;em>LoRA: Low-Rank Adaptation of Large Language Models&lt;/em> (ICLR 2022).&lt;/li>
&lt;li>Dettmers et al., &lt;em>QLoRA: Efficient Finetuning of Quantized LLMs&lt;/em> (NeurIPS 2023).&lt;/li>
&lt;li>Rafailov et al., &lt;em>Direct Preference Optimization: Your Language Model is Secretly a Reward Model&lt;/em> (NeurIPS 2023).&lt;/li>
&lt;li>Meng, Xia, Chen, &lt;em>SimPO: Simple Preference Optimization with a Reference-Free Reward&lt;/em> (NeurIPS 2024).&lt;/li>
&lt;li>Hong et al., &lt;em>ORPO: Monolithic Preference Optimization without Reference Model&lt;/em> (2024).&lt;/li>
&lt;li>Ethayarajh et al., &lt;em>KTO: Model Alignment as Prospect Theoretic Optimization&lt;/em> (2024).&lt;/li>
&lt;li>Kwon et al., &lt;em>Efficient Memory Management for Large Language Model Serving with PagedAttention&lt;/em> (SOSP 2023) — original vLLM.&lt;/li>
&lt;li>Official vLLM Multi-LoRA documentation: &lt;a href="https://docs.vllm.ai/en/stable/features/lora/">https://docs.vllm.ai/en/stable/features/lora/&lt;/a>.&lt;/li>
&lt;li>Official pgvector 0.8 documentation: &lt;a href="https://github.com/pgvector/pgvector">https://github.com/pgvector/pgvector&lt;/a>.&lt;/li>
&lt;li>TRL (HuggingFace) docs: &lt;a href="https://huggingface.co/docs/trl">https://huggingface.co/docs/trl&lt;/a>.&lt;/li>
&lt;li>EU AI Act, consolidated text and application timeline: &lt;a href="https://artificialintelligenceact.eu/">https://artificialintelligenceact.eu/&lt;/a>.&lt;/li>
&lt;/ul></description></item><item><title>The GPU cluster as a platform: turning a shared cluster into a multi-tenant service your teams can consume</title><link>https://blog.lo0.es/en/posts/gpu-cluster-as-multi-tenant-platform/</link><pubDate>Thu, 21 May 2026 07:15:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/gpu-cluster-as-multi-tenant-platform/</guid><description>&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>Having an expensive GPU cluster and many different workloads that want to use it is not an infrastructure problem: it is an internal product problem. What separates &amp;ldquo;we have a cluster&amp;rdquo; from &amp;ldquo;we have an inference platform&amp;rdquo; are four layers the market consolidated in 2026: a gateway layer that centralises authentication, routing and policies (LiteLLM, Portkey, Kong AI Gateway); a GPU isolation model appropriate to the tenants&amp;rsquo; profile (MIG hardware isolation for untrusted multi-tenant, MPS for processes from the same team, time-slicing only for dev); a quota and rate limiting system with budgets per tenant/team/project (LiteLLM does this in its core at team/user/api-key level with descriptive 429s); and a multi-tenant observability plane that enables real cost attribution (showback as an intermediate step, chargeback as the destination), per-tenant tracing and differentiated dashboards. Applied to a typical mid-scale GPU cluster (one node with 4-8 H100 SXM and NVLink, a common place to start in production), this translates into concrete decisions: with ~640 GB of aggregate VRAM across 8 GPUs and two typical production models (a large 70B+ model with tensor parallel and a replicated mid-sized model), the cluster serves between &lt;strong>tens and low hundreds of simultaneous sessions&lt;/strong> depending on the mix; GPU isolation is usually resolved with MIG on smaller workloads and per-model dedication on large ones; and the platform&amp;rsquo;s success metric is effective utilisation, which in typical production sits at 30-40% and where the reasonable optimisation target is to push it to 60-70% without degrading SLAs.&lt;/p>
&lt;blockquote>
&lt;p>This is the fifth post in the MLOps for LLMs series. It is the most operationally oriented one and cuts across several pipeline stages (Deploy + Observe plus cross-cutting concerns). The &amp;ldquo;you are here&amp;rdquo; marker flags the two active stages because the notion of a multi-tenant platform does not live in just one.&lt;/p>
&lt;/blockquote>
&lt;h2 id="you-are-here-deploy--observe-the-cluster-as-a-product">You are here: Deploy + Observe (the cluster as a product)&lt;/h2>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 90" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="you are here: Deploy + Observe">
&lt;style>.box{stroke:#444;stroke-width:1.4;rx:6}.active{fill:#7adb7a;stroke-width:3}.active2{fill:#c47aff;stroke-width:3}.idle{fill:#f4f4f4}.lbl{font:600 12px sans-serif;fill:#222}.arr{stroke:#666;stroke-width:1.4;fill:none;marker-end:url(#mt1)}.cyc{stroke:#888;stroke-width:1.2;fill:none;stroke-dasharray:4 2;marker-end:url(#mt1)}&lt;/style>
&lt;defs>&lt;marker id="mt1" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#666"/>&lt;/marker>&lt;/defs>
&lt;text x="390" y="20" text-anchor="middle" class="lbl">You are here: DEPLOY + OBSERVE · the cluster as a platform with tenants&lt;/text>
&lt;rect x="30" y="35" width="110" height="35" class="box idle"/>&lt;text x="85" y="58" text-anchor="middle" class="lbl">1 · Data&lt;/text>
&lt;rect x="155" y="35" width="110" height="35" class="box idle"/>&lt;text x="210" y="58" text-anchor="middle" class="lbl">2 · Tune&lt;/text>
&lt;rect x="280" y="35" width="110" height="35" class="box idle"/>&lt;text x="335" y="58" text-anchor="middle" class="lbl">3 · Eval&lt;/text>
&lt;rect x="405" y="35" width="110" height="35" class="box active"/>&lt;text x="460" y="58" text-anchor="middle" class="lbl">4 · Deploy&lt;/text>
&lt;rect x="530" y="35" width="110" height="35" class="box active2"/>&lt;text x="585" y="58" text-anchor="middle" class="lbl">5 · Observe&lt;/text>
&lt;rect x="655" y="35" width="110" height="35" class="box idle"/>&lt;text x="710" y="58" text-anchor="middle" class="lbl">6 · Retrain&lt;/text>
&lt;path class="arr" d="M140,52 L155,52"/>&lt;path class="arr" d="M265,52 L280,52"/>&lt;path class="arr" d="M390,52 L405,52"/>&lt;path class="arr" d="M515,52 L530,52"/>&lt;path class="arr" d="M640,52 L655,52"/>
&lt;path class="cyc" d="M710,72 L710,82 L85,82 L85,72"/>
&lt;/svg>
&lt;/div>
&lt;h2 id="the-question-that-changes-the-framing">The question that changes the framing&lt;/h2>
&lt;p>When a platform team buys expensive GPU hardware and starts building inference, the first version is almost always single-purpose: one model, one client, one target latency. It works. When the second team turns up asking for the same resource, that single purpose becomes internal politics: how many replicas do we give them? What do we do if the SLAs clash? Who pays for the tokens of team B&amp;rsquo;s experiment? And when the third one arrives, what was an SRE project becomes an internal product project.&lt;/p>
&lt;p>The distinction is not technical, it is one of framing. A cluster is infrastructure. A platform is a service with customers, contracts and success metrics. The change of framing implies:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Identifiable customers&lt;/strong> (tenants), not anonymous users.&lt;/li>
&lt;li>&lt;strong>Contracts&lt;/strong> (latency SLA, guaranteed throughput, available models), not &amp;ldquo;whatever we manage&amp;rdquo;.&lt;/li>
&lt;li>&lt;strong>Success metrics&lt;/strong> that are not technical but product ones: adoption, satisfaction, cost per query per tenant, time to the first &amp;ldquo;hello world&amp;rdquo;.&lt;/li>
&lt;/ul>
&lt;p>This post walks through how that change of framing is carried out. It lands it on a mid-scale cluster (4-8 H100 SXM with NVLink in a single node), the usual configuration when starting with serious LLM inference; but the principles generalise to any topology, from a single node with two GPUs to multi-node clusters with InfiniBand.&lt;/p>
&lt;h2 id="the-four-layers-of-a-multi-tenant-inference-platform">The four layers of a multi-tenant inference platform&lt;/h2>
&lt;p>The canonical architecture that settled in 2026 has four layers that any serious multi-tenant platform implements, from the outside in:&lt;/p>
&lt;div class="diagram" style="max-width:780px;margin:1.5rem auto;">
&lt;svg viewBox="0 0 780 410" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Four layers of a multi-tenant platform">
&lt;style>.title{font:700 13px sans-serif;fill:#222}.lbl{font:600 12px sans-serif;fill:#222}.sm{font:11px sans-serif;fill:#555}.tiny{font:10px sans-serif;fill:#666}.layer{stroke:#444;stroke-width:1.5;rx:6}.gw{fill:#ffe9d6}.pol{fill:#d6eaff}.iso{fill:#d9f5d6}.obs{fill:#e9d6f5}.cluster{stroke:#666;stroke-dasharray:4 2;fill:none}.tenant{stroke:#888;stroke-width:1.4;fill:#fffce6;rx:4}.arr{stroke:#666;stroke-width:1.4;fill:none;marker-end:url(#pm1)}&lt;/style>
&lt;defs>&lt;marker id="pm1" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#666"/>&lt;/marker>&lt;/defs>
&lt;text x="390" y="22" text-anchor="middle" class="title">The four layers of the multi-tenant platform&lt;/text>
&lt;rect x="40" y="50" width="100" height="40" class="tenant"/>&lt;text x="90" y="68" text-anchor="middle" class="sm">Tenant A&lt;/text>&lt;text x="90" y="82" text-anchor="middle" class="tiny">support chat&lt;/text>
&lt;rect x="160" y="50" width="100" height="40" class="tenant"/>&lt;text x="210" y="68" text-anchor="middle" class="sm">Tenant B&lt;/text>&lt;text x="210" y="82" text-anchor="middle" class="tiny">legal RAG&lt;/text>
&lt;rect x="280" y="50" width="100" height="40" class="tenant"/>&lt;text x="330" y="68" text-anchor="middle" class="sm">Tenant C&lt;/text>&lt;text x="330" y="82" text-anchor="middle" class="tiny">code agent&lt;/text>
&lt;rect x="400" y="50" width="100" height="40" class="tenant"/>&lt;text x="450" y="68" text-anchor="middle" class="sm">Tenant D&lt;/text>&lt;text x="450" y="82" text-anchor="middle" class="tiny">data extr.&lt;/text>
&lt;rect x="520" y="50" width="100" height="40" class="tenant"/>&lt;text x="570" y="68" text-anchor="middle" class="sm">Tenant E&lt;/text>&lt;text x="570" y="82" text-anchor="middle" class="tiny">batch ETL&lt;/text>
&lt;rect x="640" y="50" width="100" height="40" class="tenant"/>&lt;text x="690" y="68" text-anchor="middle" class="sm">notebooks&lt;/text>&lt;text x="690" y="82" text-anchor="middle" class="tiny">research&lt;/text>
&lt;rect x="40" y="120" width="700" height="60" class="layer gw"/>
&lt;text x="390" y="144" text-anchor="middle" class="lbl">Layer 1 · AI Gateway&lt;/text>
&lt;text x="55" y="166" class="sm">Auth (OIDC/API keys) · Routing by model · Failover · Caching · Logging · OTel emission · Rate limiting&lt;/text>
&lt;rect x="40" y="195" width="700" height="60" class="layer pol"/>
&lt;text x="390" y="219" text-anchor="middle" class="lbl">Layer 2 · Policy &amp;amp; Quota Plane&lt;/text>
&lt;text x="55" y="241" class="sm">RPS/TPM quotas per tenant · Monthly budgets · Model whitelist · Priority classes · Admission control&lt;/text>
&lt;rect x="40" y="270" width="700" height="60" class="layer iso"/>
&lt;text x="390" y="294" text-anchor="middle" class="lbl">Layer 3 · Isolation Plane&lt;/text>
&lt;text x="55" y="316" class="sm">MIG / MPS / time-slicing · K8s namespaces · NetworkPolicies · ResourceQuotas · Priority + preemption&lt;/text>
&lt;rect x="40" y="345" width="700" height="55" class="layer obs"/>
&lt;text x="390" y="369" text-anchor="middle" class="lbl">Layer 4 · Observability Plane (multi-tenant)&lt;/text>
&lt;text x="55" y="391" class="sm">Traces with tenant_id · Labelled metrics · Cost attribution · Per-tenant dashboards · Audit logs&lt;/text>
&lt;path class="arr" d="M90,90 L390,120"/>
&lt;path class="arr" d="M450,90 L390,120"/>
&lt;path class="arr" d="M690,90 L390,120"/>
&lt;/svg>
&lt;/div>
&lt;p>Each layer solves a concrete problem. Let us take them one by one.&lt;/p>
&lt;h2 id="layer-1--ai-gateway-the-single-front-door">Layer 1 — AI Gateway: the single front door&lt;/h2>
&lt;p>The AI Gateway is the component your tenants see. It is an HTTP/gRPC API compatible with OpenAI (typically &lt;code>/v1/chat/completions&lt;/code>, &lt;code>/v1/embeddings&lt;/code>, &lt;code>/v1/models&lt;/code>) that centralises everything that happens before touching the inference backends.&lt;/p>
&lt;h3 id="why-centralise">Why centralise&lt;/h3>
&lt;p>Without a gateway, tenants connect directly to vLLM or whatever the model is. Every change (rotating an endpoint, adding a model, changing credentials, applying a policy) means notifying every tenant. Every tenant has its own retry logic, its own logging, its own auth model. It is unworkable from the third customer onwards.&lt;/p>
&lt;p>With a gateway, the change is made in one place. Tenants have a stable URL and a set of credentials; the rest is the gateway&amp;rsquo;s problem.&lt;/p>
&lt;h3 id="the-three-dominant-options-in-2026">The three dominant options in 2026&lt;/h3>
&lt;p>&lt;strong>&lt;a href="https://docs.litellm.ai/">LiteLLM&lt;/a>&lt;/strong> is the most popular OSS option, Python-first, deployed as a proxy. It supports 100+ providers (OpenAI, Anthropic, Bedrock, self-hosted vLLM, Ollama, and so on) behind a unified OpenAI-compatible API. It has a native multi-tenant hierarchy with Organizations → Teams → Users → API Keys, each level with its own budget. The Apache 2.0 version covers the basics; RBAC, SSO, audit logs and team-level enforcement require the paid Enterprise version. Deployed on K8s with the official Helm chart.&lt;/p>
&lt;p>&lt;strong>&lt;a href="https://portkey.ai/">Portkey&lt;/a>&lt;/strong> is the most mature commercial / SaaS option. A single control plane that enforces budgets, quotas, permissions and compliance. Real-time spending tracking with alerting. RBAC, audit, workspaces and SSO included. The trade-off: dependency on an external service and a per-request pricing model.&lt;/p>
&lt;p>&lt;strong>&lt;a href="https://konghq.com/blog/enterprise/llm-cost-management-ai-showback-and-chargeback">Kong AI Gateway&lt;/a>&lt;/strong> is the option for organisations that already have Kong as their API gateway. An AI plug-in on top of the existing Kong gateway, integrated with its plugin, consumer and rate-limit model. If your platform team already runs Kong, it is the lowest friction.&lt;/p>
&lt;h3 id="when-to-choose-each-one">When to choose each one&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Situation&lt;/th>
&lt;th>Gateway&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Pure OSS, self-hosted, Python-first team&lt;/td>
&lt;td>&lt;strong>LiteLLM&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>You need RBAC, SSO, audit log out of the box, and have budget&lt;/td>
&lt;td>&lt;strong>Portkey&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>You already run Kong as a corporate API gateway&lt;/td>
&lt;td>&lt;strong>Kong AI Gateway&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Greenfield enterprise with strict compliance&lt;/td>
&lt;td>Portkey (probably)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Mid-sized OSS-first company without regulated compliance&lt;/td>
&lt;td>LiteLLM (typically)&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h3 id="the-minimum-the-gateway-has-to-do">The minimum the gateway has to do&lt;/h3>
&lt;p>Whichever option you pick, this is what any serious deployment must enforce:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Auth and identity&lt;/strong>: every request carries an API key resolvable to a tenant + user + team.&lt;/li>
&lt;li>&lt;strong>Routing by model&lt;/strong>: the tenant asks for &lt;code>model: &amp;quot;gpt-4o&amp;quot;&lt;/code>; the gateway decides whether it goes to OpenAI, to Azure OpenAI, or to your vLLM with Qwen3 32B (a cheaper fallback), according to policy.&lt;/li>
&lt;li>&lt;strong>Rate limiting&lt;/strong>: RPS per tenant, TPM (tokens per minute), concurrency limits.&lt;/li>
&lt;li>&lt;strong>Caching of identical responses&lt;/strong>: 5-30% of RAG queries are repeats; caching saves latency and cost.&lt;/li>
&lt;li>&lt;strong>OTel emission&lt;/strong>: every call produces a span with &lt;code>gen_ai.*&lt;/code> semantic conventions and &lt;code>tenant_id&lt;/code> as an attribute. Covered in the &lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">Evals post&lt;/a> and &lt;a href="https://blog.lo0.es/en/posts/mcp-deep-observability-opentelemetry/">MCP observability&lt;/a>.&lt;/li>
&lt;li>&lt;strong>Failover&lt;/strong>: if vLLM goes down, the gateway redirects to the OpenAI API. If OpenAI rate-limits, the gateway falls back to Anthropic. Configurable policy.&lt;/li>
&lt;/ul>
&lt;h3 id="example-of-a-multi-tenant-litellm-configuration">Example of a multi-tenant LiteLLM configuration&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-yaml" data-lang="yaml">&lt;span class="line">&lt;span class="cl">&lt;span class="c"># litellm-config.yaml — simplified example&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">model_list&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">model_name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">llama-3-70b&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">litellm_params&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">model&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">openai/llama-3-70b&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">api_base&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">http://vllm-llama3-70b.inference/v1&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">api_key&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">os.environ/VLLM_API_KEY&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">model_name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">qwen3-32b&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">litellm_params&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">model&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">openai/qwen3-32b&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">api_base&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">http://vllm-qwen3-32b.inference/v1&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">api_key&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">os.environ/VLLM_API_KEY&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">model_name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">gpt-4o&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">litellm_params&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">model&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">openai/gpt-4o&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">api_key&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">os.environ/OPENAI_API_KEY&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">router_settings&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">routing_strategy&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">usage-based-routing-v2&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">fallbacks&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">llama-3-70b&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="l">qwen3-32b, gpt-4o] &lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># if vLLM goes down, fall back to the external one&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">general_settings&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">master_key&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">os.environ/LITELLM_MASTER_KEY&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">database_url&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">os.environ/DATABASE_URL &lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># Postgres for budgets/keys&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c"># Hierarchy: Organizations → Teams → Users → API Keys&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c"># Created via the API, not in static YAML&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Creating a team with a budget:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">curl -X POST http://litellm/team/new &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -H &lt;span class="s2">&amp;#34;Authorization: Bearer &lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nv">LITELLM_MASTER_KEY&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -d &lt;span class="s1">&amp;#39;{
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s1"> &amp;#34;team_alias&amp;#34;: &amp;#34;soporte-chat&amp;#34;,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s1"> &amp;#34;max_budget&amp;#34;: 500, # 500 USD/month
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s1"> &amp;#34;budget_duration&amp;#34;: &amp;#34;30d&amp;#34;,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s1"> &amp;#34;tpm_limit&amp;#34;: 100000, # 100K tokens/min
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s1"> &amp;#34;rpm_limit&amp;#34;: 1000, # 1000 requests/min
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s1"> &amp;#34;models&amp;#34;: [&amp;#34;llama-3-70b&amp;#34;, &amp;#34;qwen3-32b&amp;#34;] # access to these
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s1"> }&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>And the team&amp;rsquo;s API key:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">curl -X POST http://litellm/key/generate &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -H &lt;span class="s2">&amp;#34;Authorization: Bearer &lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nv">LITELLM_MASTER_KEY&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -d &lt;span class="s1">&amp;#39;{
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s1"> &amp;#34;team_id&amp;#34;: &amp;#34;&amp;lt;team-id&amp;gt;&amp;#34;,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s1"> &amp;#34;duration&amp;#34;: &amp;#34;30d&amp;#34;,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s1"> &amp;#34;metadata&amp;#34;: {&amp;#34;environment&amp;#34;: &amp;#34;production&amp;#34;, &amp;#34;app&amp;#34;: &amp;#34;support-bot&amp;#34;}
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s1"> }&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>That API key is what the tenant uses. Every request made with it consumes from the team&amp;rsquo;s budget. When it runs out, LiteLLM returns HTTP 429 with a description.&lt;/p>
&lt;h2 id="layer-2--policy--quota-plane-what-each-tenant-can-do">Layer 2 — Policy &amp;amp; Quota Plane: what each tenant can do&lt;/h2>
&lt;p>The gateway is where enforcement happens. Policy is what gets enforced. Five axes of multi-tenant policy:&lt;/p>
&lt;h3 id="technical-quotas">Technical quotas&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>TPM&lt;/strong> (tokens per minute): the hard consumption limit. For a Llama 3 70B at TP=5, ~3000 sustained output tokens/s = 180K aggregate TPM. If you have 10 tenants, assign 18K each as the ceiling.&lt;/li>
&lt;li>&lt;strong>RPS / RPM&lt;/strong>: load control, not consumption control. A 4K-token session counts as one request; so does a batch of 100 mini-completions. Useful against abuse.&lt;/li>
&lt;li>&lt;strong>Concurrency&lt;/strong>: how many simultaneous active requests per tenant. Important for latency SLAs: 100 RPS with concurrency=50 works out at 2 seconds per request.&lt;/li>
&lt;/ul>
&lt;h3 id="economic-budgets">Economic budgets&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>Monthly per tenant&lt;/strong>: a hard cap in USD.&lt;/li>
&lt;li>&lt;strong>Daily and hourly&lt;/strong>: soft caps to avoid a runaway in a single day.&lt;/li>
&lt;li>&lt;strong>Per project / API key&lt;/strong>: fine granularity within a single tenant.&lt;/li>
&lt;/ul>
&lt;p>LiteLLM has a &lt;code>max_budget&lt;/code> field at every level of the hierarchy (organization, team, user, api key). Budgets are inherited and constrained downwards.&lt;/p>
&lt;h3 id="model-whitelist-and-blacklist">Model whitelist and blacklist&lt;/h3>
&lt;p>Tenants with critical workloads → only stable models (&lt;code>llama-3-70b&lt;/code>, &lt;code>gpt-4o&lt;/code>). Research tenants → access to experimental models as well.&lt;/p>
&lt;h3 id="priority-classes">Priority classes&lt;/h3>
&lt;p>Not all requests are equal. Three typical classes:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Guaranteed&lt;/strong>: workloads with an SLA, latency respected even under pressure.&lt;/li>
&lt;li>&lt;strong>Best-effort&lt;/strong>: normal workloads without a strict SLA.&lt;/li>
&lt;li>&lt;strong>Spot&lt;/strong>: batches that can wait, evictable if a guaranteed one arrives.&lt;/li>
&lt;/ul>
&lt;p>The &lt;a href="https://arxiv.org/abs/2603.00356">Token Management in Multi-Tenant AI Inference Platforms&lt;/a> paper (2026) formalises this with a model of token pools per priority class that has started to be adopted in production. It maintains guaranteed P99 latency for guaranteed workloads even under overload, with selective throttling of spot.&lt;/p>
&lt;h3 id="admission-control">Admission control&lt;/h3>
&lt;p>Before accepting a request: is there capacity? If not, return 429 immediately instead of queueing and degrading everyone. It is the most underrated operational discipline. A cluster with admission control done properly has predictable latency; without it, catastrophic degradation when the peak arrives.&lt;/p>
&lt;h3 id="the-typical-pattern-in-2026">The typical pattern in 2026&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-yaml" data-lang="yaml">&lt;span class="line">&lt;span class="cl">&lt;span class="c"># Conceptual policy for a &amp;#34;soporte-chat&amp;#34; tenant&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">tenant&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">soporte-chat&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">quotas&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">tpm&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">50000&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">rpm&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">500&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">max_concurrency&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">30&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">budget&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">monthly_usd&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">800&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">alert_thresholds&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="m">0.5&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">0.8&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">0.95&lt;/span>&lt;span class="p">]&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># warn when you get there&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">models_allowed&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">llama-3-70b&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">qwen3-32b&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">priority&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">guaranteed&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">fallback_on_overload&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">qwen3-32b &lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># if guaranteed fills up, fall back&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">gpt-4o-mini &lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># last resort, external model&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="layer-3--isolation-plane-isolating-workloads-physically">Layer 3 — Isolation Plane: isolating workloads physically&lt;/h2>
&lt;p>This is the technically densest layer. You have a node with several H100 SXM GPUs interconnected by NVLink. How do you partition them between tenants?&lt;/p>
&lt;h3 id="three-nvidia-mechanisms-for-sharing-a-gpu">Three NVIDIA mechanisms for sharing a GPU&lt;/h3>
&lt;p>&lt;strong>MIG (Multi-Instance GPU)&lt;/strong> is the strongest isolation. It partitions the GPU into up to 7 instances with physically separate HBM memory and dedicated compute units (SMs). Tenants in different MIG instances cannot touch each other: one workload does not consume memory another needs, one does not degrade another&amp;rsquo;s throughput. Hardware isolation. Available on A100, H100, B100 and B200.&lt;/p>
&lt;p>&lt;strong>MPS (Multi-Process Service)&lt;/strong> is soft. Several processes share the GPU concurrently and NVIDIA distributes SMs according to usage. Good performance if all the processes are yours and you trust them. Worse for multi-tenant setups between customers who do not know each other, because a noisy process can degrade the others.&lt;/p>
&lt;p>&lt;strong>Time-slicing&lt;/strong> is the simplest: the GPU is assigned alternately, slot by slot, to different processes. Much worse latency (waits between slots); not recommended for production workloads with an SLA.&lt;/p>
&lt;h3 id="the-choice-for-multi-tenant-in-2026">The choice for multi-tenant in 2026&lt;/h3>
&lt;p>According to the enterprise adoption survey: 80% use MIG for untrusted multi-tenant (different customers who do not know each other) and MPS for trusted environments (processes from the same team) where you want to maximise throughput. Time-slicing is only used in dev/staging so that every developer can touch a GPU without the cost of exclusivity.&lt;/p>
&lt;p>An important limitation of MIG: it isolates compute and HBM memory, but the PCIe path remains shared. For PCIe-bound workloads (a lot of host↔device traffic), tenants in different MIG instances can still affect each other. For LLM inference the main path is HBM, so this is rarely a problem. But it is worth knowing.&lt;/p>
&lt;h3 id="mig-partitions-on-the-h100">MIG partitions on the H100&lt;/h3>
&lt;p>An H100 (80GB HBM3) can be partitioned into fixed profiles:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Profile&lt;/th>
&lt;th>SM&lt;/th>
&lt;th>Memory&lt;/th>
&lt;th>Max instances per GPU&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>1g.10gb&lt;/td>
&lt;td>14&lt;/td>
&lt;td>10 GB&lt;/td>
&lt;td>7&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>1g.20gb&lt;/td>
&lt;td>14&lt;/td>
&lt;td>20 GB&lt;/td>
&lt;td>4&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>2g.20gb&lt;/td>
&lt;td>28&lt;/td>
&lt;td>20 GB&lt;/td>
&lt;td>3&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>3g.40gb&lt;/td>
&lt;td>42&lt;/td>
&lt;td>40 GB&lt;/td>
&lt;td>2&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>7g.80gb&lt;/td>
&lt;td>98&lt;/td>
&lt;td>80 GB&lt;/td>
&lt;td>1 (the whole GPU)&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>For a mid-scale cluster with NVLink, MIG has a fundamental problem: when you partition with MIG, NVLink between GPUs is disabled. An H100 in MIG mode does &lt;strong>not&lt;/strong> take part in multi-GPU tensor parallel. If you are going to serve a large model with tensor parallel (Llama 3 70B with TP=4 or TP=8, for instance), those GPUs have to be whole, without MIG.&lt;/p>
&lt;p>That defines the architectural decision. There are two main approaches:&lt;/p>
&lt;h3 id="approach-a--a-shared-large-model-with-quotas-at-the-gateway">Approach A — A shared large model with quotas at the gateway&lt;/h3>
&lt;p>All the node&amp;rsquo;s GPUs serve a single large model with tensor parallel spanning the whole node. All tenants share that instance. Isolation happens at the gateway layer (quotas, rate limiting) and the policy layer (priority classes). The cluster&amp;rsquo;s kernel is one enormous vLLM instance with &lt;code>--max-num-seqs=128&lt;/code> or similar; internally, vLLM shares GPU time between the active requests with continuous batching.&lt;/p>
&lt;p>&lt;strong>Advantages&lt;/strong>: you use all the GPUs to the full, NVLink stays active, better KV cache utilisation.
&lt;strong>Disadvantages&lt;/strong>: soft isolation. A tenant that saturates does not degrade the others directly (vLLM batches), but it does compete for batch slots. You need serious priority classes.&lt;/p>
&lt;h3 id="approach-b--dedicating-gpus-per-model--tenant">Approach B — Dedicating GPUs per model / tenant&lt;/h3>
&lt;p>You split the GPUs into pools dedicated to different models. Examples on an 8-GPU node:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>4 GPUs&lt;/strong>: a large 70B model with TP=4.&lt;/li>
&lt;li>&lt;strong>2 GPUs&lt;/strong>: a mid-sized 32B model replicated (2 independent instances) for tenants with a strict SLA.&lt;/li>
&lt;li>&lt;strong>2 GPUs&lt;/strong>: miscellaneous workloads (smaller models, experimentation).&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Advantages&lt;/strong>: physical isolation between critical models / tenants.
&lt;strong>Disadvantages&lt;/strong>: worse aggregate utilisation; some GPUs idle while others saturate.&lt;/p>
&lt;h3 id="approach-c-advanced--mig-on-some-gpus-plus-dedication-for-the-rest">Approach C (advanced) — MIG on some GPUs plus dedication for the rest&lt;/h3>
&lt;p>If you have small workloads (4B, 7B models), you can use MIG on 1-2 GPUs to serve them and dedicate the rest to tensor parallel for the large model. It combines strong isolation for the small workloads with full use of NVLink for the large model.&lt;/p>
&lt;h3 id="the-operational-choice-start-with-a-move-up-to-c-if-you-need-to">The operational choice: start with A, move up to C if you need to&lt;/h3>
&lt;p>In most deployments, Approach A (a shared large model plus quotas) is the right starting point. Utilisation is better, operation is simpler, and the gateway&amp;rsquo;s soft isolation works for reasonable workloads.&lt;/p>
&lt;p>When there is a tenant with a strict SLA that cannot tolerate competing with others, you move to Approach B for that tenant in particular (dedicating GPUs to an instance of the model just for them), keeping the rest of the cluster shared.&lt;/p>
&lt;p>Approach C is for when you have 10+ tenants with very heterogeneous profiles.&lt;/p>
&lt;h3 id="isolation-at-the-kubernetes-level">Isolation at the Kubernetes level&lt;/h3>
&lt;p>Independently of GPU isolation, pod-level isolation is applied in K8s:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Namespaces per tenant&lt;/strong>: &lt;code>tenant-soporte&lt;/code>, &lt;code>tenant-legal&lt;/code>, and so on.&lt;/li>
&lt;li>&lt;strong>ResourceQuotas and LimitRanges&lt;/strong>: CPU/memory limits per namespace.&lt;/li>
&lt;li>&lt;strong>NetworkPolicies&lt;/strong>: tenant A cannot talk to tenant B&amp;rsquo;s namespaces.&lt;/li>
&lt;li>&lt;strong>K8s PriorityClasses&lt;/strong>: classes with a numeric value defining preemption order if a more critical pod arrives.&lt;/li>
&lt;li>&lt;strong>PodDisruptionBudgets&lt;/strong>: how many pods of each deployment can go down simultaneously.&lt;/li>
&lt;/ul>
&lt;h2 id="layer-4--observability-plane-seeing-what-happens-per-tenant">Layer 4 — Observability Plane: seeing what happens per tenant&lt;/h2>
&lt;p>The fourth layer: observability with a tenant dimension. Without it you cannot do cost attribution, you cannot debug incidents for a single tenant, you cannot show dashboards to stakeholders.&lt;/p>
&lt;h3 id="the-four-mandatory-properties">The four mandatory properties&lt;/h3>
&lt;p>&lt;strong>1. tenant_id on every span&lt;/strong>. The AI gateway resolves the API key and attributes a &lt;code>tenant_id&lt;/code>. That ID is propagated via &lt;code>params._meta&lt;/code> or OTel headers to every downstream component (vLLM, retrieval, MCP servers, tools). Any span in any system carries that label. It is what lets you reconstruct tenant-specific traces.&lt;/p>
&lt;p>&lt;strong>2. Metrics labelled per tenant&lt;/strong>. &lt;code>gen_ai.usage.input_tokens{tenant=&amp;quot;soporte-chat&amp;quot;}&lt;/code> or equivalents. Prometheus, Grafana, groupable by tenant.&lt;/p>
&lt;p>&lt;strong>3. Real cost attribution&lt;/strong>. The sum of tokens × cost/token per tenant gives the cost. For self-hosted vLLM, the cost is per GPU hour plus the proportional share of tokens (you can compute an equivalent cost per 1k tokens).&lt;/p>
&lt;p>&lt;strong>4. An immutable audit log&lt;/strong>. Every API key used, every model invoked, every quota change, every budget exceeded. For compliance.&lt;/p>
&lt;h3 id="showback-vs-chargeback">Showback vs chargeback&lt;/h3>
&lt;p>An important FinOps distinction that gained clarity in 2026:&lt;/p>
&lt;p>&lt;strong>Showback&lt;/strong>: visibility without consequence. &amp;ldquo;Support team, you have consumed 623 USD this month on LLMs&amp;rdquo;. Information, not an invoice. It lets you spot abuse without penalising anyone before the team understands what is going on.&lt;/p>
&lt;p>&lt;strong>Chargeback&lt;/strong>: the cost is charged to the team&amp;rsquo;s budget. When it runs out, it runs out. It changes behaviour.&lt;/p>
&lt;p>The practice that works: 6-18 months on showback while tags are calibrated, misattributions are identified and teams are trained. Then chargeback, once the numbers are credible. Launching chargeback on day 1 when the costs are still dirty creates an immediate political fight; launching showback prepares the ground so that chargeback lands in an orderly way.&lt;/p>
&lt;p>&lt;a href="https://spendark.com/blog/kubernetes-cost-allocation/">Only 14% of organisations have chargeback active&lt;/a> according to a recent survey, which indicates this is still mostly showback in real production.&lt;/p>
&lt;h3 id="tools">Tools&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>&lt;a href="https://www.kubecost.com/">Kubecost&lt;/a>&lt;/strong>: cost allocation per namespace, deployment and pod on Kubernetes. For the cost of the shared GPU, allocate proportionally to the tokens consumed per tenant.&lt;/li>
&lt;li>&lt;strong>&lt;a href="https://www.finout.io/">Finout&lt;/a>&lt;/strong>: a FinOps platform that combines cloud bills and LLM API costs in a unified view with virtual tagging.&lt;/li>
&lt;li>&lt;strong>&lt;a href="https://langfuse.com/">Langfuse&lt;/a>&lt;/strong>: already covered. Cost tracking per trace, groupable by user or session metadata.&lt;/li>
&lt;li>&lt;strong>LiteLLM native tracking&lt;/strong>: LiteLLM&amp;rsquo;s master DB keeps running spend per team, user and API key, accessible via the API or the UI.&lt;/li>
&lt;/ul>
&lt;h3 id="the-minimum-multi-tenant-dashboard">The minimum multi-tenant dashboard&lt;/h3>
&lt;p>Any platform should have:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Summary per tenant&lt;/strong>: monthly spend, current RPS, TPM consumed, % of budget spent, active sessions.&lt;/li>
&lt;li>&lt;strong>Top users&lt;/strong> within each tenant (for detecting internal abuse).&lt;/li>
&lt;li>&lt;strong>p95 latency per tenant&lt;/strong>: SLA tracking.&lt;/li>
&lt;li>&lt;strong>429 / 503 errors&lt;/strong>: how many requests are being rate-limited or rejected because of overload.&lt;/li>
&lt;li>&lt;strong>Cost trend&lt;/strong>: the monthly trajectory with a projection.&lt;/li>
&lt;li>&lt;strong>Drift per tenant&lt;/strong> (from the post-tracing series): if a tenant starts getting worse results, raise an alert.&lt;/li>
&lt;/ol>
&lt;h2 id="sizing-on-mid-scale-gpu-clusters-concrete-decisions">Sizing on mid-scale GPU clusters: concrete decisions&lt;/h2>
&lt;p>Let us get down to hardware. As a reference we take a node with N H100 SXM (between 4 and 8) with NVLink/NVSwitch, 80 GB HBM3 each. That gives between 320 GB and 640 GB of aggregate VRAM. Inter-GPU connectivity is 900 GB/s (NVLink 4) or 600 GB/s (NVLink 3) depending on generation. HBM bandwidth per GPU is 3.35 TB/s.&lt;/p>
&lt;h3 id="default-decisions">Default decisions&lt;/h3>
&lt;p>Start with Approach A: all the node&amp;rsquo;s GPUs serving a single large 70B model in BF16 with tensor parallel = N. Expected real capacity (computed for a standard 8-GPU HGX node as an example; it scales roughly linearly with N):&lt;/p>
&lt;ul>
&lt;li>Model VRAM (70B BF16): ~140 GB (≈ 17.5 GB/GPU at TP=8).&lt;/li>
&lt;li>vLLM overhead + activations VRAM: ~10 GB/GPU.&lt;/li>
&lt;li>VRAM free for KV cache: ~52 GB/GPU. On an 8-GPU node that is &lt;strong>~416 GB aggregate&lt;/strong>; on a 4-GPU one, ~210 GB.&lt;/li>
&lt;li>With &lt;code>--kv-cache-dtype=fp8&lt;/code> and a 70B GQA model: ~320 KB/token.&lt;/li>
&lt;li>Aggregate cache capacity (8-GPU node): &lt;strong>~1.3M tokens&lt;/strong> to distribute between simultaneous sessions.&lt;/li>
&lt;/ul>
&lt;p>That translates into throughput and concurrency (indicative figures for an 8-GPU node):&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th style="text-align:right">Simultaneous sessions&lt;/th>
&lt;th style="text-align:right">Average context per session&lt;/th>
&lt;th style="text-align:right">Aggregate throughput (tokens/s)&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td style="text-align:right">32&lt;/td>
&lt;td style="text-align:right">16K&lt;/td>
&lt;td style="text-align:right">~5000&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td style="text-align:right">64&lt;/td>
&lt;td style="text-align:right">8K&lt;/td>
&lt;td style="text-align:right">~8000&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td style="text-align:right">128&lt;/td>
&lt;td style="text-align:right">4K&lt;/td>
&lt;td style="text-align:right">~12000&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Typical latencies: TTFT ~150ms at low traffic, TPOT ~15-20 ms/tok. Under high concurrency, TTFT rises to ~500ms if the queue is saturated.&lt;/p>
&lt;h3 id="an-example-tenant-scheme">An example tenant scheme&lt;/h3>
&lt;p>A cluster with 4 tenants and a research pool:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Tenant&lt;/th>
&lt;th style="text-align:right">TPM cap&lt;/th>
&lt;th style="text-align:right">RPM cap&lt;/th>
&lt;th style="text-align:right">Concurrency&lt;/th>
&lt;th style="text-align:right">Budget&lt;/th>
&lt;th>Priority&lt;/th>
&lt;th>Models&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Support chat&lt;/td>
&lt;td style="text-align:right">80K&lt;/td>
&lt;td style="text-align:right">800&lt;/td>
&lt;td style="text-align:right">50&lt;/td>
&lt;td style="text-align:right">1500 USD/month&lt;/td>
&lt;td>Guaranteed&lt;/td>
&lt;td>llama-3-70b, qwen3-32b&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Legal RAG&lt;/td>
&lt;td style="text-align:right">30K&lt;/td>
&lt;td style="text-align:right">200&lt;/td>
&lt;td style="text-align:right">15&lt;/td>
&lt;td style="text-align:right">600 USD/month&lt;/td>
&lt;td>Guaranteed&lt;/td>
&lt;td>llama-3-70b&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Code agent&lt;/td>
&lt;td style="text-align:right">50K&lt;/td>
&lt;td style="text-align:right">300&lt;/td>
&lt;td style="text-align:right">25&lt;/td>
&lt;td style="text-align:right">1200 USD/month&lt;/td>
&lt;td>Best-effort&lt;/td>
&lt;td>llama-3-70b, qwen-coder&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Data extr. batch&lt;/td>
&lt;td style="text-align:right">40K&lt;/td>
&lt;td style="text-align:right">1000&lt;/td>
&lt;td style="text-align:right">40&lt;/td>
&lt;td style="text-align:right">400 USD/month&lt;/td>
&lt;td>Spot&lt;/td>
&lt;td>llama-3-70b, qwen3-32b&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Research / notebooks&lt;/td>
&lt;td style="text-align:right">10K&lt;/td>
&lt;td style="text-align:right">100&lt;/td>
&lt;td style="text-align:right">5&lt;/td>
&lt;td style="text-align:right">200 USD/month&lt;/td>
&lt;td>Spot&lt;/td>
&lt;td>all&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>TPM total: 210K. Aggregate cluster capacity: ~180K sustained TPM. It is overcommitted by about 15%, assuming not every tenant hits the ceiling at the same time. That is normal and desirable; if they all do it at once, the priority classes degrade in an orderly way.&lt;/p>
&lt;h3 id="when-to-add-hardware">When to add hardware&lt;/h3>
&lt;p>Signals that the node has become too small:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Sustained p95 TTFT &amp;gt; 500 ms&lt;/strong> during peak hours → the queue is building up.&lt;/li>
&lt;li>&lt;strong>&lt;code>vllm:num_requests_waiting&lt;/code> constantly &amp;gt; 20&lt;/strong> → admission control starting to reject.&lt;/li>
&lt;li>&lt;strong>Sustained GPU utilisation &amp;gt; 80% at critical hours&lt;/strong> without dropping in quiet hours → there is no headroom.&lt;/li>
&lt;li>&lt;strong>429 rate on guaranteed tenants &amp;gt; 1%&lt;/strong> → the platform is breaking its SLA in production.&lt;/li>
&lt;/ul>
&lt;p>When several of these hold, the natural next step is to add another HGX node with internal NVLink and stand up a second vLLM instance of the same model. The gateway load-balances between the two instances. Aggregate throughput doubles; latency stays the same.&lt;/p>
&lt;h2 id="common-operational-traps">Common operational traps&lt;/h2>
&lt;h3 id="a-gateway-without-auth-a-backdoor-into-the-cluster">A gateway without auth: a backdoor into the cluster&lt;/h3>
&lt;p>Your vLLM sits on a ClusterIP Service and the main app talks to it. Some tenant discovers the endpoint directly and hits it without going through the gateway. Quotas and costs are silently evaded. Use a strict NetworkPolicy: only the gateway can talk to the vLLM Services; the rest of the cluster cannot.&lt;/p>
&lt;h3 id="mig-and-nvlink-are-incompatible">MIG and NVLink are incompatible&lt;/h3>
&lt;p>You enable MIG on a GPU thinking you will get isolation plus multi-GPU; you discover that MIG disables NVLink. Any large model with TP becomes unusable. Decide MIG vs NVLink globally per cluster, not per individual GPU.&lt;/p>
&lt;h3 id="quotas-pinned-to-the-clusters-ceiling">Quotas pinned to the cluster&amp;rsquo;s ceiling&lt;/h3>
&lt;p>You add up the TPM of all the tenants and it comes to exactly the cluster&amp;rsquo;s capacity. When two tenants peak at the same time, both wait or one gets rejected. An overcommit of 10-20% is healthy (it assumes they do not all peak at once); more than that is dangerous.&lt;/p>
&lt;h3 id="no-multi-tenant-observability-from-day-1">No multi-tenant observability from day 1&lt;/h3>
&lt;p>You launch with quotas and isolation but without tenant_id on spans. Three months later, your CFO asks &amp;ldquo;how much does the support agent cost versus the legal one?&amp;rdquo; and you cannot answer. OTel with a mandatory tenant_id from the first version, even if there are no dashboards yet; having the data is worth more than having perfect dashboards with no data.&lt;/p>
&lt;h3 id="showback-that-never-reaches-chargeback">Showback that never reaches chargeback&lt;/h3>
&lt;p>You have been on showback for 18 months, the teams know the numbers, nobody changes behaviour. Without the pressure of real chargeback, the incentive dilutes. Set an explicit calendar for the transition to chargeback, with an owner and a deadline.&lt;/p>
&lt;h3 id="non-whitelisted-models-eating-the-budget">Non-whitelisted models eating the budget&lt;/h3>
&lt;p>A team discovers that LiteLLM has &lt;code>gpt-4o&lt;/code> configured. They use it without permission. The budget burns on an external API when the idea was to use the cheap self-hosted one. Keep an explicit per-team whitelist of accessible models.&lt;/p>
&lt;h3 id="badly-calibrated-priority-classes">Badly calibrated priority classes&lt;/h3>
&lt;p>Everyone declares themselves &amp;ldquo;guaranteed&amp;rdquo;. At the first peak, there is nothing left to degrade and everything suffers. Priority classes only for critical cases, with justification. The majority should be best-effort.&lt;/p>
&lt;h3 id="no-failover-from-the-gateway">No failover from the gateway&lt;/h3>
&lt;p>Your vLLM goes down. The gateway has no fallback configured and returns 503 to every tenant. Configure a fallback to another model, ideally an external one (OpenAI) for guaranteed workloads, even if it costs more per hour. Availability is worth more than cost per hour.&lt;/p>
&lt;h2 id="an-operational-roadmap-for-getting-started">An operational roadmap for getting started&lt;/h2>
&lt;p>If you start from scratch with an empty GPU node, the minimum order is as follows. Each milestone is a day&amp;rsquo;s work with slack, not a tight one:&lt;/p>
&lt;p>&lt;strong>Day 1-2 — Base K8s infrastructure&lt;/strong>. NVIDIA GPU Operator + nvidia-device-plugin + dcgm-exporter + cluster-default NetworkPolicies. Validation: a basic pod with &lt;code>nvidia.com/gpu: 1&lt;/code> gets scheduled.&lt;/p>
&lt;p>&lt;strong>Day 3 — vLLM with a large model and tensor parallel across the whole node&lt;/strong>. The vLLM Production Stack Helm chart (or bare vLLM manifests). Model weights on a shared PVC (CephFS or NFS). Validation: a &lt;code>curl&lt;/code> request against the internal Service responds.&lt;/p>
&lt;p>&lt;strong>Day 4 — AI Gateway: LiteLLM&lt;/strong>. Helm chart, Postgres for budgets, master key, a first model_list pointing at vLLM. Validation: an OpenAI-compatible request through LiteLLM responds with the same content as vLLM directly.&lt;/p>
&lt;p>&lt;strong>Day 5 — Basic multi-tenancy&lt;/strong>. Create teams, API keys, budgets, model whitelists. Test with two teams. Validation: the second team, using the model it does not have whitelisted, gets a 403.&lt;/p>
&lt;p>&lt;strong>Day 6 — Minimum observability&lt;/strong>. Prometheus + Grafana scraping vLLM and LiteLLM. A dashboard with TTFT, TPOT, throughput, num_requests_waiting and budget_consumed_per_team. Validation: visible in Grafana with real data.&lt;/p>
&lt;p>&lt;strong>Day 7-8 — Pilot customer&lt;/strong>. One real tenant (ideally a controlled internal one) starts using it. Measure real latencies, discover the first operational incidents.&lt;/p>
&lt;p>&lt;strong>Day 9-10 — Tuning&lt;/strong>. Adjust &lt;code>--max-num-seqs&lt;/code>, &lt;code>--gpu-memory-utilization&lt;/code>, priority classes and quotas based on what the pilot taught you.&lt;/p>
&lt;p>&lt;strong>Day 11-14 — Onboarding the second tenant plus iteration&lt;/strong>. Repeat. Every new tenant onboarded reveals new cases.&lt;/p>
&lt;p>After two weeks you have an operational platform with two real tenants and data to decide whether it is ready for more. The line of progress from here on is horizontal (more tenants) until you saturate; from then on, vertical (more hardware).&lt;/p>
&lt;h2 id="what-we-have-not-covered-upcoming-posts">What we have not covered (upcoming posts)&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Continuous fine-tuning in production&lt;/strong> (post 6, already decided): LoRA/QLoRA/DPO, dataset curation, eval gates, A/B versioning with real traffic between model versions.&lt;/li>
&lt;li>&lt;strong>Constitutional AI and alignment at runtime&lt;/strong>: an option still on the table.&lt;/li>
&lt;li>&lt;strong>Edge LLMs&lt;/strong>: when an H100 cluster is too expensive for a specific workload, distilled models running on NPUs or consumer GPUs.&lt;/li>
&lt;li>&lt;strong>GPU networking deep dive&lt;/strong>: NCCL, InfiniBand, GPUDirect, RDMA. For multi-node clusters with cross-host tensor parallel.&lt;/li>
&lt;/ul>
&lt;h2 id="references">References&lt;/h2>
&lt;p>Multi-tenancy and GPU isolation:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://www.linuxoperatingsystem.net/multitenant-gpu-infrastructure-4-powerful-design-rules/">Multitenant GPU Infrastructure: 4 Powerful Design Rules&lt;/a> — survey of enterprise patterns.&lt;/li>
&lt;li>&lt;a href="https://www.spheron.network/blog/run-multiple-llms-one-gpu-mig-time-slicing-guide/">Run Multiple LLMs on One GPU: MIG, Time-Slicing, and MPS Guide (Spheron)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://sagar-parmar.medium.com/a-practical-guide-to-gpu-partitioning-with-mig-on-on-prem-servers-and-kubernetes-797ccea7e1c7">A Practical Guide to GPU Partitioning with MIG (Medium)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://www.suse.com/c/kubecon-eu-2026-nvidia-mig-suse-virtualization/">GPU Partitioning for AI Workloads: NVIDIA MIG with SUSE Virtualization (KubeCon EU 2026)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://arxiv.org/abs/2508.20274">Predictable LLM Serving on GPU Clusters (arxiv 2508.20274)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://arxiv.org/abs/2603.00356">Token Management in Multi-Tenant AI Inference Platforms (arxiv 2603.00356)&lt;/a> — paper on priority + admission control.&lt;/li>
&lt;/ul>
&lt;p>AI Gateways:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://docs.litellm.ai/docs/proxy/multi_tenant_architecture">LiteLLM — Multi-Tenant Architecture&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://docs.litellm.ai/docs/proxy/users">LiteLLM — Budgets and Rate Limits&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://portkey.ai/">Portkey AI Gateway&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://konghq.com/blog/enterprise/llm-cost-management-ai-showback-and-chargeback">Kong AI Gateway — LLM Cost Management&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://www.spheron.network/blog/ai-gateway-litellm-portkey-kong-gpu-cloud/">AI Gateway Setup 2026: LiteLLM, Portkey, Kong (Spheron)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://techsy.io/en/blog/best-llm-gateway-tools">Stop Juggling LLM APIs: 8 Gateways Ranked 2026 (TECHSY)&lt;/a>.&lt;/li>
&lt;/ul>
&lt;p>Multi-tenant FinOps:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://www.digiusher.com/blog/the-death-of-cost-allocation-why-chargeback-models-are-failing-in-the-kubernetes-and-ai-era/">The Death of Chargeback in the Kubernetes and AI Era (DigiUsher)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://medium.com/@nicholasthoni/how-to-actually-track-kubernetes-costs-in-2026-a-practical-guide-to-showback-chargeback-and-the-6a4c23f9cf51">How to Actually Track Kubernetes Costs in 2026 (Medium)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://konghq.com/blog/enterprise/llm-cost-management-ai-showback-and-chargeback">LLM Cost Management: AI Showback and Chargeback (Kong)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://www.kubecost.com/">Kubecost — cost allocation&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://www.finout.io/">Finout — FinOps + AI costs&lt;/a>.&lt;/li>
&lt;/ul>
&lt;p>Cross-references:&lt;/p>
&lt;ul>
&lt;li>Previous posts in series 4: &lt;a href="https://blog.lo0.es/en/posts/mlops-for-llms-landscape-2026/">MLOps for LLMs overview&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/rag-on-kafka-reference-architecture-streaming-datalakes/">RAG over Kafka&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/">The six-stage pipeline&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/postgresql-qdrant-rag-ingestion-postman-syncing-two-worlds/">PostgreSQL + Qdrant&lt;/a>.&lt;/li>
&lt;li>Relevant posts from the inference series: &lt;a href="https://blog.lo0.es/en/posts/vllm-kubernetes-llm-inference-that-scales/">vLLM on Kubernetes&lt;/a> — the multi-GPU HGX node scenario we develop here. &lt;a href="https://blog.lo0.es/en/posts/llm-inference-operators-kubernetes/">LLM operators on K8s&lt;/a> — the vLLM Production Stack and OME that the gateway can direct.&lt;/li>
&lt;li>Observability: &lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">Evals&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/mcp-deep-observability-opentelemetry/">MCP observability&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/ebpf-local-inference-statistical-drift-detection/">eBPF + drift&lt;/a>.&lt;/li>
&lt;/ul></description></item><item><title>The six-stage LLMOps pipeline: global architecture and a deep dive into every component</title><link>https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/</link><pubDate>Thu, 21 May 2026 06:30:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/</guid><description>&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>The first two posts in the series established the &lt;a href="https://blog.lo0.es/en/posts/mlops-for-llms-landscape-2026/">LLMOps landscape&lt;/a> and went down into the detail of the &lt;a href="https://blog.lo0.es/en/posts/rag-on-kafka-reference-architecture-streaming-datalakes/">data pipeline with Kafka&lt;/a>. This post does the intermediate zoom: it draws &lt;strong>the complete map of the system&lt;/strong>, a global architecture of a modern LLMOps setup with all the pieces the field has settled on in 2026, and goes into depth on each of the &lt;strong>six canonical stages of the pipeline&lt;/strong>: &lt;strong>Data&lt;/strong>, &lt;strong>Tune&lt;/strong>, &lt;strong>Eval&lt;/strong>, &lt;strong>Deploy&lt;/strong>, &lt;strong>Observe&lt;/strong>, &lt;strong>Retrain&lt;/strong>. For each stage we give the &lt;strong>operational sub-tasks&lt;/strong>, the &lt;strong>dominant tools&lt;/strong>, the &lt;strong>design decisions&lt;/strong> that always show up, and the &lt;strong>specific traps&lt;/strong> that are seen repeatedly in production. And, most important operationally: every stage carries a &lt;strong>&amp;ldquo;you are here&amp;rdquo; mini-map&lt;/strong> over the cycle, which will be reused in any later post in the series to place the reader. The idea: that anyone reading a post about fine-tuning, about prompt versioning, about eval gates or about drift detection can look at the mini-map and know immediately which piece of the larger system they are thinking about that day.&lt;/p>
&lt;blockquote>
&lt;p>This is the &lt;strong>third post in the MLOps series specific to LLMs&lt;/strong>. Previous ones: &lt;a href="https://blog.lo0.es/en/posts/mlops-for-llms-landscape-2026/">Landscape 2026&lt;/a> and &lt;a href="https://blog.lo0.es/en/posts/rag-on-kafka-reference-architecture-streaming-datalakes/">RAG over Kafka&lt;/a>. Here we move from &amp;ldquo;the what&amp;rdquo; and &amp;ldquo;one piece&amp;rdquo; to &lt;strong>the whole map&lt;/strong>, with detail per stage.&lt;/p>
&lt;/blockquote>
&lt;h2 id="the-global-architecture-the-master-map">The global architecture: the master map&lt;/h2>
&lt;p>Before going down into each stage, let us fix the whole map. What follows is the reference drawing of a production LLMOps system in 2026, with every component the field has settled on in its place:&lt;/p>
&lt;div class="diagram" style="max-width:780px;margin:1.5rem auto;">
&lt;svg viewBox="0 0 780 580" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Global LLMOps architecture 2026">
&lt;style>.title{font:700 14px sans-serif;fill:#222}.stage-title{font:700 13px sans-serif;fill:#222}.lbl{font:11px sans-serif;fill:#333}.sm{font:10px sans-serif;fill:#555}.tiny{font:9px sans-serif;fill:#666}.stage{stroke:#444;stroke-width:1.5;rx:8}.data{fill:#ffe9d6}.tune{fill:#ffd6d6}.eval{fill:#d6eaff}.deploy{fill:#d9f5d6}.obs{fill:#e9d6f5}.retrain{fill:#fff5b0}.cross{fill:#f0f0f0;stroke:#888;stroke-dasharray:4 2;rx:6}.arr{stroke:#444;stroke-width:1.6;fill:none;marker-end:url(#ar)}.cycle{stroke:#888;stroke-width:1.4;fill:none;marker-end:url(#ar);stroke-dasharray:6 3}&lt;/style>
&lt;defs>&lt;marker id="ar" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#444"/>&lt;/marker>&lt;/defs>
&lt;text x="390" y="22" text-anchor="middle" class="title">Global LLMOps architecture 2026 — the six stages and the cross-cutting components&lt;/text>
&lt;rect x="20" y="50" width="240" height="170" class="stage data"/>
&lt;text x="140" y="72" text-anchor="middle" class="stage-title">1 · DATA&lt;/text>
&lt;text x="35" y="92" class="sm">• Sources: OLTP, APIs, logs, scraping&lt;/text>
&lt;text x="35" y="108" class="sm">• CDC: Debezium, Flink CDC&lt;/text>
&lt;text x="35" y="124" class="sm">• Transport: Kafka + Schema Registry&lt;/text>
&lt;text x="35" y="140" class="sm">• Stream proc: Flink SQL, RisingWave&lt;/text>
&lt;text x="35" y="156" class="sm">• Versioning: DVC + lakeFS&lt;/text>
&lt;text x="35" y="172" class="sm">• Tableflow → Iceberg/Delta&lt;/text>
&lt;text x="35" y="188" class="sm">• Vector stores: Milvus, Qdrant,&lt;/text>
&lt;text x="35" y="202" class="sm"> Weaviate, pgvector, LanceDB&lt;/text>
&lt;rect x="280" y="50" width="240" height="170" class="stage tune"/>
&lt;text x="400" y="72" text-anchor="middle" class="stage-title">2 · TUNE&lt;/text>
&lt;text x="295" y="92" class="sm">• Modes: fine-tune / RAG /&lt;/text>
&lt;text x="295" y="106" class="sm"> agent training&lt;/text>
&lt;text x="295" y="124" class="sm">• Frameworks: PEFT, Axolotl, TRL,&lt;/text>
&lt;text x="295" y="138" class="sm"> Unsloth, llama-factory&lt;/text>
&lt;text x="295" y="156" class="sm">• Techniques: LoRA, QLoRA, DPO, RLHF&lt;/text>
&lt;text x="295" y="172" class="sm">• Clusters: H100/B200 + NVLink&lt;/text>
&lt;text x="295" y="188" class="sm">• Experiment tracking: MLflow, W&amp;amp;B&lt;/text>
&lt;text x="295" y="202" class="sm">• Adapter registry: private HF Hub&lt;/text>
&lt;rect x="540" y="50" width="220" height="170" class="stage eval"/>
&lt;text x="650" y="72" text-anchor="middle" class="stage-title">3 · EVAL&lt;/text>
&lt;text x="555" y="92" class="sm">• CI frameworks: DeepEval,&lt;/text>
&lt;text x="555" y="106" class="sm"> Promptfoo, Ragas, OpenAI Evals&lt;/text>
&lt;text x="555" y="124" class="sm">• Platforms: Langfuse, LangSmith,&lt;/text>
&lt;text x="555" y="138" class="sm"> Phoenix, Braintrust&lt;/text>
&lt;text x="555" y="156" class="sm">• Judge LLM (G-Eval, Prometheus)&lt;/text>
&lt;text x="555" y="172" class="sm">• Versioned golden dataset&lt;/text>
&lt;text x="555" y="188" class="sm">• Eval gates in CI/CD&lt;/text>
&lt;text x="555" y="202" class="sm">• Calibration 85-90% vs human&lt;/text>
&lt;rect x="20" y="245" width="240" height="170" class="stage deploy"/>
&lt;text x="140" y="267" text-anchor="middle" class="stage-title">4 · DEPLOY&lt;/text>
&lt;text x="35" y="287" class="sm">• Model registry: MLflow, OME&lt;/text>
&lt;text x="35" y="303" class="sm">• Serving: vLLM, SGLang, TRT-LLM&lt;/text>
&lt;text x="35" y="319" class="sm">• K8s operators: vLLM Prod Stack,&lt;/text>
&lt;text x="35" y="333" class="sm"> KServe, OME, NVIDIA Dynamo, llm-d&lt;/text>
&lt;text x="35" y="349" class="sm">• Gateway / router: LiteLLM&lt;/text>
&lt;text x="35" y="365" class="sm">• Strategies: canary, blue-green,&lt;/text>
&lt;text x="35" y="379" class="sm"> shadow, A/B versioning&lt;/text>
&lt;text x="35" y="395" class="sm">• Autoscaling: KEDA + LLM metrics&lt;/text>
&lt;rect x="280" y="245" width="240" height="170" class="stage obs"/>
&lt;text x="400" y="267" text-anchor="middle" class="stage-title">5 · OBSERVE&lt;/text>
&lt;text x="295" y="287" class="sm">• Tracing: OpenLLMetry, Langfuse,&lt;/text>
&lt;text x="295" y="301" class="sm"> Phoenix, LangSmith&lt;/text>
&lt;text x="295" y="319" class="sm">• Metrics: Prometheus, Grafana&lt;/text>
&lt;text x="295" y="335" class="sm">• Guardrails: NeMo, Llama Guard 4,&lt;/text>
&lt;text x="295" y="349" class="sm"> LLM Guard, Lakera&lt;/text>
&lt;text x="295" y="367" class="sm">• eBPF: Hubble, Tetragon, AgentSight&lt;/text>
&lt;text x="295" y="383" class="sm">• MCP observability (OTel GenAI)&lt;/text>
&lt;text x="295" y="399" class="sm">• Drift: Evidently, NannyML, WhyLabs&lt;/text>
&lt;rect x="540" y="245" width="220" height="170" class="stage retrain"/>
&lt;text x="650" y="267" text-anchor="middle" class="stage-title">6 · RETRAIN&lt;/text>
&lt;text x="555" y="287" class="sm">• Explicit feedback (thumbs)&lt;/text>
&lt;text x="555" y="303" class="sm">• Implicit feedback (latency,&lt;/text>
&lt;text x="555" y="317" class="sm"> abandonment, retries)&lt;/text>
&lt;text x="555" y="335" class="sm">• Incident triaging&lt;/text>
&lt;text x="555" y="351" class="sm">• Dataset enrichment with cases&lt;/text>
&lt;text x="555" y="365" class="sm"> where the model failed&lt;/text>
&lt;text x="555" y="383" class="sm">• Cadence: quarterly or&lt;/text>
&lt;text x="555" y="397" class="sm"> incident-driven&lt;/text>
&lt;rect x="100" y="440" width="580" height="120" class="cross"/>
&lt;text x="390" y="462" text-anchor="middle" class="stage-title">Cross-cutting components (they run through every stage)&lt;/text>
&lt;text x="115" y="482" class="sm">• OpenTelemetry Collector (gen_ai.* and mcp.* semantic conventions)&lt;/text>
&lt;text x="115" y="498" class="sm">• Prompt versioning: Langfuse / MLflow Prompts (v1/v2/v3 versioning + labels + cache)&lt;/text>
&lt;text x="115" y="514" class="sm">• MCP servers + MCP Gateway (Traefik Hub, MintMCP) — tool-model interface&lt;/text>
&lt;text x="115" y="530" class="sm">• Model gateway: LiteLLM (100+ providers unified as one OpenAI-compatible API)&lt;/text>
&lt;text x="115" y="546" class="sm">• Schema Registry (Avro/Protobuf/JSON Schema) shared between data and serving&lt;/text>
&lt;path class="arr" d="M260,135 L280,135"/>
&lt;path class="arr" d="M520,135 L540,135"/>
&lt;path class="arr" d="M650,220 L650,245"/>
&lt;path class="arr" d="M540,330 L520,330"/>
&lt;path class="arr" d="M280,330 L260,330"/>
&lt;path class="arr" d="M140,415 L140,440"/>
&lt;path class="arr" d="M400,415 L400,440"/>
&lt;path class="arr" d="M650,415 L650,440"/>
&lt;path class="cycle" d="M650,330 C780,330 780,135 760,135 L760,135"/>
&lt;text x="745" y="245" class="sm" text-anchor="middle">cycle&lt;/text>
&lt;/svg>
&lt;/div>
&lt;p>What you see: the &lt;strong>six large boxes&lt;/strong> are the stages; the &lt;strong>solid arrows&lt;/strong> are the flow of the pipeline; the &lt;strong>dashed arrow&lt;/strong> that goes from &lt;strong>Retrain&lt;/strong> to &lt;strong>Data&lt;/strong> is the feedback cycle that turns LLMOps into a living process rather than a project that ends. The grey band at the foot holds the &lt;strong>cross-cutting components&lt;/strong> (observability, prompt versioning, MCP, gateway, schema) that run through every stage and connect to each one.&lt;/p>
&lt;p>Three quick readings of the map:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Horizontal, top&lt;/strong>: the happy path, &lt;strong>data → tune → eval&lt;/strong>. What happens while you prepare the model.&lt;/li>
&lt;li>&lt;strong>Horizontal, bottom&lt;/strong>: the service path, &lt;strong>deploy → observe → retrain&lt;/strong>. What happens once the model is alive.&lt;/li>
&lt;li>&lt;strong>Vertical&lt;/strong>: the connection between the two floors. Eval gateway feeds Deploy; Observe feeds Retrain; Retrain returns to Data.&lt;/li>
&lt;/ul>
&lt;p>From here on, every stage will include a &lt;strong>navigation mini-map&lt;/strong> (&amp;ldquo;you are here&amp;rdquo;) to place you in the complete cycle. Let us go through each one.&lt;/p>
&lt;h2 id="stage-1--data-ingestion-transport-versioning-indexing">Stage 1 — Data: ingestion, transport, versioning, indexing&lt;/h2>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 90" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="you are here: Data">
&lt;style>.box{stroke:#444;stroke-width:1.4;rx:6}.active{fill:#ff8a4c;stroke-width:3}.idle{fill:#f4f4f4}.lbl{font:600 12px sans-serif;fill:#222}.arr{stroke:#666;stroke-width:1.4;fill:none;marker-end:url(#mn)}.cyc{stroke:#888;stroke-width:1.2;fill:none;stroke-dasharray:4 2;marker-end:url(#mn)}&lt;/style>
&lt;defs>&lt;marker id="mn" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#666"/>&lt;/marker>&lt;/defs>
&lt;text x="390" y="20" text-anchor="middle" class="lbl">You are here: DATA · ingestion → transport → versioning → indexing&lt;/text>
&lt;rect x="30" y="35" width="110" height="35" class="box active"/>&lt;text x="85" y="58" text-anchor="middle" class="lbl">1 · Data&lt;/text>
&lt;rect x="155" y="35" width="110" height="35" class="box idle"/>&lt;text x="210" y="58" text-anchor="middle" class="lbl">2 · Tune&lt;/text>
&lt;rect x="280" y="35" width="110" height="35" class="box idle"/>&lt;text x="335" y="58" text-anchor="middle" class="lbl">3 · Eval&lt;/text>
&lt;rect x="405" y="35" width="110" height="35" class="box idle"/>&lt;text x="460" y="58" text-anchor="middle" class="lbl">4 · Deploy&lt;/text>
&lt;rect x="530" y="35" width="110" height="35" class="box idle"/>&lt;text x="585" y="58" text-anchor="middle" class="lbl">5 · Observe&lt;/text>
&lt;rect x="655" y="35" width="110" height="35" class="box idle"/>&lt;text x="710" y="58" text-anchor="middle" class="lbl">6 · Retrain&lt;/text>
&lt;path class="arr" d="M140,52 L155,52"/>&lt;path class="arr" d="M265,52 L280,52"/>&lt;path class="arr" d="M390,52 L405,52"/>&lt;path class="arr" d="M515,52 L530,52"/>&lt;path class="arr" d="M640,52 L655,52"/>
&lt;path class="cyc" d="M710,72 L710,82 L85,82 L85,72"/>
&lt;/svg>
&lt;/div>
&lt;h3 id="operational-sub-tasks">Operational sub-tasks&lt;/h3>
&lt;p>The Data stage is the most underrated and the one that blocks the most projects. Its sub-tasks:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Ingestion&lt;/strong> from heterogeneous sources: OLTP databases (Postgres, MySQL), external APIs, file shares, scraping, SaaS systems, application logs, internal messaging.&lt;/li>
&lt;li>&lt;strong>Change capture&lt;/strong> (CDC) in streaming if the data is dynamic. Debezium over Kafka, Flink CDC, modern alternatives such as RisingWave that reads the WAL directly.&lt;/li>
&lt;li>&lt;strong>Transformation&lt;/strong> (cleansing, dedup, normalisation, PII sanitisation).&lt;/li>
&lt;li>&lt;strong>Schema management&lt;/strong>: schema registry, compatible evolution, backward/forward compatibility.&lt;/li>
&lt;li>&lt;strong>Versioning&lt;/strong> of training datasets and golden datasets: DVC + lakeFS (unified in November 2025). Covered in detail in the &lt;a href="https://blog.lo0.es/en/posts/data-versioning-llmops-dvc-lakefs-reproducible-golden-dataset/">dedicated data versioning post&lt;/a>.&lt;/li>
&lt;li>&lt;strong>Indexing&lt;/strong> for RAG: chunking, embeddings, writing to vector stores. Covered in depth in the &lt;a href="https://blog.lo0.es/en/posts/rag-on-kafka-reference-architecture-streaming-datalakes/">Kafka post&lt;/a>.&lt;/li>
&lt;li>&lt;strong>Materialisation&lt;/strong> into analytical tables: Tableflow → Iceberg/Delta, for BI consumption and low-latency queries.&lt;/li>
&lt;/ul>
&lt;h3 id="dominant-tools">Dominant tools&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Sub-task&lt;/th>
&lt;th>Tools 2026&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>CDC&lt;/td>
&lt;td>Debezium, Flink CDC, RisingWave&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Transport&lt;/td>
&lt;td>Kafka (Confluent Cloud, Redpanda, pure Apache)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Schema Registry&lt;/td>
&lt;td>Confluent Schema Registry, Apicurio&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Stream processing&lt;/td>
&lt;td>Apache Flink, RisingWave, Kafka Streams&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Data versioning&lt;/td>
&lt;td>DVC + lakeFS&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Vector stores&lt;/td>
&lt;td>Milvus, Qdrant, Weaviate, pgvector, LanceDB&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Materialised tables&lt;/td>
&lt;td>Tableflow → Iceberg/Delta&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Batch ETL/ELT (where it applies)&lt;/td>
&lt;td>dbt + Snowflake/Databricks&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h3 id="design-decisions">Design decisions&lt;/h3>
&lt;p>The three decisions that always show up:&lt;/p>
&lt;p>&lt;strong>Batch vs streaming&lt;/strong>: the more dynamic the data, the more streaming. For static corpora (manuals that never change) a nightly batch is enough; for transactional data the agent needs to see minute by minute, streaming from day 1.&lt;/p>
&lt;p>&lt;strong>Embedding model&lt;/strong>: changing the embedding model invalidates every indexed vector. An architectural decision: pin the model and have an explicit migration plan (the dual-index pattern seen in the Kafka post).&lt;/p>
&lt;p>&lt;strong>Vector store&lt;/strong>: pgvector if you already run Postgres and you are below 10M vectors; Qdrant if you want mid-scale simplicity; Milvus if you need billions; Weaviate if you value native hybrid search.&lt;/p>
&lt;h3 id="traps">Traps&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>Hardcoding connections to the source&lt;/strong> (with no abstraction): when the database changes (version, host, schema), you break the whole pipeline. An &lt;strong>adapter layer&lt;/strong> from day 1.&lt;/li>
&lt;li>&lt;strong>No schema registry&lt;/strong>: topics start breaking silently.&lt;/li>
&lt;li>&lt;strong>Full reindexing whenever something changes&lt;/strong>: it costs hours or days. Design the &lt;strong>dual-index pattern&lt;/strong> from the start.&lt;/li>
&lt;li>&lt;strong>Unsanitised PII&lt;/strong>: the RAG is serving sensitive data without meaning to. Anonymisation in the pipeline, not at consumption time.&lt;/li>
&lt;/ul>
&lt;h2 id="stage-2--tune-preparing-the-model-for-your-case">Stage 2 — Tune: preparing the model for your case&lt;/h2>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 90" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="you are here: Tune">
&lt;style>.box{stroke:#444;stroke-width:1.4;rx:6}.active{fill:#ff7777;stroke-width:3}.idle{fill:#f4f4f4}.lbl{font:600 12px sans-serif;fill:#222}.arr{stroke:#666;stroke-width:1.4;fill:none;marker-end:url(#mn2)}.cyc{stroke:#888;stroke-width:1.2;fill:none;stroke-dasharray:4 2;marker-end:url(#mn2)}&lt;/style>
&lt;defs>&lt;marker id="mn2" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#666"/>&lt;/marker>&lt;/defs>
&lt;text x="390" y="20" text-anchor="middle" class="lbl">You are here: TUNE · fine-tuning / RAG-as-tuning / agent training&lt;/text>
&lt;rect x="30" y="35" width="110" height="35" class="box idle"/>&lt;text x="85" y="58" text-anchor="middle" class="lbl">1 · Data&lt;/text>
&lt;rect x="155" y="35" width="110" height="35" class="box active"/>&lt;text x="210" y="58" text-anchor="middle" class="lbl">2 · Tune&lt;/text>
&lt;rect x="280" y="35" width="110" height="35" class="box idle"/>&lt;text x="335" y="58" text-anchor="middle" class="lbl">3 · Eval&lt;/text>
&lt;rect x="405" y="35" width="110" height="35" class="box idle"/>&lt;text x="460" y="58" text-anchor="middle" class="lbl">4 · Deploy&lt;/text>
&lt;rect x="530" y="35" width="110" height="35" class="box idle"/>&lt;text x="585" y="58" text-anchor="middle" class="lbl">5 · Observe&lt;/text>
&lt;rect x="655" y="35" width="110" height="35" class="box idle"/>&lt;text x="710" y="58" text-anchor="middle" class="lbl">6 · Retrain&lt;/text>
&lt;path class="arr" d="M140,52 L155,52"/>&lt;path class="arr" d="M265,52 L280,52"/>&lt;path class="arr" d="M390,52 L405,52"/>&lt;path class="arr" d="M515,52 L530,52"/>&lt;path class="arr" d="M640,52 L655,52"/>
&lt;path class="cyc" d="M710,72 L710,82 L85,82 L85,72"/>
&lt;/svg>
&lt;/div>
&lt;h3 id="operational-sub-tasks-1">Operational sub-tasks&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>Base model selection&lt;/strong>: Llama, Qwen, Mistral, Gemma, DeepSeek according to licence, size, quality in your domain.&lt;/li>
&lt;li>&lt;strong>Dataset preparation&lt;/strong>: train/val/test split, format (chat templates, JSONL), augmentation where it applies.&lt;/li>
&lt;li>&lt;strong>Adapter configuration&lt;/strong>: LoRA rank, target modules, alpha; QLoRA if you want to train on a consumer GPU; full fine-tune only if you have the budget.&lt;/li>
&lt;li>&lt;strong>Training loop&lt;/strong>: HuggingFace Transformers + PEFT + TRL as the canonical stack; Axolotl or llama-factory as convenience wrappers; Unsloth if you want 2-4× more speed on consumer GPUs.&lt;/li>
&lt;li>&lt;strong>Hyperparameter sweep&lt;/strong>: W&amp;amp;B Sweeps, Optuna, Ray Tune.&lt;/li>
&lt;li>&lt;strong>Checkpointing and resumability&lt;/strong>: save every N steps, resume from failure.&lt;/li>
&lt;li>&lt;strong>Promotion&lt;/strong>: the adapter is promoted to the registry after passing the next stage (Eval).&lt;/li>
&lt;/ul>
&lt;h3 id="the-three-modes-of-tune">The three modes of Tune&lt;/h3>
&lt;p>The detail of the table we saw in the &lt;a href="https://blog.lo0.es/en/posts/mlops-for-llms-landscape-2026/">landscape&lt;/a>:&lt;/p>
&lt;p>&lt;strong>Supervised fine-tuning (SFT)&lt;/strong> with LoRA/QLoRA. You collect (prompt, ideal-response) pairs and apply SFT with cross-entropy loss. The simplest option. The rule of thumb: &lt;strong>300-3,000&lt;/strong> well-curated examples are usually more useful than 50,000 noisy ones.&lt;/p>
&lt;p>&lt;strong>DPO (Direct Preference Optimization)&lt;/strong> and &lt;strong>RLAIF&lt;/strong>. Instead of &amp;ldquo;ideal-response&amp;rdquo;, you collect &lt;strong>(prompt, good_response, bad_response)&lt;/strong> triples and train the model to prefer the good one. More stable than classic RLHF, same objective. It is what most teams use when they go beyond SFT.&lt;/p>
&lt;p>&lt;strong>Agent training&lt;/strong> (RFT / Reinforcement Fine-Tuning, pure RLHF). For cases where the model needs to learn &lt;strong>multistep trajectories&lt;/strong>: when to choose tool A over B, when to ask for confirmation, how to decompose a large task. Far more expensive and complex. OpenAI&amp;rsquo;s work with RFT set the pattern in 2024-2025; in 2026 it is coming out of the experimental phase.&lt;/p>
&lt;p>&lt;strong>RAG as an alternative to Tune&lt;/strong>: although conceptually it is another stage (it lives in Data + Deploy), functionally it competes with fine-tuning for many cases. The 2026 verdict: &lt;strong>hybrid is the default&lt;/strong> (60% of deployments), fine-tune for behaviour plus RAG for volatile knowledge.&lt;/p>
&lt;h3 id="tools">Tools&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Aspect&lt;/th>
&lt;th>Tools 2026&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Base framework&lt;/td>
&lt;td>HuggingFace Transformers, PEFT, TRL&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Convenience wrappers&lt;/td>
&lt;td>Axolotl, llama-factory&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Consumer speed&lt;/td>
&lt;td>Unsloth (2-4× speedup on RTX GPUs)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Distributed training&lt;/td>
&lt;td>DeepSpeed, FSDP, NeMo Framework&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Experiment tracking&lt;/td>
&lt;td>MLflow, W&amp;amp;B, ClearML&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Adapter registry&lt;/td>
&lt;td>Private HuggingFace Hub, MLflow registry&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Hyperparameter&lt;/td>
&lt;td>W&amp;amp;B Sweeps, Optuna, Ray Tune&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h3 id="traps-1">Traps&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>Catastrophic forgetting&lt;/strong>: very aggressive SFT destroys the model&amp;rsquo;s general capabilities. Keep a small % of the original dataset or use regularisation.&lt;/li>
&lt;li>&lt;strong>Overfitting to the golden dataset&lt;/strong>: the model learns to memorise the eval set. Keep a &lt;strong>holdout test set&lt;/strong> that nobody on the team looks at until the final release.&lt;/li>
&lt;li>&lt;strong>Train/serve skew&lt;/strong>: prompts in training with a different format from production. The &lt;strong>same chat template&lt;/strong> in both.&lt;/li>
&lt;li>&lt;strong>LoRA rank too high&lt;/strong>: it looks like it improves metrics but it inflates the adapter with no real benefit. Start with &lt;code>r=8&lt;/code> or &lt;code>r=16&lt;/code>; raise it only if there is evidence.&lt;/li>
&lt;/ul>
&lt;h2 id="stage-3--eval-validating-before-promoting">Stage 3 — Eval: validating before promoting&lt;/h2>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 90" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="you are here: Eval">
&lt;style>.box{stroke:#444;stroke-width:1.4;rx:6}.active{fill:#7aafff;stroke-width:3}.idle{fill:#f4f4f4}.lbl{font:600 12px sans-serif;fill:#222}.arr{stroke:#666;stroke-width:1.4;fill:none;marker-end:url(#mn3)}.cyc{stroke:#888;stroke-width:1.2;fill:none;stroke-dasharray:4 2;marker-end:url(#mn3)}&lt;/style>
&lt;defs>&lt;marker id="mn3" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#666"/>&lt;/marker>&lt;/defs>
&lt;text x="390" y="20" text-anchor="middle" class="lbl">You are here: EVAL · CI gates + platform regression + human review&lt;/text>
&lt;rect x="30" y="35" width="110" height="35" class="box idle"/>&lt;text x="85" y="58" text-anchor="middle" class="lbl">1 · Data&lt;/text>
&lt;rect x="155" y="35" width="110" height="35" class="box idle"/>&lt;text x="210" y="58" text-anchor="middle" class="lbl">2 · Tune&lt;/text>
&lt;rect x="280" y="35" width="110" height="35" class="box active"/>&lt;text x="335" y="58" text-anchor="middle" class="lbl">3 · Eval&lt;/text>
&lt;rect x="405" y="35" width="110" height="35" class="box idle"/>&lt;text x="460" y="58" text-anchor="middle" class="lbl">4 · Deploy&lt;/text>
&lt;rect x="530" y="35" width="110" height="35" class="box idle"/>&lt;text x="585" y="58" text-anchor="middle" class="lbl">5 · Observe&lt;/text>
&lt;rect x="655" y="35" width="110" height="35" class="box idle"/>&lt;text x="710" y="58" text-anchor="middle" class="lbl">6 · Retrain&lt;/text>
&lt;path class="arr" d="M140,52 L155,52"/>&lt;path class="arr" d="M265,52 L280,52"/>&lt;path class="arr" d="M390,52 L405,52"/>&lt;path class="arr" d="M515,52 L530,52"/>&lt;path class="arr" d="M640,52 L655,52"/>
&lt;path class="cyc" d="M710,72 L710,82 L85,82 L85,72"/>
&lt;/svg>
&lt;/div>
&lt;h3 id="operational-sub-tasks-2">Operational sub-tasks&lt;/h3>
&lt;p>Covered in depth in &lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">Evals: the layer after tracing&lt;/a>. A structured summary for the pipeline:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Golden dataset curation&lt;/strong>: 100-500 examples as a minimum, actively maintained with incident cases.&lt;/li>
&lt;li>&lt;strong>Evaluators&lt;/strong>: heuristic (regex, length), semantic (embeddings), LLM-as-judge (G-Eval), human (golden labels).&lt;/li>
&lt;li>&lt;strong>Running in CI&lt;/strong>: block the merge if critical metrics drop by more than X%.&lt;/li>
&lt;li>&lt;strong>Running on the platform&lt;/strong>: over sampled production traffic, persist results, detect long-term regression.&lt;/li>
&lt;li>&lt;strong>Judge calibration&lt;/strong>: 85-90% agreement with humans before accepting the judge as productive.&lt;/li>
&lt;li>&lt;strong>Eval gates&lt;/strong>: explicit thresholds per metric (faithfulness &amp;gt; 0.85, relevancy &amp;gt; 0.80, and so on).&lt;/li>
&lt;/ul>
&lt;h3 id="tools-1">Tools&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>CI gates&lt;/strong>: DeepEval (Apache 2.0, pytest-style), Promptfoo (MIT, CLI), Ragas (RAG-specific), Inspect AI (safety/capability).&lt;/li>
&lt;li>&lt;strong>Platform&lt;/strong>: Langfuse (MIT, complete suite), LangSmith (LangChain), Phoenix (ELv2, OTel), Braintrust.&lt;/li>
&lt;li>&lt;strong>Judges&lt;/strong>: GPT-4 (expensive but the reference), Claude 3.5 Sonnet, Prometheus (OSS, 0.897 correlation), JudgeLM.&lt;/li>
&lt;/ul>
&lt;h3 id="traps-2">Traps&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>Aged golden dataset&lt;/strong>: if it is not updated, it stops reflecting production.&lt;/li>
&lt;li>&lt;strong>Contaminated judge&lt;/strong>: the judge knows the dataset (it appeared in its training).&lt;/li>
&lt;li>&lt;strong>Insufficient sample size&lt;/strong>: fewer than 50 examples makes differences look like noise.&lt;/li>
&lt;li>&lt;strong>Runaway costs&lt;/strong>: G-Eval with GPT-4 over many cases costs thousands of USD a month.&lt;/li>
&lt;li>&lt;strong>Forgetting the segment&lt;/strong>: an average of 0.85 can hide a 0.55 in German.&lt;/li>
&lt;/ul>
&lt;h2 id="stage-4--deploy-putting-the-model-into-production">Stage 4 — Deploy: putting the model into production&lt;/h2>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 90" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="you are here: Deploy">
&lt;style>.box{stroke:#444;stroke-width:1.4;rx:6}.active{fill:#7adb7a;stroke-width:3}.idle{fill:#f4f4f4}.lbl{font:600 12px sans-serif;fill:#222}.arr{stroke:#666;stroke-width:1.4;fill:none;marker-end:url(#mn4)}.cyc{stroke:#888;stroke-width:1.2;fill:none;stroke-dasharray:4 2;marker-end:url(#mn4)}&lt;/style>
&lt;defs>&lt;marker id="mn4" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#666"/>&lt;/marker>&lt;/defs>
&lt;text x="390" y="20" text-anchor="middle" class="lbl">You are here: DEPLOY · operators + serving + canary + autoscaling&lt;/text>
&lt;rect x="30" y="35" width="110" height="35" class="box idle"/>&lt;text x="85" y="58" text-anchor="middle" class="lbl">1 · Data&lt;/text>
&lt;rect x="155" y="35" width="110" height="35" class="box idle"/>&lt;text x="210" y="58" text-anchor="middle" class="lbl">2 · Tune&lt;/text>
&lt;rect x="280" y="35" width="110" height="35" class="box idle"/>&lt;text x="335" y="58" text-anchor="middle" class="lbl">3 · Eval&lt;/text>
&lt;rect x="405" y="35" width="110" height="35" class="box active"/>&lt;text x="460" y="58" text-anchor="middle" class="lbl">4 · Deploy&lt;/text>
&lt;rect x="530" y="35" width="110" height="35" class="box idle"/>&lt;text x="585" y="58" text-anchor="middle" class="lbl">5 · Observe&lt;/text>
&lt;rect x="655" y="35" width="110" height="35" class="box idle"/>&lt;text x="710" y="58" text-anchor="middle" class="lbl">6 · Retrain&lt;/text>
&lt;path class="arr" d="M140,52 L155,52"/>&lt;path class="arr" d="M265,52 L280,52"/>&lt;path class="arr" d="M390,52 L405,52"/>&lt;path class="arr" d="M515,52 L530,52"/>&lt;path class="arr" d="M640,52 L655,52"/>
&lt;path class="cyc" d="M710,72 L710,82 L85,82 L85,72"/>
&lt;/svg>
&lt;/div>
&lt;h3 id="operational-sub-tasks-3">Operational sub-tasks&lt;/h3>
&lt;p>Covered in depth in &lt;a href="https://blog.lo0.es/en/posts/vllm-kubernetes-llm-inference-that-scales/">vLLM on Kubernetes&lt;/a> and &lt;a href="https://blog.lo0.es/en/posts/llm-inference-operators-kubernetes/">LLM operators on K8s&lt;/a>. A summary for the pipeline:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Runtime selection&lt;/strong>: vLLM (default), SGLang (agents with high prefix caching), TensorRT-LLM (pure latency), llama.cpp (edge).&lt;/li>
&lt;li>&lt;strong>Operator selection&lt;/strong>: vLLM Production Stack, KServe, OME (LMSYS), NVIDIA Dynamo, llm-d (CNCF).&lt;/li>
&lt;li>&lt;strong>Serving configuration&lt;/strong>: &lt;code>--tensor-parallel-size&lt;/code>, &lt;code>--kv-cache-dtype=fp8&lt;/code>, &lt;code>--enable-prefix-caching&lt;/code>, &lt;code>--enable-chunked-prefill&lt;/code>, &lt;code>--gpu-memory-utilization=0.92&lt;/code>.&lt;/li>
&lt;li>&lt;strong>Routing between models&lt;/strong>: LiteLLM as the multi-provider abstraction.&lt;/li>
&lt;li>&lt;strong>Release strategy&lt;/strong>: canary (1% → 10% → 100%), blue-green (all or nothing with fast rollback), shadow (eval in parallel without affecting users).&lt;/li>
&lt;li>&lt;strong>Autoscaling with LLM metrics&lt;/strong>: KEDA + Prometheus over &lt;code>vllm:num_requests_waiting&lt;/code> or equivalent.&lt;/li>
&lt;li>&lt;strong>Gateway / Inference Extension&lt;/strong>: Gateway API Inference Extension once it is GA.&lt;/li>
&lt;/ul>
&lt;h3 id="dominant-tools-1">Dominant tools&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>Serving engines&lt;/strong>: vLLM, SGLang, TensorRT-LLM, llama.cpp, MLX.&lt;/li>
&lt;li>&lt;strong>Operators&lt;/strong>: OME, vLLM Production Stack, NVIDIA Dynamo, llm-d, KServe.&lt;/li>
&lt;li>&lt;strong>Routing&lt;/strong>: LiteLLM (100+ providers), OpenRouter (managed), LangChain Router.&lt;/li>
&lt;li>&lt;strong>GPU primitives&lt;/strong>: NVIDIA GPU Operator, LeaderWorkerSet (LWS) for multi-pod tensor parallel, KEDA for autoscaling.&lt;/li>
&lt;/ul>
&lt;h3 id="traps-3">Traps&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>Naïve rolling update&lt;/strong> that cuts sessions: &lt;code>maxUnavailable: 0, maxSurge: 1&lt;/code> and &lt;code>terminationGracePeriodSeconds: 120+&lt;/code>.&lt;/li>
&lt;li>&lt;strong>A short readiness probe&lt;/strong> that kills pods while they load: &lt;code>startupProbe&lt;/code> with &lt;code>failureThreshold: 60&lt;/code>.&lt;/li>
&lt;li>&lt;strong>HPA on CPU%&lt;/strong> with no LLM metrics: vLLM batches internally, one replica serves dozens. KEDA on queue depth.&lt;/li>
&lt;li>&lt;strong>Unquantised KV cache&lt;/strong>: &lt;code>--kv-cache-dtype=fp8&lt;/code> is almost always worth it.&lt;/li>
&lt;li>&lt;strong>Tensor parallel on GPUs without NVLink&lt;/strong>: all-reduce saturates PCIe and throughput collapses.&lt;/li>
&lt;/ul>
&lt;h2 id="stage-5--observe-seeing-what-happens-in-production">Stage 5 — Observe: seeing what happens in production&lt;/h2>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 90" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="you are here: Observe">
&lt;style>.box{stroke:#444;stroke-width:1.4;rx:6}.active{fill:#c47aff;stroke-width:3}.idle{fill:#f4f4f4}.lbl{font:600 12px sans-serif;fill:#222}.arr{stroke:#666;stroke-width:1.4;fill:none;marker-end:url(#mn5)}.cyc{stroke:#888;stroke-width:1.2;fill:none;stroke-dasharray:4 2;marker-end:url(#mn5)}&lt;/style>
&lt;defs>&lt;marker id="mn5" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#666"/>&lt;/marker>&lt;/defs>
&lt;text x="390" y="20" text-anchor="middle" class="lbl">You are here: OBSERVE · tracing + metrics + guardrails + drift + eBPF&lt;/text>
&lt;rect x="30" y="35" width="110" height="35" class="box idle"/>&lt;text x="85" y="58" text-anchor="middle" class="lbl">1 · Data&lt;/text>
&lt;rect x="155" y="35" width="110" height="35" class="box idle"/>&lt;text x="210" y="58" text-anchor="middle" class="lbl">2 · Tune&lt;/text>
&lt;rect x="280" y="35" width="110" height="35" class="box idle"/>&lt;text x="335" y="58" text-anchor="middle" class="lbl">3 · Eval&lt;/text>
&lt;rect x="405" y="35" width="110" height="35" class="box idle"/>&lt;text x="460" y="58" text-anchor="middle" class="lbl">4 · Deploy&lt;/text>
&lt;rect x="530" y="35" width="110" height="35" class="box active"/>&lt;text x="585" y="58" text-anchor="middle" class="lbl">5 · Observe&lt;/text>
&lt;rect x="655" y="35" width="110" height="35" class="box idle"/>&lt;text x="710" y="58" text-anchor="middle" class="lbl">6 · Retrain&lt;/text>
&lt;path class="arr" d="M140,52 L155,52"/>&lt;path class="arr" d="M265,52 L280,52"/>&lt;path class="arr" d="M390,52 L405,52"/>&lt;path class="arr" d="M515,52 L530,52"/>&lt;path class="arr" d="M640,52 L655,52"/>
&lt;path class="cyc" d="M710,72 L710,82 L85,82 L85,72"/>
&lt;/svg>
&lt;/div>
&lt;h3 id="operational-sub-tasks-4">Operational sub-tasks&lt;/h3>
&lt;p>This is the stage we have covered most deeply in previous series: the whole eBPF series (4 posts) and the whole post-tracing series (4 posts) deal with sub-tasks of Observe. A structured summary:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Tracing&lt;/strong>: OpenLLMetry/Traceloop, Langfuse, Phoenix, LangSmith. Spans with OTel GenAI semantic conventions (&lt;code>gen_ai.*&lt;/code>, &lt;code>mcp.*&lt;/code>).&lt;/li>
&lt;li>&lt;strong>Metrics&lt;/strong>: Prometheus + Grafana. TTFT, TPOT, throughput, queue depth, KV cache usage, cost per tool.&lt;/li>
&lt;li>&lt;strong>Active guardrails&lt;/strong> (not just eval): NeMo Guardrails with 5 types of rails, multimodal Llama Guard 4, Llama Prompt Guard 2 (86M/22M), LLM Guard.&lt;/li>
&lt;li>&lt;strong>eBPF observability&lt;/strong> (zero-instrumentation): Hubble (network), Tetragon (process/syscall), AgentSight (LLM agent with SSL uprobes + stdiocap MCP).&lt;/li>
&lt;li>&lt;strong>eBPF in the local engine&lt;/strong> (inference): ProfInfer-style with uprobes in llama.cpp / vLLM / libcudart.&lt;/li>
&lt;li>&lt;strong>Drift detection&lt;/strong>: Evidently AI, NannyML, WhyLabs. KS, PSI, MMD over embeddings.&lt;/li>
&lt;li>&lt;strong>MCP observability&lt;/strong>: OpenTelemetry GenAI MCP semantic conventions, trace propagation via &lt;code>params._meta&lt;/code>, a centralised MCP Gateway.&lt;/li>
&lt;/ul>
&lt;h3 id="the-four-mandatory-metrics">The four mandatory metrics&lt;/h3>
&lt;p>Out of everything covered, the four any minimal dashboard must have:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>TTFT p50/p95&lt;/strong> (time to first token) — what the user perceives.&lt;/li>
&lt;li>&lt;strong>TPOT p50/p95&lt;/strong> (time per output token) — streaming speed.&lt;/li>
&lt;li>&lt;strong>Throughput&lt;/strong> (aggregate tokens per second) — capacity planning.&lt;/li>
&lt;li>&lt;strong>Queue depth&lt;/strong> (&lt;code>vllm:num_requests_waiting&lt;/code>) — the leading indicator.&lt;/li>
&lt;/ol>
&lt;p>To these you add, per domain:&lt;/p>
&lt;ul>
&lt;li>For RAG: faithfulness rolling mean, retrieval hit rate.&lt;/li>
&lt;li>For agents: tool call accuracy, multi-step task completion.&lt;/li>
&lt;li>For multi-tenant: cost per tenant, p95 latency per tenant.&lt;/li>
&lt;/ul>
&lt;h3 id="traps-4">Traps&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>Cardinality in Prometheus&lt;/strong>: metrics carrying every K8s label blow up.&lt;/li>
&lt;li>&lt;strong>Tracing with no sampling&lt;/strong>: storage grows out of control.&lt;/li>
&lt;li>&lt;strong>Guardrails permanently in monitoring mode&lt;/strong>: they never reach enforce.&lt;/li>
&lt;li>&lt;strong>Drift with no alerts&lt;/strong>: you spot drift on the dashboard once a month; meanwhile the problem has been running for weeks.&lt;/li>
&lt;li>&lt;strong>OTel with no propagation&lt;/strong>: MCP, Tetragon and AgentSight spans left disconnected.&lt;/li>
&lt;/ul>
&lt;h2 id="stage-6--retrain-closing-the-loop">Stage 6 — Retrain: closing the loop&lt;/h2>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 90" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="you are here: Retrain">
&lt;style>.box{stroke:#444;stroke-width:1.4;rx:6}.active{fill:#ffd24a;stroke-width:3}.idle{fill:#f4f4f4}.lbl{font:600 12px sans-serif;fill:#222}.arr{stroke:#666;stroke-width:1.4;fill:none;marker-end:url(#mn6)}.cyc{stroke:#c66;stroke-width:2;fill:none;stroke-dasharray:4 2;marker-end:url(#mn6)}&lt;/style>
&lt;defs>&lt;marker id="mn6" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#c66"/>&lt;/marker>&lt;/defs>
&lt;text x="390" y="20" text-anchor="middle" class="lbl">You are here: RETRAIN · closing the loop back to DATA&lt;/text>
&lt;rect x="30" y="35" width="110" height="35" class="box idle"/>&lt;text x="85" y="58" text-anchor="middle" class="lbl">1 · Data&lt;/text>
&lt;rect x="155" y="35" width="110" height="35" class="box idle"/>&lt;text x="210" y="58" text-anchor="middle" class="lbl">2 · Tune&lt;/text>
&lt;rect x="280" y="35" width="110" height="35" class="box idle"/>&lt;text x="335" y="58" text-anchor="middle" class="lbl">3 · Eval&lt;/text>
&lt;rect x="405" y="35" width="110" height="35" class="box idle"/>&lt;text x="460" y="58" text-anchor="middle" class="lbl">4 · Deploy&lt;/text>
&lt;rect x="530" y="35" width="110" height="35" class="box idle"/>&lt;text x="585" y="58" text-anchor="middle" class="lbl">5 · Observe&lt;/text>
&lt;rect x="655" y="35" width="110" height="35" class="box active"/>&lt;text x="710" y="58" text-anchor="middle" class="lbl">6 · Retrain&lt;/text>
&lt;path class="arr" d="M140,52 L155,52"/>&lt;path class="arr" d="M265,52 L280,52"/>&lt;path class="arr" d="M390,52 L405,52"/>&lt;path class="arr" d="M515,52 L530,52"/>&lt;path class="arr" d="M640,52 L655,52"/>
&lt;path class="cyc" d="M710,72 L710,82 L85,82 L85,72"/>
&lt;/svg>
&lt;/div>
&lt;h3 id="operational-sub-tasks-5">Operational sub-tasks&lt;/h3>
&lt;p>This is the stage most neglected in GenAI projects. Closing the loop turns LLMOps into a living practice; not closing it leaves it as a project that ages.&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Explicit feedback&lt;/strong>: thumbs up/down in the UI, annotations by power users, forms for &amp;ldquo;what went wrong&amp;rdquo;.&lt;/li>
&lt;li>&lt;strong>Implicit feedback&lt;/strong>: anomalous latency, abandonment rate, user retries, aborted sessions.&lt;/li>
&lt;li>&lt;strong>Incident triaging&lt;/strong>: classify incidents by root cause (model issue, retrieval issue, prompt issue, infra issue).&lt;/li>
&lt;li>&lt;strong>Dataset enrichment&lt;/strong>: add to the golden dataset the cases where the system failed, with the correct answer labelled by a human.&lt;/li>
&lt;li>&lt;strong>Retrain cadence&lt;/strong>: quarterly by default, &lt;strong>incident-driven&lt;/strong> when a problematic pattern goes over a threshold.&lt;/li>
&lt;li>&lt;strong>Promotion&lt;/strong>: the new model/adapter goes through the Tune → Eval → Deploy stages, with eval gates that compare against the model in production.&lt;/li>
&lt;/ul>
&lt;h3 id="the-two-cadences">The two cadences&lt;/h3>
&lt;p>&lt;strong>Scheduled retrain&lt;/strong> (quarterly or half-yearly): an established process. It lets you plan capacity, budget and risk. The default.&lt;/p>
&lt;p>&lt;strong>Incident-driven retrain&lt;/strong>: when a serious incident (detected drift, a failing segment, a prompt injection attack) crosses a threshold, a mini-cycle fires. More expensive but necessary for critical cases.&lt;/p>
&lt;h3 id="dominant-tools-2">Dominant tools&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>Annotation and feedback collection&lt;/strong>: Langfuse (built-in UI), Argilla (OSS), Label Studio.&lt;/li>
&lt;li>&lt;strong>Dataset enrichment&lt;/strong>: pipelines in Airflow or Argo Workflows.&lt;/li>
&lt;li>&lt;strong>Triaging&lt;/strong>: Langfuse dashboards with filters on traces with a low eval.&lt;/li>
&lt;li>&lt;strong>Promoting candidates&lt;/strong>: MLflow model registry stages.&lt;/li>
&lt;/ul>
&lt;h3 id="traps-5">Traps&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>An open loop&lt;/strong>: production does not inform the dataset; the model never improves.&lt;/li>
&lt;li>&lt;strong>Human feedback gets lost&lt;/strong>: thumbs down with no structured capture channel.&lt;/li>
&lt;li>&lt;strong>Undefined cadence&lt;/strong>: &amp;ldquo;we retrain when it is needed&amp;rdquo; → nobody ever retrains.&lt;/li>
&lt;li>&lt;strong>No holdout test set&lt;/strong>: the golden dataset is enriched with the same cases used to evaluate; eval measures memorisation.&lt;/li>
&lt;li>&lt;strong>Promotion with no gates&lt;/strong>: the new model enters production without passing the checks the previous models passed.&lt;/li>
&lt;/ul>
&lt;h2 id="the-complete-cycle-how-the-stages-fit-together">The complete cycle: how the stages fit together&lt;/h2>
&lt;p>Now that we have seen each stage separately, the key insight is &lt;strong>how they hook into each other&lt;/strong>. Five emergent properties of the cycle:&lt;/p>
&lt;p>&lt;strong>1. Data is the raw material of every stage&lt;/strong>. Tune reads from the golden dataset. Eval reads from the eval dataset. Deploy reads from the RAG (vector store). Observe produces new data. Retrain creates new datasets. &lt;strong>The Kafka log is the gospel of the whole system&lt;/strong> (post 2 in the series).&lt;/p>
&lt;p>&lt;strong>2. Eval is the bidirectional gatekeeper&lt;/strong>. Before Deploy: it blocks the release if the model regresses. After Observe: it feeds Retrain by identifying the worst-scoring cases. The quality of the eval determines the quality of the whole cycle.&lt;/p>
&lt;p>&lt;strong>3. Observe feeds Retrain and Eval simultaneously&lt;/strong>. Traces produce metrics for Observe; problematic traces are annotated and go to the dataset; the new cases enrich the eval golden set. &lt;strong>Observe is the operational source of truth&lt;/strong>.&lt;/p>
&lt;p>&lt;strong>4. The cross-cutting components (the grey band on the map) are not a stage, they are an infrastructure&lt;/strong>. OpenTelemetry, prompt versioning, MCP gateway, model gateway, schema registry. Badly configured, every stage suffers separately. Well configured, the stages integrate without friction.&lt;/p>
&lt;p>&lt;strong>5. The cycle is not strictly sequential, it is concurrent&lt;/strong>. At any given moment the system has: requests being served (Deploy + Observe), a new version in training (Tune), continuous eval in CI (Eval), data arriving from CDC (Data), incident analysis (Retrain). &lt;strong>Every stage is alive at once&lt;/strong>.&lt;/p>
&lt;h2 id="cross-stage-traps-things-that-break-the-whole-system">Cross-stage traps: things that break the whole system&lt;/h2>
&lt;p>There are errors that do not belong to a stage but to the interfaces between stages. The most common ones:&lt;/p>
&lt;h3 id="trainserve-skew">Train/serve skew&lt;/h3>
&lt;p>The exact format of the prompt in training is different from the one in production. The result: the model trained to answer &lt;code>&amp;lt;|im_start|&amp;gt;user\n...\n&amp;lt;|im_end|&amp;gt;&lt;/code> receives &lt;code>User: ...\nAssistant:&lt;/code> in production and performs worse. &lt;strong>Solution&lt;/strong>: extract the chat template into a shared library used by the Tune pipeline &lt;strong>and&lt;/strong> the Deploy one.&lt;/p>
&lt;h3 id="an-eval-that-does-not-reflect-production">An eval that does not reflect production&lt;/h3>
&lt;p>Your golden dataset is careful questions; production is real questions with typos, mixed languages, and so on. Eval passes at 95%, production performs at 70%. &lt;strong>Solution&lt;/strong>: continuously enrich the golden set with real samples.&lt;/p>
&lt;h3 id="drift-with-no-response-pipeline">Drift with no response pipeline&lt;/h3>
&lt;p>You spot drift on the Observe dashboard; nobody has a defined workflow for what to do. &lt;strong>Solution&lt;/strong>: every drift alert must have a clear runbook: investigate, classify, act (retrain, adjust the prompt, widen the retrieval).&lt;/p>
&lt;h3 id="schema-break-cascade">Schema break cascade&lt;/h3>
&lt;p>You change the schema at the OLTP source; Debezium reflects it; the Flink job breaks; the embedded topic stops updating; the vector store ages; the RAG answers over old data. Three stages affected by one change in Data. &lt;strong>Solution&lt;/strong>: mandatory &lt;strong>backward-compatible&lt;/strong> schema evolution, contracts between producers and consumers.&lt;/p>
&lt;h3 id="no-observability-of-the-pipeline-itself">No observability of the pipeline itself&lt;/h3>
&lt;p>The LLMOps pipeline is a complex system. If it has no observability of its own (how long training takes, how many jobs fail, how many re-embeddings run), debugging failures is an exercise in spelunking. &lt;strong>Solution&lt;/strong>: OTel over the pipeline itself, not just over the LLM calls.&lt;/p>
&lt;h3 id="invisible-vendor-lock-in">Invisible vendor lock-in&lt;/h3>
&lt;p>Pipelines written against LangChain, prompts stuck in LangSmith, embeddings in Pinecone, the model in OpenAI. Migrating is a months-long project. &lt;strong>Solution&lt;/strong>: LiteLLM and OpenLLMetry abstractions, vendor-neutral from the start.&lt;/p>
&lt;h2 id="what-comes-in-the-following-posts">What comes in the following posts&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Post 4 — &lt;a href="https://blog.lo0.es/en/posts/postgresql-qdrant-rag-ingestion-postman-syncing-two-worlds/">PostgreSQL + Qdrant in the ingestion stage&lt;/a>&lt;/strong> — the first post that applies the &amp;ldquo;you are here&amp;rdquo; pattern over the Data stage. Synchronisation patterns (outbox + CDC), microservices architecture, deployment manifests.&lt;/li>
&lt;li>&lt;strong>Upcoming posts&lt;/strong> — still to be decided: the cluster as a multi-tenant platform, Constitutional AI / runtime alignment, continuous fine-tuning in depth, edge LLMs.&lt;/li>
&lt;li>In any later post in this or future series, the &lt;strong>&amp;ldquo;you are here&amp;rdquo; mini-map&lt;/strong> will tell you which stage of the cycle the topic fits into. If you read a post about quantization, you will know you are in Deploy. If you read one about evaluator ensembles, you will know you are in Eval. If you read one about RAG over Iceberg, you will know you are in Data.&lt;/li>
&lt;li>If you want to see &lt;strong>the whole pipeline in action following a single real request&lt;/strong>, the synthesis post &lt;a href="https://blog.lo0.es/en/posts/anatomy-llm-request-production-tour-six-stages/">Anatomy of an LLM request in production&lt;/a> does exactly that: it rewinds a request back to the data that trained it 90 days earlier and follows it forward to the feedback that will reappear in the next Retrain cycle, crossing the six stages and the two cross-cutting components in one coherent story.&lt;/li>
&lt;li>If what interests you is &lt;strong>comparing how each stage is built in open source against the hyperscalers&lt;/strong>, the post &lt;a href="https://blog.lo0.es/en/posts/parallel-catalogue-llmops-stages-open-source-hyperscalers/">The parallel catalogue: the six LLMOps stages in OSS and in AWS / GCP / Azure&lt;/a> makes the vertical cut: for every stage, which tools the blog&amp;rsquo;s reference OSS stack uses and what the cloud equivalents are, with summary tables, gap identification and the multi-tenant chatbot ported to an AWS stack as a concrete example.&lt;/li>
&lt;li>If you want the &lt;strong>OSS toolbox piece by piece&lt;/strong>, the post &lt;a href="https://blog.lo0.es/en/posts/oss-catalogue-llmops-six-stages-tool-by-tool/">The OSS catalogue for LLMOps in six stages: entry by entry&lt;/a> does the zoom in: ~150 words of description per core tool (what it does, how it differs from its alternatives, licence and governance, typical gotcha), a decision matrix per stage, a diagram of the connected OSS stack and a master table of licences and EE / SaaS offerings.&lt;/li>
&lt;li>If what you are missing is &lt;strong>the common vocabulary that runs through the six stages&lt;/strong>, the post &lt;a href="https://blog.lo0.es/en/posts/ontologies-knowledge-graphs-llmops-linnaean-nomenclature/">Ontologies and knowledge graphs in LLMOps&lt;/a> walks the six stages from the perspective of shared formal nomenclature: how TBox + ABox + SHACL + SKOS change the operation of Data, Train/Adapt, Eval, Deploy, Observe and Govern, the GraphRAG 2026 landscape (Microsoft GraphRAG v2, LightRAG, HippoRAG 2, KAG/OpenSPG), vertical ontologies actually deployed (FIBO, SNOMED CT, schema.org, ENS, EU AI Act) and an open source stack with its licensing caveats (Neo4j Community GPLv3, KuzuDB upstream archived in October 2025).&lt;/li>
&lt;/ul>
&lt;h2 id="references">References&lt;/h2>
&lt;p>Foundations:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://medium.com/@sanjeebmeister/the-complete-mlops-llmops-roadmap-for-2026-building-production-grade-ai-systems-bdcca5ed2771">The Complete MLOps/LLMOps Roadmap for 2026 (Sanjeeb Panda)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://hyscaler.com/insights/mlops-in-2026-guide/">MLOps in 2026: Architecture, Trends &amp;amp; Strategy (Hyscaler)&lt;/a>.&lt;/li>
&lt;/ul>
&lt;p>Per stage (entries from the blog series):&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Data&lt;/strong>: &lt;a href="https://blog.lo0.es/en/posts/rag-on-kafka-reference-architecture-streaming-datalakes/">RAG over Kafka — technical architecture&lt;/a> and the &lt;a href="https://blog.lo0.es/en/posts/data-versioning-llmops-dvc-lakefs-reproducible-golden-dataset/">dedicated post on data versioning with DVC and lakeFS&lt;/a> — the four artefacts to version separately (training, RAG corpus, golden eval, enriched retrain), schema contracts, end-to-end lineage from dataset to trace, and why a golden set without a strict holdout measures memorisation.&lt;/li>
&lt;li>&lt;strong>Tune&lt;/strong>: partly covered in &lt;a href="https://blog.lo0.es/en/posts/mlops-for-llms-landscape-2026/">Landscape 2026&lt;/a>; a deeper treatment in post 4 if continuous fine-tuning is chosen.&lt;/li>
&lt;li>&lt;strong>Eval&lt;/strong>: &lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">Evals: the layer after tracing&lt;/a>.&lt;/li>
&lt;li>&lt;strong>Deploy&lt;/strong>: &lt;a href="https://blog.lo0.es/en/posts/vllm-kubernetes-llm-inference-that-scales/">vLLM on Kubernetes&lt;/a> and &lt;a href="https://blog.lo0.es/en/posts/llm-inference-operators-kubernetes/">LLM operators on K8s&lt;/a>.&lt;/li>
&lt;li>&lt;strong>Observe&lt;/strong>: the whole eBPF series and the whole post-tracing series.&lt;/li>
&lt;li>&lt;strong>Retrain&lt;/strong>: &lt;a href="https://blog.lo0.es/en/posts/retrain-closing-the-loop-feedback-dataset-adapter/">the dedicated post on how to close the loop&lt;/a> — feedback capture (explicit + implicit), triage by root cause, dataset enrichment with human annotation (Argilla / Label Studio), scheduled vs incident-driven cadences, governed promotion with eval gates.&lt;/li>
&lt;/ul>
&lt;p>Cross-cutting components:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Prompt versioning&lt;/strong>: &lt;a href="https://blog.lo0.es/en/posts/prompt-versioning-contract-five-word-change/">the dedicated post with Langfuse and MLflow Prompts&lt;/a> — the three-primitive pattern (immutable version, mutable label, cache), eval gates on promotion, and per-request traceability.&lt;/li>
&lt;li>&lt;strong>MCP&lt;/strong>: &lt;a href="https://blog.lo0.es/en/posts/mcp-deep-observability-opentelemetry/">deep MCP observability&lt;/a>.&lt;/li>
&lt;li>&lt;strong>Drift detection&lt;/strong>: &lt;a href="https://blog.lo0.es/en/posts/ebpf-local-inference-statistical-drift-detection/">eBPF + drift detection&lt;/a>.&lt;/li>
&lt;li>&lt;strong>Local inference&lt;/strong>: &lt;a href="https://blog.lo0.es/en/posts/pagedattention-vllm-block-manager/">PagedAttention deep dive&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/kv-cache-working-memory-llm-inference/">KV cache&lt;/a>.&lt;/li>
&lt;/ul>
&lt;p>Frameworks and tools referenced:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://mlflow.org/">MLflow&lt;/a>, &lt;a href="https://wandb.ai/">W&amp;amp;B&lt;/a>, &lt;a href="https://www.kubeflow.org/">Kubeflow&lt;/a>, &lt;a href="https://www.zenml.io/">ZenML&lt;/a>, &lt;a href="https://www.bentoml.com/">BentoML&lt;/a>, &lt;a href="https://metaflow.org/">Metaflow&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://github.com/huggingface/peft">HuggingFace PEFT&lt;/a>, &lt;a href="https://github.com/huggingface/trl">TRL&lt;/a>, &lt;a href="https://github.com/axolotl-ai-cloud/axolotl">Axolotl&lt;/a>, &lt;a href="https://github.com/unslothai/unsloth">Unsloth&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://dvc.org/">DVC&lt;/a> + &lt;a href="https://lakefs.io/">lakeFS&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://langfuse.com/">Langfuse&lt;/a>, &lt;a href="https://www.evidentlyai.com/">Evidently AI&lt;/a>, &lt;a href="https://phoenix.arize.com/">Phoenix&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://github.com/vllm-project/production-stack">vLLM Production Stack&lt;/a>, &lt;a href="https://kserve.github.io/website/">KServe&lt;/a>, &lt;a href="https://github.com/ome-projects/ome">OME&lt;/a>, &lt;a href="https://developer.nvidia.com/dynamo">NVIDIA Dynamo&lt;/a>, &lt;a href="https://github.com/llm-d/llm-d">llm-d&lt;/a>.&lt;/li>
&lt;/ul></description></item><item><title>RAG on Kafka: a technical reference architecture for streaming datalakes, with fresh embeddings and vector stores that are always up to date</title><link>https://blog.lo0.es/en/posts/rag-on-kafka-reference-architecture-streaming-datalakes/</link><pubDate>Thu, 21 May 2026 06:00:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/rag-on-kafka-reference-architecture-streaming-datalakes/</guid><description>&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>The piece that blocks enterprise GenAI projects most in 2026 is not the model, nor even the guardrails: it is &lt;strong>data ingestion for RAG&lt;/strong>. Companies hold valuable information in OLTP databases, in operational logs, in SaaS systems, and all of it is quietly changing every second. Batch RAG systems that reindex every night arrive late (the model&amp;rsquo;s answer is backed by a snapshot from 18 hours ago) and open the door to operational hallucinations even when the retriever is perfect. The dominant answer in production in 2026 is to build the RAG piece on top of Kafka as the source of truth: an immutable log, massive throughput, managed schema evolution, and a mature stream processing ecosystem (Flink, Kafka Streams, RisingWave) that makes it possible to transform and embed events as they happen, delivering them to vector stores (Milvus, Qdrant, Weaviate, pgvector) in milliseconds. The canonical pattern: source → CDC with Debezium → Kafka topics → Flink SQL with an embedding UDF → sink connector to a vector store → serving with vLLM or equivalent. The 2026 developments that change the game: Confluent Tableflow turns Kafka topics into Iceberg/Delta tables automatically (read from Snowflake/Databricks/Trino with no ETL, 30-50 % lower TCO); native Flink SQL brings &lt;code>openai_embedding()&lt;/code> and vector search integrated with Cosmos DB and Amazon S3 Vectors; Confluent&amp;rsquo;s official MCP server lets AI agents query Kafka/Flink/Tableflow in natural language. This post develops the end-to-end architecture with manifests, Flink SQL code and concrete numbers.&lt;/p>
&lt;blockquote>
&lt;p>This is the second post in the MLOps series specific to LLMs. The first (&lt;a href="https://blog.lo0.es/en/posts/mlops-for-llms-landscape-2026/">2026 landscape&lt;/a>) set out the framework. Here we go down to the most operational piece of the stack: how a real enterprise system connects to an LLM agent while keeping RAG fresh without falling into explosive complexity.&lt;/p>
&lt;/blockquote>
&lt;h2 id="the-analogy-kafka-as-the-single-source-of-truth">The analogy: Kafka as the &amp;ldquo;single source of truth&amp;rdquo;&lt;/h2>
&lt;p>Anyone who has spent time in distributed systems has seen the pattern again and again: an immutable, append-only, replicated, time-ordered log has become the canonical primitive for rebuilding complex systems. DBAs know it as the write-ahead log (PostgreSQL WAL, MySQL binlog). Event system developers know it as event sourcing. Data architects know it as the Kappa architecture. Kafka is the massive, distributed, mature implementation of that primitive: a log that lives on disk, partitioned to scale, replicated for durability, retained by time or size, readable from any point in history.&lt;/p>
&lt;p>When you think about RAG, this is exactly what you need. A well-designed RAG system has two critical questions: how do you keep the index fresh? And how do you rebuild the index when something breaks? Kafka answers both naturally: fresh because every change at the source is published as an event to the log and the pipeline processes it in milliseconds; rebuildable because the whole log is there: you drop the vector store, you have the Kafka topic from offset 0, and you build the index back exactly as it was.&lt;/p>
&lt;p>There is a second layer to the analogy as well. For a modern GenAI architecture, Kafka plays the role of the WAL of the entire system. Just as the Postgres WAL is the gospel of the database&amp;rsquo;s state (if you lose the DB but keep the WAL, you can rebuild it), the Kafka log is the gospel of the state of the business as a whole: orders, users, transactions, documents. Connecting your AI agent to Kafka means connecting it to the real pulse of the system, not to stale snapshots.&lt;/p>
&lt;h2 id="the-static-rag-problem">The static RAG problem&lt;/h2>
&lt;p>Before presenting the architecture, it is worth pinning down what concrete problem we are solving. The antipattern that trips up most GenAI projects:&lt;/p>
&lt;ol>
&lt;li>A team builds RAG on a static dataset: it dumps Confluence documents, product PDFs, database snapshots.&lt;/li>
&lt;li>It embeds the lot with a nightly cron that regenerates the index every 24 hours.&lt;/li>
&lt;li>It ships the product.&lt;/li>
&lt;li>&lt;strong>Day 2&lt;/strong>: a user asks about a change that happened two hours ago. RAG does not have it; the model answers about the old version.&lt;/li>
&lt;li>The team adds fragile logic: &amp;ldquo;if the query mentions a recent date, escalate to a human agent&amp;rdquo;.&lt;/li>
&lt;li>&lt;strong>Day 30&lt;/strong>: the dataset has moved so much that half the RAG is out of date. The team decides to refactor and migrate to streaming.&lt;/li>
&lt;/ol>
&lt;p>It is the repeated story of so many projects that the ecosystem has learned the lesson: streaming from day 1, even when the volume is low. The operational complexity of a well-designed streaming pipeline is constant; the complexity of migrating from batch to streaming on a live project is enormous.&lt;/p>
&lt;h2 id="from-lambda-to-kappa-to-streaming-rag">From Lambda to Kappa to Streaming RAG&lt;/h2>
&lt;p>Three architectures in historical order:&lt;/p>
&lt;p>&lt;strong>Lambda (the classic big-data design from 2014)&lt;/strong>: two parallel pipelines, one batch for accuracy and one streaming for freshness. The query combines both. It works, but it means maintaining two pipelines.&lt;/p>
&lt;p>&lt;strong>Kappa (Jay Kreps, 2014, mainstream since 2020)&lt;/strong>: a single streaming pipeline. Batch is a special case of streaming (reprocessing from the beginning). It simplifies a great deal.&lt;/p>
&lt;p>&lt;strong>Streaming RAG (emerging in 2025-2026)&lt;/strong>: a specific variant of Kappa where the pipeline&amp;rsquo;s output is embeddings indexed in a vector store that the LLM queries at runtime. The Kafka log is the source of truth, the vector store is a queryable projection.&lt;/p>
&lt;p>The mental conversion: think of the vector store as the materialised view of the Kafka log. If the view is corrupted, you rebuild it from the log. If you want a new view (a different embedding model, a different chunking strategy), you create another consumer of the log and build a second view in parallel.&lt;/p>
&lt;h2 id="the-reference-architecture">The reference architecture&lt;/h2>
&lt;p>On to the diagram. I am going to present the canonical architecture that stabilised in 2026, showing where each component fits:&lt;/p>
&lt;pre tabindex="0">&lt;code>[OLTP DB (Postgres)] [Other sources]
│ │
│ WAL via logical decoding │
▼ ▼
┌──────────────────────────────────────────────────────────┐
│ Debezium / Kafka Connect (Sources) │
└──────────────────────────────────────────────────────────┘
│
▼ produces events
┌──────────────────────────────────────────────────────────┐
│ Kafka cluster │
│ ┌───────────────────────────────────────────────────┐ │
│ │ topic: orders.raw (3 partitions, RF=3) │ │
│ │ topic: users.raw (3 partitions, RF=3) │ │
│ │ topic: documents.raw (6 partitions, RF=3) │ │
│ └───────────────────────────────────────────────────┘ │
│ + Schema Registry (Avro/Protobuf) │
└──────────────────────────────────────────────────────────┘
│
▼ consumes and transforms
┌──────────────────────────────────────────────────────────┐
│ Flink SQL streaming jobs │
│ - chunking text │
│ - calls to the embedding model (UDF) │
│ - enrichment with metadata │
│ - sink to a curated topic: documents.embedded │
└──────────────────────────────────────────────────────────┘
│
┌───────────┼────────────────────┐
▼ ▼ ▼
[Vector store] [Tableflow] [Iceberg/Delta]
Milvus/Qdrant auto-convert for analytics
/pgvector/ topics →
Weaviate tables
│
▼ queried at runtime
┌──────────────────────────────────────────────────────────┐
│ LLM serving (vLLM / SGLang) + Retriever │
│ - receives the agent&amp;#39;s query │
│ - searches top-K in the vector store │
│ - builds prompt + context │
│ - generates an answer with citations │
└──────────────────────────────────────────────────────────┘
&lt;/code>&lt;/pre>&lt;p>The five layers you can see (source, ingestion (CDC), transport (Kafka), processing (Flink), storage (vectors + tables)) are the ones that structure any serious RAG on a datalake in 2026. Let us go through each one.&lt;/p>
&lt;h2 id="layer-1--sources-your-oltp-as-the-starting-point">Layer 1 — Sources: your OLTP as the starting point&lt;/h2>
&lt;p>The typical source is an OLTP database (Postgres, MySQL, SQL Server). It is where the live state of the business lives. The technique for extracting changes in real time is Change Data Capture (CDC): reading the database&amp;rsquo;s transaction log (PostgreSQL WAL, MySQL binlog) and turning each commit into a Kafka event.&lt;/p>
&lt;p>The OSS standard is &lt;a href="https://debezium.io/">Debezium&lt;/a>. It supports Postgres, MySQL, SQL Server, MongoDB, Oracle, Cassandra and others. The typical deployment is a Kafka Connect cluster with Debezium connectors.&lt;/p>
&lt;p>An example Debezium configuration for PostgreSQL:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-json" data-lang="json">&lt;span class="line">&lt;span class="cl">&lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;name&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;postgres-orders-connector&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;config&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;connector.class&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;io.debezium.connector.postgresql.PostgresConnector&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;tasks.max&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;1&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;database.hostname&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;postgres.prod.internal&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;database.port&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;5432&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;database.user&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;debezium&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;database.password&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;${secret:postgres-creds}&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;database.dbname&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;ecommerce&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;database.server.name&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;ecommerce-prod&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;table.include.list&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;public.orders,public.users,public.products&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;publication.autocreate.mode&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;filtered&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;slot.name&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;debezium_slot&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;plugin.name&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;pgoutput&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;topic.prefix&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;ecommerce&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;key.converter&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;io.confluent.connect.avro.AvroConverter&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;value.converter&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;io.confluent.connect.avro.AvroConverter&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;key.converter.schema.registry.url&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;http://schema-registry:8081&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;value.converter.schema.registry.url&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;http://schema-registry:8081&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>For each commit in the database, this produces an Avro event on the corresponding topic (&lt;code>ecommerce.public.orders&lt;/code>, &lt;code>ecommerce.public.users&lt;/code>, and so on) carrying the change: type (INSERT/UPDATE/DELETE), values before and after, commit timestamp, position in the WAL.&lt;/p>
&lt;p>A simpler alternative for 2026: &lt;a href="https://risingwave.com/">RisingWave&lt;/a> can read the Postgres WAL directly, with no Debezium or Kafka Connect in between. When the case is CDC only, with no other sources, it is operationally simpler. For architectures with multiple sources (CDC + APIs + scrapers + logs), Debezium remains the standard piece.&lt;/p>
&lt;h2 id="layer-2--kafka-as-transport-and-persistence">Layer 2 — Kafka as transport and persistence&lt;/h2>
&lt;p>The Kafka cluster is where all events land. Key operational decisions:&lt;/p>
&lt;h3 id="topics-raw-vs-curated">Topics: raw vs curated&lt;/h3>
&lt;p>The convention that settled in 2026:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>&lt;code>*.raw&lt;/code>&lt;/strong>: the raw event exactly as it arrived. Untransformed CDC, unparsed application logs.&lt;/li>
&lt;li>&lt;strong>&lt;code>*.cleaned&lt;/code>&lt;/strong>: after dedup, schema validation, type normalisation.&lt;/li>
&lt;li>&lt;strong>&lt;code>*.enriched&lt;/code>&lt;/strong>: after adding metadata (geolocation, cross identifiers, and so on).&lt;/li>
&lt;li>&lt;strong>&lt;code>*.embedded&lt;/code>&lt;/strong>: the event with its vector embedding already computed.&lt;/li>
&lt;/ul>
&lt;p>Multi-stage topics allow debugging per layer and partial reprocessing: if you change the embedding model, discarding &lt;code>*.embedded&lt;/code> and rebuilding from &lt;code>*.enriched&lt;/code> costs hours; rebuilding from &lt;code>*.raw&lt;/code> costs days.&lt;/p>
&lt;h3 id="schema-registry">Schema Registry&lt;/h3>
&lt;p>Without a schema registry, topics break silently when someone changes the schema at the source. &lt;a href="https://docs.confluent.io/platform/current/schema-registry/index.html">Confluent Schema Registry&lt;/a> or the OSS &lt;a href="https://www.apicur.io/registry/">Apicurio&lt;/a> are the dominant options.&lt;/p>
&lt;p>Common formats:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Avro&lt;/strong>: versioned schema, strict evolution rules. The historical default.&lt;/li>
&lt;li>&lt;strong>Protobuf&lt;/strong>: compatible with gRPC stacks, good performance.&lt;/li>
&lt;li>&lt;strong>JSON Schema&lt;/strong>: textual, debuggable by eye, less efficient.&lt;/li>
&lt;/ul>
&lt;p>For RAG on Kafka we recommend Avro by default. Schema evolution matters because source tables change over time, and an unversioned schema breaks downstream consumers.&lt;/p>
&lt;h3 id="partitions-replication-and-retention">Partitions, replication and retention&lt;/h3>
&lt;p>Operational decisions for RAG topics:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Partitions&lt;/strong>: typically 3-12. More partitions means more parallelism in the Flink consumer, but more overhead. The rule of thumb: partitions = expected peak events/s ÷ 1000.&lt;/li>
&lt;li>&lt;strong>Replication factor&lt;/strong>: 3 as a minimum in production. Replication protects against broker failure; with RAG, the cost of losing a topic can be weeks of re-embedding.&lt;/li>
&lt;li>&lt;strong>Retention&lt;/strong>: for topics that feed RAG, use long retention or compaction by key. If document &lt;code>doc-42&lt;/code> changes 100 times, compaction keeps only the last state per key, leaving a smaller, rebuildable log. For data that is never updated (historical logs), retention by time (90 days, 1 year).&lt;/li>
&lt;/ul>
&lt;h3 id="cross-cluster-replication">Cross-cluster replication&lt;/h3>
&lt;p>For multi-region or multi-cloud deployments, MirrorMaker 2 or &lt;a href="https://docs.confluent.io/platform/current/multi-dc-deployments/cluster-linking/index.html">Cluster Linking&lt;/a> (Confluent) replicate topics between Kafka clusters. RAG can then query the local cluster without crossing regions.&lt;/p>
&lt;h2 id="layer-3--flink-as-the-streaming-processor">Layer 3 — Flink as the streaming processor&lt;/h2>
&lt;p>&lt;a href="https://flink.apache.org/">Apache Flink&lt;/a> is the dominant stream processing piece in 2026. Apache 2.0, a mature distribution, a broad ecosystem. The main alternative is Kafka Streams (simpler, Java-only); RisingWave is the emerging option for pure SQL cases.&lt;/p>
&lt;p>What Flink adds to Kafka:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Stateful streaming&lt;/strong>: time-based aggregations, joins between streams, sessions.&lt;/li>
&lt;li>&lt;strong>Exactly-once semantics&lt;/strong>: with checkpoint coordination.&lt;/li>
&lt;li>&lt;strong>Watermarks&lt;/strong>: correct handling of out-of-order events.&lt;/li>
&lt;li>&lt;strong>UDFs in Python/Java&lt;/strong>: including calls to LLM models.&lt;/li>
&lt;/ul>
&lt;h3 id="flink-sql-the-most-operational-piece">Flink SQL: the most operational piece&lt;/h3>
&lt;p>Flink SQL is the most usable part of Flink for data engineers who are not streaming experts. Here is a realistic RAG pipeline example:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-sql" data-lang="sql">&lt;span class="line">&lt;span class="cl">&lt;span class="c1">-- 1. Define the source: Kafka topic with CDC events from documents
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="k">CREATE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">TABLE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">documents_raw&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">doc_id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">STRING&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">title&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">STRING&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">body&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">STRING&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">category&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">STRING&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">updated_at&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">TIMESTAMP_LTZ&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">3&lt;/span>&lt;span class="p">),&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">PRIMARY&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">KEY&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">doc_id&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">NOT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ENFORCED&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">WITH&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;connector&amp;#39;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;upsert-kafka&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;topic&amp;#39;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;ecommerce.public.documents&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;properties.bootstrap.servers&amp;#39;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;kafka:9092&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;key.format&amp;#39;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;avro-confluent&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;value.format&amp;#39;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;avro-confluent&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;value.fields-include&amp;#39;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;EXCEPT_KEY&amp;#39;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c1">-- 2. Define the sink: vector store via an intermediate Kafka topic
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="k">CREATE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">TABLE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">documents_embedded&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">doc_id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">STRING&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">chunk_id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">INT&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">title&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">STRING&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">chunk_text&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">STRING&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">category&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">STRING&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">embedding&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">ARRAY&lt;/span>&lt;span class="o">&amp;lt;&lt;/span>&lt;span class="nb">FLOAT&lt;/span>&lt;span class="o">&amp;gt;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">embedded_at&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">TIMESTAMP_LTZ&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">3&lt;/span>&lt;span class="p">),&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">PRIMARY&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">KEY&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">doc_id&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">chunk_id&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">NOT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ENFORCED&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">WITH&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;connector&amp;#39;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;upsert-kafka&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;topic&amp;#39;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;rag.documents.embedded&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;properties.bootstrap.servers&amp;#39;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;kafka:9092&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;key.format&amp;#39;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;json&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;value.format&amp;#39;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;json&amp;#39;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c1">-- 3. UDF for chunking (defined in Python or Java)
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">-- CREATE TEMPORARY FUNCTION chunk_text AS &amp;#39;com.example.ChunkingUDF&amp;#39;;
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c1">-- 4. Pipeline: chunk, embed, write to the sink
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="k">INSERT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">INTO&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">documents_embedded&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">SELECT&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">doc_id&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">chunk_idx&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">chunk_id&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">title&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">chunk&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">chunk_text&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">category&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">OPENAI_EMBEDDING&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">chunk&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;text-embedding-3-small&amp;#39;&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">embedding&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">CURRENT_TIMESTAMP&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">embedded_at&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">FROM&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">documents_raw&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">CROSS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">JOIN&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">UNNEST&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">chunk_text&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">body&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">512&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">64&lt;/span>&lt;span class="p">))&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">WITH&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">ORDINALITY&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">t&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">chunk&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">chunk_idx&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>What happens here, line by line:&lt;/p>
&lt;ul>
&lt;li>The &lt;code>documents_raw&lt;/code> table reads the CDC topic in upsert-kafka mode (each new event on the same key replaces the previous one). This correctly reflects the semantics of &amp;ldquo;this is the latest version of doc 42&amp;rdquo;.&lt;/li>
&lt;li>The &lt;code>documents_embedded&lt;/code> table will be the intermediate topic where Flink writes the embedded chunks.&lt;/li>
&lt;li>The &lt;code>chunk_text&lt;/code> UDF (defined in Python or Java) splits each doc into 512-token chunks with an overlap of 64.&lt;/li>
&lt;li>The &lt;code>INSERT INTO&lt;/code> query runs continuously: every new event in &lt;code>documents_raw&lt;/code> is chunked, each chunk is embedded with &lt;code>OPENAI_EMBEDDING&lt;/code> (a built-in Flink SQL function in Confluent Cloud 2026), and written to the embedded topic.&lt;/li>
&lt;/ul>
&lt;p>&lt;code>OPENAI_EMBEDDING&lt;/code> can be swapped for a custom function that calls a self-hosted model (vLLM with an encoder), SentenceTransformers, or a managed service. The syntax is the same; you change the provider.&lt;/p>
&lt;h3 id="watermarks-and-late-events">Watermarks and late events&lt;/h3>
&lt;p>For cases where an event can arrive late (for example, the Postgres WAL falls behind because of a network blip), Flink lets you define watermarks:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-sql" data-lang="sql">&lt;span class="line">&lt;span class="cl">&lt;span class="k">CREATE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">TABLE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">documents_raw&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">doc_id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">STRING&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">title&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">STRING&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">body&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">STRING&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">updated_at&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">TIMESTAMP_LTZ&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">3&lt;/span>&lt;span class="p">),&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">WATERMARK&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">FOR&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">updated_at&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">updated_at&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">-&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">INTERVAL&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;5&amp;#39;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">MINUTE&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">WITH&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(...)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>This tells Flink &amp;ldquo;assume no event arrives more than 5 minutes late relative to the event timestamp&amp;rdquo;. For temporal joins and aggregations, Flink uses the watermark to decide when to &amp;ldquo;close&amp;rdquo; a window.&lt;/p>
&lt;h2 id="layer-4--sinks-to-vector-stores">Layer 4 — Sinks to vector stores&lt;/h2>
&lt;p>The last step is indexing the embeddings in a vector store. Three patterns in 2026:&lt;/p>
&lt;h3 id="pattern-a--direct-kafka-connect-sink">Pattern A — direct Kafka Connect sink&lt;/h3>
&lt;p>Each vector store has its official connector:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>&lt;a href="https://github.com/zilliztech/kafka-connect-milvus">Milvus&lt;/a>&lt;/strong>: official Zilliz sink connector. Supports named/unnamed dense/sparse vectors.&lt;/li>
&lt;li>&lt;strong>&lt;a href="https://github.com/qdrant/qdrant-kafka">Qdrant&lt;/a>&lt;/strong>: official sink connector. Supports dense, sparse, multi-vector.&lt;/li>
&lt;li>&lt;strong>pgvector&lt;/strong>: has no dedicated connector, but the &lt;a href="https://www.confluent.io/hub/confluentinc/kafka-connect-jdbc">JDBC Sink Connector&lt;/a> is used with custom SQL.&lt;/li>
&lt;li>&lt;strong>Weaviate&lt;/strong>: community connector.&lt;/li>
&lt;li>&lt;strong>LanceDB&lt;/strong>: community connector.&lt;/li>
&lt;/ul>
&lt;p>An example Milvus sink configuration:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-json" data-lang="json">&lt;span class="line">&lt;span class="cl">&lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;name&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;milvus-rag-embeddings-sink&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;config&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;connector.class&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;com.milvus.io.kafka.MilvusSinkConnector&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;tasks.max&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;3&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;topics&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;rag.documents.embedded&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;milvus.host&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;milvus.prod.internal&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;milvus.port&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;19530&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;milvus.collection.name&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;documents&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;milvus.collection.dim&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;1536&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;milvus.collection.partition&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;default&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;key.converter&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;org.apache.kafka.connect.storage.StringConverter&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;value.converter&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;org.apache.kafka.connect.json.JsonConverter&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;value.converter.schemas.enable&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="kc">false&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Three parallel tasks (&lt;code>tasks.max: 3&lt;/code>) consume the embedded topic and write to the Milvus collection. Latency from &amp;ldquo;event in Kafka&amp;rdquo; to &amp;ldquo;indexable vector in Milvus&amp;rdquo; is typically &amp;lt;5 seconds.&lt;/p>
&lt;h3 id="pattern-b--pgvector-with-a-direct-cdc-pipe">Pattern B — pgvector with a direct CDC pipe&lt;/h3>
&lt;p>For teams that already live in PostgreSQL, pgvector is the lowest-friction option. The pattern: the same source Postgres cluster holds a second DB for embeddings with the pgvector extension enabled; the Flink pipeline writes to it directly over JDBC.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-sql" data-lang="sql">&lt;span class="line">&lt;span class="cl">&lt;span class="c1">-- On the Postgres cluster with pgvector enabled
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="k">CREATE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">EXTENSION&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">IF&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">NOT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">EXISTS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">vector&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">CREATE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">TABLE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">document_embeddings&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">doc_id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">TEXT&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">chunk_id&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">INT&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">chunk_text&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">TEXT&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">category&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">TEXT&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">embedding&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">vector&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">1536&lt;/span>&lt;span class="p">),&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">embedded_at&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">TIMESTAMP&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">PRIMARY&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">KEY&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">doc_id&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">chunk_id&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">CREATE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">INDEX&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">ON&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">document_embeddings&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">USING&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">hnsw&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">embedding&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">vector_cosine_ops&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">WITH&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">m&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">16&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ef_construction&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">64&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Advantages: the same DBA operates everything, transactionality across tables, trivial joins with relational metadata. Limitation: beyond 10M vectors, pgvector performance starts to give way compared with dedicated systems.&lt;/p>
&lt;h3 id="pattern-c--confluent-tableflow--iceberg--flink-sql-vector-search">Pattern C — Confluent Tableflow → Iceberg + Flink SQL vector search&lt;/h3>
&lt;p>This is the 2026 development that changes the mechanics. &lt;a href="https://www.confluent.io/product/tableflow/">Confluent Tableflow&lt;/a> materialises Kafka topics automatically as Apache Iceberg or Delta Lake tables. Features:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>No ETL pipeline&lt;/strong>: you do not write Flink/Spark jobs to move Kafka into a table. Tableflow does it.&lt;/li>
&lt;li>&lt;strong>Automatic schema evolution&lt;/strong>: changes to the topic schema are reflected in the table.&lt;/li>
&lt;li>&lt;strong>Unified catalogue&lt;/strong>: the table appears in Glue, Unity Catalog, Snowflake, Databricks. Any analytical engine queries it without copying data.&lt;/li>
&lt;li>&lt;strong>Native CDC&lt;/strong>: handles inserts, updates and deletes correctly.&lt;/li>
&lt;li>&lt;strong>30-50 % lower TCO&lt;/strong> according to the figures Confluent publishes against traditional pipelines.&lt;/li>
&lt;/ul>
&lt;p>And since 2026, Tableflow + Flink SQL offer native vector search integrated with Cosmos DB and Amazon S3 Vectors. The RAG query can be made directly in Flink SQL:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-sql" data-lang="sql">&lt;span class="line">&lt;span class="cl">&lt;span class="k">SELECT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">doc_id&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">chunk_text&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">category&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">FROM&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">documents_embedded&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">WHERE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">VECTOR_SEARCH&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">embedding&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">OPENAI_EMBEDDING&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;user query&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s1">&amp;#39;text-embedding-3-small&amp;#39;&lt;/span>&lt;span class="p">),&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">top_k&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&amp;gt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">10&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">&amp;gt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="mi">7&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">ORDER&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">BY&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">VECTOR_SEARCH_SCORE&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">DESC&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>This unifies layers that used to be separate (vector store + analytics). For many cases, it removes the need to maintain a dedicated vector store.&lt;/p>
&lt;h2 id="confluents-official-mcp-server">Confluent&amp;rsquo;s official MCP server&lt;/h2>
&lt;p>One piece added in 2026 deserves a mention: Confluent has published an official MCP server that exposes Kafka, Flink and Tableflow as tools accessible to AI agents over MCP. Any MCP client (Claude Desktop, Cursor, your own agents) can:&lt;/p>
&lt;ul>
&lt;li>List topics, read recent messages, publish to topics.&lt;/li>
&lt;li>Run Flink SQL queries in natural language (&amp;ldquo;give me the orders from the last 24 hours worth more than 1000 €&amp;rdquo;).&lt;/li>
&lt;li>Query Tableflow Iceberg tables.&lt;/li>
&lt;li>Manage Kafka Connect connectors.&lt;/li>
&lt;/ul>
&lt;p>This closes the circle: as well as reading data from the datalake through RAG (with vector search), your AI agent can write data to the log (through MCP) and trigger transformations (through Flink SQL in natural language). It is the deepest point of fusion between LLM ops and data ops this year.&lt;/p>
&lt;p>A connection with the earlier series: this MCP server emits traces with the OpenTelemetry GenAI MCP semantic conventions we covered in the &lt;a href="https://blog.lo0.es/en/posts/mcp-deep-observability-opentelemetry/">MCP observability post&lt;/a>. The spans show up in Langfuse, Phoenix or your OTel backend with the right cardinality. Zero instrumentation code.&lt;/p>
&lt;h2 id="vector-stores-a-2026-comparison">Vector stores: a 2026 comparison&lt;/h2>
&lt;p>The five dominant options:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Vector store&lt;/th>
&lt;th>Licence&lt;/th>
&lt;th>Operation&lt;/th>
&lt;th>Where it fits&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>pgvector&lt;/strong>&lt;/td>
&lt;td>Postgres ext, OSS&lt;/td>
&lt;td>Your DBA&lt;/td>
&lt;td>&amp;lt;10M vectors, Postgres-heavy team&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Qdrant&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>Self-host or managed&lt;/td>
&lt;td>Mid-scale, performance focus&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Milvus&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>Self-host or Zilliz Cloud&lt;/td>
&lt;td>Large-scale, scalability focus&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Weaviate&lt;/strong>&lt;/td>
&lt;td>BSD-3&lt;/td>
&lt;td>Self-host or managed&lt;/td>
&lt;td>Native hybrid search, semantically rich&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>LanceDB&lt;/strong>&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;td>Embedded or serverless&lt;/td>
&lt;td>Small-medium, simplicity&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The choice depends on:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Scale&lt;/strong>: pgvector falls short beyond 10M vectors. Milvus and Qdrant scale to billions.&lt;/li>
&lt;li>&lt;strong>Hybrid search&lt;/strong>: Weaviate brings lexical + vector natively. Others support it but less integrated.&lt;/li>
&lt;li>&lt;strong>Operation&lt;/strong>: pgvector if you already run Postgres. Qdrant if you want simplicity. Milvus if you need maximum scale.&lt;/li>
&lt;li>&lt;strong>Cloud managed&lt;/strong>: Zilliz Cloud for Milvus, Qdrant Cloud for Qdrant, Pinecone if you want pure SaaS (with no OSS behind it).&lt;/li>
&lt;/ul>
&lt;h2 id="freshness-vs-accuracy-the-operational-trade-off">Freshness vs accuracy: the operational trade-off&lt;/h2>
&lt;p>A critical decision any RAG system on Kafka must answer: when is a new document considered &amp;ldquo;live&amp;rdquo; in the index?&lt;/p>
&lt;p>Three options:&lt;/p>
&lt;p>&lt;strong>Synchronous streaming&lt;/strong>: the event reaches Kafka, Flink embeds it, the sink writes it to the vector store, and only then is it considered live. Typical latency: 1-5 seconds. The best freshness. But if the embedding model fails or the vector store is slow, events pile up in the topic.&lt;/p>
&lt;p>&lt;strong>Asynchronous streaming with a baseline&lt;/strong>: the event is considered live immediately; a background process embeds it when it can. In the meantime, queries asking for that document do not find it. Typical latency: 5-60 seconds. Acceptable for most applications.&lt;/p>
&lt;p>&lt;strong>Micro-batch&lt;/strong>: processing happens in mini-batches every 1-5 minutes. Less efficient than continuous streaming but more stable under variable load. Latency: 1-5 minutes.&lt;/p>
&lt;p>The decision depends on the product&amp;rsquo;s SLA. For customer support chatbots, 5-60 seconds is acceptable. For systems that react to critical events (financial prices, alarms), synchronous streaming is necessary.&lt;/p>
&lt;h2 id="schema-evolution-and-re-embedding">Schema evolution and re-embedding&lt;/h2>
&lt;p>When the embedding model changes (you move from &lt;code>text-embedding-3-small&lt;/code> to &lt;code>text-embedding-3-large&lt;/code>, or from OpenAI to Cohere), the vectors already in the index are incompatible: different dimensions, different semantic spaces. The distance between an old vector and a new one means nothing.&lt;/p>
&lt;p>The standard pattern for handling this: &lt;strong>dual-index&lt;/strong> during the migration.&lt;/p>
&lt;ol>
&lt;li>&lt;strong>T0&lt;/strong>: the active index is V1 (embedding model A).&lt;/li>
&lt;li>&lt;strong>T1&lt;/strong>: a parallel pipeline starts writing to a V2 index (embedding model B), consuming the topic from offset 0 (reprocessing the whole log).&lt;/li>
&lt;li>&lt;strong>T2&lt;/strong>: V2 has caught up with the present.&lt;/li>
&lt;li>&lt;strong>T3&lt;/strong>: you switch the retriever over to V2.&lt;/li>
&lt;li>&lt;strong>T4&lt;/strong>: a week later, you discard V1.&lt;/li>
&lt;/ol>
&lt;p>The Kafka log makes this pattern feasible because it is &lt;strong>immutable and reproducible&lt;/strong>. Without the log, this pattern becomes a weeks-long data migration project.&lt;/p>
&lt;h2 id="operational-pitfalls">Operational pitfalls&lt;/h2>
&lt;h3 id="topics-without-adequate-retention">Topics without adequate retention&lt;/h3>
&lt;p>Configuring topics with 7-day retention on the grounds that &amp;ldquo;I already have the vector store&amp;rdquo; means losing the ability to rebuild if the vector store fails. &lt;strong>Long retention (90+ days) or compaction by key&lt;/strong> for topics that feed RAG.&lt;/p>
&lt;h3 id="heavy-cdc-during-peak-load">Heavy CDC during peak load&lt;/h3>
&lt;p>Debezium reading the WAL at peak hours can hit the source database&amp;rsquo;s performance. &lt;strong>A dedicated read replica&lt;/strong> for Debezium, not the production primary. Or use logical replication restricted to just the tables you need.&lt;/p>
&lt;h3 id="embedding-cost-run-away">Embedding cost run-away&lt;/h3>
&lt;p>&lt;code>OPENAI_EMBEDDING&lt;/code> on every event of a topic with millions of messages a day comes to thousands of USD per month. Strategies: filter before embedding (only embed what adds value); deduplicate by content hash; use self-hosted open-source embedding models (BGE, E5, GTE) when the cloud cost is prohibitive.&lt;/p>
&lt;h3 id="slow-re-embedding-due-to-limited-throughput">Slow re-embedding due to limited throughput&lt;/h3>
&lt;p>Recomputing 10M embeddings with the OpenAI API at 3000 req/min takes 55 hours. If you wait for an incident to re-embed, that is two days without service. &lt;strong>Embedding throughput is an explicit capacity planning item&lt;/strong>; reserve capacity or keep an offline job ready to start.&lt;/p>
&lt;h3 id="downstream-schema-breaks">Downstream schema breaks&lt;/h3>
&lt;p>A change to the raw topic&amp;rsquo;s schema breaks Flink jobs downstream. &lt;strong>Schema Registry with BACKWARD compatibility made mandatory&lt;/strong>; never ALLOW_ALL. And test schema evolution in CI.&lt;/p>
&lt;h3 id="a-vector-store-with-no-backup">A vector store with no backup&lt;/h3>
&lt;p>Your vector store holds 50M vectors. It is the only copy (the topics expired). A failure wipes it. &lt;strong>Vector stores must be backed up&lt;/strong> like any primary persistence layer. For Milvus/Qdrant: periodic snapshots. For pgvector: plain pg_dump.&lt;/p>
&lt;h3 id="multi-region-without-cross-cluster-replication">Multi-region without cross-cluster replication&lt;/h3>
&lt;p>Your RAG serves users in the US and the EU. The vector store is in US-east. Latency from the EU = 100 ms+ per query. &lt;strong>MirrorMaker or Cluster Linking&lt;/strong> to replicate topics and vector stores in both regions.&lt;/p>
&lt;h2 id="what-we-have-not-covered">What we have not covered&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Hybrid search in production&lt;/strong>: combining BM25/lexical + vector + reranker. A topic for its own post.&lt;/li>
&lt;li>&lt;strong>Multimodal RAG&lt;/strong>: indexing images, audio and video alongside text. Multimodal embeddings (CLIP, Imagebind), a specific architecture.&lt;/li>
&lt;li>&lt;strong>GraphRAG&lt;/strong>: using structured knowledge (knowledge graphs) as well as vector retrieval. Microsoft GraphRAG, LlamaIndex KnowledgeGraphQueryEngine.&lt;/li>
&lt;li>&lt;strong>RAG with multi-tenant ACLs&lt;/strong>: filtering by permissions at runtime. The pattern uses metadata in the vector store + server-side filters.&lt;/li>
&lt;li>&lt;strong>Query rewriting with an LLM&lt;/strong>: using a first LLM to expand the query before retrieval (HyDE, multi-query, step-back prompting).&lt;/li>
&lt;/ul>
&lt;h2 id="references">References&lt;/h2>
&lt;p>Kafka and stream processing:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://kafka.apache.org/">Apache Kafka&lt;/a> y &lt;a href="https://debezium.io/">Debezium&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://docs.confluent.io/platform/current/schema-registry/index.html">Confluent Schema Registry&lt;/a> y &lt;a href="https://www.apicur.io/registry/">Apicurio Registry&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://flink.apache.org/">Apache Flink&lt;/a> y &lt;a href="https://nightlies.apache.org/flink/flink-docs-stable/docs/dev/table/sql/overview/">Flink SQL docs&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://risingwave.com/">RisingWave&lt;/a> — alternativa SQL streaming con embedding built-in.&lt;/li>
&lt;/ul>
&lt;p>Vector store connectors:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://github.com/zilliztech/kafka-connect-milvus">Milvus Sink Connector (Zilliz, GitHub)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://milvus.io/docs/kafka-connect-milvus.md">Connect Apache Kafka with Milvus (docs)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://github.com/qdrant/qdrant-kafka">Qdrant Kafka Sink (GitHub)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://callsphere.ai/blog/vector-database-benchmarks-2026-pgvector-qdrant-weaviate-milvus-lancedb">Vector Database Benchmarks 2026&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://streamkap.com/resources-and-guides/streaming-vector-databases-platform-comparison">Streaming to Vector Databases (Streamkap)&lt;/a>.&lt;/li>
&lt;/ul>
&lt;p>Tableflow and 2026 architecture:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://www.confluent.io/product/tableflow/">Tableflow — Confluent&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://www.confluent.io/blog/tableflow-ga-kafka-snowflake-iceberg/">Tableflow GA: Real-Time Kafka to Iceberg (Confluent Blog)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://www.confluent.io/blog/tableflow-delta-lake-databricks-unity-catalog-ga/">Tableflow + Databricks Unity Catalog (Confluent Blog)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://www.confluent.io/blog/data-lake-governance-tableflow/">Better-Governed Data Lake Architectures with Tableflow (Confluent Blog)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://www.kai-waehner.de/blog/2025/12/10/top-trends-for-data-streaming-with-apache-kafka-and-flink-in-2026/">Top Trends for Data Streaming with Kafka and Flink in 2026 (Kai Waehner)&lt;/a>.&lt;/li>
&lt;/ul>
&lt;p>Streaming RAG:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://risingwave.com/blog/rag-architecture-2026/">RAG Architecture in 2026: How to Keep Retrieval Actually Fresh (RisingWave)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://streamkap.com/resources-and-guides/streaming-to-vector-databases">Streaming CDC Events to Vector Databases (Streamkap)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://www.kai-waehner.de/blog/2023/11/08/apache-kafka-flink-vector-database-llm-real-time-genai/">Apache Kafka + Vector Database + LLM = Real-Time GenAI (Kai Waehner)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://arxiv.org/pdf/2508.05662">From Static to Dynamic: A Streaming RAG Approach (arxiv 2508.05662)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://developer.confluent.io/confluent-tutorials/gen-ai-vector-embedding/flinksql/">How to generate vector embeddings for RAG with Flink SQL (Confluent Developer)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://dasroot.net/posts/2026/03/event-driven-architectures-ai-pipelines-kafka-flink/">Event-Driven Architectures for AI Pipelines (dasroot)&lt;/a>.&lt;/li>
&lt;/ul>
&lt;p>Cross-references:&lt;/p>
&lt;ul>
&lt;li>Previous post: &lt;a href="https://blog.lo0.es/en/posts/mlops-for-llms-landscape-2026/">MLOps specific to LLMs in 2026: the landscape&lt;/a>.&lt;/li>
&lt;li>Data series: &lt;a href="https://blog.lo0.es/en/posts/postgresql-qdrant-rag-ingestion-postman-syncing-two-worlds/">PostgreSQL + Qdrant at the ingestion stage&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/rag-corpus-curation-active-librarian/">RAG corpus curation: the active librarian&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/reranker-hybrid-retrieval-five-chunks-llm-reads/">Reranker and hybrid retrieval&lt;/a> — the four pieces that close the Data block: streaming, ingest, curation and retrieval.&lt;/li>
&lt;li>Post-tracing series: &lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">Evals&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/llm-guardrails-safety-four-lines-of-defence/">Guardrails&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/mcp-deep-observability-opentelemetry/">MCP observability&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/ebpf-local-inference-statistical-drift-detection/">eBPF + drift&lt;/a>.&lt;/li>
&lt;li>eBPF series: &lt;a href="https://blog.lo0.es/en/posts/ebpf-zero-to-cilium-kernel-tcp-ip-bypass/">eBPF from zero to Cilium&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/tetragon-cilium-security-syscalls-kernel/">Tetragon&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/hubble-ebpf-network-observability-ai-agents/">Hubble&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/agentsight-llm-tracing-ebpf-zero-instrumentation/">AgentSight&lt;/a>.&lt;/li>
&lt;/ul></description></item><item><title>MLOps specific to LLMs in 2026: the landscape of three modalities, six stages and ten tools that make them work</title><link>https://blog.lo0.es/en/posts/mlops-for-llms-landscape-2026/</link><pubDate>Thu, 21 May 2026 05:30:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/mlops-for-llms-landscape-2026/</guid><description>&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>This is the blog&amp;rsquo;s fourth series and it is called &lt;strong>MLOps specific to LLMs&lt;/strong>. It takes the operational craft of traditional MLOps (reproducible pipelines, model registries, dataset versioning, eval gates, controlled deployments) and redraws it for a world where the model is probabilistic, the outputs are subjective, the dependencies include external vendors that update weights without warning, and the &amp;ldquo;application&amp;rdquo; is not a model but an orchestration of models, embeddings, retrievers, guardrails and routers. Gartner predicts that more than 50% of enterprise GenAI deployments will fail before the end of 2026, and the main cause is not the model: it is that deterministic software assumptions were applied to probabilistic systems. This post opens the series with the frame: the seven structural differences between LLMOps and classic MLOps; the six-stage pipeline (data → tune → eval → deploy → observe → retrain); the three modalities of preparing a model (continuous fine-tuning, RAG over datalakes, agent training) with their decision matrix, where 60% of 2025-2026 deployments use hybrid because each modality solves a different problem: &amp;ldquo;fine-tune for behaviour, RAG for volatile knowledge&amp;rdquo;; and the 2026 tool landscape, which already forms reasonably stable layers: MLflow 3.10 (March 2026) as a GenAI-aware registry, W&amp;amp;B Weave and ZenML for tracing and pipelines, Kubeflow + KServe vLLM 0.8.1+ for serving, BentoML for flexibility, DVC + lakeFS (joined since November 2025) for data, Langfuse for prompts and observability. The three following posts will go down into the detail of the most critical pieces.&lt;/p>
&lt;blockquote>
&lt;p>This is the opening of series 4: MLOps for LLMs. It continues the tradition of the previous series: &lt;a href="https://blog.lo0.es/en/posts/kv-cache-working-memory-llm-inference/">LLM inference&lt;/a> (the first), &lt;a href="https://blog.lo0.es/en/posts/ebpf-zero-to-cilium-kernel-tcp-ip-bypass/">eBPF&lt;/a> (the second) and &lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">post-tracing&lt;/a> (the third). Here we enter the discipline that ties all the pieces together: how an LLM system is operated in production over months, not just deployed once.&lt;/p>
&lt;/blockquote>
&lt;h2 id="the-analogy-the-sres-craft-redrawn">The analogy: the SRE&amp;rsquo;s craft redrawn&lt;/h2>
&lt;p>Anyone who has worked for years as an SRE or a platform engineer recognises the classic pillars: reproducibility (same code + same data + same config = same result), observability (what happens can be measured), safe rollback (if something goes wrong, I go back within minutes), gradual rollout (the new thing goes to 1% before it goes to 100%). These pillars are not negotiable. The question is whether they hold up when the central component is an LLM.&lt;/p>
&lt;p>The answer is: &lt;strong>same pillars, radically different mechanics&lt;/strong>. Reproducibility: versioning code and data is no longer enough; you have to version prompts, retrieval configurations, snapshots of the vendor&amp;rsquo;s model (which change without warning). Observability: error and latency metrics are no longer enough; you have to measure subjective quality via LLM-as-judge and embedding drift. Rollback: dropping the binary&amp;rsquo;s version is no longer enough; you have to keep the old model cached because loading a new one takes minutes. Gradual rollout: a % of traffic is no longer enough; you have to decide what % of what kind of queries by segment.&lt;/p>
&lt;p>It is the same craft, practised with partly new tools and reflexes. MLOps specific to LLMs, or &amp;ldquo;LLMOps&amp;rdquo;, as the field has christened itself, is the discipline that codifies those reflexes.&lt;/p>
&lt;h2 id="the-seven-structural-differences-between-llmops-and-traditional-mlops">The seven structural differences between LLMOps and traditional MLOps&lt;/h2>
&lt;p>Before going down to the pipeline, let us fix the differences that make this territory new rather than a mere continuation. Each one has concrete practical consequences.&lt;/p>
&lt;h3 id="1-non-deterministic-outputs">1. Non-deterministic outputs&lt;/h3>
&lt;p>Traditional MLOps: the model receives structured input and returns a bounded, reproducible prediction. Same input → same output. Unit tests work.&lt;/p>
&lt;p>LLMOps: same input → different output every time (through sampling, through temperature, through the order of tools invoked, through the retrieval context that changed). The idea of a &amp;ldquo;unit test&amp;rdquo; breaks.&lt;/p>
&lt;p>&lt;strong>Operational consequence&lt;/strong>: tests over properties (was the tone maintained?, does it mention the source?, does it respect the JSON schema?), not over equality. Statistical evals over a distribution, not over samples.&lt;/p>
&lt;h3 id="2-behaviour-metrics-not-statistical-accuracy">2. Behaviour metrics, not statistical accuracy&lt;/h3>
&lt;p>Traditional MLOps: F1, accuracy, AUC, RMSE. Metrics with a clear number.&lt;/p>
&lt;p>LLMOps: subjective rubric scores (G-Eval, faithfulness, helpfulness, toxicity), judge LLMs, human feedback. The &amp;ldquo;number&amp;rdquo; depends on who judges.&lt;/p>
&lt;p>&lt;strong>Operational consequence&lt;/strong>: platforms have to treat evals as versioned artifacts, not just &amp;ldquo;model v3 scored 0.87&amp;rdquo;, but &amp;ldquo;model v3 evaluated with the judge claude-3-5-sonnet-20251022 over the dataset gold-rag-v7 with the prompt judge-v2 scored 0.87&amp;rdquo;. Versioning the judge is as important as versioning the model being evaluated.&lt;/p>
&lt;h3 id="3-the-model-is-an-external-dependency-not-an-internal-asset">3. The model is an external dependency, not an internal asset&lt;/h3>
&lt;p>Traditional MLOps: you train the model, it lives in your registry, it does not change until you change it.&lt;/p>
&lt;p>LLMOps: the base model belongs to Anthropic, OpenAI, Google, Meta. They change it on you without warning. The &lt;code>claude-3-5-sonnet&lt;/code> version that answered well yesterday answers somewhat differently today.&lt;/p>
&lt;p>&lt;strong>Operational consequence&lt;/strong>: drift detection becomes far more critical (&lt;a href="https://blog.lo0.es/en/posts/ebpf-local-inference-statistical-drift-detection/">previous post&lt;/a>). Pinning to specific snapshots (&lt;code>claude-3-5-sonnet-20251022&lt;/code>) when the vendor allows it. For high-commitment apps, self-hosting the base model to guarantee reproducibility.&lt;/p>
&lt;h3 id="4-the-application-is-an-orchestration-not-a-model">4. The application is an orchestration, not a model&lt;/h3>
&lt;p>Traditional MLOps: an app calls a model and consumes its output.&lt;/p>
&lt;p>LLMOps 2026: an app connects foundation model + LoRA adapters + retrievers + vector stores + guardrails + routers + tool servers (MCP) + evaluators, all composing the final behaviour. Any component can degrade the result.&lt;/p>
&lt;p>&lt;strong>Operational consequence&lt;/strong>: cross-component debugging requires distributed tracing with OTel (covered in previous posts). The registry does not only store &amp;ldquo;the model&amp;rdquo; but the composition: which prompt version + which adapter + which vector store + which retriever config.&lt;/p>
&lt;h3 id="5-cost-per-inference-not-per-training">5. Cost per inference, not per training&lt;/h3>
&lt;p>Traditional MLOps: the high cost is training; serving is cheap. You optimise training.&lt;/p>
&lt;p>LLMOps: the high cost is serving (every token costs, every call to the vendor is paid for, the GPUs doing the serving are switched on 24/7). You optimise inference.&lt;/p>
&lt;p>&lt;strong>Operational consequence&lt;/strong>: cost accountability per tenant, per agent, per tool. Metrics such as &lt;code>gen_ai.usage.input_tokens&lt;/code> aggregated at customer and product level. Model decisions based on cost per query, not only on quality.&lt;/p>
&lt;h3 id="6-gpu-heavy-infra-with-specific-primitives">6. GPU-heavy infra with specific primitives&lt;/h3>
&lt;p>Traditional MLOps: CPU + some GPU for training. Standard Kubernetes.&lt;/p>
&lt;p>LLMOps: Hopper/Blackwell SXM GPUs, NVLink/NVSwitch, tensor parallel, paged attention, KV cache. Infra that only fits into Kubernetes with primitives such as LeaderWorkerSet, GPU Operator, KEDA with LLM metrics (covered in &lt;a href="https://blog.lo0.es/en/posts/vllm-kubernetes-llm-inference-that-scales/">vLLM on Kubernetes&lt;/a>).&lt;/p>
&lt;p>&lt;strong>Operational consequence&lt;/strong>: the orchestration stack includes specialised operators (OME, vLLM Production Stack, NVIDIA Dynamo, llm-d, see &lt;a href="https://blog.lo0.es/en/posts/llm-inference-operators-kubernetes/">LLM K8s Operators&lt;/a>) that traditional MLOps does not contemplate.&lt;/p>
&lt;h3 id="7-rlhf-and-human-feedback-as-a-first-class-citizen">7. RLHF and human feedback as a first-class citizen&lt;/h3>
&lt;p>Traditional MLOps: human feedback means labelling data before training.&lt;/p>
&lt;p>LLMOps: human feedback lives inside the model in production, whether through RLHF of the foundation models (Anthropic, OpenAI), through RLAIF, through DPO, or through explicit user feedback that is fed back into fine-tuning.&lt;/p>
&lt;p>&lt;strong>Operational consequence&lt;/strong>: bidirectional production → training pipelines. Datasets grow with real incidents. Model decisions are taken with continuous feedback, not in a training project every N months.&lt;/p>
&lt;h2 id="why-gartner-predicts-50-failures">Why Gartner predicts 50%+ failures&lt;/h2>
&lt;p>&lt;a href="https://medium.com/@sanjeebmeister/the-complete-mlops-llmops-roadmap-for-2026-building-production-grade-ai-systems-bdcca5ed2771">Gartner published that more than 50% of enterprise GenAI deployments will fail before 2026&lt;/a>. The causes are not technical ones about the model but about the system:&lt;/p>
&lt;ul>
&lt;li>Hallucinated outputs from poor grounding: badly designed RAG, poor retrieval, insufficient context.&lt;/li>
&lt;li>Data architectures that are not ready: companies have data in silos, with no stable schemas, with no controlled freshness. Connecting an LLM to this data without a serious pipeline produces erratic answers.&lt;/li>
&lt;li>Lack of structured workflows for prompt-driven systems: teams that treat prompts as code in hardcoded strings, with no versioning, no tests, no gates.&lt;/li>
&lt;/ul>
&lt;p>The conclusion the field draws: &lt;strong>LLMOps is not optional&lt;/strong>. Companies that deploy GenAI without operational discipline fall into one of the three failure modes. Those that apply it (MLflow/W&amp;amp;B for tracking, DVC/lakeFS for data, Langfuse for prompts and evals, KServe or vLLM Production Stack for serving, drift detection in production) are the ones that keep the system working six months after the first release.&lt;/p>
&lt;h2 id="the-six-stage-llmops-pipeline">The six-stage LLMOps pipeline&lt;/h2>
&lt;p>On to the pipeline. The six stages that any serious LLM system goes through, in order:&lt;/p>
&lt;pre tabindex="0">&lt;code>[1. Data] → [2. Tune] → [3. Eval] → [4. Deploy] → [5. Observe] → [6. Retrain]
│
└─→ back to 1
&lt;/code>&lt;/pre>&lt;p>Each stage is an operational domain of its own, with its own tools and traps:&lt;/p>
&lt;h3 id="stage-1--data">Stage 1 — Data&lt;/h3>
&lt;p>&lt;strong>What happens&lt;/strong>: ingestion, cleaning, curation, versioning, indexing of the corpus. It is where real projects suffer most, because companies have data in heterogeneous silos.&lt;/p>
&lt;p>&lt;strong>Typical sub-tasks&lt;/strong>: extraction from source (CDC over Kafka, batch from data lakes, scraping), cleaning (PII removal, dedup, format), curation (labelling for fine-tuning, golden datasets for eval), versioning (DVC + lakeFS), indexing (embeddings + vector store for RAG).&lt;/p>
&lt;p>&lt;strong>Traps&lt;/strong>: schema drift at the source, undetected PII, poor dedup that injects redundancy into training, a vector store that is not updated.&lt;/p>
&lt;h3 id="stage-2--tune">Stage 2 — Tune&lt;/h3>
&lt;p>&lt;strong>What happens&lt;/strong>: preparing the model for your use case. Three modalities (we go deeper into them shortly): fine-tuning, RAG, agent training.&lt;/p>
&lt;p>&lt;strong>Typical sub-tasks&lt;/strong>: base model selection, adapter preparation (LoRA, QLoRA), training loop with continuous eval, hyperparameter sweep (Optuna, W&amp;amp;B Sweeps), saving the checkpoint.&lt;/p>
&lt;p>&lt;strong>Traps&lt;/strong>: catastrophic forgetting if the fine-tuning is very aggressive, overfitting to the golden dataset, no independent validation set.&lt;/p>
&lt;h3 id="stage-3--eval">Stage 3 — Eval&lt;/h3>
&lt;p>&lt;strong>What happens&lt;/strong>: validating that the model + adapters + RAG configuration is acceptable before promoting. Covered in &lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">Evals&lt;/a>.&lt;/p>
&lt;p>&lt;strong>Typical sub-tasks&lt;/strong>: running an eval framework (DeepEval, Promptfoo, Ragas) against the golden dataset, judge LLM evaluations, human review over a sample, gates with thresholds.&lt;/p>
&lt;p>&lt;strong>Traps&lt;/strong>: a golden dataset that ages, an uncalibrated judge, evals that pass in CI but fail in production because of distribution shift.&lt;/p>
&lt;h3 id="stage-4--deploy">Stage 4 — Deploy&lt;/h3>
&lt;p>&lt;strong>What happens&lt;/strong>: going from &amp;ldquo;the model evaluated well&amp;rdquo; to &amp;ldquo;the model serves real traffic&amp;rdquo;. Covered in &lt;a href="https://blog.lo0.es/en/posts/llm-inference-operators-kubernetes/">LLM K8s Operators&lt;/a>.&lt;/p>
&lt;p>&lt;strong>Typical sub-tasks&lt;/strong>: serving with vLLM/SGLang/TRT-LLM, runtime configuration, gradual rollout (canary, shadow, blue-green), routing between models (LiteLLM, OpenRouter, LangChain routers).&lt;/p>
&lt;p>&lt;strong>Traps&lt;/strong>: a naive rolling update that cuts sessions, autoscaling by CPU% that does not respond to LLM metrics (covered), a new model that performs worse in production than in eval.&lt;/p>
&lt;h3 id="stage-5--observe">Stage 5 — Observe&lt;/h3>
&lt;p>&lt;strong>What happens&lt;/strong>: seeing what is happening in real time. Covered in the whole post-tracing series and the eBPF series.&lt;/p>
&lt;p>&lt;strong>Typical sub-tasks&lt;/strong>: tracing (Langfuse, LangSmith, Phoenix, OpenLLMetry), metrics (TTFT, TPOT, queue depth, cost per query), active guardrails (NeMo, Llama Guard), drift detection (Evidently, NannyML, WhyLabs).&lt;/p>
&lt;p>&lt;strong>Traps&lt;/strong>: cardinality explosion in metrics, batch evals with no tail-sampling over real traces, drift that is ignored until an incident makes it real.&lt;/p>
&lt;h3 id="stage-6--retrain">Stage 6 — Retrain&lt;/h3>
&lt;p>&lt;strong>What happens&lt;/strong>: closing the loop. Production feedback (incidents, worst-scoring cases, detected drift) generates new data to go back to stage 1.&lt;/p>
&lt;p>&lt;strong>Typical sub-tasks&lt;/strong>: extraction of problematic logs, human labelling of the sample, incorporation into the golden dataset, re-fine-tuning if applicable, decision on a new release.&lt;/p>
&lt;p>&lt;strong>Traps&lt;/strong>: an &amp;ldquo;open&amp;rdquo; loop where production never informs the dataset, human feedback that gets lost, lack of a clear retrain cadence.&lt;/p>
&lt;h2 id="the-three-modalities-of-preparing-the-model">The three modalities of &amp;ldquo;preparing the model&amp;rdquo;&lt;/h2>
&lt;p>Stage 2 (Tune) is where there is most confusion. In 2026 three modalities coexist, each solving a different problem:&lt;/p>
&lt;h3 id="fine-tuning">Fine-tuning&lt;/h3>
&lt;p>&lt;strong>What it does&lt;/strong>: modifying the model&amp;rsquo;s weights (or those of a LoRA/QLoRA adapter on top) so that it learns specific behaviour patterns: tone, output structure, idiomatic decisions of the domain.&lt;/p>
&lt;p>&lt;strong>When&lt;/strong>: when your main failure is behavioural inconsistency between calls. The model sometimes answers formally, sometimes not; sometimes it structures the JSON, sometimes not; sometimes it follows the company&amp;rsquo;s conventions, sometimes it invents them. Fine-tuning stabilises it.&lt;/p>
&lt;p>&lt;strong>When NOT&lt;/strong>: when what you need is up-to-date knowledge. Fine-tuning fixes knowledge in frozen weights; the day after the fine-tuning, the model knows nothing new.&lt;/p>
&lt;h3 id="rag-retrieval-augmented-generation">RAG (Retrieval-Augmented Generation)&lt;/h3>
&lt;p>&lt;strong>What it does&lt;/strong>: leaving the model intact and, on each call, retrieving fresh context from a knowledge base (vector store + lexical search, typically) and passing it to the model so that it answers on that basis.&lt;/p>
&lt;p>&lt;strong>When&lt;/strong>: when the knowledge you need is dynamic or very large. Documentation that changes, a product catalogue that is updated, an internal knowledge base that grows.&lt;/p>
&lt;p>&lt;strong>When NOT&lt;/strong>: when the problem is behavioural (RAG does not teach the model how to behave, it only gives it information). Or when retrieval is so noisy that the context arriving is worse than nothing.&lt;/p>
&lt;h3 id="agent-training">Agent training&lt;/h3>
&lt;p>&lt;strong>What it does&lt;/strong>: going beyond conventional fine-tuning with Reinforcement Learning techniques. RFT (OpenAI&amp;rsquo;s Reinforcement Fine-Tuning), classic RLHF, RLAIF (with AI feedback), DPO (Direct Preference Optimization) over datasets of (good, bad) pairs.&lt;/p>
&lt;p>&lt;strong>When&lt;/strong>: when the model needs to learn complex multistep trajectories: when to choose each tool, how to decompose a task, when to ask the user for confirmation. It is what is turning Claude, Gemini and GPT into agents capable of long tasks.&lt;/p>
&lt;p>&lt;strong>When NOT&lt;/strong>: when your case is simple chat or RAG. It is overkill, expensive and complicated for problems that the previous modalities solve.&lt;/p>
&lt;h3 id="decision-matrix">Decision matrix&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Observed problem&lt;/th>
&lt;th>Modality&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Inconsistent answers in tone/structure&lt;/td>
&lt;td>Fine-tuning&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>The model makes things up (hallucinates)&lt;/td>
&lt;td>RAG&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Out-of-date knowledge (&amp;gt;1 year)&lt;/td>
&lt;td>RAG&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>The model chooses tools badly&lt;/td>
&lt;td>Agent training (RLAIF/RFT)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Mixed behaviour + knowledge&lt;/td>
&lt;td>Hybrid (fine-tune + RAG)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Multi-step trajectory fails&lt;/td>
&lt;td>Agent training&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>A specific language/regional style&lt;/td>
&lt;td>Fine-tuning&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h3 id="the-2026-verdict-hybrid-is-the-default">The 2026 verdict: hybrid is the default&lt;/h3>
&lt;p>&lt;a href="https://www.scalacode.com/blog/rag-vs-fine-tuning/">Multiple reports&lt;/a> agree that in 2025-2026, &lt;strong>around 60% of production projects use hybrid&lt;/strong>: fine-tuning for behaviour + RAG for knowledge. The key insight:&lt;/p>
&lt;blockquote>
&lt;p>&lt;strong>Fine-tune for behaviour (brand voice, decision protocol, output structure); use RAG for volatile knowledge you need the model to cite. Do not force a single tool to do both jobs.&lt;/strong>&lt;/p>
&lt;/blockquote>
&lt;p>A practical observation: the biggest quality improvements of 2025-2026 come from better reranking in RAG (cross-encoders), not from better embeddings. Rerankers add 15-35% of quality with little complexity.&lt;/p>
&lt;p>On cost: combined fine-tuning + RAG tends to be 30-50% cheaper than pure RAG with frontier models at high volume, because the fine-tuned model can be smaller and cheaper while keeping equivalent quality.&lt;/p>
&lt;h2 id="the-2026-tool-landscape">The 2026 tool landscape&lt;/h2>
&lt;p>On to the concrete pieces, grouped by function. The field has matured enough for each piece to have 2-3 reasonable options and a couple of leaders.&lt;/p>
&lt;h3 id="experiment-tracking-and-model-registry">Experiment tracking and model registry&lt;/h3>
&lt;p>&lt;a href="https://mlflow.org/">MLflow&lt;/a> remains the de facto standard, now with LLM-specific traction. MLflow 3 was published in June 2025; version 3.10.1 (March 2026) added:&lt;/p>
&lt;ul>
&lt;li>A GenAI Overview dashboard with ready-made metrics for LLM apps.&lt;/li>
&lt;li>Multi-workspace support for large teams.&lt;/li>
&lt;li>Cost tracking in traces (gen_ai.usage.* aggregated per experiment).&lt;/li>
&lt;li>MemAlign: a new specific eval algorithm.&lt;/li>
&lt;li>Integrated native OpenTelemetry tracing.&lt;/li>
&lt;li>First-class support for LangChain, LlamaIndex, AutoGen as frameworks.&lt;/li>
&lt;/ul>
&lt;p>MLflow treats prompts and agents as first-class citizens alongside classic models. It is the biggest change relative to MLflow 2.x.&lt;/p>
&lt;p>&lt;a href="https://wandb.ai/">Weights &amp;amp; Biases (W&amp;amp;B)&lt;/a> with its LLM-specific product Weave offers tracing + eval + debug with a very polished UI. More commercial, less self-host friendly, but excellent UX.&lt;/p>
&lt;p>&lt;a href="https://www.zenml.io/">ZenML&lt;/a> is the piece that most cleanly integrates &amp;ldquo;classic MLOps + emerging LLMOps&amp;rdquo; into a single framework. Its automatic artifact versioning captures prompt templates, retrieval chunks and agent conversation histories with no extra work. Open-source. The most complete unification option that exists.&lt;/p>
&lt;h3 id="dataset-versioning">Dataset versioning&lt;/h3>
&lt;p>&lt;a href="https://dvc.org/">DVC&lt;/a> remains the OSS standard. It extends Git to large files and pipelines. Important news from November 2025: &lt;a href="https://medium.com/the-modern-scientist/reproducible-ai-versioning-models-prompts-and-data-96dd0337af65">lakeFS acquired DVC&lt;/a>, consolidating the two OSS data versioning projects under one organisation. The combined roadmap is oriented towards LLM training and RAG datalakes specifically.&lt;/p>
&lt;p>&lt;strong>Typical pattern&lt;/strong>: Git for code + DVC for data/models + MLflow or W&amp;amp;B for experiment tracking + registry. Few teams use just one; the combination is what covers the cycle. Detailed in the &lt;a href="https://blog.lo0.es/en/posts/data-versioning-llmops-dvc-lakefs-reproducible-golden-dataset/">dedicated post on data versioning for LLMOps&lt;/a> — the four artifacts to version separately, schema contracts, end-to-end lineage, and a golden eval set with a strict holdout.&lt;/p>
&lt;h3 id="prompt-versioning-and-observability">Prompt versioning and observability&lt;/h3>
&lt;p>Covered in depth in the &lt;a href="https://blog.lo0.es/en/posts/agentsight-llm-tracing-ebpf-zero-instrumentation/">AgentSight post&lt;/a> where we go deeper into Langfuse as the OSS reference. Summary here:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://langfuse.com/">Langfuse&lt;/a>: MIT, self-host, prompt management with v1/v2/v3 versioning + labels + cache + linkage with traces.&lt;/li>
&lt;li>&lt;a href="https://www.langchain.com/langsmith">LangSmith&lt;/a>: if your stack is LangChain.&lt;/li>
&lt;li>&lt;a href="https://phoenix.arize.com/">Arize Phoenix&lt;/a>: ELv2, OTel-native.&lt;/li>
&lt;/ul>
&lt;h3 id="pipeline-orchestration">Pipeline orchestration&lt;/h3>
&lt;p>For the LLMOps pipeline steps, the dominant options:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://www.kubeflow.org/docs/components/pipelines/">Kubeflow Pipelines&lt;/a>: the K8s-native standard. KServe (the serving part of Kubeflow) has its vLLM runtime upgraded to v0.8.1+ with support for reasoning models, tool calling, embeddings, reranking, Llama 4 and Qwen 3.&lt;/li>
&lt;li>&lt;a href="https://www.zenml.io/">ZenML&lt;/a>: already mentioned; also a pipeline orchestrator.&lt;/li>
&lt;li>&lt;a href="https://metaflow.org/">Metaflow&lt;/a> (Netflix-originated): Python-first pipelines, less LLM-specific but workable.&lt;/li>
&lt;li>&lt;a href="https://argoproj.github.io/workflows/">Argo Workflows&lt;/a>: a pure K8s OSS alternative.&lt;/li>
&lt;li>&lt;a href="https://flyte.org/">Flyte&lt;/a>: Kubernetes-native, OSS.&lt;/li>
&lt;/ul>
&lt;h3 id="serving">Serving&lt;/h3>
&lt;p>Covered in depth in &lt;a href="https://blog.lo0.es/en/posts/vllm-kubernetes-llm-inference-that-scales/">vLLM on Kubernetes&lt;/a> and &lt;a href="https://blog.lo0.es/en/posts/llm-inference-operators-kubernetes/">LLM K8s Operators&lt;/a>. Summary:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://github.com/vllm-project/production-stack">vLLM Production Stack&lt;/a>: a curated Helm chart.&lt;/li>
&lt;li>&lt;a href="https://kserve.github.io/website/">KServe vLLM runtime&lt;/a>: K8s-native, vLLM 0.8.1+ with full agentic support.&lt;/li>
&lt;li>&lt;a href="https://www.bentoml.com/">BentoML&lt;/a>: flexible serving, popular in startups for its simplicity.&lt;/li>
&lt;li>&lt;a href="https://developer.nvidia.com/dynamo">NVIDIA Dynamo&lt;/a>: the successor to Triton.&lt;/li>
&lt;li>&lt;a href="https://github.com/llm-d/llm-d">llm-d&lt;/a>: CNCF Sandbox.&lt;/li>
&lt;li>&lt;a href="https://github.com/ome-projects/ome">OME&lt;/a>: an LMSYS operator with native SGLang.&lt;/li>
&lt;/ul>
&lt;h3 id="evals-and-guardrails">Evals and guardrails&lt;/h3>
&lt;p>Covered in &lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">Evals&lt;/a> and &lt;a href="https://blog.lo0.es/en/posts/llm-guardrails-safety-four-lines-of-defence/">Guardrails&lt;/a>. Ultra-short summary:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Evals CI&lt;/strong>: DeepEval, Promptfoo, Ragas.&lt;/li>
&lt;li>&lt;strong>Evals platform&lt;/strong>: Langfuse, LangSmith, Phoenix, Braintrust.&lt;/li>
&lt;li>&lt;strong>Guardrails&lt;/strong>: NeMo Guardrails, Llama Guard 4, Llama Prompt Guard 2, LLM Guard, Lakera.&lt;/li>
&lt;/ul>
&lt;h3 id="drift-detection-and-observability">Drift detection and observability&lt;/h3>
&lt;p>Covered in the &lt;a href="https://blog.lo0.es/en/posts/ebpf-local-inference-statistical-drift-detection/">closing eBPF post&lt;/a>. Summary:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Drift&lt;/strong>: Evidently AI, NannyML, WhyLabs.&lt;/li>
&lt;li>&lt;strong>Tracing&lt;/strong>: Langfuse, OpenLLMetry, Phoenix.&lt;/li>
&lt;li>&lt;strong>eBPF&lt;/strong>: AgentSight, Hubble, Tetragon, ProfInfer.&lt;/li>
&lt;/ul>
&lt;h3 id="the-typical-2026-stack-table">The typical 2026 stack table&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Stage&lt;/th>
&lt;th>Dominant piece&lt;/th>
&lt;th>Alternatives&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Data ingestion + versioning&lt;/td>
&lt;td>DVC + lakeFS (unified Nov 2025)&lt;/td>
&lt;td>Pachyderm, Quilt&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Vector store / RAG index&lt;/td>
&lt;td>Milvus, Qdrant, pgvector, Weaviate&lt;/td>
&lt;td>LanceDB, Pinecone, Chroma&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Experiment tracking&lt;/td>
&lt;td>MLflow 3.10&lt;/td>
&lt;td>W&amp;amp;B Weave, Neptune&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Pipeline orchestration&lt;/td>
&lt;td>Kubeflow + Argo&lt;/td>
&lt;td>ZenML, Metaflow, Flyte&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Model registry&lt;/td>
&lt;td>MLflow registry&lt;/td>
&lt;td>W&amp;amp;B Models, KServe ModelMesh&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Prompt versioning&lt;/td>
&lt;td>Langfuse&lt;/td>
&lt;td>LangSmith, MLflow Prompts&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Serving&lt;/td>
&lt;td>vLLM Production Stack&lt;/td>
&lt;td>KServe, BentoML, Dynamo, llm-d, OME&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Evals CI&lt;/td>
&lt;td>DeepEval, Ragas&lt;/td>
&lt;td>Promptfoo, OpenAI Evals&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Evals platform&lt;/td>
&lt;td>Langfuse, Phoenix&lt;/td>
&lt;td>LangSmith, Braintrust&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Guardrails&lt;/td>
&lt;td>NeMo + Llama Guard&lt;/td>
&lt;td>LLM Guard, Lakera&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Tracing&lt;/td>
&lt;td>OpenLLMetry + Langfuse&lt;/td>
&lt;td>Phoenix, LangSmith&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Drift detection&lt;/td>
&lt;td>Evidently AI&lt;/td>
&lt;td>NannyML, WhyLabs&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>eBPF observability&lt;/td>
&lt;td>AgentSight + Tetragon + Hubble&lt;/td>
&lt;td>(new territory, few alternatives)&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>13 pieces. No org uses them all; any serious org uses at least six. &lt;strong>This is the current LLMOps stack&lt;/strong>.&lt;/p>
&lt;h2 id="the-operational-reality-nobody-uses-a-single-tool">The operational reality: nobody uses a single tool&lt;/h2>
&lt;p>&lt;a href="https://medium.com/@kanerika/mlflow-vs-kubeflow-vs-w-b-which-mlops-tool-fits-your-stack-b59007460b25">Multiple comparisons&lt;/a> agree on one thing: &lt;strong>the teams that win combine&lt;/strong>. Recurring patterns:&lt;/p>
&lt;ul>
&lt;li>ZenML to orchestrate + MLflow for tracking + KServe for serving: the most popular OSS stack in companies coming from classic MLOps.&lt;/li>
&lt;li>Kubeflow + W&amp;amp;B + BentoML: for teams with a research focus.&lt;/li>
&lt;li>Langfuse + DeepEval + Phoenix + LiteLLM: for pure-LLM teams with no classic MLOps background.&lt;/li>
&lt;li>MLflow + DVC + Argo + KServe: an idiomatic cloud-native stack without additional LLM-specifics (with its limitations).&lt;/li>
&lt;/ul>
&lt;p>The choice depends on the team&amp;rsquo;s background, on the licensing model they can afford, on the level of self-hosting they need, and on which frictions blocked them most in previous projects. &lt;strong>There is no &amp;ldquo;one right answer&amp;rdquo;&lt;/strong>; there is a stable meta-pattern of layers worth covering.&lt;/p>
&lt;h2 id="common-operational-traps">Common operational traps&lt;/h2>
&lt;h3 id="treating-the-prompt-as-text-in-code">Treating the prompt as text in code&lt;/h3>
&lt;p>Hardcoding prompts in strings in the repo. Changing them requires a PR + redeploy. Result: teams that do not iterate on prompts because every change costs hours of pipeline. &lt;strong>Solution&lt;/strong>: externalised prompt management (Langfuse, MLflow Prompts) with versioning, labels, hot-reload.&lt;/p>
&lt;h3 id="skipping-dataset-versioning">Skipping dataset versioning&lt;/h3>
&lt;p>&amp;ldquo;DVC is complicated, we will add it later&amp;rdquo;. Result: two months later, nobody knows which dataset trained which model. Impossible to reproduce incidents. &lt;strong>Solution&lt;/strong>: DVC + lakeFS from day 1, even if only with a small subset.&lt;/p>
&lt;h3 id="mixing-layers-in-the-same-pipeline">Mixing layers in the same pipeline&lt;/h3>
&lt;p>Teams that put ingestion, fine-tuning, eval and deploy into a single giant pipeline. When something fails, the whole pipeline fails. &lt;strong>Solution&lt;/strong>: independent pipelines per stage, with versioned artifacts as the interfaces between them.&lt;/p>
&lt;h3 id="tracking-with-no-structure">Tracking with no structure&lt;/h3>
&lt;p>Logging everything to stdout and &amp;ldquo;we will look at it in CloudWatch later&amp;rdquo;. Result: impossible to correlate, compare, debug. &lt;strong>Solution&lt;/strong>: OTel from day 1 with &lt;code>gen_ai.*&lt;/code> semantic conventions.&lt;/p>
&lt;h3 id="evals-that-block-nothing">Evals that block nothing&lt;/h3>
&lt;p>You have evals, you run them, you look at them, but they do not prevent the deploy if they drop. Eventually it drops gradually and nobody notices. &lt;strong>Solution&lt;/strong>: eval gates in CI/CD that block the merge if critical metrics regress by more than X%.&lt;/p>
&lt;h3 id="no-retrain-cadence">No retrain cadence&lt;/h3>
&lt;p>You launch v1 and never go back to the model. Six months later, drift has degraded it but the team is on other projects. &lt;strong>Solution&lt;/strong>: a formal retrain cadence (monthly, quarterly) tied to the production incident queue.&lt;/p>
&lt;h3 id="invisible-vendor-lock-in">Invisible vendor lock-in&lt;/h3>
&lt;p>You start with the OpenAI API + LangSmith + Pinecone. When you want to self-host, you discover that migrating is a 3-month project. &lt;strong>Solution&lt;/strong>: abstraction layers (LiteLLM, OpenLLMetry) and vendor-neutrality from the start.&lt;/p>
&lt;h2 id="what-is-coming-in-the-following-posts-of-the-series">What is coming in the following posts of the series&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Post 2 — &lt;a href="https://blog.lo0.es/en/posts/rag-on-kafka-reference-architecture-streaming-datalakes/">RAG over datalakes with Kafka: end-to-end technical architecture&lt;/a>&lt;/strong> — the most hands-on one. Kafka as source-of-truth, Flink CDC, embedding pipelines, continuous indexing in Milvus/Qdrant, a complete example with real numbers and manifests.&lt;/li>
&lt;li>&lt;strong>Post 3 — &lt;a href="https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/">The six-stage LLMOps pipeline: global architecture&lt;/a>&lt;/strong> — the master map of the complete system with a reusable &amp;ldquo;you are here&amp;rdquo; SVG for the following posts. A deep dive into each of the six stages (Data, Tune, Eval, Deploy, Observe, Retrain).&lt;/li>
&lt;li>&lt;strong>Post 4 — &lt;a href="https://blog.lo0.es/en/posts/postgresql-qdrant-rag-ingestion-postman-syncing-two-worlds/">PostgreSQL + Qdrant in the ingestion stage&lt;/a>&lt;/strong> — synchronisation patterns (dual-write, outbox + CDC, event-driven), a complete microservices architecture, a Qdrant cluster manifest.&lt;/li>
&lt;li>&lt;strong>Upcoming posts&lt;/strong> — still to be decided: the cluster as a multi-tenant platform, Constitutional AI / alignment runtime, continuous fine-tuning in depth, edge LLMs.&lt;/li>
&lt;li>&lt;strong>Synthesis post&lt;/strong> — &lt;a href="https://blog.lo0.es/en/posts/anatomy-llm-request-production-tour-six-stages/">Anatomy of an LLM request in production, May 2026&lt;/a> — the complete journey of a real request through the six stages and the two cross-cutting components, with cross-links to each dedicated post. It works as a mental map of the blog and as an integrator&amp;rsquo;s guide.&lt;/li>
&lt;li>&lt;strong>Parallel OSS vs hyperscalers catalogue&lt;/strong> — &lt;a href="https://blog.lo0.es/en/posts/parallel-catalogue-llmops-stages-open-source-hyperscalers/">The parallel catalogue: the six LLMOps stages in OSS and in AWS / GCP / Azure&lt;/a> — for each stage of the pipeline, which tools the blog&amp;rsquo;s reference OSS stack uses and what the cloud equivalents are, with summary tables, identification of real gaps and the multi-tenant chatbot ported to an AWS stack component by component. A neutral editorial stance.&lt;/li>
&lt;li>&lt;strong>OSS catalogue entry by entry&lt;/strong> — &lt;a href="https://blog.lo0.es/en/posts/oss-catalogue-llmops-six-stages-tool-by-tool/">The OSS catalogue for LLMOps in six stages: entry by entry&lt;/a> — the zoom in on the open source side: ~150 words of description per core tool (vLLM, Langfuse, DVC, Qdrant, Airflow, NeMo Guardrails, Presidio…), licence and governance, a decision matrix per stage, a diagram of the connected OSS stack and a master table of licences and EE / SaaS offerings.&lt;/li>
&lt;/ul>
&lt;h2 id="references">References&lt;/h2>
&lt;p>LLMOps vs MLOps:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://medium.com/@sanjeebmeister/the-complete-mlops-llmops-roadmap-for-2026-building-production-grade-ai-systems-bdcca5ed2771">The Complete MLOps/LLMOps Roadmap for 2026 (Sanjeeb Panda)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://www.iamraghuveer.com/posts/mlops-vs-llmops-what-changes/">MLOps vs LLMOps: What Changes (Raghuveer)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://hyscaler.com/insights/mlops-in-2026-guide/">MLOps in 2026: Architecture, Trends &amp;amp; Strategy (Hyscaler)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://www.ideas2it.com/blogs/llmops-vs-mlops-key-differences-and-evolution">LLMOps vs MLOps: Differences and Evolution (Ideas2IT)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://dev.to/apprecode/llmops-vs-mlops-whats-different-whats-the-same-and-how-to-run-both-in-production-2o52">LLMOps vs MLOps in production (DEV/Apprecode)&lt;/a>.&lt;/li>
&lt;/ul>
&lt;p>Tools:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://mlflow.org/">MLflow&lt;/a> — registry + tracking + serving.&lt;/li>
&lt;li>&lt;a href="https://wandb.ai/site/weave">Weights &amp;amp; Biases Weave&lt;/a> — LLM tracing.&lt;/li>
&lt;li>&lt;a href="https://www.zenml.io/">ZenML&lt;/a> — pipeline orchestration MLOps + LLMOps.&lt;/li>
&lt;li>&lt;a href="https://www.kubeflow.org/">Kubeflow&lt;/a> — K8s-native MLOps.&lt;/li>
&lt;li>&lt;a href="https://kserve.github.io/website/">KServe&lt;/a> — model serving K8s.&lt;/li>
&lt;li>&lt;a href="https://www.bentoml.com/">BentoML&lt;/a> — flexible serving.&lt;/li>
&lt;li>&lt;a href="https://metaflow.org/">Metaflow&lt;/a> — Netflix&amp;rsquo;s pipelines.&lt;/li>
&lt;li>&lt;a href="https://dvc.org/">DVC&lt;/a> — dataset versioning.&lt;/li>
&lt;li>&lt;a href="https://lakefs.io/">lakeFS&lt;/a> — enterprise data versioning, acquired DVC in Nov 2025.&lt;/li>
&lt;/ul>
&lt;p>2026 comparisons:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://medium.com/@kanerika/mlflow-vs-kubeflow-vs-w-b-which-mlops-tool-fits-your-stack-b59007460b25">MLflow vs Kubeflow vs W&amp;amp;B (Kanerika)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://www.zenml.io/blog/mlflow-alternatives">9 MLflow alternatives tested (ZenML)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://www.zenml.io/blog/metaflow-vs-kubeflow">Metaflow vs Kubeflow vs ZenML (ZenML)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://www.zenml.io/blog/mlops-tools">12 Best MLOps Tools for Agentic AI (ZenML)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://www.spheron.network/blog/mlops-pipeline-gpu-cloud-kubeflow-zenml-metaflow-2026/">MLOps Pipeline on GPU Cloud 2026 (Spheron)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://northflank.com/blog/top-7-kubeflow-alternatives">Top 7 Kubeflow alternatives 2026 (Northflank)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://www.sganalytics.com/blog/mlops-tools/">Top 20 MLOps Tools 2026 (SG Analytics)&lt;/a>.&lt;/li>
&lt;/ul>
&lt;p>RAG vs Fine-Tuning:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://www.scalacode.com/blog/rag-vs-fine-tuning/">RAG Vs Fine-Tuning In 2026 (ScalaCode)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://www.arxiv.org/pdf/2510.01375">Fine-Tuning with RAG (ICLR 2026, arxiv)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://dev.to/tyson_cung/rag-vs-fine-tuning-what-actually-works-in-production-2026-20jg">RAG vs Fine-Tuning — What Actually Works in Production 2026 (DEV)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://www.kapa.ai/blog/how-to-build-a-rag-pipeline-from-scratch-in-2026">How to Build a RAG Pipeline from Scratch in 2026 (kapa.ai)&lt;/a>.&lt;/li>
&lt;/ul>
&lt;p>Cross-references (the three previous series):&lt;/p>
&lt;ul>
&lt;li>LLM inference series: &lt;a href="https://blog.lo0.es/en/posts/kv-cache-working-memory-llm-inference/">KV cache&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/vllm-kubernetes-llm-inference-that-scales/">vLLM on K8s&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/pagedattention-vllm-block-manager/">PagedAttention&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/llm-inference-operators-kubernetes/">LLM K8s Operators&lt;/a>.&lt;/li>
&lt;li>eBPF series: &lt;a href="https://blog.lo0.es/en/posts/ebpf-zero-to-cilium-kernel-tcp-ip-bypass/">eBPF from zero to Cilium&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/tetragon-cilium-security-syscalls-kernel/">Tetragon&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/hubble-ebpf-network-observability-ai-agents/">Hubble&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/agentsight-llm-tracing-ebpf-zero-instrumentation/">AgentSight&lt;/a>.&lt;/li>
&lt;li>Post-tracing series: &lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">Evals&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/llm-guardrails-safety-four-lines-of-defence/">Guardrails&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/mcp-deep-observability-opentelemetry/">MCP observability&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/ebpf-local-inference-statistical-drift-detection/">eBPF + drift&lt;/a>.&lt;/li>
&lt;/ul></description></item></channel></rss>