<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tyler Edwards</title>
    <description>The latest articles on DEV Community by Tyler Edwards (@tyler007).</description>
    <link>https://dev.to/tyler007</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4088298%2F6d881582-8f62-4da6-b85a-793162ef8815.webp</url>
      <title>DEV Community: Tyler Edwards</title>
      <link>https://dev.to/tyler007</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tyler007"/>
    <language>en</language>
    <item>
      <title>RAG or fine-tuning? How to tell which one your model needs</title>
      <dc:creator>Tyler Edwards</dc:creator>
      <pubDate>Sat, 14 Nov 2026 10:30:38 +0000</pubDate>
      <link>https://dev.to/tyler007/rag-or-fine-tuning-how-to-tell-which-one-your-model-needs-2p28</link>
      <guid>https://dev.to/tyler007/rag-or-fine-tuning-how-to-tell-which-one-your-model-needs-2p28</guid>
      <description>&lt;p&gt;When the model inside your product gets something wrong, there are two usual causes. Either the model does not know something it needs, such as your pricing, your policies or last week's release. Or it knows enough and still gets the format, the tone or the call wrong. Retrieval-augmented generation (RAG) fixes the first. &lt;a href="https://docs.overmindlab.ai/how-to/train?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=always-on&amp;amp;utm_content=rag-vs-fine-tuning-devto" rel="noopener noreferrer"&gt;Fine-tuning&lt;/a&gt; fixes the second.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.overmindlab.ai/research/rag-vs-fine-tuning?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=always-on&amp;amp;utm_content=rag-vs-fine-tuning-devto-original" rel="noopener noreferrer"&gt;overmindlab.ai&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The two work on different parts of the system. RAG changes what the model reads. Fine-tuning changes the model itself. RAG is like an open-book exam, where the answer can only be as good as the page you turn to. Fine-tuning is like practice, which changes what you do without looking anything up.&lt;/p&gt;

&lt;h2&gt;
  
  
  RAG vs fine-tuning, side by side
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;RAG&lt;/th&gt;
&lt;th&gt;Fine-tuning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;What changes&lt;/td&gt;
&lt;td&gt;What the model reads at answer time&lt;/td&gt;
&lt;td&gt;The model's weights (the learned numbers inside it)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;What it fixes&lt;/td&gt;
&lt;td&gt;Missing, private or outdated knowledge&lt;/td&gt;
&lt;td&gt;Wrong format, tone or decisions on a repeated task&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Where knowledge lives&lt;/td&gt;
&lt;td&gt;In your documents, fetched per request&lt;/td&gt;
&lt;td&gt;In the model, fixed at training time&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Freshness&lt;/td&gt;
&lt;td&gt;As current as your index&lt;/td&gt;
&lt;td&gt;As current as the last training run&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;What you need&lt;/td&gt;
&lt;td&gt;Documents, an index and a retriever&lt;/td&gt;
&lt;td&gt;Hundreds to a few thousand good examples of the task&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost per request&lt;/td&gt;
&lt;td&gt;Longer prompts on every call&lt;/td&gt;
&lt;td&gt;Shorter prompts, and the model can be smaller&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sources&lt;/td&gt;
&lt;td&gt;Can show the passage it used&lt;/td&gt;
&lt;td&gt;Cannot point to where an answer came from&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Typical failure&lt;/td&gt;
&lt;td&gt;The retriever misses the right passage&lt;/td&gt;
&lt;td&gt;Confident answers outside what it was trained on&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;RAG vs fine-tuning, side by side&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  When should you use RAG?
&lt;/h2&gt;

&lt;p&gt;RAG adds a lookup step before the model answers. A retriever finds passages related to the request, often with embeddings (a way of matching text by meaning), and puts them in the prompt next to the question. The model answers from what it was handed and does not change. RAG is the right tool in four situations.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The facts change. Prices, policies and docs move faster than any training schedule. Update the document, re-index it, and the next answer uses it.&lt;/li&gt;
&lt;li&gt;The knowledge is private or too large to fit. The base model never saw your help center, and no prompt holds all of it. Retrieval picks the few passages that matter.&lt;/li&gt;
&lt;li&gt;Answers need a source. The model answers from specific passages, so you can show users where each answer came from.&lt;/li&gt;
&lt;li&gt;Access differs by user. You can filter retrieval by who is asking, whereas anything trained into the weights can surface for any user.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;RAG has limits too. Answers are only as good as the passages the retriever returns, and every passage adds tokens and latency. Retrieving facts does little for behavior. If the model has the right facts and still gets the format wrong, more retrieval will not help.&lt;/p&gt;

&lt;h2&gt;
  
  
  When should you fine-tune?
&lt;/h2&gt;

&lt;p&gt;Fine-tuning continues training a model on examples of the job, each pairing an input with the output you want. After enough of them, the model produces that output without being told. It pays off in four situations.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The task is narrow and repeats. Classification, extraction, routing and fixed-format replies are the classic cases.&lt;/li&gt;
&lt;li&gt;The model has the knowledge but not the behavior. It knows enough to answer, yet keeps breaking the output format or picking the wrong tool.&lt;/li&gt;
&lt;li&gt;You have real examples, ideally hundreds to a few thousand labeled runs from production traffic. &lt;a href="https://www.overmindlab.ai/research/traces-to-training-dataset?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=always-on&amp;amp;utm_content=rag-vs-fine-tuning-devto" rel="noopener noreferrer"&gt;How to turn traces into a training dataset&lt;/a&gt; shows how to build them.&lt;/li&gt;
&lt;li&gt;Cost or latency matters. A small fine-tuned model with a short prompt can replace a frontier model carrying a long one. &lt;a href="https://www.overmindlab.ai/research/open-weights-vs-frontier-apis?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=always-on&amp;amp;utm_content=rag-vs-fine-tuning-devto" rel="noopener noreferrer"&gt;Open-weight vs frontier models&lt;/a&gt; covers when that switch pays.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Fine-tuning is a poor way to add facts. Models learn new facts slowly this way, and the facts go stale the moment they change. Keep knowledge in retrieval and behavior in training.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where does prompt engineering fit?
&lt;/h2&gt;

&lt;p&gt;Prompt engineering changes the instructions. RAG changes the facts. Fine-tuning changes the model. The usual order follows the cost. Start with the prompt, because it takes minutes and you can undo it instantly. Add RAG when failures trace back to missing knowledge. Fine-tune when failures are about behavior on a narrow task and better prompts have stopped improving your test scores.&lt;/p&gt;

&lt;p&gt;Read the failures to tell the gaps apart. Quoting an old price is a knowledge gap. Formatting the right price wrongly is a behavior gap. &lt;a href="https://www.overmindlab.ai/research/prompt-engineering-vs-fine-tuning?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=always-on&amp;amp;utm_content=rag-vs-fine-tuning-devto" rel="noopener noreferrer"&gt;Prompt engineering vs fine-tuning&lt;/a&gt; covers how to tell when prompting has hit its ceiling.&lt;/p&gt;

&lt;h2&gt;
  
  
  Can you combine RAG and fine-tuning?
&lt;/h2&gt;

&lt;p&gt;Yes, and agents that need both should use both. The two fix different gaps, so they stack. A support agent might retrieve the customer's plan and the right help article, then hand both to a model trained on thousands of resolved tickets.&lt;/p&gt;

&lt;p&gt;Train on what the model will see in production. If your agent answers from retrieved passages, keep those passages in the input of each training example. The model then learns to answer from context the way your agent's best runs did. This is the idea behind &lt;a href="https://arxiv.org/abs/2403.10131" rel="noopener noreferrer"&gt;RAFT&lt;/a&gt;, short for retrieval-augmented fine-tuning.&lt;/p&gt;

&lt;p&gt;Keep the split clean. Facts stay in retrieval, so a changed policy needs a document edit and no training run. Behavior lives in the weights, so the prompt can shrink to the request and its passages.&lt;/p&gt;

&lt;h2&gt;
  
  
  RAG, fine-tuning or both in five worked examples
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Problem&lt;/th&gt;
&lt;th&gt;Start with&lt;/th&gt;
&lt;th&gt;Why&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;The agent quotes last quarter's prices&lt;/td&gt;
&lt;td&gt;RAG&lt;/td&gt;
&lt;td&gt;Prices change faster than you could retrain&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Each customer should see only their own records&lt;/td&gt;
&lt;td&gt;RAG&lt;/td&gt;
&lt;td&gt;Filter retrieval per user. Anything in the weights can surface for anyone&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A routing or extraction step runs on every request&lt;/td&gt;
&lt;td&gt;Fine-tuning&lt;/td&gt;
&lt;td&gt;Narrow task, high volume, and production gives you the examples&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The right document is in the prompt, but answers misquote it or add details&lt;/td&gt;
&lt;td&gt;Fine-tuning, on examples that include the retrieved text&lt;/td&gt;
&lt;td&gt;The gap is in how the model reads, not what it reads&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Replies are too long or the wrong tone&lt;/td&gt;
&lt;td&gt;Prompt engineering&lt;/td&gt;
&lt;td&gt;One instruction often fixes it, and you can undo it instantly&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Which technique fits which problem&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What training adds when the document is already in the prompt
&lt;/h2&gt;

&lt;p&gt;RAG decides what the model reads. Training changes how faithfully it reads. Overmind's benchmark, &lt;a href="https://www.overmindlab.ai/research/when-bigger-isnt-better?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=always-on&amp;amp;utm_content=rag-vs-fine-tuning-devto" rel="noopener noreferrer"&gt;When bigger isn't better&lt;/a&gt;, measured that second part on three reading tasks. Each gives the model a document to answer from, the same step every RAG pipeline ends with.&lt;/p&gt;

&lt;p&gt;The clearest case is contract review. Across 4,000+ questions on 100+ contracts, the model had to say whether a clause was in the contract and quote its exact wording. The benchmark scored the base model before and after training on real examples of the task, alongside a frontier flagship model.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Base model, before training&lt;/th&gt;
&lt;th&gt;Same model, trained with Overmind&lt;/th&gt;
&lt;th&gt;Frontier flagship&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Clause detection (F1 score)&lt;/td&gt;
&lt;td&gt;80.4%&lt;/td&gt;
&lt;td&gt;91.6%&lt;/td&gt;
&lt;td&gt;82.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Exact quote match&lt;/td&gt;
&lt;td&gt;4.2%&lt;/td&gt;
&lt;td&gt;59.6%&lt;/td&gt;
&lt;td&gt;8.5%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;False alarm rate (clause claimed but absent)&lt;/td&gt;
&lt;td&gt;2.46%&lt;/td&gt;
&lt;td&gt;0.65%&lt;/td&gt;
&lt;td&gt;10.01%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fabrication rate (quote that does not exist)&lt;/td&gt;
&lt;td&gt;3.36%&lt;/td&gt;
&lt;td&gt;0.12%&lt;/td&gt;
&lt;td&gt;3.36%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Contract clause detection, 4,000+ questions across 100+ contracts (from When bigger isn't better)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Training took exact quotes from 4.2% to 59.6% and fabricated quotes from 3.36% to 0.12%. Retrieval played no part in that gain, because every model was given the same contract text.&lt;/p&gt;

&lt;p&gt;The other two tests compared trained models with the frontier flagship, and the results pointed the same way. On biomedical papers (BioRED), 48.2% of the relationships the frontier flagship claimed were not there, more than 7x the trained model's 6.6%. On NASA aviation incident reports, it added a detail that was not in the report to more than 1 in 3 synopses (33.4%), against 13.4% for the smallest model Overmind trained.&lt;/p&gt;

&lt;p&gt;Because these tests hand the model the document, they measure the reading step only. They say nothing about retrieval quality.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fine-tuning a RAG agent with Overmind
&lt;/h2&gt;

&lt;p&gt;Keep your retriever. Overmind trains the model that reads what it returns. The Overmind Python SDK can record each retrieval as its own span, so a trace shows what was fetched next to what the model answered. You &lt;a href="https://www.overmindlab.ai/research/traces-to-training-dataset?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=always-on&amp;amp;utm_content=rag-vs-fine-tuning-devto" rel="noopener noreferrer"&gt;build a dataset from those production traces&lt;/a&gt;, and every row links back to the trace it came from. Then you &lt;a href="https://www.overmindlab.ai/product/model-training?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=always-on&amp;amp;utm_content=rag-vs-fine-tuning-devto" rel="noopener noreferrer"&gt;fine-tune an open-weight base model&lt;/a&gt; with &lt;a href="https://www.overmindlab.ai/research/types-of-fine-tuning?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=always-on&amp;amp;utm_content=rag-vs-fine-tuning-devto" rel="noopener noreferrer"&gt;LoRA or full supervised fine-tuning&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Before you switch traffic, benchmark the trained model with your evaluators on a separate eval set. By default Overmind compares the base model before training with the trained model after. Comparing against the model your agent runs today is opt-in. The trained model is served through an OpenAI-compatible endpoint, and you can download its weights once the deployment's archive is ready. &lt;a href="https://docs.overmindlab.ai/how-to/train?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=always-on&amp;amp;utm_content=rag-vs-fine-tuning-devto" rel="noopener noreferrer"&gt;The training docs&lt;/a&gt; cover each step.&lt;/p&gt;

&lt;p&gt;If you have an agent in production, its own past work is the training data, and your coding agent can set Overmind up for you. Open the repo in Claude Code, Cursor, Codex or OpenCode and paste &lt;code&gt;Set me up on Overmind https://console.overmindlab.ai/setup.md&lt;/code&gt; into the chat. If you prefer the browser, &lt;a href="https://console.overmindlab.ai/?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=always-on&amp;amp;utm_content=rag-vs-fine-tuning-devto-next-step" rel="noopener noreferrer"&gt;start for free&lt;/a&gt; and copy the prompt from the console.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What is the difference between RAG and fine-tuning?
&lt;/h3&gt;

&lt;p&gt;RAG retrieves relevant documents when a request arrives and adds them to the prompt, so the model answers from current facts. Fine-tuning trains the model on examples, which changes its weights. RAG changes what the model knows in the moment. Fine-tuning changes how it behaves every time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Should you try RAG, fine-tuning or prompt engineering first?
&lt;/h3&gt;

&lt;p&gt;Prompt engineering, because it takes minutes and you can undo it instantly. Add RAG when failures come from missing or outdated knowledge. Fine-tune when failures are about behavior on a narrow, repeated task and prompt changes have stopped improving your test scores.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is RAG cheaper than fine-tuning?
&lt;/h3&gt;

&lt;p&gt;RAG is cheaper to start, because there is no training run. Fine-tuning can be cheaper to run, mostly because a fine-tuned model can be a smaller one. In Overmind's contract benchmark, where both models read the same contract, the small trained model cost about 20x less per question than the frontier flagship, before counting the one-off training run.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does fine-tuning add knowledge to a model?
&lt;/h3&gt;

&lt;p&gt;Only slowly and unreliably. &lt;a href="https://arxiv.org/abs/2405.05904" rel="noopener noreferrer"&gt;A 2024 EMNLP paper&lt;/a&gt; found that models learn new facts from fine-tuning more slowly than facts they already know, and that their tendency to hallucinate rises as those new facts are learned. Its authors say this supports the view that models get most of their knowledge from pre-training, while fine-tuning mainly teaches them to use it.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is RAFT?
&lt;/h3&gt;

&lt;p&gt;RAFT, short for retrieval-augmented fine-tuning, is a training recipe from &lt;a href="https://arxiv.org/abs/2403.10131" rel="noopener noreferrer"&gt;a 2024 UC Berkeley paper&lt;/a&gt;. Each training example pairs a question with retrieved documents and a step-by-step answer that quotes the relevant passage. Usually the relevant document sits among distractors, and in some examples only distractors are given. The model learns to find the right passage and ignore the rest.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does RAG stop hallucinations?
&lt;/h3&gt;

&lt;p&gt;No. The model can still misread the retrieved text or add details that are not in it. In Overmind's aviation benchmark, a frontier flagship given the incident report still added a detail the report did not contain to 33.4% of its synopses. Retrieval addresses missing knowledge. Training on real examples of the task improves how faithfully the model uses it.&lt;/p&gt;

</description>
      <category>rag</category>
      <category>finetuning</category>
      <category>llm</category>
      <category>ai</category>
    </item>
    <item>
      <title>How to fine-tune a small model on your Langfuse or LangSmith traces</title>
      <dc:creator>Tyler Edwards</dc:creator>
      <pubDate>Fri, 13 Nov 2026 14:31:29 +0000</pubDate>
      <link>https://dev.to/tyler007/how-to-fine-tune-a-small-model-on-your-langfuse-or-langsmith-traces-ddi</link>
      <guid>https://dev.to/tyler007/how-to-fine-tune-a-small-model-on-your-langfuse-or-langsmith-traces-ddi</guid>
      <description>&lt;p&gt;If your agent logs to Langfuse or LangSmith, you already have a record of it doing its job thousands of times. Each record is called a trace, and it holds the input, every model and tool call along the way, and the output. Those traces can train a small model you own to do one of the agent's jobs, and a small model is usually cheaper and faster to run than the large one the agent calls today. Training a model further on examples like these is called fine-tuning.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.overmindlab.ai/research/traces-to-fine-tuned-model?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=always-on&amp;amp;utm_content=traces-to-fine-tuned-model-devto-original" rel="noopener noreferrer"&gt;overmindlab.ai&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It works like training a new hire from a file of past cases. You pick the cases that were handled well, black out the customer names, and test the new hire on cases they haven't seen. Exporting the traces takes a short script, and most of the time goes into the same three jobs. You decide which traces to keep, clean them, and test the trained model in a way that can't flatter it.&lt;/p&gt;

&lt;p&gt;All of this assumes the traces already exist. If you're still working out what to capture or how to label it, read &lt;a href="https://www.overmindlab.ai/research/traces-to-training-dataset?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=always-on&amp;amp;utm_content=traces-to-fine-tuned-model-devto" rel="noopener noreferrer"&gt;how to turn traces into a training dataset&lt;/a&gt; first.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pick one step of the agent to train
&lt;/h2&gt;

&lt;p&gt;A single agent run usually contains several model calls that do different jobs. One call might classify the request and a later one write the reply. Train a model for one of those calls at a time. A single step has a defined input and output, and you can tell whether it succeeded, so the dataset stays small and the trained model is easy to measure and swap in.&lt;/p&gt;

&lt;p&gt;Start with the step that runs most often, or the one where a mistake costs the most. In your tracer it appears as an observation or run with a stable name, something like &lt;code&gt;classify_ticket&lt;/code&gt; or &lt;code&gt;extract_invoice&lt;/code&gt;, and the export scripts below filter on that name.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which traces are worth training on?
&lt;/h2&gt;

&lt;p&gt;Supervised fine-tuning teaches a model to copy its examples, and it copies the mistakes as faithfully as everything else. So for each trace you're asking whether you'd want that output repeated. Your tracer usually holds four signals that help, from weakest to strongest.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The call returned valid output without an error or a retry. You need this, but a confident wrong answer passes it too.&lt;/li&gt;
&lt;li&gt;An automated check (an eval) scored the output, whether that was another model acting as judge or a piece of code. This is useful at volume once you have compared a sample of its verdicts with a person's.&lt;/li&gt;
&lt;li&gt;The user gave a thumbs up, or the ticket closed without escalation.&lt;/li&gt;
&lt;li&gt;Someone corrected the output. The corrected version is the best training target you can get, because it is exactly what you wanted.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Keep the traces that pass the signals you trust. Put failures in your test set unless a person corrected them, in which case train on the corrected version.&lt;/p&gt;

&lt;p&gt;Before you train on any output, check who wrote it. If a GPT or Claude model wrote it, the vendor's terms apply. OpenAI's &lt;a href="https://openai.com/policies/usage-policies/" rel="noopener noreferrer"&gt;usage policies&lt;/a&gt;, effective November 20, 2026, bar using its outputs "to generate, prepare, select, or supply training material or signals for models that are intended as alternatives to or substitutes for OpenAI models or services." Anthropic's &lt;a href="https://www.anthropic.com/legal/aup" rel="noopener noreferrer"&gt;usage policy&lt;/a&gt;, effective November 12, 2026, prohibits using outputs to train an AI model without Anthropic's prior authorization. OpenAI's wording includes "select", so a GPT model that judges which traces to keep may fall under it too. Outputs your team wrote are yours. A GPT or Claude output that someone edited may still count as the vendor's. If you're unsure, ask your legal team before you train. Teams leaving OpenAI fine-tuning face the same question, and the &lt;a href="https://www.overmindlab.ai/research/openai-fine-tuning-migration?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=always-on&amp;amp;utm_content=traces-to-fine-tuned-model-devto" rel="noopener noreferrer"&gt;migration guide&lt;/a&gt; covers what they can take with them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Export the traces
&lt;/h2&gt;

&lt;p&gt;Each model call you export holds the messages your agent sent and the reply it got back. Each one becomes a chat row whose final assistant message is the accepted or corrected output.&lt;/p&gt;

&lt;p&gt;Both tools changed their read APIs in 2026, so any tutorial that calls &lt;code&gt;langfuse.api.trace.list&lt;/code&gt; or &lt;code&gt;client.list_runs&lt;/code&gt; is out of date. Check your retention window before you do anything else. LangSmith's base tier keeps traces for 14 days and Langfuse's Hobby plan shows 30 days of history, so older traces drop out while you wait.&lt;/p&gt;

&lt;h3&gt;
  
  
  From Langfuse
&lt;/h3&gt;

&lt;p&gt;Langfuse stores each trace as a tree of observations, and its &lt;a href="https://langfuse.com/docs/api-and-data-platform/features/public-api" rel="noopener noreferrer"&gt;Observations API&lt;/a&gt; returns them a page at a time. It can't filter observations by score, so you fetch the scores you trust from the Scores API first and then keep the model calls that belong to those traces. Human corrections are stored as scores with the data type &lt;code&gt;CORRECTION&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;export_langfuse.py&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timedelta&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timezone&lt;/span&gt;

&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;langfuse&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;get_client&lt;/span&gt;  &lt;span class="c1"&gt;# langfuse&amp;gt;=5, Python 3.11+&lt;/span&gt;

&lt;span class="c1"&gt;# Reads LANGFUSE_PUBLIC_KEY and LANGFUSE_SECRET_KEY.&lt;/span&gt;
&lt;span class="n"&gt;langfuse&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;get_client&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;end&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;timezone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;utc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;start&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nf"&gt;timedelta&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;days&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# 1. Traces that got positive user feedback (100 scores a page at most).&lt;/span&gt;
&lt;span class="n"&gt;good_traces&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cursor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;langfuse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;scores&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_many&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"user-feedback"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;data_type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"BOOLEAN"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"true"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;# thumbs up; NUMERIC and "1" if you log numbers&lt;/span&gt;
        &lt;span class="n"&gt;fields&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"subject"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;from_timestamp&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;to_timestamp&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cursor&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subject&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;kind&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"trace"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;good_traces&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;score&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subject&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;kind&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"observation"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;good_traces&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;score&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;trace_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;cursor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;meta&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cursor&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;

&lt;span class="c1"&gt;# 2. The model calls for one step, kept only from those traces.&lt;/span&gt;
&lt;span class="n"&gt;calls&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cursor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;langfuse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;observations&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_many&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"GENERATION"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"classify_ticket"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;from_start_time&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;to_start_time&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;fields&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"core,basic,io"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cursor&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;calls&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;obs&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;obs&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;obs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;trace_id&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;good_traces&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;cursor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;meta&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cursor&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;calls&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"calls from"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;good_traces&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"traces"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;input&lt;/code&gt; and &lt;code&gt;output&lt;/code&gt; come back as raw strings, so run &lt;code&gt;json.loads&lt;/code&gt; on them before you build chat rows. If you'd rather not write code at all, you can filter a Langfuse table by score in the UI and export it as CSV or JSON, and Enterprise, self-hosted and Pro (with the Teams add-on) plans can &lt;a href="https://langfuse.com/docs/api-and-data-platform/features/export-to-blob-storage" rel="noopener noreferrer"&gt;schedule exports&lt;/a&gt; to S3, Google Cloud Storage or Azure. Langfuse doesn't train models itself. Its &lt;a href="https://langfuse.com/integrations/model-providers/fireworks-ai" rel="noopener noreferrer"&gt;Fireworks guide&lt;/a&gt; curates a dataset by score and converts it to chat JSONL so you can train on Fireworks.&lt;/p&gt;

&lt;h3&gt;
  
  
  From LangSmith
&lt;/h3&gt;

&lt;p&gt;In LangSmith, &lt;code&gt;runs.query&lt;/code&gt; replaces &lt;code&gt;list_runs&lt;/code&gt;, which LangSmith Cloud removes on January 31, 2027. Its &lt;a href="https://docs.langchain.com/langsmith/trace-query-syntax" rel="noopener noreferrer"&gt;filter language&lt;/a&gt; can match on feedback directly, and the &lt;code&gt;trace_filter&lt;/code&gt; argument keeps only the model calls from traces whose root run got a thumbs up.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;export_langsmith.py&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;asyncio&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timedelta&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timezone&lt;/span&gt;

&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;langsmith&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;Client&lt;/span&gt;  &lt;span class="c1"&gt;# langsmith&amp;gt;=0.10.15&lt;/span&gt;


&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;export_calls&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# reads LANGSMITH_API_KEY&lt;/span&gt;
    &lt;span class="n"&gt;project&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read_project&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;project_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"support-agent"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;calls&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;runs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;project_ids&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;project&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="c1"&gt;# Without this, runs.query only looks back one day.&lt;/span&gt;
        &lt;span class="n"&gt;min_start_time&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;timezone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;utc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nf"&gt;timedelta&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;days&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;14&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;run_type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"LLM"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nb"&gt;filter&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'eq(name, "classify_ticket")'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;trace_filter&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="s1"&gt;'and(eq(feedback_key, "user_score"), '&lt;/span&gt;
            &lt;span class="s2"&gt;"eq(feedback_score, 1))"&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;selects&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"ID"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"TRACE_ID"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"START_TIME"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"INPUTS"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"OUTPUTS"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;calls&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;calls&lt;/span&gt;


&lt;span class="n"&gt;calls&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;asyncio&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;export_calls&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;calls&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"calls"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you've already curated a LangSmith dataset, you can download it in OpenAI's fine-tuning format from the UI or with &lt;code&gt;client.read_dataset_openai_finetuning(dataset_name=...)&lt;/code&gt;. Bulk export of whole projects to S3 as Parquet needs the Enterprise plan for accounts created after August 3, 2026. Unlike Langfuse, LangSmith does offer fine-tuning. Its &lt;a href="https://docs.langchain.com/langsmith/smithtune" rel="noopener noreferrer"&gt;smithtune&lt;/a&gt; command-line tool, in beta since September 2026, trains a LoRA model on Fireworks or Baseten with your own provider key and compares the base and tuned models in a LangSmith experiment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Clean the data before you train
&lt;/h2&gt;

&lt;p&gt;Duplicates are the first problem. Production traffic repeats itself, and one template that runs thousands of times a day can swamp everything else in the dataset. Drop exact duplicates by hashing the normalized input, then go after near-duplicates, such as the same request with a different order ID. In a study of language model training data, &lt;a href="https://arxiv.org/abs/2107.06499" rel="noopener noreferrer"&gt;Lee et al.&lt;/a&gt; found that after deduplication, models repeated memorized text ten times less often and reached the same or better accuracy in fewer training steps.&lt;/p&gt;

&lt;p&gt;A language model can repeat text from its training data word for word (&lt;a href="https://arxiv.org/abs/2012.07805" rel="noopener noreferrer"&gt;Carlini et al., 2021&lt;/a&gt;), so names, emails and account numbers in your traces should never reach the training set. Both tracers can mask data before it leaves your app, which means new traces arrive clean. &lt;a href="https://langfuse.com/docs/observability/features/masking" rel="noopener noreferrer"&gt;Langfuse's Python SDK&lt;/a&gt; accepts a &lt;code&gt;mask_otel_spans&lt;/code&gt; function, and &lt;a href="https://docs.langchain.com/langsmith/mask-inputs-outputs" rel="noopener noreferrer"&gt;LangSmith's client&lt;/a&gt; accepts an &lt;code&gt;anonymizer&lt;/code&gt; or can hide inputs and outputs entirely. That doesn't help with the traces you already have. For those, run a scrubber over the inputs and outputs before the data leaves your systems. The open-source &lt;a href="https://presidio.dataprivacystack.org/" rel="noopener noreferrer"&gt;Presidio&lt;/a&gt; library finds personal data such as names and email addresses and replaces it with placeholders.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;scrub.py&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;presidio_analyzer&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;AnalyzerEngine&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;presidio_anonymizer&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;AnonymizerEngine&lt;/span&gt;

&lt;span class="n"&gt;analyzer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;anonymizer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;AnalyzerEngine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;AnonymizerEngine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;scrub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;found&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;analyzer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;analyze&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;language&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"en"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;anonymizer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;anonymize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;analyzer_results&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;found&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;scrub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Refund order 4417 for Jane Smith, jane@example.com"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# Refund order &amp;lt;DATE_TIME&amp;gt; for &amp;lt;PERSON&amp;gt;, &amp;lt;EMAIL_ADDRESS&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With placeholders like these, the model still learns the shape of a request but never sees the real values. Check a sample by hand, though, because detectors get it wrong in both directions. In the output above, Presidio took the order number for a date, and it can just as easily miss an internal account number.&lt;/p&gt;

&lt;p&gt;The labels need a check as well. If your targets come from outcomes and nobody edited them by hand, pull 50 at random and read them against a written definition of a correct output. If more than a few are wrong, fix the rule that produced them before you train.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which training method do your traces support?
&lt;/h2&gt;

&lt;p&gt;Supervised fine-tuning is the place to begin. It needs the simplest data, and it is the baseline any other method has to beat. Whether the other two methods are open to you depends on what your traces contain.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;What each example needs&lt;/th&gt;
&lt;th&gt;Where it comes from in traces&lt;/th&gt;
&lt;th&gt;Use it when&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Supervised fine-tuning (SFT)&lt;/td&gt;
&lt;td&gt;An input and one good output&lt;/td&gt;
&lt;td&gt;Accepted or corrected outputs&lt;/td&gt;
&lt;td&gt;You can say what the right output is&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Preference training (DPO)&lt;/td&gt;
&lt;td&gt;An input, a better output and a worse one&lt;/td&gt;
&lt;td&gt;Edits (edited version vs original), regenerations, A/B picks&lt;/td&gt;
&lt;td&gt;You can tell better from worse but rarely have a perfect answer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reinforcement learning (RL)&lt;/td&gt;
&lt;td&gt;An input and a scoring function&lt;/td&gt;
&lt;td&gt;Inputs from traces; the score comes from code you write&lt;/td&gt;
&lt;td&gt;Correctness can be checked by code and SFT has stalled&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Choosing a training method from what your traces hold&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://arxiv.org/abs/2305.18290" rel="noopener noreferrer"&gt;DPO&lt;/a&gt; trains on pairs of answers to the same prompt, one preferred and one not. &lt;a href="https://arxiv.org/abs/2402.03300" rel="noopener noreferrer"&gt;GRPO&lt;/a&gt;, introduced in the DeepSeekMath paper, samples several answers to each prompt, scores each one and rewards those that beat the group's average, so it needs a scoring function and no written-out target for each prompt. The guide to &lt;a href="https://www.overmindlab.ai/research/types-of-fine-tuning?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=always-on&amp;amp;utm_content=traces-to-fine-tuned-model-devto" rel="noopener noreferrer"&gt;types of fine-tuning&lt;/a&gt; covers supervised and reinforcement fine-tuning in more depth.&lt;/p&gt;

&lt;h2&gt;
  
  
  How many examples do you need?
&lt;/h2&gt;

&lt;p&gt;No single number holds for every task. OpenAI's &lt;a href="https://developers.openai.com/api/docs/guides/supervised-fine-tuning" rel="noopener noreferrer"&gt;fine-tuning guide&lt;/a&gt; sets a minimum of 10 examples and recommends starting with 50 well-crafted ones. The research favors quality over volume. &lt;a href="https://arxiv.org/abs/2305.11206" rel="noopener noreferrer"&gt;LIMA&lt;/a&gt; tuned a 65B model's chat style with 1,000 curated examples, and &lt;a href="https://arxiv.org/abs/2307.08701" rel="noopener noreferrer"&gt;AlpaGasus&lt;/a&gt; beat a model trained on 52,000 instructions with one trained on 9,000 filtered ones. Across the 31 tasks in &lt;a href="https://arxiv.org/abs/2405.00732" rel="noopener noreferrer"&gt;LoRA Land&lt;/a&gt;, the size of the training set did not predict how much fine-tuning helped.&lt;/p&gt;

&lt;p&gt;You can measure this on your own data. Train on a quarter of your examples, then half, then all of them, and score each model on the same test set. If the score is still climbing at full size, more data will help. If it flattened early, more data won't fix it, and the place to look is the quality of the data or the definition of the task.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep the test set out of the training data
&lt;/h2&gt;

&lt;p&gt;A model that has already seen the test questions scores better than it deserves. With traces that happens easily, because the same user, session or template turns up again and again.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Split by session or user. If you split by row, steps from one conversation can land on both sides.&lt;/li&gt;
&lt;li&gt;Split by time when you can. Train on older traces and test on the newest week, which matches real use, where the model only sees new traffic.&lt;/li&gt;
&lt;li&gt;Remove near-duplicates across the split as well as inside the training set.&lt;/li&gt;
&lt;li&gt;Freeze the test set and tune settings on a separate validation slice. Each look at the test set while you iterate leaks a little of it into your choices.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Exact-match checks are not enough on their own. &lt;a href="https://arxiv.org/abs/2311.04850" rel="noopener noreferrer"&gt;Yang et al.&lt;/a&gt; showed that paraphrased test questions slip past n-gram decontamination, and that a 13B model trained on them can match GPT-4 on the benchmark it has effectively seen.&lt;/p&gt;

&lt;p&gt;This script splits by time, then drops any training row whose session also appears in the test set.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;split.py&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;

&lt;span class="n"&gt;rows&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;loads&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"clean.jsonl"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="c1"&gt;# Assumes ISO 8601 timestamps in UTC, which sort correctly as text.&lt;/span&gt;
&lt;span class="n"&gt;cutoff&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"2026-11-01"&lt;/span&gt;  &lt;span class="c1"&gt;# the newest traffic becomes the test set&lt;/span&gt;

&lt;span class="n"&gt;train&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;rows&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"timestamp"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;cutoff&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;test&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;rows&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"timestamp"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;cutoff&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="c1"&gt;# Drop any training row from a session that also appears in the test set.&lt;/span&gt;
&lt;span class="n"&gt;test_sessions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"session_id"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;train&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;train&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"session_id"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;test_sessions&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;train&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"train,"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Measure the result against what you run today
&lt;/h2&gt;

&lt;p&gt;Score three models on the same frozen test set, with the same checks. The first is the base model before training, which shows you what training added. The second is the model your agent calls today, which sets the bar. Your trained model has to beat the base and at least match the model you run today.&lt;/p&gt;

&lt;p&gt;Which check to use depends on the step. Exact match or F1 works for labels and extracted fields. JSON output needs schema validation, and for free text you can use an LLM judge with a short yes-or-no rubric. Break the score down by segment too, because an average can hide a rare case that got worse. Before you switch, run the trained model on live traffic in shadow mode, where it answers copies of real requests while users still see the current model.&lt;/p&gt;

&lt;h2&gt;
  
  
  The same work in Overmind
&lt;/h2&gt;

&lt;p&gt;Overmind runs this work in one place, and your coding agent can drive each step.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Connect Langfuse, LangSmith, Braintrust or Galileo on the &lt;strong&gt;Integrations&lt;/strong&gt; page with the provider's API keys, and choose how far back to import. The traces land in &lt;a href="https://www.overmindlab.ai/product/observability?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=always-on&amp;amp;utm_content=traces-to-fine-tuned-model-devto" rel="noopener noreferrer"&gt;Observability&lt;/a&gt;, and Overmind can keep polling for new ones. The import brings the traces but leaves behind the scores and feedback attached to them (Braintrust scores arrive only as raw metadata), so filter on those in your tracer or recreate the checks as Overmind evaluators. Python agents can also send traces with the Overmind SDK, and any other stack can send them over OpenTelemetry.&lt;/li&gt;
&lt;li&gt;In Observability, select traces and click &lt;strong&gt;Add to dataset&lt;/strong&gt;. Each trace becomes one row. When you split the rows into training and evaluation sets, Overmind removes exact duplicates and keeps rows with the same input, trace or conversation on one side. If training rows still overlap your evaluation set, you get a warning when you train.&lt;/li&gt;
&lt;li&gt;Clean the data in the &lt;a href="https://www.overmindlab.ai/product/data-workshop?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=always-on&amp;amp;utm_content=traces-to-fine-tuned-model-devto" rel="noopener noreferrer"&gt;Data Workshop&lt;/a&gt;. Your coding agent writes each cleaning step as a small Python script, which Overmind runs in an isolated sandbox and versions. Overmind does not detect personal data for you, so scrub it before import or in one of these steps.&lt;/li&gt;
&lt;li&gt;Write evaluators as code checks or model judges. The ones you enable score imported traces as they arrive.&lt;/li&gt;
&lt;li&gt;Train the model. Overmind trains with supervised fine-tuning, either LoRA or, on selected models up to 14B, full fine-tuning. It can score the trained model against its untouched base on your evaluation set, and against the model you use today if OpenRouter serves it.&lt;/li&gt;
&lt;li&gt;Call the model with the OpenAI SDK at &lt;code&gt;https://api.overmindlab.ai/api/v1&lt;/code&gt;, or download the weights and run them yourself.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If your traces are already in Langfuse or LangSmith, your coding agent can set this up for you. Open your agent's repo in Claude Code, Cursor, Codex or OpenCode and paste &lt;code&gt;Set me up on Overmind https://console.overmindlab.ai/setup.md&lt;/code&gt; into the chat. You can also &lt;a href="https://console.overmindlab.ai/?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=always-on&amp;amp;utm_content=traces-to-fine-tuned-model-devto-next-step" rel="noopener noreferrer"&gt;start for free&lt;/a&gt; and connect your tracer from the console.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Can I fine-tune a model directly on my Langfuse traces?
&lt;/h3&gt;

&lt;p&gt;Langfuse records and evaluates traces but doesn't train models, so the training has to happen somewhere else. Export the traces, filter and clean them, then train on them with a fine-tuning tool. Overmind can import them straight from Langfuse.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does LangSmith fine-tune models?
&lt;/h3&gt;

&lt;p&gt;Yes. LangSmith Fine-Tuning, in public beta since September 2026, uses the smithtune command-line tool to run supervised LoRA fine-tuning on Fireworks or Baseten with your own provider key. It then compares the base and tuned models in a LangSmith experiment, and can deploy the tuned model.&lt;/p&gt;

&lt;h3&gt;
  
  
  How many traces do I need to fine-tune a model?
&lt;/h3&gt;

&lt;p&gt;Fewer than you might expect, if they're clean. OpenAI's guide recommends starting with 50 well-crafted examples. In research, LIMA tuned a model's chat style with 1,000 curated examples, and AlpaGasus beat a 52,000-example dataset with 9,000 filtered ones. To find where your own curve flattens, train on growing slices of your data.&lt;/p&gt;

&lt;h3&gt;
  
  
  Should I train on traces where the agent failed?
&lt;/h3&gt;

&lt;p&gt;Only once someone has corrected them. Supervised fine-tuning copies its examples, so a failed run teaches the model to fail the same way. Put uncorrected failures in your test set.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I train on traces where GPT or Claude wrote the output?
&lt;/h3&gt;

&lt;p&gt;Check the vendor's terms first. OpenAI's usage policies from November 20, 2026 and Anthropic's from November 12, 2026 restrict using their outputs to train other models. Outputs your team wrote are yours, and model outputs that someone edited are a grey area. Ask your legal team if you're unsure.&lt;/p&gt;

&lt;p&gt;Overmind is the model training platform for AI teams. &lt;a href="https://console.overmindlab.ai/?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=always-on&amp;amp;utm_content=traces-to-fine-tuned-model-devto-footer" rel="noopener noreferrer"&gt;Start for free&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>llm</category>
      <category>finetuning</category>
      <category>observability</category>
      <category>ai</category>
    </item>
    <item>
      <title>How to move your fine-tuned models off OpenAI before January 14</title>
      <dc:creator>Tyler Edwards</dc:creator>
      <pubDate>Fri, 13 Nov 2026 14:30:48 +0000</pubDate>
      <link>https://dev.to/tyler007/how-to-move-your-fine-tuned-models-off-openai-before-january-14-4l85</link>
      <guid>https://dev.to/tyler007/how-to-move-your-fine-tuned-models-off-openai-before-january-14-4l85</guid>
      <description>&lt;p&gt;OpenAI is closing its self-serve fine-tuning platform. Eligible existing customers can create training jobs only until January 6, 2027, and on January 14 the fine-tuned versions of GPT-4o, GPT-4o mini, GPT-4.1 and GPT-4.1 mini shut down along with their base models. A fine-tuned model is a standard OpenAI model given extra training on your own examples, so that it does one job your way. If your product calls one, this is a seven-week plan to replace it, with a script for each step.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.overmindlab.ai/research/openai-fine-tuning-migration?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=always-on&amp;amp;utm_content=openai-fine-tuning-migration-devto-original" rel="noopener noreferrer"&gt;overmindlab.ai&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The weights, the learned numbers that make up the model, stay with OpenAI, but the data is yours. That covers the examples you trained on, the test cases you judged the model with and the production requests it has answered since, and it is enough to train a replacement that you own. It is like closing a restaurant in a rented building. The kitchen stays with the landlord, but the recipes and the record of what customers ordered are yours, and they are enough to reopen somewhere else. Start now, because the old model is the bar the new one has to clear, and you can only measure it while it still answers.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is changing, and when?
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Date&lt;/th&gt;
&lt;th&gt;What changes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;May 7, 2026&lt;/td&gt;
&lt;td&gt;Organizations that had never run fine-tuning can no longer create fine-tuning jobs.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;July 2, 2026&lt;/td&gt;
&lt;td&gt;Organizations with no fine-tuned inference in the past 60 days can no longer create jobs.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;October 23, 2026&lt;/td&gt;
&lt;td&gt;GPT-3.5 Turbo (0125), GPT-4 (0613), GPT-4.1 nano and o4-mini shut down, and their fine-tuned versions with them.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;October 31, 2026&lt;/td&gt;
&lt;td&gt;The OpenAI Evals platform becomes read-only.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;November 30, 2026&lt;/td&gt;
&lt;td&gt;The OpenAI Evals dashboard and API shut down.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;January 6, 2027&lt;/td&gt;
&lt;td&gt;Existing customers can no longer create new fine-tuning jobs.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;January 14, 2027&lt;/td&gt;
&lt;td&gt;GPT-4o, GPT-4o mini, GPT-4.1 and GPT-4.1 mini shut down, and their fine-tuned versions with them.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;OpenAI fine-tuning and Evals wind-down, checked November 9, 2026&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The dates come from OpenAI's &lt;a href="https://developers.openai.com/api/docs/deprecations" rel="noopener noreferrer"&gt;deprecations page&lt;/a&gt; and its &lt;a href="https://developers.openai.com/api/docs/guides/supervised-fine-tuning" rel="noopener noreferrer"&gt;supervised fine-tuning guide&lt;/a&gt;. A fine-tuned model keeps answering until its base model shuts down, so check the base of each model you run against the table.&lt;/p&gt;

&lt;p&gt;If your test cases live in OpenAI Evals, your deadline comes sooner, because the Evals API shuts down on November 30.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Audit what you run today
&lt;/h2&gt;

&lt;p&gt;Before you rebuild anything, write down what the old model does and how well it does it.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Which fine-tuned models does your code call? Search code and config for model IDs that start with &lt;code&gt;ft:&lt;/code&gt;, then match each one to its job, base model and training file.&lt;/li&gt;
&lt;li&gt;How much traffic does each one get? Note requests per day, typical input and output length, and the latency your product needs. This decides how large a replacement you can afford to run.&lt;/li&gt;
&lt;li&gt;Where is the training data? Find your own copy of every training file, and note who wrote the answers in it, whether your team, a labeling vendor or a model.&lt;/li&gt;
&lt;li&gt;How do you know it works? Find the test set and the score the fine-tune gets on it. If there is no test set, building one is the first job, while the model still answers.&lt;/li&gt;
&lt;li&gt;Which API features do you rely on? Note whether you call Chat Completions or the Responses API, and whether you use tool calls, structured outputs or streaming. The replacement has to support each one.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This script lists every fine-tuned model in your organization with its base model and training file ID.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;list_finetunes.py&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# reads OPENAI_API_KEY&lt;/span&gt;

&lt;span class="c1"&gt;# The SDK pages through every job.&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;job&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fine_tuning&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kt"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fine_tuned_model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fine_tuned_model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;training_file&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sep&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"\t"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep a local copy of every file on that list. OpenAI's API reference says the training data can be retrieved with the Files API, but an OpenAI staff reply on its forum in 2021 said files uploaded for fine-tuning can't be downloaded, and a developer reported the same there in 2025. Look for your own copy first. If you need the API, test it now rather than in January.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Collect the data you own
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://developers.openai.com/api/docs/guides/supervised-fine-tuning" rel="noopener noreferrer"&gt;OpenAI's fine-tuning docs&lt;/a&gt; describe no way to export a fine-tuned model's weights, so the model itself stays behind. You can collect the data around it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your training files hold one conversation per line, each ending in the answer you wanted. They are already in the chat &lt;code&gt;messages&lt;/code&gt; format that open-weight training tools accept.&lt;/li&gt;
&lt;li&gt;Your test cases need exporting from wherever they live. If that is OpenAI Evals, export them before November 30. OpenAI's own &lt;a href="https://developers.openai.com/cookbook/examples/evaluation/moving-from-openai-evals-to-promptfoo" rel="noopener noreferrer"&gt;migration guide&lt;/a&gt; points to Promptfoo.&lt;/li&gt;
&lt;li&gt;The requests your fine-tune has answered in production show what real inputs look like today, which your original training set may not. If your Chat Completions calls were stored (with &lt;code&gt;store: true&lt;/code&gt;, or by default on newer accounts), &lt;code&gt;client.chat.completions.list(model=...)&lt;/code&gt; lists them with the model's replies, and &lt;code&gt;client.chat.completions.messages.list(completion_id)&lt;/code&gt; returns the messages you sent. OpenAI documents no retention period for them, so export them now.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Production traffic needs care, because the replies in it were written by an OpenAI model. OpenAI's &lt;a href="https://openai.com/policies/usage-policies/" rel="noopener noreferrer"&gt;usage policies&lt;/a&gt;, effective November 20, 2026, say you must not use OpenAI models or their outputs "to generate, prepare, select, or supply training material or signals for models that are intended as alternatives to or substitutes for OpenAI models or services." The inputs your users sent are not OpenAI outputs, and neither are answers your own team wrote from scratch. An answer your team corrected from a model's draft is a grey area. If you're not sure which kind of data you have, ask your legal team before you train on it.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Rebuild the dataset from your own records
&lt;/h2&gt;

&lt;p&gt;Apart from the policy, there is an engineering reason to take your training targets from your own records. A model trained on the old model's replies learns the old model's mistakes along with everything else. The answer a person on your team accepted, or the final outcome in your system of record, is a better target than whatever the model said.&lt;/p&gt;

&lt;p&gt;The script below assumes you log each request with the messages you sent and, where one exists, the answer your team accepted. It skips requests with no accepted answer and drops repeated inputs, keeping the first answer. Then it holds out about one conversation in five for testing (none if you have fewer than five), so that no conversation ends up on both sides. In a conversation with several turns, the earlier assistant messages were written by the OpenAI model. Replace them with the answers your team accepted for those turns, or leave those rows out, before you train.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;build_dataset.py&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;hashlib&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;random&lt;/span&gt;

&lt;span class="n"&gt;examples&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;seen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"requests.jsonl"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;loads&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c1"&gt;# Written or approved by a person, or taken from your records.&lt;/span&gt;
    &lt;span class="n"&gt;accepted&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"accepted_answer"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;accepted&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;continue&lt;/span&gt;
    &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"messages"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sort_keys&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;fingerprint&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;hashlib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sha256&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hexdigest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;fingerprint&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;seen&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;continue&lt;/span&gt;
    &lt;span class="n"&gt;seen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fingerprint&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;examples&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"conversation"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"conversation_id"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"messages"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"messages"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"assistant"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;accepted&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;conversations&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"conversation"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;examples&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Random&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;shuffle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;conversations&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;held_out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;conversations&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;conversations&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"train.jsonl"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"w"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;train&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"test.jsonl"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"w"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;examples&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;test&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"conversation"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;held_out&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="n"&gt;train&lt;/span&gt;
        &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"messages"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"messages"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;"\n"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;requests.jsonl&lt;/code&gt; stands in for however you log requests. If yours sit in an observability tool, export them first. &lt;a href="https://www.overmindlab.ai/research/traces-to-fine-tuned-model?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=always-on&amp;amp;utm_content=openai-fine-tuning-migration-devto" rel="noopener noreferrer"&gt;How to fine-tune a model on your agent's traces&lt;/a&gt; has export scripts for Langfuse and LangSmith, and &lt;a href="https://www.overmindlab.ai/research/traces-to-training-dataset?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=always-on&amp;amp;utm_content=openai-fine-tuning-migration-devto" rel="noopener noreferrer"&gt;how to turn traces into a training dataset&lt;/a&gt; covers sampling and labeling.&lt;/p&gt;

&lt;p&gt;Then merge the result with your original training file and remove duplicates across the two. Before you train, read 50 rows at random. Check that every kind of request your product handles shows up, and that no test input also sits in the training file. OpenAI's &lt;a href="https://developers.openai.com/api/docs/guides/supervised-fine-tuning" rel="noopener noreferrer"&gt;fine-tuning guide&lt;/a&gt; recommends starting with 50 well-crafted examples, and its &lt;a href="https://developers.openai.com/api/docs/guides/fine-tuning-best-practices" rel="noopener noreferrer"&gt;best practices&lt;/a&gt; expect a similar gain each time you double the count. You can test that on your own data. Train on half of it, then all of it, and keep adding examples only while the test score keeps rising.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Pick an open-weight base model
&lt;/h2&gt;

&lt;p&gt;An open-weight model's weights are public, so you can train it and run it wherever you like, within its license. Your fine-tune did one narrow job, and a smaller open model trained on that job can often match it. In Overmind's &lt;a href="https://www.overmindlab.ai/research/when-bigger-isnt-better?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=always-on&amp;amp;utm_content=openai-fine-tuning-migration-devto" rel="noopener noreferrer"&gt;contract review benchmark&lt;/a&gt;, a small model trained with Overmind scored 91.6% against a frontier flagship's 82.0% on 4,000+ questions across 100+ contracts, and cost 20x less to run. The score is F1, which penalizes both missed clauses and false alarms.&lt;/p&gt;

&lt;p&gt;Other published results point the same way. LoRA is a way of fine-tuning that trains a small add-on, called an adapter, and leaves the original weights untouched. In &lt;a href="https://arxiv.org/abs/2405.00732" rel="noopener noreferrer"&gt;LoRA Land&lt;/a&gt;, a 2024 technical report from the fine-tuning company Predibase, the best LoRA fine-tune of ten small open models beat GPT-4 on most of 31 tasks, many of them classification. GPT-4 stayed ahead on 6 broader tasks, such as Python coding.&lt;/p&gt;

&lt;p&gt;The table lists six models you could start from. A parameter is one of the model's learned numbers, and the count (2B means two billion) is a rough measure of size.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Parameters&lt;/th&gt;
&lt;th&gt;License&lt;/th&gt;
&lt;th&gt;Context window&lt;/th&gt;
&lt;th&gt;Weights at 16-bit&lt;/th&gt;
&lt;th&gt;Worth knowing&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Qwen3.5-2B&lt;/td&gt;
&lt;td&gt;2B&lt;/td&gt;
&lt;td&gt;Apache 2.0&lt;/td&gt;
&lt;td&gt;262K tokens&lt;/td&gt;
&lt;td&gt;About 4.5 GB&lt;/td&gt;
&lt;td&gt;Small enough for classification and routing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Llama 3.1 8B Instruct&lt;/td&gt;
&lt;td&gt;8B&lt;/td&gt;
&lt;td&gt;Llama 3.1 Community License&lt;/td&gt;
&lt;td&gt;128K tokens&lt;/td&gt;
&lt;td&gt;About 16 GB&lt;/td&gt;
&lt;td&gt;Custom license with naming and attribution rules&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen3.5-9B&lt;/td&gt;
&lt;td&gt;9B&lt;/td&gt;
&lt;td&gt;Apache 2.0&lt;/td&gt;
&lt;td&gt;262K tokens&lt;/td&gt;
&lt;td&gt;About 19 GB&lt;/td&gt;
&lt;td&gt;A common next step up from 2B&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gemma 4 12B&lt;/td&gt;
&lt;td&gt;12B&lt;/td&gt;
&lt;td&gt;Apache 2.0&lt;/td&gt;
&lt;td&gt;256K tokens&lt;/td&gt;
&lt;td&gt;About 24 GB&lt;/td&gt;
&lt;td&gt;Reads text, images and audio&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;gpt-oss-20b&lt;/td&gt;
&lt;td&gt;21B, 3.6B active&lt;/td&gt;
&lt;td&gt;Apache 2.0&lt;/td&gt;
&lt;td&gt;131K tokens&lt;/td&gt;
&lt;td&gt;About 42 GB&lt;/td&gt;
&lt;td&gt;OpenAI's open-weight model; ships 4-bit to fit 16 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen3.8-27B&lt;/td&gt;
&lt;td&gt;27B&lt;/td&gt;
&lt;td&gt;Apache 2.0&lt;/td&gt;
&lt;td&gt;262K tokens&lt;/td&gt;
&lt;td&gt;About 56 GB&lt;/td&gt;
&lt;td&gt;Needs an 80 GB GPU at 16-bit&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Six open-weight base models Overmind can train, from their Hugging Face model cards, November 9, 2026&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Licenses, sizes and context windows come from the model cards for &lt;a href="https://huggingface.co/Qwen/Qwen3.5-2B" rel="noopener noreferrer"&gt;Qwen3.5-2B&lt;/a&gt;, &lt;a href="https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct" rel="noopener noreferrer"&gt;Llama 3.1 8B Instruct&lt;/a&gt;, &lt;a href="https://huggingface.co/Qwen/Qwen3.5-9B" rel="noopener noreferrer"&gt;Qwen3.5-9B&lt;/a&gt;, &lt;a href="https://huggingface.co/google/gemma-4-12B-it" rel="noopener noreferrer"&gt;Gemma 4 12B&lt;/a&gt;, &lt;a href="https://huggingface.co/openai/gpt-oss-20b" rel="noopener noreferrer"&gt;gpt-oss-20b&lt;/a&gt; and &lt;a href="https://huggingface.co/Qwen/Qwen3.8-27B" rel="noopener noreferrer"&gt;Qwen3.8-27B&lt;/a&gt;. Weights at 16-bit is the checkpoint's full parameter count on Hugging Face, vision parts included, times two bytes. A host may serve a shorter context window than the model card states, so check its limit.&lt;/p&gt;

&lt;p&gt;Running cost falls with size, though not always below what you pay today. OpenAI's &lt;a href="https://developers.openai.com/api/docs/pricing" rel="noopener noreferrer"&gt;pricing page&lt;/a&gt; charges twice the base rate to run a fine-tuned GPT-4.1 mini or GPT-4o mini. On &lt;a href="https://openrouter.ai/models" rel="noopener noreferrer"&gt;OpenRouter&lt;/a&gt;, which lists several hosts' prices for the same open models, the base Qwen3.5-9B's list price per output token on November 9, 2026 was about 13x lower than OpenAI's price for a fine-tuned GPT-4.1 mini, and gpt-oss-20b's about 36x lower. Qwen3.8-27B's was higher than a fine-tuned GPT-4o mini's. Each host prices a fine-tuned copy on dedicated hardware differently, so treat these as a guide to scale.&lt;/p&gt;

&lt;p&gt;Train the smallest model that passes your test set. Try two sizes at once, such as a 2B and a 9B, and move up only if both fall short. Size also decides the hardware you need. To serve a model at 16-bit precision, each billion parameters takes about 2 GB of GPU memory, plus room for the requests in flight. Training needs more.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Prove the new model matches the old one
&lt;/h2&gt;

&lt;p&gt;Decide what "as good as" means before you look at any results, then hold both models to it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Freeze a test set made up of held-out production requests (split by conversation), your original test cases and a short list of hard cases, such as past incidents and the requests that cost the most when they go wrong.&lt;/li&gt;
&lt;li&gt;Score both models with the same checks. Exact match or F1 works for labels and extracted fields. For JSON, check that it parses and fits your schema. For free text, use an LLM judge with a short rubric of yes-or-no checks, and compare a sample of its verdicts with human ones.&lt;/li&gt;
&lt;li&gt;Score your OpenAI fine-tune on the full test set now and save its replies and scores, because after January 14 you can't run it again.&lt;/li&gt;
&lt;li&gt;Write the pass rule down. For example, switch only if the new model is within one point of the old one overall, misses none of the hard cases the old one got right, and returns valid JSON every time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both models speak the same API, so one script can score them. This version uses exact match, which suits labels and short extractions. It prints the two scores and nothing else, so write the old model's replies to a file as well.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;parity.py&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;

&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;

&lt;span class="n"&gt;current&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# your OpenAI fine-tune&lt;/span&gt;
&lt;span class="n"&gt;candidate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"https://api.overmindlab.ai/api/v1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"OVERMIND_API_KEY"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# The model ID comes from list_finetunes.py.&lt;/span&gt;
&lt;span class="no"&gt;CURRENT_MODEL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"ft:gpt-4.1-mini-2025-04-14:your-org::abc123"&lt;/span&gt;
&lt;span class="no"&gt;CANDIDATE_MODEL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"your-deployment-model-id"&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;accuracy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;correct&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;reply&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"messages"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;temperature&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;answer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;correct&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;answer&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"messages"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;correct&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;rows&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;loads&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"test.jsonl"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;old&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;accuracy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;current&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;CURRENT_MODEL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;accuracy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;candidate&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;CANDIDATE_MODEL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"current {old:.1%}, candidate {new:.1%}"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;old&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.01&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s2"&gt;"More than a point behind: fix the data and retrain."&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  6. Switch traffic without rewriting your app
&lt;/h2&gt;

&lt;p&gt;If the new model sits behind an OpenAI-compatible endpoint, the switch is a configuration change. Your code keeps the OpenAI SDK and you change the base URL, the API key and the model name, the same way &lt;code&gt;parity.py&lt;/code&gt; does above. Before you switch, check which OpenAI APIs your new host supports. Overmind's endpoint, for example, serves Chat Completions with streaming and tool calls but doesn't serve the Responses API, so any Responses calls have to move to Chat Completions first.&lt;/p&gt;

&lt;p&gt;If you would rather run the model yourself, download the trained weights and serve them with an OpenAI-compatible server such as vLLM. After a LoRA run the download is an adapter that &lt;a href="https://docs.vllm.ai/en/latest/features/lora/" rel="noopener noreferrer"&gt;vLLM loads&lt;/a&gt; on top of the open base model it was trained from. vLLM accepts adapters up to rank 16 unless you raise &lt;code&gt;--max-lora-rank&lt;/code&gt;, so set it to at least the &lt;code&gt;r&lt;/code&gt; value in the adapter's &lt;code&gt;adapter_config.json&lt;/code&gt;. The command below uses 64, which covers Overmind's default ranks of 16 and 32. Llama 3.1 is a gated model, so accept its license on Hugging Face and log in before you run this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vllm serve meta-llama/Llama-3.1-8B-Instruct \
  --enable-lora --max-lora-rank 64 \
  --lora-modules support-router=./adapter
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Either way, move traffic in stages. Start in shadow mode, where the new model answers a copy of each live request and users still see the old model's reply. Compare the two on live traffic, then move 5% of users, then half, then everyone. Keep the OpenAI model as the fallback until it shuts down.&lt;/p&gt;

&lt;h2&gt;
  
  
  How long does the move take?
&lt;/h2&gt;

&lt;p&gt;From a mid-November start there are about eight and a half weeks before January 14, so seven working weeks fit with at most one week off. Weeks 6 and 7 fall over Christmas and New Year, so if your team takes a break of more than a week, start sooner. And if you want one last refreshed OpenAI fine-tune as a fallback, start that job before January 6.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Week&lt;/th&gt;
&lt;th&gt;What to do&lt;/th&gt;
&lt;th&gt;Done when&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Audit models, traffic and data. Export test cases from OpenAI Evals before it shuts on November 30.&lt;/td&gt;
&lt;td&gt;Every ft: model has an owner, a training file and a test set&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Rebuild the dataset, freeze the test split, and score the current fine-tune on it&lt;/td&gt;
&lt;td&gt;train.jsonl, test.jsonl and baseline scores are saved&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Train two sizes of open-weight model, such as a 2B and a 9B&lt;/td&gt;
&lt;td&gt;Both are scored on the frozen test set&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Fix the data where the candidate fails, then retrain&lt;/td&gt;
&lt;td&gt;The candidate meets the pass rule&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;Shadow traffic: the new model answers copies of live requests&lt;/td&gt;
&lt;td&gt;Live scores match the offline ones&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;Move 5% of traffic, then half&lt;/td&gt;
&lt;td&gt;Product metrics hold steady&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;Move all traffic and keep the OpenAI model as a fallback&lt;/td&gt;
&lt;td&gt;Nothing in production calls an ft: model&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;A seven-week migration, assuming a start in mid-November 2026&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Making the move with Overmind
&lt;/h2&gt;

&lt;p&gt;Overmind covers the data, training, comparison and serving steps, and your coding agent can drive each one.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Upload the JSONL file you trained on as it is. Overmind trains on the same chat &lt;code&gt;messages&lt;/code&gt; format, tool calls included. There is no one-click OpenAI import, so production traffic comes in through the Python SDK, OpenTelemetry or a Langfuse, LangSmith, Braintrust or Galileo connector.&lt;/li&gt;
&lt;li&gt;Prepare the data in the &lt;a href="https://www.overmindlab.ai/product/data-workshop?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=always-on&amp;amp;utm_content=openai-fine-tuning-migration-devto" rel="noopener noreferrer"&gt;Data Workshop&lt;/a&gt;, where your coding agent writes each preparation step as a small Python script. Overmind runs each script in an isolated sandbox, keeps every version and checks that each version fits the training format. When you split data into training and test sets, it removes exact duplicates and keeps rows from the same conversation on one side.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.overmindlab.ai/product/model-training?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=always-on&amp;amp;utm_content=openai-fine-tuning-migration-devto" rel="noopener noreferrer"&gt;Fine-tune&lt;/a&gt; any model in the table above with LoRA, or with full fine-tuning on models up to 14B.&lt;/li&gt;
&lt;li&gt;Compare the result. Overmind can score the trained model against its untouched base on your test set. It can't call a private OpenAI fine-tune, so score your fine-tune's saved replies with the same checks yourself.&lt;/li&gt;
&lt;li&gt;Call the model with the OpenAI SDK at &lt;code&gt;https://api.overmindlab.ai/api/v1&lt;/code&gt;, or download the weights from the model page or with &lt;code&gt;overmind model download-checkpoint&lt;/code&gt;. Serverless deployments scale down when idle, so the first request after a quiet spell waits for a worker. For steady traffic, a dedicated GPU deployment lets you set the replica range.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you have a fine-tuned OpenAI model in production, your coding agent can make this move for you. Open your product's repo in Claude Code, Cursor, Codex or OpenCode and paste &lt;code&gt;Set me up on Overmind https://console.overmindlab.ai/setup.md&lt;/code&gt; into the chat. If there's no repo to hand, &lt;a href="https://console.overmindlab.ai/?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=always-on&amp;amp;utm_content=openai-fine-tuning-migration-devto-next-step" rel="noopener noreferrer"&gt;start for free&lt;/a&gt; and upload the JSONL file you trained on. The console then gives you a prompt for your coding agent that works without a repo.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  When does OpenAI fine-tuning shut down?
&lt;/h3&gt;

&lt;p&gt;Eligible existing customers can create new fine-tuning jobs until January 6, 2027. A fine-tuned model keeps answering until its base model shuts down. For GPT-4o, GPT-4o mini, GPT-4.1 and GPT-4.1 mini, that is January 14, 2027.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I download my fine-tuned OpenAI model?
&lt;/h3&gt;

&lt;p&gt;Not as far as OpenAI's documentation shows. Its fine-tuning docs describe no way to export a fine-tuned model's weights, and a fine-tuned checkpoint can only be shared with other projects in your own OpenAI organization. You keep your training files and test cases, and train a new model on them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I train a new model on my fine-tune's replies?
&lt;/h3&gt;

&lt;p&gt;Check the terms first. From November 20, 2026, OpenAI's usage policies bar using its outputs to prepare training data for models meant to substitute for OpenAI's. Inputs from your users and answers your team wrote from scratch are not OpenAI outputs. Answers corrected from a model's draft are a grey area, so ask your legal team if you're unsure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Which open model should replace a fine-tuned GPT-4.1 mini?
&lt;/h3&gt;

&lt;p&gt;Start with a small one. Train a 2B to 9B model on the same task and score it against your fine-tune on the same test set. Move to a larger model only if the small ones fall short.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do I need to change my application code?
&lt;/h3&gt;

&lt;p&gt;Very little, if the new model sits behind an OpenAI-compatible endpoint. You change the base URL, the API key and the model name. Calls to the Responses API need moving to Chat Completions first if your new host only serves Chat Completions.&lt;/p&gt;

&lt;p&gt;Overmind is the model training platform for AI teams. &lt;a href="https://console.overmindlab.ai/?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=always-on&amp;amp;utm_content=openai-fine-tuning-migration-devto-footer" rel="noopener noreferrer"&gt;Start for free&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>openai</category>
      <category>finetuning</category>
      <category>llm</category>
      <category>ai</category>
    </item>
    <item>
      <title>How to train your agent: 7 patterns from production teams</title>
      <dc:creator>Tyler Edwards</dc:creator>
      <pubDate>Wed, 07 Oct 2026 13:21:44 +0000</pubDate>
      <link>https://dev.to/tyler007/how-to-train-your-agent-7-patterns-from-production-teams-4e2c</link>
      <guid>https://dev.to/tyler007/how-to-train-your-agent-7-patterns-from-production-teams-4e2c</guid>
      <description>&lt;p&gt;Training an agent in production runs on seven patterns. Instrument every trace, build evals from real traffic, label those traces into a dataset, accept that prompt engineering has a ceiling, run a LoRA fine-tune, freeze the eval set before you train, then repeat the loop. Most of the effort goes into infrastructure, not the agent.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.overmindlab.ai/research/how-to-train-your-agent?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;overmindlab.ai&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Learnings from building, deploying and improving agents in production.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you're running an LLM-powered agent in production, the seven patterns below show up again and again.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are the seven patterns for training an agent?
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;#&lt;/th&gt;
&lt;th&gt;Pattern&lt;/th&gt;
&lt;th&gt;What you do&lt;/th&gt;
&lt;th&gt;Tactical advice&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Instrument every agent trace&lt;/td&gt;
&lt;td&gt;Route every agent run into one OpenTelemetry-compatible tracing tool&lt;/td&gt;
&lt;td&gt;Keep traces at least 30 days. Tag with user ID, use case and agent version&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Build evals from real traffic&lt;/td&gt;
&lt;td&gt;Sample production traces weekly and turn the failures into new test cases&lt;/td&gt;
&lt;td&gt;By week two in production, your primary eval set should come from real traces&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Turn traces into a labelled dataset&lt;/td&gt;
&lt;td&gt;Score traces against pass/fail criteria taken from your codebase, then group failures into a taxonomy&lt;/td&gt;
&lt;td&gt;Draft 5 to 20 criteria straight from the code. Label the first month yourself&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Prompt engineering has a ceiling&lt;/td&gt;
&lt;td&gt;Keep iterating while the eval score still moves, then switch lever&lt;/td&gt;
&lt;td&gt;Run the eval twice on an unchanged prompt first. Ignore any change smaller than that wobble&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;Fine-tuning doesn't need a research lab&lt;/td&gt;
&lt;td&gt;Run a LoRA pass over labelled trajectories on an open-weights base&lt;/td&gt;
&lt;td&gt;1,000+ labelled trajectories and a narrow task, compared against your prompt-engineered baseline&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;Freeze the eval set before you train&lt;/td&gt;
&lt;td&gt;Lock the eval set before training starts and test inside the agent harness&lt;/td&gt;
&lt;td&gt;Every model change runs against the same frozen eval set, every time&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;The self-improvement loop&lt;/td&gt;
&lt;td&gt;Repeat capture, label, train, deploy and measure until it runs in hours&lt;/td&gt;
&lt;td&gt;Put a cadence on the calendar. Weekly is aggressive, monthly is the floor&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Overmind is the model training platform for AI teams. It turns your production traces into specialised models you own, automatically trained, benchmarked, and served. The patterns below are that same loop, whether you build it yourself or not.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do you instrument an agent trace?
&lt;/h2&gt;

&lt;p&gt;Every agent run generates a trace: the full sequence of inputs, tool calls, retrieved context, intermediate reasoning, and final output. Without that record, you're reconstructing agent behaviour from scattered log files, which is miserable work.&lt;/p&gt;

&lt;p&gt;OpenTelemetry has become the default standard for this. Its GenAI semantic conventions set one shared format for what each step of a run records, including model name, token usage, and tool calls. A trace from a LangChain agent then looks the same as one from a raw API call. Most observability platforms now speak this format natively, including Langfuse, Arize Phoenix, Datadog LLM Observability, and LangSmith.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tactical advice:&lt;/strong&gt; pick one OpenTelemetry-compatible tracing tool. Route every agent run into it. Keep the traces for at least 30 days. Tag them with user ID, use case, and agent version, so you can filter them later without going back to change your tracing code.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do you build evals from real production traffic?
&lt;/h2&gt;

&lt;p&gt;Before deploying an agent, run it against some evals. An eval is a scored check of whether the agent did the job. However, when real traffic arrives, so will edge cases.&lt;/p&gt;

&lt;p&gt;Production traces can be a real eval source. Sample traces weekly and turn the failures into new test cases. Older eval sets can become a regression check, to confirm old fixes still hold, rather than your source of truth. Langfuse, Braintrust, Arize, and LangSmith all support this workflow directly, turning sampled production data into structured eval sets.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tactical advice:&lt;/strong&gt; by week two in production, your primary eval set should be built from real traces, not synthetic ones written before launch.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do you turn traces into a labelled dataset?
&lt;/h2&gt;

&lt;p&gt;A trace only records what happened. Before you can train or evaluate on it, you need to know whether the run was any good. That judgment is the label, and labels are what a dataset is actually made of. More unlabelled traces will not make it better, so label what you have before you collect more.&lt;/p&gt;

&lt;p&gt;Start with your agent's codebase. It already spells out what the agent is meant to do, so turn that into a checklist of pass or fail criteria. Score traces against the checklist and write a note on each one that fails. Hamel Husain calls this error analysis. Group those notes into a failure taxonomy, a fixed list of failure types you can count and track over time.&lt;/p&gt;

&lt;p&gt;Once every trace carries a label, and a failure type where it failed, you have a dataset. That is what you fine-tune on, and what you score every later change against. We go through the full pipeline in &lt;a href="https://www.overmindlab.ai/research/traces-to-training-dataset?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;how do you turn traces into a training dataset&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tactical advice:&lt;/strong&gt; draft 5 to 20 pass/fail criteria straight from the code, then refine them as you label. Spend a few hours a week labelling yourself for the first month. Don't outsource the first pass. Your judgment about what "good" looks like only shows up once you've sat with the traces yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  When should you stop prompt engineering?
&lt;/h2&gt;

&lt;p&gt;Prompt engineering has a ceiling. Prompt iteration is cheap and fast, so use it for as long as it keeps improving your eval score. Eventually each new instruction fixes yesterday's bug and quietly introduces a new one. The system prompt bloats, latency creeps up, and the model starts ignoring parts of it altogether.&lt;/p&gt;

&lt;p&gt;At that point you're choosing between more tweaking or a different lever entirely. Most teams keep tweaking a month longer than they should, because prompt edits feel free. They aren't. Engineering time is the most expensive line item in the whole pipeline. We break the trade-off down in &lt;a href="https://www.overmindlab.ai/research/prompt-engineering-vs-fine-tuning?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;prompt engineering vs fine-tuning&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tactical advice:&lt;/strong&gt; track your eval score before and after every prompt change. First run the eval twice on an unchanged prompt to see how much the score wobbles on its own. Ignore any change smaller than that.&lt;/p&gt;

&lt;h2&gt;
  
  
  Do you need a research team to fine-tune?
&lt;/h2&gt;

&lt;p&gt;Fine-tuning an open-weights model used to mean a research team and a large GPU budget. LoRA freezes the base model and trains a small set of low-rank adapter matrices instead. Those adapters are often under 1% of total parameters. That is why a 70B model can be fine-tuned on a single high-memory GPU, using QLoRA's 4-bit quantisation. Quantisation stores the weights at lower precision, so the model takes up less memory.&lt;/p&gt;

&lt;p&gt;Pick an open-weights base, run a LoRA pass over labelled trajectories, meaning recorded agent runs you have already scored. Then serve the result on Fireworks, Together, or Modal. Unsloth, OpenPipe, and Predibase handle most of the pipeline for you. The method choice is a separate question, covered in &lt;a href="https://www.overmindlab.ai/research/types-of-fine-tuning?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;what are the different types of fine-tuning&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tactical advice:&lt;/strong&gt; if you have 1,000+ labelled trajectories and a narrow task, run a LoRA fine-tune. Compare it against your prompt-engineered baseline on the same eval set.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why should you freeze the eval set before you train?
&lt;/h2&gt;

&lt;p&gt;The eval set you score a fine-tune against has to be the same one you scored the baseline against, and it has to be locked before training starts. Change the criteria and the training run in the same week and you cannot tell which one moved the number.&lt;/p&gt;

&lt;p&gt;Test the model inside the agent harness, not on its own. A model that scores better in isolation can still make the agent worse, because the agent depends on tool call formats, output structure, and instruction following that a benchmark score does not capture.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tactical advice:&lt;/strong&gt; every model change runs against the same frozen eval set, every time. Models regress for all sorts of reasons, and a fixed scoreboard is the only way you find out.&lt;/p&gt;

&lt;h2&gt;
  
  
  The self-improvement loop
&lt;/h2&gt;

&lt;p&gt;The first full pass through capture, label, train, deploy, and measure takes weeks. By the fifth pass, most of the friction is gone and the loop runs in hours.&lt;/p&gt;

&lt;p&gt;That compounding is the whole point. A team that runs this loop five times in a quarter ends up with an agent that matches their business needs at a fraction of frontier API cost. A team that runs it once, ships, and calls it done is roughly where it started six months ago.&lt;/p&gt;

&lt;p&gt;This is essentially Overmind's product thesis. It connects your repository and traces, then proposes changes through its optimiser. It tests those changes against your labelled data and only surfaces the ones that actually move your score. The loop from evidence to shipped improvement stays short, instead of becoming its own six-week project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tactical advice:&lt;/strong&gt; pick a cadence and put it on the calendar. Weekly is aggressive but doable. Monthly is the floor. Anything slower and you're not really running a loop, you're running occasional cleanup.&lt;/p&gt;

&lt;h2&gt;
  
  
  Infrastructure is more work than the agent
&lt;/h2&gt;

&lt;p&gt;Any one of these seven steps is a real job on its own. Strung together, they're several jobs. Most teams find the surrounding infrastructure costs more engineering time than the agent.&lt;/p&gt;

&lt;p&gt;Here is every tool named above, grouped by the job it does.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Job&lt;/th&gt;
&lt;th&gt;Tools named in this post&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Trace format standard&lt;/td&gt;
&lt;td&gt;OpenTelemetry GenAI semantic conventions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tracing and observability&lt;/td&gt;
&lt;td&gt;Langfuse, Arize Phoenix, Datadog LLM Observability, LangSmith&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Eval sets from production traces&lt;/td&gt;
&lt;td&gt;Langfuse, Braintrust, Arize, LangSmith&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fine-tuning pipeline&lt;/td&gt;
&lt;td&gt;Unsloth, OpenPipe, Predibase&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Serving a trained model&lt;/td&gt;
&lt;td&gt;Fireworks, Together, Modal&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The whole loop as one system&lt;/td&gt;
&lt;td&gt;Overmind&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Overmind closes that gap. It reads your agent's codebase to understand what it does. Then it handles trace capture, labelling, fine-tuning, deployment, and measurement as one connected system, instead of five separate vendor integrations.&lt;/p&gt;

&lt;p&gt;If you're past the prototype stage and want the loop running without building it from scratch, it's worth a look.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  How many labelled examples do you need to fine-tune an agent?
&lt;/h3&gt;

&lt;p&gt;If you have 1,000 or more labelled trajectories and a narrow task, a LoRA fine-tune is worth running. Below that, keep labelling and keep iterating on the prompt.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can you fine-tune a 70B model without a GPU cluster?
&lt;/h3&gt;

&lt;p&gt;Yes. LoRA trains a small set of adapter matrices, often under 1% of total parameters, and QLoRA's 4-bit quantisation shrinks the frozen base model further. That puts a 70B fine-tune on a single high-memory GPU.&lt;/p&gt;

&lt;h3&gt;
  
  
  Should you test a fine-tuned model on its own or inside the agent?
&lt;/h3&gt;

&lt;p&gt;Inside the agent harness. A model that scores better in isolation can still make the agent worse, because the agent depends on tool call formats, output structure, and instruction following that a benchmark score does not capture.&lt;/p&gt;

&lt;h3&gt;
  
  
  How often should you run the training loop?
&lt;/h3&gt;

&lt;p&gt;Weekly is aggressive but doable, monthly is the floor. Slower than that and you're running occasional cleanup rather than a loop, so the compounding never arrives.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Overmind is the model training platform for AI teams. It turns your production traces into specialised models you own. &lt;a href="https://console.overmindlab.ai/?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;Get started&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>machinelearning</category>
      <category>agents</category>
    </item>
    <item>
      <title>Secret Agent Overmind: diagnose an AI agent with code, traces, evals and datasets</title>
      <dc:creator>Tyler Edwards</dc:creator>
      <pubDate>Wed, 30 Sep 2026 10:24:05 +0000</pubDate>
      <link>https://dev.to/tyler007/secret-agent-overmind-diagnose-an-ai-agent-with-code-traces-evals-and-datasets-233n</link>
      <guid>https://dev.to/tyler007/secret-agent-overmind-diagnose-an-ai-agent-with-code-traces-evals-and-datasets-233n</guid>
      <description>&lt;p&gt;To diagnose an AI agent you need four records joined, not four dashboards. Read the codebase for what the agent can do, traces for what it actually did, dataset rows for what it will be trained and tested on, and eval scores for how well it scored. The answer to "why did it do that" lives in the gaps between them.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.overmindlab.ai/research/secret-agent-overmind?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;overmindlab.ai&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Your agent is the most documented system in your engineering org and yet you can't answer simple questions.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;No, Christopher McQuarrie has not asked me to direct the next instalment of Mission: Impossible, though I am keeping a keen eye on my inbox. Today, we are talking state secrets!&lt;/p&gt;

&lt;p&gt;That is also not true. But I did spend many years building stuff and things (the OFFICIAL term) for British Intelligence, and the single most valuable thing I took away was not state secrets. Instead, it was a deeply troubling obsession with data.&lt;/p&gt;

&lt;p&gt;"Is this person a credible threat?" is the canonical example, and a very difficult one to answer. Intelligence analysts are basically superhumans, capable of finding links between vast amounts of varied data, and one of the ways they do that is by layering context.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data, data, everywhere.
&lt;/h2&gt;

&lt;p&gt;That data is vast: signals intelligence, human intelligence, financial records, travel manifests, satellite imagery, and a mountain of open-source material. Some of it is a tidy database, some of it is a photograph, and some of it is words scrawled on a piece of paper. The scale is hard to picture: by the NSA's own figures, it "touches" around 29 petabytes of data a day, which is equivalent to the entire Library of Congress being inspected nearly 3,000 times over, daily.&lt;/p&gt;

&lt;p&gt;I hear you shouting, "Well Tyler, big tech companies have access to lots of data, so why is MI5 so special?" Beyond the legal implications and the fact that we don't (yet) live in a Blade Runner-style dystopia, the reasons are structural. Broadly speaking, any one organisation only ever holds a single thin slice of the picture: what you searched, what you spent, or where you travelled. You can know someone's entire spending history in perfect detail and still have no idea what any of it means. An intelligence agency exists precisely to sit above all those slices and join them, which is the part almost nobody else is mandated, or built, to do. The fusion, not the volume, is the whole point.&lt;/p&gt;

&lt;p&gt;This is the core function of an intelligence agency: not simply to collect the data, but to surface the hidden correlations in vast pools of information. Which brings us, as everything eventually does, to AI agents.&lt;/p&gt;

&lt;h2&gt;
  
  
  Context really is king
&lt;/h2&gt;

&lt;p&gt;Your agent is the most thoroughly documented system in your engineering org. Every prompt, every completion, every tool call, every retry is captured somewhere: traces in your observability tool, scores in your eval suite, rows in your dataset. And yet you still can't answer simple questions. Why did it do that? Where did the behaviour come from? Who gave it a gun? The records are all there, sitting in separate systems, and nobody joins them up.&lt;/p&gt;

&lt;p&gt;Each of those systems holds one thin slice, and each slice has a blind spot the next one covers.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;What it holds&lt;/th&gt;
&lt;th&gt;What it can tell you&lt;/th&gt;
&lt;th&gt;What it can't&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Codebase&lt;/td&gt;
&lt;td&gt;The tools the agent can call and their contracts, its input and output schema, the prompts, the expected output&lt;/td&gt;
&lt;td&gt;What the agent could do&lt;/td&gt;
&lt;td&gt;Whether it ever did&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Production traces&lt;/td&gt;
&lt;td&gt;Every prompt, completion, tool call and retry&lt;/td&gt;
&lt;td&gt;What the agent actually did&lt;/td&gt;
&lt;td&gt;What it was built to be able to do&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dataset rows&lt;/td&gt;
&lt;td&gt;Format, schema, per-column distribution, label space, cohorts, hygiene problems&lt;/td&gt;
&lt;td&gt;What you are about to evaluate or train on&lt;/td&gt;
&lt;td&gt;Whether that covers the agent's real surface&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Eval scores&lt;/td&gt;
&lt;td&gt;Scores against your eval suite&lt;/td&gt;
&lt;td&gt;That a behaviour was wrong&lt;/td&gt;
&lt;td&gt;Why it was wrong&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;So we did exactly that. We built a context layer that joins all these things together: one grounded picture of how your agent is put together and what it actually does, assembled from your codebase and traces, then turned loose to power Overmind. Overmind is the model training platform for AI teams. It turns your production traces into specialised models you own, automatically trained, benchmarked and served. Getting there starts with knowing what the agent actually is.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is a Capability Card?
&lt;/h3&gt;

&lt;p&gt;We start at the codebase, because that's where the ground truth lives. Before Overmind touches a single trace, it reads the code the agent runs on and compiles a Capability Card: the tools the agent can call and their real contracts, its input and output schema, the prompts, and the expected output. That's the agent at its raw logical level, taken from the source rather than inferred from behaviour. Skip it, as most tooling does, and a trace is just a behaviour with nothing behind it, leaving you to reverse-engineer intent from whatever the trace happened to capture.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What Overmind reads from the code&lt;/th&gt;
&lt;th&gt;What it pins down&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;The tools the agent can call, with their real contracts&lt;/td&gt;
&lt;td&gt;The full set of actions available to it, not only the ones a trace happened to capture&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Input and output schema&lt;/td&gt;
&lt;td&gt;The shape the agent is written to accept and return&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The prompts&lt;/td&gt;
&lt;td&gt;The instructions in the source, not a reconstruction from behaviour&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The expected output&lt;/td&gt;
&lt;td&gt;The result the code is written to expect&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Then we bring in the data and the traces. Every record of what the agent did is a context source: production traces, dataset rows, eval scores, all built into the same shape. For a dataset, that layer is the spine: format, schema, per-column distribution, label space, cohorts, hygiene problems, derived straight from the data. If you have not got traces flowing yet, &lt;a href="https://www.overmindlab.ai/research/so-you-have-observability-now-what?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;start there&lt;/a&gt;, and if the word "agent" is doing a lot of undefined work in your org, &lt;a href="https://www.overmindlab.ai/research/anatomy-of-an-ai-agent?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;we pulled it apart here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  How do you know whether your data covers your agent?
&lt;/h3&gt;

&lt;p&gt;The codebase context is what makes that data useful. With the Capability Card in hand, Overmind knows the full surface of the agent and can measure the data against it: how much of that surface the data actually covers, which behaviours are well represented, which tools never appear, and which paths the agent takes in production that no dataset row touches. A pile of traces tells you what happened. The codebase tells you what could happen, and the gap between the two is the thing you need to see. That delta is what decides whether the data is good enough to evaluate against or train on, or whether you're about to write evals for a fraction of the agent or fine-tune on the same narrow slice of its total behaviours.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2a5hclmt21j4bhep7o8p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2a5hclmt21j4bhep7o8p.png" alt="The Overmind console showing the PR Approval Agent (StampHog), discovered from the posthog/posthog repository. The page lists the agent's prompt, its ci, github and security tags, and the seven models it calls, including Claude Sonnet 4.6, GPT 4.1 Mini, o3, Gemini 2.5 Flash Lite and Claude Haiku 4.5. A score panel reads 50 percent, with 1 of 2 runs traced and a badge that says eval metrics not approved. Below, a flow graph links Input, Agent and Read nodes to conversation_summarizer, title_generator, session_summarizer and llm_traces_summarizer, ending at Output." width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Overmind's analysis of a PostHog Agent. The same view in text:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What the console shows&lt;/th&gt;
&lt;th&gt;For the PostHog agent&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Agent&lt;/td&gt;
&lt;td&gt;PR Approval Agent (StampHog)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Discovered from&lt;/td&gt;
&lt;td&gt;The &lt;code&gt;posthog/posthog&lt;/code&gt; repository&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tags&lt;/td&gt;
&lt;td&gt;ci, github, security&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Models it calls&lt;/td&gt;
&lt;td&gt;Seven, including Claude Sonnet 4.6, GPT 4.1 Mini, o3, Gemini 2.5 Flash Lite and Claude Haiku 4.5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Score&lt;/td&gt;
&lt;td&gt;50%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Trace coverage&lt;/td&gt;
&lt;td&gt;1 of 2 runs traced&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Eval status&lt;/td&gt;
&lt;td&gt;Eval metrics not approved&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Flow graph&lt;/td&gt;
&lt;td&gt;Input, Agent and Read into conversation_summarizer, title_generator, session_summarizer and llm_traces_summarizer, ending at Output&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Nothing in that card was filled in by hand. Seven models, three tags and a flow graph, read out of a public repository, with the coverage number sitting next to it so you can see how much of that surface anyone has actually watched run.&lt;/p&gt;

&lt;p&gt;Codebase tied to data tied to traces is the working surface for everything else we do. The data preprocessing reads from it, the evals are written against it, the fine-tuning sets are curated out of it, and the agent optimisation is steered by it. That's the line between a tool that can tell you a behaviour was wrong and one that can tell you why, as well as how to fix it.&lt;/p&gt;

&lt;h2&gt;
  
  
  So, what do you know about your agent?
&lt;/h2&gt;

&lt;p&gt;So much, maybe too much. But not in a useful way.&lt;/p&gt;

&lt;p&gt;That is what Overmind is built for: not more raw evidence, but the relationships between it. Code, traces, datasets, evals, and training runs joined into one grounded view of the agent, so you can see what is really happening and where the gaps are.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Why can't I tell why my AI agent did something?
&lt;/h3&gt;

&lt;p&gt;Because the evidence is split across systems that never meet. Traces live in your observability tool, scores in your eval suite, rows in your dataset, and the agent's actual definition in your repository. Each one answers a different question, and no single one of them answers "why".&lt;/p&gt;

&lt;h3&gt;
  
  
  Are production traces enough to debug an agent?
&lt;/h3&gt;

&lt;p&gt;No. A trace tells you what happened, not what could have happened. Without the codebase you cannot tell whether a behaviour was one of many available paths or the only one, which tools the agent never reached for, or which parts of its surface nobody has ever watched run.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is agent coverage analysis?
&lt;/h3&gt;

&lt;p&gt;Measuring your traces and dataset rows against the agent's full capability surface, taken from the code. It tells you which behaviours are well represented, which tools never appear, and which production paths no dataset row touches. That delta decides whether your data is fit to evaluate against or train on.&lt;/p&gt;

&lt;h3&gt;
  
  
  How is this different from an observability tool?
&lt;/h3&gt;

&lt;p&gt;Observability records behaviour. Joining that record to the codebase, the datasets and the eval scores is what turns a wrong behaviour into an explained one, and then into a fix you can ship.&lt;/p&gt;

&lt;p&gt;Tyler Edwards is Co-Founder and CEO of Overmind. He writes about agent infrastructure, fine-tuning, and what it takes to ship AI that actually improves in production. &lt;a href="https://www.linkedin.com/in/tyler-edwards-b393a5352/" rel="noopener noreferrer"&gt;Connect on LinkedIn&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Overmind is the model training platform for AI teams. It turns your production traces into specialised models you own. &lt;a href="https://console.overmindlab.ai/?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;Get started&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>observability</category>
      <category>agents</category>
    </item>
    <item>
      <title>Unwrapping the wrappers: who actually trains their own models, and why</title>
      <dc:creator>Tyler Edwards</dc:creator>
      <pubDate>Tue, 29 Sep 2026 10:54:39 +0000</pubDate>
      <link>https://dev.to/tyler007/unwrapping-the-wrappers-who-actually-trains-their-own-models-and-why-3mh6</link>
      <guid>https://dev.to/tyler007/unwrapping-the-wrappers-who-actually-trains-their-own-models-and-why-3mh6</guid>
      <description>&lt;p&gt;Cursor, Intercom, Replit and Perplexity all train specialist models on their own production data. Each picked one narrow, high-volume task, trained on traffic no competitor can access, and shipped a model that matches or beats frontier APIs on that job at lower latency and cost. None of them tried to out-build OpenAI.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.overmindlab.ai/research/who-trains-their-own-models?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;overmindlab.ai&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Application layer companies, often labelled as 'ChatGPT wrappers', are starting to train their own models. Specialist models, post-trained or fine-tuned on a dataset their competitors cannot touch: their own production traffic.&lt;/p&gt;

&lt;p&gt;Four recent examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cursor trained Composer, the model inside its coding agent, with online RL on production agent traces. Delivering frontier-level coding at a fraction of the latency and cost.&lt;/li&gt;
&lt;li&gt;Intercom trained Fin Apex, a customer-service model post-trained on billions of support interactions. It bought them control of the resolution-rate metric at scale.&lt;/li&gt;
&lt;li&gt;Replit trained a 7B code-repair model, a fine-tune of DeepSeek-Coder-Instruct-v1.5. It bought them a fast, narrow specialist trained on IDE data nobody else has.&lt;/li&gt;
&lt;li&gt;Perplexity trained Sonar, its search-answer model, a fine-tune of Llama 3.3 70B served on Cerebras hardware. It bought them sub-second, citation-heavy answers at search scale.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Which companies train their own models?
&lt;/h2&gt;

&lt;p&gt;The same four, with the base model, the method and the measured result in one view.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Company&lt;/th&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Base model&lt;/th&gt;
&lt;th&gt;How they trained it&lt;/th&gt;
&lt;th&gt;Measured result&lt;/th&gt;
&lt;th&gt;Source&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Cursor&lt;/td&gt;
&lt;td&gt;Composer&lt;/td&gt;
&lt;td&gt;Not disclosed, a mixture-of-experts architecture&lt;/td&gt;
&lt;td&gt;Online RL on production agent traces, inside a harness mirroring Cursor's real tool space; new checkpoints ship several times a day&lt;/td&gt;
&lt;td&gt;Generates tokens several times faster than comparable frontier models, landing close to the top tier on internal coding benchmarks&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://cursor.com/blog/composer" rel="noopener noreferrer"&gt;Cursor&lt;/a&gt;, &lt;a href="https://arxiv.org/html/2603.24477v1" rel="noopener noreferrer"&gt;Composer 2 report&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Intercom&lt;/td&gt;
&lt;td&gt;Fin Apex 1.0&lt;/td&gt;
&lt;td&gt;Not disclosed&lt;/td&gt;
&lt;td&gt;Post-trained on the company's own support interaction data, billions of interactions&lt;/td&gt;
&lt;td&gt;73.1% benchmark resolution rate against 71.1% for GPT-5.4 and Claude Opus 4.5; one enterprise customer went from 68% to 75% overnight&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://www.intercom.com/blog/announcing-fin-apex-the-age-of-vertical-models-is-here/" rel="noopener noreferrer"&gt;Intercom&lt;/a&gt;, &lt;a href="https://venturebeat.com/technology/intercoms-new-post-trained-fin-apex-1-0-beats-gpt-5-4-and-claude-sonnet-4-6" rel="noopener noreferrer"&gt;VentureBeat&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Replit&lt;/td&gt;
&lt;td&gt;7B code-repair model&lt;/td&gt;
&lt;td&gt;DeepSeek-Coder-Instruct-v1.5 (7B)&lt;/td&gt;
&lt;td&gt;Fine-tuned on IDE telemetry, scoped to roughly 20 diagnostic categories&lt;/td&gt;
&lt;td&gt;Matched or beat GPT-4 and Claude 3 on real-world fixes inside that use case&lt;/td&gt;
&lt;td&gt;&lt;a href="https://replit.com/blog/code-repair" rel="noopener noreferrer"&gt;Replit&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Perplexity&lt;/td&gt;
&lt;td&gt;Sonar&lt;/td&gt;
&lt;td&gt;Llama 3.3 70B&lt;/td&gt;
&lt;td&gt;Fine-tuned for factual grounding, citation quality and readability, served on Cerebras wafer-scale hardware&lt;/td&gt;
&lt;td&gt;Roughly 1,200 tokens per second, and matched or beat larger frontier models on user satisfaction in Perplexity's own A/B tests&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://www.perplexity.ai/hub/blog/meet-new-sonar" rel="noopener noreferrer"&gt;Perplexity&lt;/a&gt;, &lt;a href="https://www.cerebras.ai/press-release/cerebras-powers-perplexity-sonar-with-industrys-fastest-ai-inference" rel="noopener noreferrer"&gt;Cerebras&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Where we sit, for the record. Overmind is the model training platform for AI teams, and the pattern running through these four case studies is the one it is built for. The case studies themselves are other people's work, cited at source.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cursor: reinforcement learning on live agent traces
&lt;/h2&gt;

&lt;p&gt;Cursor didn't fine-tune once and ship. The Composer family of models run on real-time RL: model checkpoints go to production, real user interactions become the reward signal, and an improved checkpoint ships several times a day. The model is a mixture-of-experts architecture trained inside a harness built to mirror Cursor's actual tool space, including file edits, semantic search, and terminal commands. The reward signal reflects how developers really use the product rather than a synthetic benchmark, according to &lt;a href="https://cursor.com/blog/composer" rel="noopener noreferrer"&gt;Cursor's technical post on Composer&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Cursor reports Composer generates tokens several times faster than comparable frontier models while landing close to the top tier on internal coding benchmarks, a tradeoff explored in more depth by the &lt;a href="https://arxiv.org/html/2603.24477v1" rel="noopener noreferrer"&gt;Composer 2 technical report&lt;/a&gt;. Nobody else has Cursor's trace data, which means nobody else can train Cursor's model, even with an identical base checkpoint and an identical training recipe.&lt;/p&gt;

&lt;p&gt;What it bought them: coding performance competitive with larger models, at preferential latency and cost, plus a moat provided by their own proprietary data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Intercom: post-training on the metric the product is sold on
&lt;/h2&gt;

&lt;p&gt;Fin launched in 2023 on top of GPT-4. Fin 2 moved to Claude in late 2024. Then Intercom's roughly 60-person AI research group, led by Fergal Reid, built Fin Apex 1.0, a model post-trained on the company's own support interaction data, as described in the &lt;a href="https://www.intercom.com/blog/announcing-fin-apex-the-age-of-vertical-models-is-here/" rel="noopener noreferrer"&gt;Fin Apex launch post&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;One large enterprise customer saw its resolution rate jump from 68% to 75% overnight after the switch to Apex, a 22% cut in unresolved conversations according to Intercom's own numbers. Independent coverage from &lt;a href="https://venturebeat.com/technology/intercoms-new-post-trained-fin-apex-1-0-beats-gpt-5-4-and-claude-sonnet-4-6" rel="noopener noreferrer"&gt;VentureBeat&lt;/a&gt; puts Apex's benchmark resolution rate at 73.1%, against 71.1% for both GPT-5.4 and Claude Opus 4.5.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Benchmark resolution rate&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Fin Apex 1.0&lt;/td&gt;
&lt;td&gt;73.1%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPT-5.4&lt;/td&gt;
&lt;td&gt;71.1%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Claude Opus 4.5&lt;/td&gt;
&lt;td&gt;71.1%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Intercom's own model documentation breaks the pipeline into separate retrieval, reranking, and generation models rather than one monolithic system, detailed on the &lt;a href="https://fin.ai/cx-models" rel="noopener noreferrer"&gt;Fin CX models page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Worth noting: Intercom hasn't abandoned rented models. Apex is layered on top of retrieval and routing components, and the company still uses third-party models elsewhere. This architecture is common as companies balance performance, latency and cost.&lt;/p&gt;

&lt;h2&gt;
  
  
  Replit: a narrow 7B specialist trained on IDE telemetry
&lt;/h2&gt;

&lt;p&gt;Replit's bet was the opposite of "bigger is better." The team fine-tuned a 7B open-weights model, DeepSeek-Coder-Instruct-v1.5, chosen after testing several code-focused base models and documented in its &lt;a href="https://replit.com/blog/code-repair" rel="noopener noreferrer"&gt;code-repair write-up&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The model targets a specific use case, roughly the 20 diagnostic categories responsible for the majority of everyday coding errors, and the fine-tuned 7B checkpoint matched or beat GPT-4 and Claude 3 on real-world fixes in that use case. Small &lt;a href="https://huggingface.co/deepseek-ai/deepseek-coder-7b-instruct-v1.5" rel="noopener noreferrer"&gt;open source models&lt;/a&gt; can beat much larger general-purpose models at many tasks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Perplexity: search-optimised inference at 1,200 tokens per second
&lt;/h2&gt;

&lt;p&gt;Perplexity fine-tuned Meta's Llama 3.3 70B into Sonar, tuned specifically for factual grounding, citation quality, and readability in its default search mode, as the company explains in its &lt;a href="https://www.perplexity.ai/hub/blog/meet-new-sonar" rel="noopener noreferrer"&gt;Sonar launch post&lt;/a&gt;. Sonar runs on Cerebras wafer-scale inference hardware, which Perplexity and &lt;a href="https://www.cerebras.ai/press-release/cerebras-powers-perplexity-sonar-with-industrys-fastest-ai-inference" rel="noopener noreferrer"&gt;Cerebras jointly announced&lt;/a&gt; pushes throughput to roughly 1,200 tokens per second, an order of magnitude faster than comparable models on conventional GPU inference.&lt;/p&gt;

&lt;p&gt;In Perplexity's own A/B testing, Sonar matched or beat larger frontier models on user satisfaction inside search, while running far cheaper and faster than calling those models directly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why build a specialist model instead of prompting a frontier one?
&lt;/h2&gt;

&lt;p&gt;Calling a frontier model for every request is sometimes the equivalent of running a data centre to toast bread. It works, but it's the wrong tool for a narrow, high-volume, well-defined job. Across these four companies, three conditions kept showing up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A narrow task, not a general one. Small specialised models are excellent at one narrow task. Don't ask them to be broadly intelligent.&lt;/li&gt;
&lt;li&gt;Proprietary production data no competitor can access. Cursor has Cursor's traces. Intercom has Intercom's support conversations. Your production traffic is the one dataset nobody can buy.&lt;/li&gt;
&lt;li&gt;Enough volume that per-token latency and cost actually move the P&amp;amp;L. Fine-tuning a model can be expensive. It only pays off once inference volume is high enough that shaving cost per call compounds.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of these companies want to out-build OpenAI or Anthropic on general intelligence. Each trained a model that wins one specific task, using the one dataset it uniquely owned.&lt;/p&gt;

&lt;h2&gt;
  
  
  What does the traces-to-training loop look like?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftuc4hrt0ff13e2l248hp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftuc4hrt0ff13e2l248hp.png" alt="Flywheel diagram titled " width="800" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Stage&lt;/th&gt;
&lt;th&gt;What it produces&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Production runs&lt;/td&gt;
&lt;td&gt;Traces of what the agent actually did&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Labelled dataset&lt;/td&gt;
&lt;td&gt;Those traces, curated and labelled&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fine-tuned model&lt;/td&gt;
&lt;td&gt;A specialist trained on that dataset&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Redeploy&lt;/td&gt;
&lt;td&gt;The specialist back in production, generating the next round of traces&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Capture production traces, turn them into a labelled dataset, train a model on it, and ship that model back into production. That's where the application layer is going. We break the middle two stages down in &lt;a href="https://www.overmindlab.ai/research/traces-to-training-dataset?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;how do you turn traces into a training dataset&lt;/a&gt; and &lt;a href="https://www.overmindlab.ai/research/how-to-train-your-agent?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;how to train your agent&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Do companies that train their own models still use frontier APIs?
&lt;/h3&gt;

&lt;p&gt;Usually yes, alongside. Intercom hasn't abandoned rented models. Fin Apex sits on top of retrieval and routing components, and the company still uses third-party models elsewhere. A mix of owned and rented models is the common architecture, chosen to balance performance, latency and cost.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do you need a large model to beat a frontier one?
&lt;/h3&gt;

&lt;p&gt;Not on a narrow task. Replit's 7B fine-tune of DeepSeek-Coder-Instruct-v1.5 matched or beat GPT-4 and Claude 3 on real-world fixes inside its target diagnostic categories. Perplexity's Sonar, a 70B fine-tune, matched or beat larger frontier models on user satisfaction inside search.&lt;/p&gt;

&lt;h3&gt;
  
  
  What data do you need to train a specialist model?
&lt;/h3&gt;

&lt;p&gt;Your own production traffic. Cursor used live agent traces, Intercom used its support interactions, Replit used IDE telemetry, and Perplexity tuned against its own search behaviour. The common ingredient is a dataset the product generates itself, which is the one thing a competitor cannot buy.&lt;/p&gt;

&lt;h3&gt;
  
  
  When does training your own model not pay off?
&lt;/h3&gt;

&lt;p&gt;When any of the three conditions is missing. A broad task rather than a narrow one, no proprietary data sitting behind it, or volume too low for per-call savings to compound. Fine-tuning costs money, so it only pays back once inference volume is high enough.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Overmind is the model training platform for AI teams. It turns your production traces into specialised models you own. &lt;a href="https://console.overmindlab.ai/?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;Get started&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>machinelearning</category>
      <category>finetuning</category>
    </item>
    <item>
      <title>The anatomy of an AI agent: model, loop, tools, memory</title>
      <dc:creator>Tyler Edwards</dc:creator>
      <pubDate>Wed, 23 Sep 2026 11:50:46 +0000</pubDate>
      <link>https://dev.to/tyler007/the-anatomy-of-an-ai-agent-model-loop-tools-memory-207g</link>
      <guid>https://dev.to/tyler007/the-anatomy-of-an-ai-agent-model-loop-tools-memory-207g</guid>
      <description>&lt;p&gt;An AI agent is a language model wrapped in a loop that plans, calls tools and iterates toward a goal across many steps. Five components make one up. A model that picks the next action, a harness that runs the loop, tools that reach outside the model, memory that carries state, and a trajectory, the record of the whole run.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.overmindlab.ai/research/anatomy-of-an-ai-agent?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;overmindlab.ai&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;An agent has a model, loop, tools and memory.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In 2024, most AI products were chatbots. A single LLM inference call, one prompt in, one completion out. In 2026, the default architecture is an &lt;strong&gt;AI agent&lt;/strong&gt;, an agentic system that plans, calls tools, and iterates toward a goal across many steps.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Chatbot (the 2024 default)&lt;/th&gt;
&lt;th&gt;AI agent (the 2026 default)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Model calls per task&lt;/td&gt;
&lt;td&gt;One&lt;/td&gt;
&lt;td&gt;Many&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Shape&lt;/td&gt;
&lt;td&gt;One prompt in, one completion out&lt;/td&gt;
&lt;td&gt;Plans, acts, observes, repeats&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tools&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;APIs, databases, code execution&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Execution path&lt;/td&gt;
&lt;td&gt;A single step&lt;/td&gt;
&lt;td&gt;Varies run to run, non-deterministic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;What you get back&lt;/td&gt;
&lt;td&gt;The first model response&lt;/td&gt;
&lt;td&gt;An outcome, plus a trajectory&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Instead of returning the first model response, teams wrap the LLM in an &lt;strong&gt;agent harness&lt;/strong&gt;, expose &lt;strong&gt;tool calling&lt;/strong&gt; (APIs, databases, code execution), and let the system work toward an objective. Frameworks such as LangChain, Agno, CrewAI, and the OpenAI Agents SDK exist to make it easier to build the harness.&lt;/p&gt;

&lt;p&gt;This article decomposes an AI agent into its core components. We define each part of the &lt;strong&gt;AI harness&lt;/strong&gt; and walk through one complete agent run. Worth stating where we sit. Overmind is the model training platform for AI teams, and the trajectory, component five below, is the raw material it works from.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are the five components of an AI agent?
&lt;/h2&gt;

&lt;p&gt;Strip an agentic system down and you get five components. Four you assemble and the fifth is what they produce.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Model.&lt;/strong&gt; Selects the next action given goal and state.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Harness.&lt;/strong&gt; Runs the loop of reason, act, observe, repeat.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tools.&lt;/strong&gt; How the agent interacts with external systems.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory.&lt;/strong&gt; How the agent persists and retrieves state.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trajectory.&lt;/strong&gt; The record of one complete agent run.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;th&gt;Assembled or produced&lt;/th&gt;
&lt;th&gt;How you change it&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Model&lt;/td&gt;
&lt;td&gt;Selects the next action given goal and state&lt;/td&gt;
&lt;td&gt;Assembled&lt;/td&gt;
&lt;td&gt;Swap it, or train and fine-tune it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Harness&lt;/td&gt;
&lt;td&gt;Runs the loop of reason, act, observe, repeat&lt;/td&gt;
&lt;td&gt;Assembled&lt;/td&gt;
&lt;td&gt;Rewrite prompts, context rules and stop conditions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tools&lt;/td&gt;
&lt;td&gt;How the agent interacts with external systems&lt;/td&gt;
&lt;td&gt;Assembled&lt;/td&gt;
&lt;td&gt;Add, remove or redescribe tools&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Memory&lt;/td&gt;
&lt;td&gt;How the agent persists and retrieves state&lt;/td&gt;
&lt;td&gt;Assembled&lt;/td&gt;
&lt;td&gt;Change what stays in the context window, change retrieval&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Trajectory&lt;/td&gt;
&lt;td&gt;The record of one complete agent run&lt;/td&gt;
&lt;td&gt;Produced by the other four&lt;/td&gt;
&lt;td&gt;Not directly. It changes when the other four change&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  What is the model in an AI agent?
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;language model&lt;/strong&gt; is the only component that reasons, and the only one you can train or fine-tune. Conditioned on the goal and the observations so far, it chooses the next action. Most teams start on a &lt;strong&gt;frontier model API&lt;/strong&gt; and some migrate to an &lt;strong&gt;open-weights model&lt;/strong&gt; they host themselves or run through a third-party provider.&lt;/p&gt;

&lt;p&gt;More on that trade-off in &lt;a href="https://www.overmindlab.ai/research/open-weights-vs-frontier-apis?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;open-weights LLMs vs frontier APIs&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is an agent harness?
&lt;/h3&gt;

&lt;p&gt;The harness assembles what the model sees, reads the action it picks, calls the matching tool, and feeds the result back in. It also decides everything the model does not. Which tools exist and how they are described, what stays in the context window, what happens when a tool call fails or comes back malformed, and when to stop, whether that is the goal being met, a step limit, or an error.&lt;/p&gt;

&lt;p&gt;This is what agent frameworks give you. It is the part of an agent you can change immediately.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is tool calling?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Tools&lt;/strong&gt; are how the agent reaches outside the model, whether that is querying a database, calling an HTTP API, running code, or sending an email. OpenAI shipped &lt;strong&gt;function calling&lt;/strong&gt; in June 2023, letting the model emit a structured request to invoke a function instead of prose. Anthropic open-sourced the &lt;strong&gt;Model Context Protocol (MCP)&lt;/strong&gt; in November 2024 to standardise how agents connect to those tools, and now everything is an MCP server.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is agent memory?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Memory&lt;/strong&gt; is how the agent carries state across loop iterations. Short-term memory is the &lt;strong&gt;context window&lt;/strong&gt;, the running transcript of the goal, prior steps, and tool outputs. Longer-term memory is &lt;strong&gt;retrieval&lt;/strong&gt;, pulling documents or past runs from outside the window (often via RAG or a vector store). Without memory, the agent loses its way.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is an agent trajectory?
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;trajectory&lt;/strong&gt;, also called the &lt;strong&gt;agent trace&lt;/strong&gt;, is the full ordered record of a single run. The goal, every LLM call, every tool invocation, every observation, and the final outcome. It is the agent's stack trace. You do not build it; the other four components produce it. It is also the only unit of analysis at which you can honestly say whether the agent succeeded. Capture it.&lt;/p&gt;

&lt;h2&gt;
  
  
  One agent run, start to finish
&lt;/h2&gt;

&lt;p&gt;Watch a support agent handle a refund. The user goal enters, the agentic loop runs, an outcome exits.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The user goal arrives. Refund this customer.&lt;/li&gt;
&lt;li&gt;The model calls &lt;code&gt;get_order(id)&lt;/code&gt;; the tool returns the order details.&lt;/li&gt;
&lt;li&gt;The model checks the order against the refund policy.&lt;/li&gt;
&lt;li&gt;The model calls &lt;code&gt;issue_refund(amount)&lt;/code&gt;; the tool returns a confirmation.&lt;/li&gt;
&lt;li&gt;The model reports back. Refund done.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Four model calls, two tool calls, one outcome. That entire sequence is the &lt;strong&gt;agent trajectory&lt;/strong&gt;. Change the goal, the tool responses, or the model's sampling behaviour and the next run takes a different path. Agents are &lt;strong&gt;non-deterministic&lt;/strong&gt;. The same prompt does not guarantee the same execution path.&lt;/p&gt;

&lt;h2&gt;
  
  
  What does each layer of the AI stack actually control?
&lt;/h2&gt;

&lt;p&gt;Each layer of a typical AI stack controls an aspect of the agent. Almost none control the whole run.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;What it sees&lt;/th&gt;
&lt;th&gt;Can it update the model?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;LLM gateway&lt;/td&gt;
&lt;td&gt;One request and response at a time&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agent observability&lt;/td&gt;
&lt;td&gt;The full trace, after the fact&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agent evals&lt;/td&gt;
&lt;td&gt;A score for the run&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Closed training loop&lt;/td&gt;
&lt;td&gt;Judged trajectories fed back into training&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Three of the four tell you what happened. Only the last one changes what happens next time. More on that gap in &lt;a href="https://www.overmindlab.ai/research/so-you-have-observability-now-what?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;so, you have observability. Now what?&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do you improve an AI agent?
&lt;/h2&gt;

&lt;p&gt;Improving an AI agent means operating at the level of the &lt;strong&gt;trajectory&lt;/strong&gt;, not the individual LLM call. Capture the full run, judge it against your definition of success, and feed judged trajectories back into the system.&lt;/p&gt;

&lt;p&gt;There are two distinct ways to improve an agent.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Improve the harness.&lt;/strong&gt; Rewrite prompts, tighten tool definitions, change the context rules and stop conditions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Improve the model.&lt;/strong&gt; Retrain it on the failure modes in the traces, then benchmark the result against the model you serve today.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is the loop Overmind is built to close.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ: agents, harnesses and trajectories
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What is the difference between an AI agent and a chatbot?
&lt;/h3&gt;

&lt;p&gt;A chatbot is one model call. One prompt in, one completion out. An agent runs many model calls inside a loop, calls tools between them, and keeps going until the goal is met or it stops. The comparison table above sets the two side by side.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is an AI agent the same thing as a workflow?
&lt;/h3&gt;

&lt;p&gt;No. In a workflow, you decide the order of steps in advance. In an agent, the model decides the next action at each turn given the goal and what it has observed so far. That is why two runs of the same agent can take different paths and a workflow cannot.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why are AI agents non-deterministic?
&lt;/h3&gt;

&lt;p&gt;Because the model chooses each action, and its sampling behaviour, the goal, and the tool responses all vary. Change any of them and the next run takes a different path. This is why a single run tells you very little and the trajectory is the unit you have to judge.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do I need an agent framework to build an AI agent?
&lt;/h3&gt;

&lt;p&gt;No. Frameworks such as LangChain, Agno, CrewAI, and the OpenAI Agents SDK exist to make the harness easier to build, not to make it possible. The loop is reason, act, observe, repeat, and plenty of teams write their own.&lt;/p&gt;

&lt;h3&gt;
  
  
  Which part of an agent should you change first when it fails?
&lt;/h3&gt;

&lt;p&gt;Start with the harness, because it is the part you can change immediately. Prompts, tool descriptions, context rules, stop conditions. Go to the model when the same failure keeps showing up across trajectories after the harness is clean.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Overmind is the model training platform for AI teams. It turns your production traces into specialised models you own. &lt;a href="https://console.overmindlab.ai/?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;Get started&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>agents</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Think smaller: why specialist SLMs beat frontier models in production</title>
      <dc:creator>Tyler Edwards</dc:creator>
      <pubDate>Tue, 22 Sep 2026 11:46:42 +0000</pubDate>
      <link>https://dev.to/tyler007/think-smaller-why-specialist-slms-beat-frontier-models-in-production-17gl</link>
      <guid>https://dev.to/tyler007/think-smaller-why-specialist-slms-beat-frontier-models-in-production-17gl</guid>
      <description>&lt;p&gt;Most agent tasks do not need a frontier model. The subtasks inside a production agent are largely repetitive and narrowly scoped, and a small language model of 1B to 8B parameters, fine-tuned on your production data, beats a frontier model on cost, latency and accuracy for that job. Serving a 7B runs roughly 10 to 30x cheaper than a 70B+ model.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.overmindlab.ai/research/think-smaller?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;overmindlab.ai&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Frontier models are overkill for most agent tasks. Specialised small language models beat them on cost, latency, and accuracy.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The AI industry has spent three years in an arms race measured in billions of parameters, and somewhere along the way everyone agreed that the answer to every problem was a bigger model.&lt;/p&gt;

&lt;p&gt;Bigger clusters, bigger bills, bigger teams to manage the complexity. The implicit assumption is that general intelligence at scale is the end state and everything else is just waiting to catch up.&lt;/p&gt;

&lt;p&gt;Which is obviously great for the foundational teams pushing this agenda, were it not for the fact that the overwhelming majority of problems we throw AI at don't need otherworldly intelligence and infinite compute to solve.&lt;/p&gt;

&lt;p&gt;Llama, Phi, Qwen, Mistral: models that would have been considered frontier-grade two years ago are now freely available, fine-tuneable, and deployable on hardware you control. The performance gap that once justified the cost and lock-in of proprietary giants is now much slimmer, so the question is no longer "which frontier model should we use?" but rather "do we need a frontier model at all?"&lt;/p&gt;

&lt;p&gt;For most tasks, the honest answer is no.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why is a frontier model overkill for most agent tasks?
&lt;/h2&gt;

&lt;p&gt;Using a frontier model on every task is like using a flamethrower to light a candle. Technically works, but your eyebrows and your budget are gone.&lt;/p&gt;

&lt;p&gt;The majority of subtasks in a deployed agentic system are repetitive, scoped, and non-conversational. Extract this field, classify this ticket, format this output, none of these require a model trained on the sum of human knowledge. They require a model that is fast, predictable, cheap to run, and tuned to behave exactly as expected in a well-defined context.&lt;/p&gt;

&lt;p&gt;In fact, on well-defined, repetitive tasks, specialised SLMs do not just cost a fraction of what frontier models cost, they outperform them. A model built specifically for one thing, trained on real examples of that thing, is better at that thing than a model trained to do everything.&lt;/p&gt;

&lt;h3&gt;
  
  
  Which small models have beaten frontier models on benchmarks?
&lt;/h3&gt;

&lt;p&gt;And this holds even as the tasks get harder. Qwen2.5-Math-7B, running Microsoft's &lt;a href="https://arxiv.org/abs/2501.04519" rel="noopener noreferrer"&gt;rStar-Math&lt;/a&gt; reasoning framework, scores 90% on the MATH benchmark, beating OpenAI's o1-preview. John Snow Labs' &lt;a href="https://www.johnsnowlabs.com/evaluating-john-snow-labs-medical-llms-against-gpt4o-by-expert-review/" rel="noopener noreferrer"&gt;MedS&lt;/a&gt;, an 8B medical model, was preferred over GPT-4o by practising physicians in blind evaluation across every dimension: factuality, clinical relevance, and conciseness. &lt;a href="https://arxiv.org/abs/2402.09391" rel="noopener noreferrer"&gt;LlaSMol&lt;/a&gt;, a 7B chemistry model, achieves 93% exact match on molecular prediction tasks where GPT-4 scores under 5%. On &lt;a href="https://gorilla.cs.berkeley.edu/leaderboard.html" rel="noopener noreferrer"&gt;Berkeley's function-calling leaderboard&lt;/a&gt;, an 8B model held the top spot at the time of writing, beating GPT-4o and Claude 3.5 Sonnet.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Specialist model&lt;/th&gt;
&lt;th&gt;Params&lt;/th&gt;
&lt;th&gt;Benchmark&lt;/th&gt;
&lt;th&gt;Score&lt;/th&gt;
&lt;th&gt;Model it beats&lt;/th&gt;
&lt;th&gt;Source&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Qwen2.5-Math-7B with rStar-Math&lt;/td&gt;
&lt;td&gt;7B&lt;/td&gt;
&lt;td&gt;MATH&lt;/td&gt;
&lt;td&gt;90%&lt;/td&gt;
&lt;td&gt;OpenAI o1-preview&lt;/td&gt;
&lt;td&gt;&lt;a href="https://arxiv.org/abs/2501.04519" rel="noopener noreferrer"&gt;rStar-Math, Microsoft&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;John Snow Labs MedS&lt;/td&gt;
&lt;td&gt;8B&lt;/td&gt;
&lt;td&gt;Blind physician review on factuality, clinical relevance and conciseness&lt;/td&gt;
&lt;td&gt;Preferred over GPT-4o on every dimension&lt;/td&gt;
&lt;td&gt;GPT-4o&lt;/td&gt;
&lt;td&gt;&lt;a href="https://www.johnsnowlabs.com/evaluating-john-snow-labs-medical-llms-against-gpt4o-by-expert-review/" rel="noopener noreferrer"&gt;John Snow Labs expert review&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LlaSMol&lt;/td&gt;
&lt;td&gt;7B&lt;/td&gt;
&lt;td&gt;Molecular prediction, exact match&lt;/td&gt;
&lt;td&gt;93%&lt;/td&gt;
&lt;td&gt;GPT-4, under 5%&lt;/td&gt;
&lt;td&gt;&lt;a href="https://arxiv.org/abs/2402.09391" rel="noopener noreferrer"&gt;LlaSMol, OSU NLP&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Top open function-calling specialist&lt;/td&gt;
&lt;td&gt;8B&lt;/td&gt;
&lt;td&gt;Berkeley function-calling leaderboard&lt;/td&gt;
&lt;td&gt;Top of the leaderboard at the time of writing&lt;/td&gt;
&lt;td&gt;GPT-4o and Claude 3.5 Sonnet&lt;/td&gt;
&lt;td&gt;&lt;a href="https://gorilla.cs.berkeley.edu/leaderboard.html" rel="noopener noreferrer"&gt;Berkeley function-calling leaderboard&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  What does open-weights actually unlock for production AI?
&lt;/h2&gt;

&lt;p&gt;The capability trajectory of small open models has been striking, yet the capability of these models is not the most exciting piece, what open weights actually unlock is control.&lt;/p&gt;

&lt;p&gt;A frontier model you do not own, cannot audit, and cannot modify is a dependency, not infrastructure and certainly not your 'technical moat'. When it changes, your system changes. When it halts, your system halts. When the provider decides to deprecate a version or reprice the API, you absorb it. The case for specialised small models is not just that they are better. It is that they are yours.&lt;/p&gt;

&lt;p&gt;The physical dimension matters too. Frontier models run in data centres, behind APIs, with latency measured in hundreds of milliseconds and costs that compound with every token. In an agentic system where a single workflow might invoke a model thirty or forty times, that compounds fast. Serving a 7B SLM is roughly 10 to 30x cheaper in latency, energy, and compute than serving a 70 to 175B LLM. Small models can run on-premise, inside the security perimeter, on the device generating the data. A fraud detection model running locally, fine-tuned on that institution's own transaction patterns, makes faster decisions with no external dependency and no data crossing a network boundary. The performance is better, the risk profile and compliance conversation are entirely different.&lt;/p&gt;

&lt;p&gt;Even more exciting still (if you can believe it) is that a model small enough to run on a phone can be fine-tuned not just to a specific workflow but to a specific person. An agent that lives on your device and learns from how you actually work is a categorically different thing to one calling to a data centre every time you ask it something. We are moving from general intelligence in the cloud to personal intelligence in your pocket. That shift is bigger than most people are currently treating it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Which fits your job, a frontier API or a specialist SLM?
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Frontier model behind an API&lt;/th&gt;
&lt;th&gt;Specialist SLM you own&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Best at&lt;/td&gt;
&lt;td&gt;Open-ended reasoning and conversation&lt;/td&gt;
&lt;td&gt;Repetitive, scoped, non-conversational subtasks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Serving cost&lt;/td&gt;
&lt;td&gt;Compounds with every token, and one workflow may invoke the model thirty or forty times&lt;/td&gt;
&lt;td&gt;Roughly 10 to 30x cheaper at 7B than at 70 to 175B&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Latency&lt;/td&gt;
&lt;td&gt;Hundreds of milliseconds, over the network&lt;/td&gt;
&lt;td&gt;No network hop, runs where the data is&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Where it runs&lt;/td&gt;
&lt;td&gt;A data centre, behind an API&lt;/td&gt;
&lt;td&gt;On-premise, inside the security perimeter, or on the device&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Control&lt;/td&gt;
&lt;td&gt;Version deprecations and repricing land on you&lt;/td&gt;
&lt;td&gt;Yours to audit, modify and version&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Failure surface&lt;/td&gt;
&lt;td&gt;Vast and constantly shifting, answered with hand-written guardrails&lt;/td&gt;
&lt;td&gt;Narrow scope, tighter output distribution, predictable failures&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Setup effort&lt;/td&gt;
&lt;td&gt;Write a prompt, get an answer, iterate, ship&lt;/td&gt;
&lt;td&gt;Instrumentation, curation, fine-tuning jobs, evals, versioning, a deployment you can swap&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Production is the best training data you have
&lt;/h2&gt;

&lt;p&gt;Every invocation of a model in an agentic workflow is a natural source of high-quality training data. The prompts are well-defined, the expected outputs are narrow, and whether the workflow succeeded or failed is a clean signal. A listener at the model call interface, logging inputs, outputs, and downstream outcomes, accumulates exactly the dataset you need to continuously fine-tune a specialist model for that task, as the system runs. The production environment is generating its own improvement data in real time.&lt;/p&gt;

&lt;p&gt;This is where the SLM case becomes compelling beyond economics. You instrument the calls, cluster the patterns, fine-tune the specialists, and the system gets better with every run. What determines whether you actually close that loop is whether you have the infrastructure to capture it, label it, and act on it.&lt;/p&gt;

&lt;p&gt;That loop is what we build. Overmind turns your production traces into specialised models you own, automatically trained, benchmarked, and served.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why are specialist models easier to supervise?
&lt;/h3&gt;

&lt;p&gt;AI security has become a pretty bloated term, so stick with me here. The version of it that actually matters is not about firewalls or prompt injection. It is about knowing what your model is doing, and knowing when it is doing something it should not. Specialised models make that question answerable. When a model has a narrow, well-defined scope, you know what it should be doing, which means you know when it is doing something else. The output distribution is tighter, the failure modes are more predictable, and the feedback loop from production behaviour back to model improvement is shorter and more reliable.&lt;/p&gt;

&lt;p&gt;General models are a different problem entirely. The failure surface is vast, constantly shifting, and practically impossible to enumerate in advance. Guardrails are the industry's current answer, which is to say: a list of rules written by humans trying to statically account for an infinite and ever-changing set of ways a frontier model can go wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  Are small specialist models harder to train?
&lt;/h2&gt;

&lt;p&gt;Now I would love to just dunk on frontier models for the rest of this post, but there is a real counter-argument worth addressing. Calling an API is easy. You write a prompt, you get an answer, you iterate, you ship. The feedback loop is fast and the overhead is minimal. Building SLM-first infrastructure is a different proposition entirely.&lt;/p&gt;

&lt;p&gt;Fine-tuning a specialist model requires training data, which requires instrumentation, which requires someone to own it. You need pipelines to capture production traces, processes to curate and label them, and infrastructure to run fine-tuning jobs on a cadence that actually moves the needle. You need model versioning, evaluation harnesses, and a deployment setup that lets you swap models without taking down the system. None of this is impossibly hard, but none of it is free either.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters to us
&lt;/h2&gt;

&lt;p&gt;Everything in this post is, admittedly, not a neutral observation. &lt;a href="https://www.overmindlab.ai/about?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;We built Overmind&lt;/a&gt; on a specific bet: that the teams who win the next phase of agentic AI will be the ones who own their models, not the ones who rent the most powerful ones.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://www.overmindlab.ai/product?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;infrastructure to do that&lt;/a&gt;, fine-tuning pipelines, production observability, continuous improvement loops that do not require a dedicated ML team to run, that is what we are building. Not just because it is an interesting technical problem, but because without it the agentic future we are all so excited about, the one where AI runs diagnostics in hospitals or runs locally on your phone and adapts to you as an individual, simply cannot happen.&lt;/p&gt;

&lt;p&gt;So we are building that future.&lt;/p&gt;

&lt;p&gt;Overmind is the model training platform for AI teams. It turns your production traces into specialised models you own, automatically trained, benchmarked, and served. If you are &lt;a href="https://docs.overmindlab.ai/?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;deploying agentic AI&lt;/a&gt;, get in touch.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Are small language models better than frontier models?
&lt;/h3&gt;

&lt;p&gt;For repetitive, scoped tasks they are. A model trained specifically for one job, on real examples of that job, outperforms a generalist on cost, latency and accuracy. Frontier models still win on open-ended reasoning and conversation.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is a specialist SLM?
&lt;/h3&gt;

&lt;p&gt;A small language model (typically 1B to 8B parameters) fine-tuned on a narrow task using your own production data. Llama, Phi, Qwen and Mistral are common open-weight bases.&lt;/p&gt;

&lt;h3&gt;
  
  
  How much cheaper is a 7B SLM compared to a 70B+ LLM?
&lt;/h3&gt;

&lt;p&gt;Roughly 10 to 30x cheaper in latency, energy and compute when self-hosted, and the gap widens at high request volumes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I run a specialist SLM on-device?
&lt;/h3&gt;

&lt;p&gt;Yes. 7B and 8B models run on modern phones and laptops, which enables per-user fine-tuning, offline operation, and no data leaving the device.&lt;/p&gt;

&lt;h3&gt;
  
  
  What do you need in place before you can run specialist models in production?
&lt;/h3&gt;

&lt;p&gt;Four things. Instrumentation that captures production traces, a process to curate and label them, somewhere to run fine-tuning jobs on a regular cadence, and model versioning plus evaluation harnesses so you can swap a model without taking the system down. None of it is impossibly hard, but none of it is free either.&lt;/p&gt;




&lt;p&gt;Tyler Edwards is Co-Founder and CEO of Overmind. He writes about agent infrastructure, fine-tuning, and what it takes to ship AI that actually improves in production. &lt;a href="https://www.linkedin.com/in/tyler-edwards-b393a5352/" rel="noopener noreferrer"&gt;Connect on LinkedIn&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Overmind is the model training platform for AI teams. It turns your production traces into specialised models you own. &lt;a href="https://console.overmindlab.ai/?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;Get started&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>machinelearning</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Prompt engineering vs fine-tuning vs RAG: when to switch</title>
      <dc:creator>Tyler Edwards</dc:creator>
      <pubDate>Tue, 08 Sep 2026 17:01:47 +0000</pubDate>
      <link>https://dev.to/tyler007/prompt-engineering-vs-fine-tuning-which-one-do-you-need-9n</link>
      <guid>https://dev.to/tyler007/prompt-engineering-vs-fine-tuning-which-one-do-you-need-9n</guid>
      <description>&lt;p&gt;Every LLM team hits the same fork eventually, either keep steering the prompt or start training the model. Here's how to read the signals before you burn a sprint finding out the hard way.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.overmindlab.ai/research/prompt-engineering-vs-fine-tuning?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;overmindlab.ai&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Prompt engineering changes what you send the model. Fine-tuning changes the model's weights. Start with prompts because they are fast, cheap and reversible. Fine-tune when the eval stops improving, the task is narrow, and you have a few thousand real examples of the output you want.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Most teams building LLM applications start the same way. They write a system prompt, test it against a few examples, and ship. &lt;a href="https://docs.overmindlab.ai/agent-testing/optimisers?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;Prompt engineering&lt;/a&gt; is cheap, fast, and reversible. &lt;a href="https://docs.overmindlab.ai/models/training?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;Fine-tuning&lt;/a&gt; used to be something only teams with a training pipeline and a GPU budget could afford. Things have changed but the order of operations hasn't.&lt;/p&gt;

&lt;p&gt;Both techniques steer model behaviour. Prompting changes what you say to the model. Fine-tuning changes the model itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prompt engineering vs fine-tuning, side by side
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Feo6nxunorwj0hlfs2tgc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Feo6nxunorwj0hlfs2tgc.png" alt="Table comparing prompt engineering and fine-tuning across seven rows. Prompt engineering changes the input, lives in the context window, costs seconds with no infrastructure, needs no data or a handful of examples, reverses instantly, survives a model swap, and plateaus quickly. Fine-tuning changes the model's weights, lives in the model, costs GPU time and a training pipeline, needs thousands of labelled runs, reverses only by retraining, does not survive a model swap, and has a high ceiling bounded by data quality." width="799" height="397"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Prompt engineering&lt;/th&gt;
&lt;th&gt;Fine-tuning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;What changes&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The input&lt;/td&gt;
&lt;td&gt;The model's weights&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Where it lives&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The context window&lt;/td&gt;
&lt;td&gt;The model&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Cost&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Seconds, no infrastructure&lt;/td&gt;
&lt;td&gt;GPU time and a training pipeline&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Data needed&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;None, or a handful of examples&lt;/td&gt;
&lt;td&gt;Thousands of labelled runs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Reversibility&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Instant&lt;/td&gt;
&lt;td&gt;Only by retraining&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Survives a model swap&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Ceiling&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Plateaus quickly&lt;/td&gt;
&lt;td&gt;High, bounded by data quality&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Why prompting is the right first move
&lt;/h2&gt;

&lt;p&gt;Prompt engineering means editing what enters the context window. No adjustment of the model's weights. You're changing the input and reading the output.&lt;/p&gt;

&lt;p&gt;For a new agent, that's almost always the correct starting point. You learn what the model can already do before you spend anything on training. Most of the behaviour changes you want, prompting will give you.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to tell which regime you're in
&lt;/h2&gt;

&lt;p&gt;This isn't a one-time decision so much as a loop. You stay in prompt-engineering mode until the eval curve goes flat, then check whether you actually have what fine-tuning needs, a narrow task and real data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw18dpcxsa2e4yg0pdz3o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw18dpcxsa2e4yg0pdz3o.png" alt="Decision flowchart. When new behavior is needed, ship prompt changes while the eval is still moving. Once the eval is flat for three to four changes, check whether you have a narrow task and a few thousand labeled runs: if not, build the dataset first; if yes, fine-tune." width="800" height="765"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Ship prompt changes until the eval goes flat, then fine-tune.&lt;/em&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Where you are&lt;/th&gt;
&lt;th&gt;What you're seeing&lt;/th&gt;
&lt;th&gt;What to do next&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;New behaviour needed&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A gap between what the agent does and what it should do&lt;/td&gt;
&lt;td&gt;Ship a prompt change&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Eval still moving&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Each change shifts the score&lt;/td&gt;
&lt;td&gt;Keep prompting&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Eval flat for 3-4 changes, task is narrow, a few thousand labelled runs in hand&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Plateau, and you have the ingredients&lt;/td&gt;
&lt;td&gt;Fine-tune&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Eval flat, but the task is broad or the labelled runs aren't there&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Plateau without the ingredients&lt;/td&gt;
&lt;td&gt;Build the dataset first&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Where prompting hits its ceiling
&lt;/h2&gt;

&lt;p&gt;Prompting always runs out of road eventually, and the symptoms show up in predictable order:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The plateau.&lt;/strong&gt; Each prompt tweak moves the eval less.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Whack-a-mole.&lt;/strong&gt; The instruction that fixes today's failure mode causes tomorrow's.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prompt bloat.&lt;/strong&gt; The system prompt keeps growing, slows the model down, and gets partially ignored.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Paying rent.&lt;/strong&gt; You're re-sending the same correction on every single call.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At that point, prompting stops being cheap. Engineering hours are the priciest line item in most LLM pipelines, and it's easy to burn a month nudging a prompt that plateaued weeks ago.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to fine-tune
&lt;/h2&gt;

&lt;p&gt;Fine-tuning updates a model's weights on examples of the behaviour you want until the model does it by default, without being told every time. It's worth trying when these conditions are met:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The task is narrow.&lt;/strong&gt; Fine-tuning sharpens a model on one job, not general capability.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You have real data.&lt;/strong&gt; A few thousand labelled runs, ideally sampled from production traffic rather than synthetic examples.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost or latency matters.&lt;/strong&gt; A smaller, fine-tuned model &lt;a href="https://www.overmindlab.ai/research/when-bigger-isnt-better?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;can outperform a much larger general-purpose one&lt;/a&gt; carrying a bloated prompt, at a fraction of the inference cost.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Deciding whether to fine-tune an open-weight model or keep renting a frontier one? See &lt;a href="https://www.overmindlab.ai/research/open-weights-vs-frontier-apis?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;open-weight vs frontier models&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where RAG fits
&lt;/h2&gt;

&lt;p&gt;Retrieval-augmented generation (RAG) is the third option, and it solves a different problem. Prompting and fine-tuning both shape how the model behaves. RAG changes what the model knows at the moment it answers, by fetching documents and putting them in the context window.&lt;/p&gt;

&lt;p&gt;Use RAG when the answer depends on facts that change, such as product docs, policies or customer records. Use fine-tuning when the model already has the knowledge it needs but gets the format, tone or decision wrong. Fine-tuning is a poor way to teach facts that change next week, because every change means another training run.&lt;/p&gt;

&lt;p&gt;Many production systems use all three. RAG supplies the facts, a short prompt supplies the per-request instructions, and a fine-tuned model supplies the behavior.&lt;/p&gt;

&lt;h2&gt;
  
  
  Can you use prompt engineering and fine-tuning together?
&lt;/h2&gt;

&lt;p&gt;Yes, and most teams should. A fine-tuned model still takes a prompt. The difference is what the prompt has to carry. Before fine-tuning, the system prompt holds every rule and every correction, and you pay to resend it on every call. After fine-tuning, the behavior lives in the weights and the prompt can shrink to the instructions that change per request.&lt;/p&gt;

&lt;p&gt;Keep your eval set fixed across both stages. Score the prompted baseline, train, then score the fine-tuned model on the same set. That is the only fair way to tell whether the training run was worth it. &lt;a href="https://www.overmindlab.ai/research/how-to-train-your-agent?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;How to freeze the eval set before you train&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prompt, RAG or fine-tune? Worked examples
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Problem&lt;/th&gt;
&lt;th&gt;Start with&lt;/th&gt;
&lt;th&gt;Why&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Replies are too long or the wrong tone&lt;/td&gt;
&lt;td&gt;Prompt engineering&lt;/td&gt;
&lt;td&gt;One instruction fixes it, and you can undo it instantly&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The agent needs this week's pricing or policy&lt;/td&gt;
&lt;td&gt;RAG&lt;/td&gt;
&lt;td&gt;The facts change faster than you could retrain&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A classification or extraction step runs on every request&lt;/td&gt;
&lt;td&gt;Fine-tuning&lt;/td&gt;
&lt;td&gt;Narrow task, high volume, and production gives you the examples&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The system prompt keeps growing and each fix breaks something else&lt;/td&gt;
&lt;td&gt;Fine-tuning&lt;/td&gt;
&lt;td&gt;You have hit the prompting ceiling&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A new agent with no traffic yet&lt;/td&gt;
&lt;td&gt;Prompt engineering&lt;/td&gt;
&lt;td&gt;You have no data to fine-tune on&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  How Overmind handles both
&lt;/h2&gt;

&lt;p&gt;On the prompt side, the Overmind &lt;a href="https://www.overmindlab.ai/product/agent-testing?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;Optimiser&lt;/a&gt; has your coding agent rewrite prompts, tool descriptions and logic as real git diffs, replays each candidate over your dataset and scores it with your evaluators. You apply the winning diff yourself. On the fine-tuning side, you &lt;a href="https://www.overmindlab.ai/research/traces-to-training-dataset?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;build a dataset from production traces&lt;/a&gt;, &lt;a href="https://www.overmindlab.ai/product/model-training?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;fine-tune an open-weight base model&lt;/a&gt; with LoRA or full supervised training, and benchmark the result with the same evaluators before it serves traffic. The weights are downloadable.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What is the difference between prompt engineering and fine-tuning?
&lt;/h3&gt;

&lt;p&gt;Prompt engineering changes the input you send to a model and leaves the model untouched. Fine-tuning trains the model on examples of the behavior you want, which changes its weights so it behaves that way without being told. Prompting is instant and reversible. Fine-tuning takes data and GPU time, and you undo it only by retraining.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is fine-tuning better than prompt engineering?
&lt;/h3&gt;

&lt;p&gt;Neither is better in general. Prompting is the right first move for almost every new agent. Fine-tuning wins on narrow, high-volume tasks once prompting has plateaued and you have real examples to train on. A smaller fine-tuned model can then beat a larger prompted one at a fraction of the inference cost.&lt;/p&gt;

&lt;h3&gt;
  
  
  How much data do you need to fine-tune?
&lt;/h3&gt;

&lt;p&gt;A few thousand labeled examples is a sensible starting point, ideally sampled from production traffic rather than written synthetically. Quality matters more than volume. &lt;a href="https://www.overmindlab.ai/research/types-of-fine-tuning?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;Types of fine-tuning&lt;/a&gt; covers which method fits which amount of data.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is prompt tuning?
&lt;/h3&gt;

&lt;p&gt;Prompt tuning is not the same as prompt engineering. It trains a small set of soft prompt vectors that are prepended to the input, while the model's own weights stay frozen. It sits between the two approaches. It needs training data like fine-tuning, but changes far fewer parameters.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is fine-tuning still worth it?
&lt;/h3&gt;

&lt;p&gt;Yes, for narrow tasks at volume. Frontier models keep getting better at everything, but most production agents do a handful of jobs over and over. A small model trained on those jobs can match or beat a much larger one on them, at a fraction of the cost per call, and you own the weights.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does fine-tuning replace the prompt?
&lt;/h3&gt;

&lt;p&gt;No. A fine-tuned model still takes a prompt, but a much shorter one. The rules you used to repeat on every call move into the weights.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Overmind is the model training platform for AI teams. It turns your production traces into specialised models you own. &lt;a href="https://console.overmindlab.ai" rel="noopener noreferrer"&gt;Get started&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>llm</category>
      <category>promptengineering</category>
      <category>finetuning</category>
      <category>ai</category>
    </item>
    <item>
      <title>Open-weight vs frontier models: when to rent, when to own</title>
      <dc:creator>Tyler Edwards</dc:creator>
      <pubDate>Mon, 07 Sep 2026 14:54:01 +0000</pubDate>
      <link>https://dev.to/tyler007/open-weights-llms-vs-frontier-apis-when-to-rent-when-to-own-4bdg</link>
      <guid>https://dev.to/tyler007/open-weights-llms-vs-frontier-apis-when-to-rent-when-to-own-4bdg</guid>
      <description>&lt;p&gt;Most AI products start on a frontier API and stay there until the bill, the latency or legal forces a rethink. Here's the practical case for when a self-hosted open-weights model is the better call, and the cost-crossover logic behind it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.overmindlab.ai/research/open-weights-vs-frontier-apis?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;overmindlab.ai&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Frontier models are the most capable models available, and most are closed and rented through an API. Open-weight models publish their weights, so you can fine-tune them and run them where you choose. Rent while volume is low and the task is broad. Own once volume is high, the task is narrow, or data cannot leave your perimeter.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Developers start building AI products by tokenmaxxing. Calling frontier APIs and paying per token.&lt;/p&gt;

&lt;p&gt;Then the bill shows up. Or the agent feels slow. Or legal asks where the data goes. Suddenly "just use the API" might not be the right strategy.&lt;/p&gt;

&lt;p&gt;Underneath every AI product is one choice. Rent a frontier API, or own a model. Renting means closed weights, so someone else trains it, serves it, and sets the price. Owning means picking the model, post-training it and running &lt;strong&gt;self-hosted&lt;/strong&gt; or third-party inference.&lt;/p&gt;

&lt;p&gt;This piece is a practical guide to open-weight vs frontier models, and when each one wins.&lt;/p&gt;

&lt;h2&gt;
  
  
  The trade-offs
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F98aciwgv3scz59bj3k3v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F98aciwgv3scz59bj3k3v.png" alt="Table comparing closed models and open models across seven rows. Closed models give the best capability out of the box, need no infrastructure, cost more with every token, add a network trip and a shared queue, send prompts outside your network, lock you to the vendor's pricing and retirement schedule, and swap with one line of code. Open models are strong and tunable to your task, run on infrastructure you own or buy, drop hard in cost after the upfront work, serve on dedicated hardware with lower time to first token, stay on your own servers or in your own cloud, leave you your stack and your weights, and need a retrain or a re-quantise to swap." width="800" height="543"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Dimension&lt;/th&gt;
&lt;th&gt;Closed models (frontier API)&lt;/th&gt;
&lt;th&gt;Open models (open-weights)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Capability&lt;/td&gt;
&lt;td&gt;Best capability out of the box&lt;/td&gt;
&lt;td&gt;Strong, and tunable to your task&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Infrastructure&lt;/td&gt;
&lt;td&gt;None needed&lt;/td&gt;
&lt;td&gt;Runs on infrastructure you own or buy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;Costs more with every token&lt;/td&gt;
&lt;td&gt;Drops hard in cost after the upfront work&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Latency&lt;/td&gt;
&lt;td&gt;Adds a network trip and a shared queue&lt;/td&gt;
&lt;td&gt;Serves on dedicated hardware, with lower time to first token&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data&lt;/td&gt;
&lt;td&gt;Sends prompts outside your network&lt;/td&gt;
&lt;td&gt;Stays on your own servers or in your own cloud&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lock-in&lt;/td&gt;
&lt;td&gt;Locks you to the vendor's pricing and retirement schedule&lt;/td&gt;
&lt;td&gt;Leaves you your stack and your weights&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Switching&lt;/td&gt;
&lt;td&gt;Swap with one line of code&lt;/td&gt;
&lt;td&gt;Needs a retrain or a re-quantise to swap&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  LLM inference cost: when open-weight models beat the API
&lt;/h2&gt;

&lt;p&gt;Renting feels cheap at the start, especially when showered with credits.&lt;/p&gt;

&lt;p&gt;Then usage grows. The bill grows and a painful chunk of that spend is frontier prices for work &lt;a href="https://www.overmindlab.ai/research/think-smaller?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;a smaller specialised model could do&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Owning the model changes that. You pay upfront for a &lt;strong&gt;LoRA / QLoRA&lt;/strong&gt; fine-tune, inference setup and some evals. After that, &lt;strong&gt;per-token cost&lt;/strong&gt; is a fraction of the API. Somewhere on the volume axis the lines cross. That &lt;strong&gt;crossover point&lt;/strong&gt; is where a self-hosted open-weights LLM stops being a science project and starts being the cheaper path.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3awdl03912ml1d8zr0v5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3awdl03912ml1d8zr0v5.png" alt="Chart of cost per month against tokens per month. The rent line rises linearly with usage; the own line is near-flat after an upfront build. Past the crossover point, every token is cheaper owned." width="800" height="598"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is not theory. A LoRA fine-tune of a 7B-8B open-weights model on a few thousand trajectories often costs a few hundred dollars.&lt;/p&gt;

&lt;h2&gt;
  
  
  Beyond cost: latency, data residency, and vendor lock-in
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Your agent feels sluggish
&lt;/h3&gt;

&lt;p&gt;A small model you serve has no hop to someone else's cluster and fewer parameters per forward pass. If your AI agent makes dozens of tool calls per task, &lt;strong&gt;200ms vs 2s&lt;/strong&gt; is not a benchmark flex, it is whether the product feels alive. Lower &lt;strong&gt;time to first token (TTFT)&lt;/strong&gt; compounds across the whole agent loop. Users notice the speed. They leave when it isn't there.&lt;/p&gt;

&lt;h3&gt;
  
  
  Your data cannot leave the building
&lt;/h3&gt;

&lt;p&gt;When you rent, prompts and completions leave your perimeter. For fintech, healthcare, or anyone under data-residency, GDPR, or HIPAA rules, that is not a preference. It is a hard no. A &lt;strong&gt;private LLM&lt;/strong&gt;, self-hosted or VPC-hosted open-weights, is not an optimisation. It is how you ship at all.&lt;/p&gt;

&lt;h3&gt;
  
  
  The vendor moved the goalposts
&lt;/h3&gt;

&lt;p&gt;Renting means their roadmap, their rate limits, &lt;a href="https://www.overmindlab.ai/compare/openai-fine-tuning-alternatives?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;their deprecation calendar&lt;/a&gt;. When they sunset the model your agent was tuned around, you re-tune on their schedule. Owning means your inference stack and your weights. Still a dependency, but one &lt;strong&gt;you control&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  How far behind are open-weight models?
&lt;/h2&gt;

&lt;p&gt;Not far, and the gap is measured in months. &lt;a href="https://epoch.ai/data-insights/open-closed-eci-gap" rel="noopener noreferrer"&gt;Epoch AI found&lt;/a&gt; that since January 2026 the most capable open-weight models have trailed the best closed models by about four months on average. For a narrow production task the gap matters less than that headline suggests. You are not asking a model to be good at everything, only at your job, and fine-tuning on your own data closes much of the difference that is left.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to use an open-weight model vs a frontier API
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Own (open-weights, self-hosted) when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;volume is high and climbing&lt;/li&gt;
&lt;li&gt;the task is narrow&lt;/li&gt;
&lt;li&gt;latency is a product problem&lt;/li&gt;
&lt;li&gt;data cannot leave your perimeter&lt;/li&gt;
&lt;li&gt;the model &lt;em&gt;is&lt;/em&gt; your edge&lt;/li&gt;
&lt;li&gt;you know what you are building&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Rent (frontier API) when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;volume is low or spiky&lt;/li&gt;
&lt;li&gt;the task is broad and messy&lt;/li&gt;
&lt;li&gt;latency is fine&lt;/li&gt;
&lt;li&gt;data has no residency limits&lt;/li&gt;
&lt;li&gt;raw frontier capability matters most&lt;/li&gt;
&lt;li&gt;you are still finding out&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Not sure your task is narrow enough yet? Start with &lt;a href="https://www.overmindlab.ai/research/prompt-engineering-vs-fine-tuning?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;prompt engineering vs fine-tuning&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ: open-weight vs frontier models
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What is the difference between open-weight and frontier models?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A frontier model is one of the most capable models available, and most of them are closed. You reach them only through the vendor's API, and the vendor trains, serves and prices them. An open-weight model publishes its trained weights, so you can download it, fine-tune it on your own data and run it on infrastructure you choose.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why are open-weight models cheaper to run?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With an API you pay frontier prices on every token, forever. With an open-weight model you pay upfront for a fine-tune, inference setup and some evals, and after that the per-token cost is a fraction of the API price. Past the crossover point on the volume axis, every token is cheaper owned.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do I need a team of ML engineers to fine-tune an open-weights LLM?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No. LoRA / QLoRA plus a managed inference host (such as &lt;a href="https://www.overmindlab.ai/product/model-training?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;Overmind&lt;/a&gt;, or vLLM on your own GPUs) is within reach of one strong engineer. The hard part is not GPUs. It is good training data and honest evals.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which open-weights base model should I start with?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.overmindlab.ai/models?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;Pick a family that fits your licence and task&lt;/a&gt;, such as Llama, Qwen, Mistral or DeepSeek. Start small. A 7B-8B model, fine-tuned on your task, handles more production work than most teams expect.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What if a better frontier model ships next month?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you rent, you get the upgrade (until the API changes). If you own, you decide whether to re-tune. Here is the part people miss. A small model trained on &lt;em&gt;your&lt;/em&gt; production trajectories often still wins on &lt;strong&gt;your&lt;/strong&gt; cost, latency, and task metrics. That is the scoreboard that pays the bill, not the leaderboard screenshot.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is my data really at risk on a frontier API?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For most consumer SaaS a zero-retention, no-training contract covers you. For regulated data, get an explicit guarantee in writing or run a private, self-hosted LLM. Do not guess.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fine-tuning on production data is the real moat
&lt;/h2&gt;

&lt;p&gt;Owning only works if your model is actually better at &lt;em&gt;your&lt;/em&gt; task than the rented one. Downloading open-weights does not get you there. &lt;a href="https://www.overmindlab.ai/research/traces-to-training-dataset?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;Fine-tuning on your production data does&lt;/a&gt;. Traces, tool-call trajectories, preference pairs, real evals from real usage.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Overmind is the model training platform for AI teams. It turns your production traces into specialised models you own. &lt;a href="https://console.overmindlab.ai" rel="noopener noreferrer"&gt;Get started&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>llm</category>
      <category>opensource</category>
      <category>ai</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>How do you turn traces into a training dataset?</title>
      <dc:creator>Tyler Edwards</dc:creator>
      <pubDate>Fri, 04 Sep 2026 10:17:42 +0000</pubDate>
      <link>https://dev.to/tyler007/how-do-you-turn-traces-into-a-training-dataset-1e9</link>
      <guid>https://dev.to/tyler007/how-do-you-turn-traces-into-a-training-dataset-1e9</guid>
      <description>&lt;p&gt;If you're running agents in production, you already have a training dataset sitting in your traces and most teams never look. Here's the four-stage pipeline for turning that raw telemetry into something you can actually fine-tune on.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.overmindlab.ai/research/traces-to-training-dataset?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;overmindlab.ai&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Every agentic system can create its own training data.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Every agentic AI system you run is quietly writing its own training set, and most teams never use it.&lt;/p&gt;

&lt;p&gt;When an agent runs, it emits a stream of inputs and outputs: the prompt, the tool calls, the reasoning and the final answer. That stream is a trace, and once you standardise how you capture it (the &lt;a href="https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/" rel="noopener noreferrer"&gt;OpenTelemetry GenAI semantic conventions&lt;/a&gt; is the default schema here) you have raw telemetry. A training dataset is narrower: a curated set of runs, scored against a spec, designed for fine-tuning jobs.&lt;/p&gt;

&lt;p&gt;Building a dataset like this is a four-stage pipeline.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F49c960qfuc3y5w2ayu38.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F49c960qfuc3y5w2ayu38.png" alt="Pipeline diagram: 1 Capture every run as a trace, 2 Sample and pick what to label, 3 Label and score against your spec, 4 Build and format for training, then train the model. A dotted feedback loop feeds each week's new runs back into capture." width="799" height="358"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Four stages, then a weekly rebuild.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here's a worked example, using a refund agent, to show what each stage actually involves.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Capture every run as a trace
&lt;/h2&gt;

&lt;p&gt;If your agent is instrumented at all, you already have this part. Every run generates a trace: the goal it was given, every model call, every tool invocation, every observation from the environment, and the eventual outcome. That trace is the raw material everything downstream depends on.&lt;/p&gt;

&lt;p&gt;The industry is converging on a shared vocabulary for this. OpenTelemetry's GenAI working group has been building &lt;a href="https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/" rel="noopener noreferrer"&gt;standard span attributes for LLM calls&lt;/a&gt; since 2024, covering model name, token counts, latency, and tool execution as first-class fields rather than something each team invents from scratch. That matters more than it sounds like it should, because a trace schema you have to redesign every time you switch observability vendors is a trace schema nobody trusts enough to build a dataset on top of.&lt;/p&gt;

&lt;p&gt;This is also where a tool like &lt;a href="https://www.overmindlab.ai/?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;Overmind&lt;/a&gt; tends to sit. Its SDK wraps the model call interface directly, so a single &lt;code&gt;overmind.init()&lt;/code&gt; call captures every LLM invocation across OpenAI, Anthropic, Google Gemini and Agno, logging inputs, outputs, latency, token counts and errors without extra plumbing on your side. The point isn't the SDK itself. It's that capture has to be automatic and total, or the sampling and labelling stages downstream never get the raw material they need.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Sample, because you cannot label everything
&lt;/h2&gt;

&lt;p&gt;You should not try to label every run. Most of what an agent does in a given week is unremarkable, and reviewing all of it teaches a labelling team nothing it didn't already know. The job at this stage is picking which runs are worth a human's attention.&lt;/p&gt;

&lt;p&gt;Three strategies cover most cases:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Sampling strategy&lt;/th&gt;
&lt;th&gt;What it gives you&lt;/th&gt;
&lt;th&gt;When to use it&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Random&lt;/td&gt;
&lt;td&gt;An honest baseline of what the agent does on an ordinary day&lt;/td&gt;
&lt;td&gt;Every cycle, as the control slice you compare everything else against&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Stratified&lt;/td&gt;
&lt;td&gt;Deliberate coverage of cases you already care about, such as a specific refund reason, a customer tier, or a tool that keeps timing out&lt;/td&gt;
&lt;td&gt;When a known segment matters more than the average run&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Failure-weighted&lt;/td&gt;
&lt;td&gt;The most signal per run, because the runs that went wrong carry the most information&lt;/td&gt;
&lt;td&gt;When you have an error flag or a satisfaction score to sort on&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Out of the refund agent's 50,000 weekly runs, a reasonable pull is around 500: a random slice plus every run that hit an error or a low satisfaction score. Whatever strategy you pick, run it on a cadence, weekly to start, rather than treating it as a one-off export you remember to do after something breaks in production.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Label against what good actually looks like
&lt;/h2&gt;

&lt;p&gt;This is the step almost everyone skips, and it's the one that decides whether the dataset is worth anything.&lt;/p&gt;

&lt;p&gt;The instinct is to label by gut: skim a run, decide it feels fine, move to the next one. That works at a hundred runs and falls apart completely at ten thousand, mostly because "feels fine" means something slightly different to every reviewer and drifts over time even for the same reviewer. The alternative is writing down, explicitly, what good looks like, and scoring every sampled run against that spec.&lt;/p&gt;

&lt;p&gt;You're not starting from nothing here. Your agent's own codebase already encodes most of what it's supposed to do: the outputs it should produce, the tools it's allowed to call, the checks it runs before acting, the paths it should and shouldn't take. Read the code first and most of the labelling criteria fall directly out of it.&lt;/p&gt;

&lt;p&gt;For the refund agent, that read produces a checklist along these lines:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Criterion&lt;/th&gt;
&lt;th&gt;What it requires&lt;/th&gt;
&lt;th&gt;Example violation&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Refund within terms&lt;/td&gt;
&lt;td&gt;Amount within the order value and the 30-day window&lt;/td&gt;
&lt;td&gt;Refunded a 90-day-old order&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No invented terms&lt;/td&gt;
&lt;td&gt;Only cites the published refund terms&lt;/td&gt;
&lt;td&gt;Quoted a returns rule that does not exist&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Escalate disputes&lt;/td&gt;
&lt;td&gt;Hands chargebacks off to a human&lt;/td&gt;
&lt;td&gt;Auto-refunded a disputed charge&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Automating this scoring step is where LLM-as-judge techniques have become the practical default, since manually reviewing thousands of runs against a rubric doesn't scale. The approach has real limits worth knowing before you lean on it: research comparing LLM judges against human-labelled relevance data found &lt;a href="https://eugeneyan.com/writing/llm-evaluators/" rel="noopener noreferrer"&gt;strong rank correlation but only fair agreement on exact labels&lt;/a&gt;, and accuracy drops sharply on the more nuanced categories rather than the easy pass/fail calls. A &lt;a href="https://arxiv.org/html/2412.05579v2" rel="noopener noreferrer"&gt;survey of LLM-as-judge methods&lt;/a&gt; notes it emerged specifically because manually assessing helpfulness in training data got too expensive to do at scale by hand, which is exactly the tradeoff a labelling pipeline is making. Overmind runs this scoring as evaluators against a rubric you write. Six evaluator kinds cover it, from a deterministic check to an LLM judge, and every run is scored against a baseline before the result counts.&lt;/p&gt;

&lt;p&gt;The runs that fail a criterion, whatever the customer clicked afterward, are the highest-value training data you have. The labels encode your judgment about what good looks like, and that judgment is the one thing no generic tool can supply for you. Do the first pass yourself for the first month. It's the fastest way to find out what your criteria actually are, as opposed to what you assumed they were when you wrote the checklist.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Build the training set
&lt;/h2&gt;

&lt;p&gt;Labelled runs aren't training examples yet. The last step shapes them for whatever method you're about to run, and the method decides the shape.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Supervised fine-tuning (SFT)&lt;/th&gt;
&lt;th&gt;Reinforcement learning (RL)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Which runs you keep&lt;/td&gt;
&lt;td&gt;Runs that passed every criterion&lt;/td&gt;
&lt;td&gt;Sampled runs with their criterion scores attached&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;What a row holds&lt;/td&gt;
&lt;td&gt;An input-output pair of the behaviour you want repeated&lt;/td&gt;
&lt;td&gt;The run plus the scores, used as a reward signal&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;What the model learns&lt;/td&gt;
&lt;td&gt;To imitate a fixed set of good examples&lt;/td&gt;
&lt;td&gt;To produce runs that score higher&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;What labelling has to produce&lt;/td&gt;
&lt;td&gt;A pass/fail verdict per criterion&lt;/td&gt;
&lt;td&gt;A usable score per criterion, not just pass/fail&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Either way, the format needs to be consistent and machine-readable, with the goal and outcome attached to every run.&lt;/p&gt;

&lt;p&gt;This is also the stage where the case for smaller, specialised models gets concrete. Overmind's own research argues that &lt;a href="https://www.overmindlab.ai/research/think-smaller?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;every model invocation inside an agentic workflow is a natural source of high-quality training data&lt;/a&gt;, precisely because the prompts are narrow and well-defined and the pass/fail signal is clean, unlike open-ended chat data. A team that instruments its model calls, clusters the resulting patterns, and fine-tunes a specialist model on them ends up with a system that improves with every production run instead of one that's frozen at whatever a general-purpose model happened to learn at pretraining time.&lt;/p&gt;

&lt;p&gt;Which method you feed, supervised fine-tuning or RL, is &lt;a href="https://www.overmindlab.ai/research/types-of-fine-tuning?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;its own separate decision&lt;/a&gt;. The dataset from steps 1 through 3 is what feeds either one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this is the hard part
&lt;/h2&gt;

&lt;p&gt;None of these four steps is exotic on its own. What makes the whole thing difficult is that it never stops. Production keeps producing new traces, your criteria keep getting sharper as you find edge cases you didn't anticipate, and the dataset has to be rebuilt against what users actually did this week, not what they did last quarter. The dotted feedback line on that diagram at the top is the entire job.&lt;/p&gt;

&lt;p&gt;It's also exactly the gap most observability tooling leaves open. Datadog's own writeup on GenAI tracing gets at this directly: teams are encouraged to &lt;a href="https://www.datadoghq.com/blog/llm-otel-semantic-convention/" rel="noopener noreferrer"&gt;promote interesting production traces into curated, version-controlled "golden" datasets&lt;/a&gt; and layer evaluation metadata on top, which is essentially this same capture-to-label pipeline described from the observability side. An observability platform hands you the traces and stops there. Stitching production traces to behavioural training data to a deployed, improved model is work that mostly happens in spreadsheets and one-off scripts today, and it's the specific gap platforms like Overmind are built to close, running the optimise-evaluate-accept loop end to end instead of leaving it as a manual export.&lt;/p&gt;

&lt;p&gt;Owning that labelled dataset matters because differentiation in agentic AI increasingly lives in proprietary behavioural data, not in which foundation model you call. Anyone can capture traces. The labelled dataset built from them, tuned to your own definition of correct, is the thing actually worth owning.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Overmind is the model training platform for AI teams. It turns your production traces into specialised models you own. &lt;a href="https://console.overmindlab.ai" rel="noopener noreferrer"&gt;Get started&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>llm</category>
      <category>machinelearning</category>
      <category>ai</category>
      <category>observability</category>
    </item>
    <item>
      <title>What are the different types of fine-tuning?</title>
      <dc:creator>Tyler Edwards</dc:creator>
      <pubDate>Tue, 01 Sep 2026 15:56:43 +0000</pubDate>
      <link>https://dev.to/tyler007/what-are-the-different-types-of-fine-tuning-3mfa</link>
      <guid>https://dev.to/tyler007/what-are-the-different-types-of-fine-tuning-3mfa</guid>
      <description>&lt;p&gt;Picking a fine-tuning method usually comes down to one thing, whether you can write the ideal output yourself or can only judge one when you see it. Here's a practitioner rundown of SFT, RFT with GRPO, distillation and LoRA/QLoRA, and how to choose between them for your own task.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.overmindlab.ai/research/types-of-fine-tuning?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;overmindlab.ai&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Supervised fine-tuning (SFT)
&lt;/h2&gt;

&lt;p&gt;SFT is where most people start, and most people should. You give the model input/output pairs and train it until it reproduces that pattern. It's teaching by worked example: here's the prompt, here's the answer, do more of this.&lt;/p&gt;

&lt;p&gt;You'll typically need a few thousand examples for a narrow task. The catch is that SFT only works if you know what "good" looks like.&lt;/p&gt;

&lt;h2&gt;
  
  
  LoRA and QLoRA
&lt;/h2&gt;

&lt;p&gt;LoRA doesn't compete with SFT or RFT.&lt;/p&gt;

&lt;p&gt;Full fine-tuning updates every weight in the model. That's slow, and it eats memory. &lt;a href="https://arxiv.org/abs/2106.09685" rel="noopener noreferrer"&gt;LoRA&lt;/a&gt; freezes the base model and trains a small set of adapter weights on top, which gets you most of the benefit for a fraction of the compute. &lt;a href="https://arxiv.org/abs/2305.14314" rel="noopener noreferrer"&gt;QLoRA&lt;/a&gt; pushes this further by quantising the frozen base model down to 4-bit before training the adapter. That's the reason a 7B model now fits on one consumer GPU instead of a rack of them.&lt;/p&gt;

&lt;p&gt;Tools worth knowing:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://unsloth.ai/" rel="noopener noreferrer"&gt;Unsloth&lt;/a&gt; is open source and runs LoRA/QLoRA 2 to 5x faster with up to 80% less VRAM, using custom kernels and 4-bit quantisation. It's become the default starting point for solo builders.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://thinkingmachines.ai/tinker/" rel="noopener noreferrer"&gt;Tinker&lt;/a&gt;, from Thinking Machines Lab, is a managed LoRA API. It handles GPU scheduling and checkpointing but still lets you control the actual training algorithm. It &lt;a href="https://thinkingmachines.ai/news/announcing-tinker/" rel="noopener noreferrer"&gt;launched in October 2025&lt;/a&gt; and supports both SFT and RFT.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.overmindlab.ai/?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;Overmind&lt;/a&gt; is a model training platform. It runs LoRA fine-tuning on your agent traces.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reinforcement fine-tuning (RFT)
&lt;/h2&gt;

&lt;p&gt;This used to just be called "RL," or RLHF if you wanted to impress someone.&lt;/p&gt;

&lt;p&gt;SFT needs you to write the correct answer. RFT only needs you to score it. You define a reward, hand it the model's output, and the model learns to produce completions that score higher across many attempts.&lt;/p&gt;

&lt;p&gt;Reach for this when good is easier to recognise than to demonstrate. I can't write the perfect customer support reply off the top of my head, but I can tell you whether one resolved the ticket, stayed on brand, and didn't promise something we don't offer. RFT is also the natural fit for agents: tool calls, multi-step retrieval, anything where success depends on the whole trajectory and not any single message.&lt;/p&gt;

&lt;p&gt;GRPO (Group Relative Policy Optimization) is the algorithm doing most of the RFT work right now. It came out of &lt;a href="https://arxiv.org/abs/2402.03300" rel="noopener noreferrer"&gt;DeepSeekMath&lt;/a&gt; and got famous when it trained &lt;a href="https://arxiv.org/abs/2501.12948" rel="noopener noreferrer"&gt;DeepSeek-R1&lt;/a&gt;. The trick is sampling a group of responses to the same prompt, then scoring each one against the group average instead of some absolute scale. That kills the need for a separate critic model, which is what made older methods like PPO so expensive to run. &lt;a href="https://arxiv.org/abs/2503.14476" rel="noopener noreferrer"&gt;DAPO&lt;/a&gt; and &lt;a href="https://arxiv.org/abs/2503.20783" rel="noopener noreferrer"&gt;Dr.GRPO&lt;/a&gt; are newer variants that patch specific instabilities GRPO runs into on long chain-of-thought outputs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Distillation
&lt;/h2&gt;

&lt;p&gt;Distillation is copying a big model's behaviour into a small one. Run your inputs through the big model, collect what it says, then train a smaller model to say the same things. You lose a little quality and gain a lot of speed, plus a much smaller bill.&lt;/p&gt;

&lt;p&gt;This is helpful when a frontier model already nails your task but is too slow or too expensive to run at real volume. It's also a big part of why small language models have taken off this past year. Teams distill a specialist model instead of shipping the 400B-parameter original into production.&lt;/p&gt;

&lt;h2&gt;
  
  
  Picking one
&lt;/h2&gt;

&lt;p&gt;Once you know your task, the decision is mostly mechanical.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;What you must supply&lt;/th&gt;
&lt;th&gt;When to pick it&lt;/th&gt;
&lt;th&gt;Data volume&lt;/th&gt;
&lt;th&gt;Relative cost&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Supervised fine-tuning (SFT)&lt;/td&gt;
&lt;td&gt;Input/output pairs you already know are right&lt;/td&gt;
&lt;td&gt;You can write the ideal output yourself&lt;/td&gt;
&lt;td&gt;A few thousand examples for a narrow task&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reinforcement fine-tuning (RFT, usually GRPO)&lt;/td&gt;
&lt;td&gt;A reward function or judge that can score an attempt&lt;/td&gt;
&lt;td&gt;You can recognise a good output but can't write one, or success spans a whole agent trajectory&lt;/td&gt;
&lt;td&gt;Prompts plus a scorer, no written answers needed&lt;/td&gt;
&lt;td&gt;Highest, you sample many completions per prompt&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Distillation&lt;/td&gt;
&lt;td&gt;A teacher model that already does the task, plus your inputs&lt;/td&gt;
&lt;td&gt;A frontier model nails the task but is too slow or too expensive at volume&lt;/td&gt;
&lt;td&gt;As many teacher outputs as you can afford to generate&lt;/td&gt;
&lt;td&gt;Medium, teacher inference then a cheap SFT run&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LoRA / QLoRA&lt;/td&gt;
&lt;td&gt;Whichever method above, plus one GPU&lt;/td&gt;
&lt;td&gt;Almost always, unless you specifically need full-weight training&lt;/td&gt;
&lt;td&gt;Same as the method it wraps&lt;/td&gt;
&lt;td&gt;Lowest, a 7B run over a few thousand examples often costs a few hundred dollars&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftle1wi4rk12h2dqf424r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftle1wi4rk12h2dqf424r.png" alt="Decision tree for choosing a fine-tuning method. If a big model already does the job but is too slow or costly, use distillation. Otherwise, if you can write the ideal output, use supervised fine-tuning; if you can only judge it, use reinforcement fine-tuning with GRPO. Every path then runs through LoRA or QLoRA." width="800" height="681"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The same tree in words.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Your situation&lt;/th&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A big model already does the job, but it's too slow or too costly&lt;/td&gt;
&lt;td&gt;Distillation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;You can write the ideal output&lt;/td&gt;
&lt;td&gt;Supervised fine-tuning&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;You can only judge the output, not write it&lt;/td&gt;
&lt;td&gt;Reinforcement fine-tuning with GRPO&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Any of the three, on one GPU&lt;/td&gt;
&lt;td&gt;Run it through LoRA or QLoRA&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Data is still the hard part
&lt;/h2&gt;

&lt;p&gt;Every method above needs the same raw material underneath. SFT needs labelled pairs. RFT needs a reward or a judge that can rank attempts. Distillation needs a teacher and your inputs. Pick the wrong method and you lose some efficiency. Show up with bad data and none of them work. No algorithm fixes that for you.&lt;/p&gt;

&lt;p&gt;Fine-tuning has gotten cheap. A LoRA run on a 7B model over a few thousand examples often costs a few hundred dollars. But cheap training doesn't fix bad data, and none of these tools hand you a set of real runs labelled, or ranked, against your own definition of good. That's a separate problem, and it's the one that eats the time. We cover it in &lt;a href="https://www.overmindlab.ai/research/traces-to-training-dataset?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;how do you turn traces into a training dataset&lt;/a&gt; and &lt;a href="https://www.overmindlab.ai/research/how-to-train-your-agent?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=research-repost" rel="noopener noreferrer"&gt;how to train your agent&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Is LoRA a replacement for fine-tuning?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No. LoRA is a way to run fine-tuning or RFT cheaper, not a different goal. You still pick SFT or RFT first, then decide whether to run it through LoRA.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When should I use reinforcement fine-tuning instead of SFT?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When you can judge a good output but can't write one yourself, or you're training an agent where success depends on a whole multi-step trajectory rather than one response.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is distillation cheaper than fine-tuning a small model from scratch?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Usually, if a large model already performs well on your task. You're paying for inference calls to the teacher model instead of building the target behaviour from labelled data by hand.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is GRPO and why does everyone use it now?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Group Relative Policy Optimization scores a batch of responses against each other instead of an absolute baseline, which removes the need for a separate critic model. It's cheaper to run than older RL methods like PPO, which is most of why it's become the default for RFT.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Overmind is the model training platform for AI teams. It turns your production traces into specialised models you own. &lt;a href="https://console.overmindlab.ai" rel="noopener noreferrer"&gt;Get started&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>llm</category>
      <category>finetuning</category>
      <category>machinelearning</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
