<?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: galian</title>
    <description>The latest articles on DEV Community by galian (@galian).</description>
    <link>https://dev.to/galian</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3827330%2F5a53ab61-2fc1-4072-a44e-873913dd8cd7.png</url>
      <title>DEV Community: galian</title>
      <link>https://dev.to/galian</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/galian"/>
    <language>en</language>
    <item>
      <title>We just launched our AI course catalog in English — 20 hands-on courses with an AI professor in every lesson</title>
      <dc:creator>galian</dc:creator>
      <pubDate>Fri, 17 Jul 2026 07:21:16 +0000</pubDate>
      <link>https://dev.to/galian/we-just-launched-our-ai-course-catalog-in-english-20-hands-on-courses-with-an-ai-professor-in-46ip</link>
      <guid>https://dev.to/galian/we-just-launched-our-ai-course-catalog-in-english-20-hands-on-courses-with-an-ai-professor-in-46ip</guid>
      <description>&lt;p&gt;I'm the founder of &lt;a href="https://cursuri-ai.ro/en" rel="noopener noreferrer"&gt;Cursuri AI&lt;/a&gt;, an AI e-learning platform for professionals. "Cursuri" is simply Romanian for "courses" — the platform started in Romania, where it now runs a catalog of 50 AI courses in Romanian, from prompt engineering fundamentals to building production AI agents.&lt;/p&gt;

&lt;p&gt;This week we shipped the thing people kept asking for: &lt;strong&gt;the platform is now available in English&lt;/strong&gt;, with an international catalog of 20 courses built for people who want to actually &lt;em&gt;use&lt;/em&gt; AI at work — not just read about it.&lt;/p&gt;

&lt;p&gt;This post is the announcement, but I also want to be concrete about what the platform does and what's in the catalog, so you can decide in two minutes whether it's for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  The idea: learning AI should feel like working with AI
&lt;/h2&gt;

&lt;p&gt;Most online courses are passive: you watch or read, you nod along, and a week later you remember 10% of it. That model is especially broken for AI, where the whole point is &lt;em&gt;interaction&lt;/em&gt; — prompting, iterating, getting feedback, correcting course.&lt;/p&gt;

&lt;p&gt;So we built the platform around active learning instead:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;An AI professor in every lesson.&lt;/strong&gt; Not a generic chatbot bolted onto the side — an assistant that knows exactly which lesson you're in and answers questions in that context. You can type or just talk to it: it works in &lt;strong&gt;text and voice&lt;/strong&gt;. Stuck on why your RAG retrieval returns garbage, or what a "system prompt" actually is? Ask mid-lesson and get a precise answer. There's a full overview of how it works on the &lt;a href="https://cursuri-ai.ro/en/ai-professor" rel="noopener noreferrer"&gt;AI professor page&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interactive AI quizzes.&lt;/strong&gt; Questions adapt to your level, and every answer comes with a detailed explanation — including &lt;em&gt;why the wrong options are wrong&lt;/em&gt;, which is where most of the learning actually happens.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hands-on exercises on the platform.&lt;/strong&gt; Coding challenges for the engineering track, realistic work scenarios for the business track. You apply things as you learn them, not "someday later."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automatic AI summaries.&lt;/strong&gt; Key points extracted from every lesson, so reviewing before an interview or a meeting takes minutes, not hours.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A personal dashboard.&lt;/strong&gt; Progress, scores, and insights, so you can see whether you're actually getting better or just clicking "next."&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And because AI moves absurdly fast, &lt;strong&gt;content is kept up to date&lt;/strong&gt; — courses get refreshed as the tools and models change, and new courses are added to the bundles at no extra cost.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's in the English catalog
&lt;/h2&gt;

&lt;p&gt;The 20 launch courses are split into two tracks, because "learning AI" means very different things for a backend engineer and a marketing manager.&lt;/p&gt;

&lt;h3&gt;
  
  
  IT &amp;amp; Engineering track (10 courses)
&lt;/h3&gt;

&lt;p&gt;This is the track I'm personally most excited about, because it covers the stack of skills that 2026-era AI engineering actually demands:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Introduction to AI Engineering&lt;/strong&gt; — the on-ramp if you're a developer new to the field&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Complete Prompt Engineering Masterclass&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;RAG: Retrieval-Augmented Generation in Practice&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Advanced LLM Integration in Production Applications&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AI Agents: Architecting and Automating Autonomous Systems&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context Engineering and Memory for AI Agents&lt;/strong&gt; — beyond prompting: managing what your agent knows and remembers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://cursuri-ai.ro/en/courses/claude-code-mastery-agentic-coding" rel="noopener noreferrer"&gt;Claude Code Mastery: Agentic Coding from the Terminal&lt;/a&gt;&lt;/strong&gt; — multi-file work, git workflows, CI, MCP&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;MCP (Model Context Protocol): Building Servers and Integrations&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cursor as a Pro: AI-Native IDE, Composer and Multi-Agent workflows&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vibe Coding: From Prompt to Application&lt;/strong&gt; with Lovable, v0, Bolt and Replit Agent&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you've been meaning to move from "I use ChatGPT sometimes" to "I ship AI features and agentic workflows," this track is a structured path through exactly that.&lt;/p&gt;

&lt;h3&gt;
  
  
  Business &amp;amp; Professionals track (10 courses)
&lt;/h3&gt;

&lt;p&gt;No code required — built for managers, marketers, founders, analysts, and office professionals:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;AI for Business Leaders&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Manager in the AI Era: Leading Your Team Through the AI Transformation&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AI for Entrepreneurs and Startups: The Complete Guide&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AI for Digital Marketing&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AI for Content Creation and Copywriting&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AI for Sales and CRM&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SEO and AEO/GEO in the AI Era&lt;/strong&gt; — optimizing for Google, AI Overviews and generative engines&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Microsoft 365 Copilot for Office Work: Role-Based Productivity&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No-Code Data Analysis with AI&lt;/strong&gt; — ChatGPT, Excel and SQL for non-programmers&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AI Image Generation: The Complete Guide from Prompt to Publishing&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The full list with detailed curricula is on the &lt;a href="https://cursuri-ai.ro/en/courses" rel="noopener noreferrer"&gt;course catalog&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pricing — simple and honest
&lt;/h2&gt;

&lt;p&gt;We deliberately kept it simple, and every plan is &lt;strong&gt;billed monthly with cancel-anytime&lt;/strong&gt;:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Plan&lt;/th&gt;
&lt;th&gt;What you get&lt;/th&gt;
&lt;th&gt;Price&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Single course&lt;/td&gt;
&lt;td&gt;Any one course, full access + AI professor&lt;/td&gt;
&lt;td&gt;€49/month + VAT&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Business&lt;/td&gt;
&lt;td&gt;All 10 Business &amp;amp; Professionals courses&lt;/td&gt;
&lt;td&gt;€199/month + VAT&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IT Pro&lt;/td&gt;
&lt;td&gt;All 10 IT &amp;amp; Engineering courses&lt;/td&gt;
&lt;td&gt;€399/month + VAT&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;All Access&lt;/td&gt;
&lt;td&gt;The entire international catalog, both tracks&lt;/td&gt;
&lt;td&gt;€499/month + VAT&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two things worth calling out:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;You're not forced into a bundle.&lt;/strong&gt; If you only need the RAG course or the Copilot course, subscribe to just that one for €49/month and cancel when you're done.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;New courses are included.&lt;/strong&gt; Bundle subscribers get every new course we release, as it's released.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Full details and a plan comparison are on the &lt;a href="https://cursuri-ai.ro/en/pricing" rel="noopener noreferrer"&gt;pricing page&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who this is for (and who it isn't for)
&lt;/h2&gt;

&lt;p&gt;It's for you if you're a professional who wants a structured, hands-on path to using AI in your actual job — whether that job is writing code, running a team, or growing a business. It works well for companies too: there's a dedicated track structure and team offering for organizations that want to upskill whole departments.&lt;/p&gt;

&lt;p&gt;It's probably &lt;em&gt;not&lt;/em&gt; for you if you want academic ML theory — we don't teach you to derive backpropagation. The focus is applied: tools, workflows, and skills you use the same week you learn them.&lt;/p&gt;

&lt;h2&gt;
  
  
  The ask
&lt;/h2&gt;

&lt;p&gt;If this sounds useful, take a look at &lt;a href="https://cursuri-ai.ro/en" rel="noopener noreferrer"&gt;cursuri-ai.ro/en&lt;/a&gt; — and if you check out a course, I'd genuinely love feedback. We're a team from Romania, competing on quality and depth of content, so every piece of honest criticism from this community makes the platform better.&lt;/p&gt;

&lt;p&gt;And if you have questions about the catalog, the AI professor, or where we're taking the platform next — ask away in the comments. I'll answer everything.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Fine-Tuning vs RAG vs Prompting: How to Actually Decide in 2026</title>
      <dc:creator>galian</dc:creator>
      <pubDate>Wed, 15 Jul 2026 11:49:01 +0000</pubDate>
      <link>https://dev.to/cursuri-ai/fine-tuning-vs-rag-vs-prompting-how-to-actually-decide-in-2026-11gj</link>
      <guid>https://dev.to/cursuri-ai/fine-tuning-vs-rag-vs-prompting-how-to-actually-decide-in-2026-11gj</guid>
      <description>&lt;p&gt;There's a predictable arc to most LLM projects. Something doesn't work, someone says "we should fine-tune it," a month disappears into dataset wrangling and GPU bills, and the model comes back... about as wrong as before — because the actual problem was that it never had the right facts in front of it. Fine-tuning was never going to fix that.&lt;/p&gt;

&lt;p&gt;The three techniques — &lt;strong&gt;prompting&lt;/strong&gt;, &lt;strong&gt;retrieval-augmented generation (RAG)&lt;/strong&gt;, and &lt;strong&gt;fine-tuning&lt;/strong&gt; — are not a ladder you climb from cheap to fancy. They solve &lt;em&gt;different problems&lt;/em&gt;, and choosing the wrong one is expensive in exactly the way that's hard to notice: it looks like progress while it burns weeks.&lt;/p&gt;

&lt;p&gt;This is a decision framework. Not "here's what each one is" — you can get that anywhere — but the concrete questions that tell you which one your problem actually needs, and the failure signatures that mean you picked wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  The one distinction that resolves most arguments
&lt;/h2&gt;

&lt;p&gt;Before any framework, internalize this split, because it settles 80% of the "should we fine-tune?" debates on its own:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;RAG changes what the model &lt;em&gt;knows&lt;/em&gt;.&lt;/strong&gt; It injects facts into the context at inference time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fine-tuning changes how the model &lt;em&gt;behaves&lt;/em&gt;.&lt;/strong&gt; It adjusts the weights to shift style, format, structure, and task-specific skill.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prompting changes what the model is &lt;em&gt;told to do&lt;/em&gt; right now&lt;/strong&gt;, using the knowledge and behavior it already has.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the first question is never "which technique is best?" It's "&lt;strong&gt;is my problem a knowledge gap or a behavior gap?&lt;/strong&gt;"&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The model gives outdated, made-up, or "I don't have access to that" answers about &lt;em&gt;your&lt;/em&gt; data → &lt;strong&gt;knowledge gap → RAG.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;The model knows the facts but won't reliably produce the &lt;em&gt;format, tone, or task structure&lt;/em&gt; you need → &lt;strong&gt;behavior gap → fine-tuning (maybe).&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;You haven't seriously tried telling it clearly what to do yet → &lt;strong&gt;prompting, first, always.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Get this wrong and no amount of engineering saves you. Fine-tuning a model to "know your docs" is the classic error: you can bake a &lt;em&gt;few&lt;/em&gt; facts into weights, but they go stale the moment your docs change, you can't cite sources, and you've spent training compute to build a worse version of a lookup. Knowledge that changes belongs in retrieval, not in weights.&lt;/p&gt;

&lt;h2&gt;
  
  
  Always start with prompting (yes, even now)
&lt;/h2&gt;

&lt;p&gt;Prompting is not the beginner tier you graduate from. In 2026, with frontier models, a well-constructed prompt plus a few good examples solves a startling share of problems that teams &lt;em&gt;assume&lt;/em&gt; need training. It's the fastest, cheapest, most inspectable option, and it should be your baseline before you're allowed to say the word "fine-tune."&lt;/p&gt;

&lt;p&gt;Reach for prompting when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You're still discovering what "good output" even looks like. Prompts are editable in seconds; datasets are not.&lt;/li&gt;
&lt;li&gt;The task is reasoning, transformation, or generation the model already broadly knows how to do.&lt;/li&gt;
&lt;li&gt;You need to ship this week.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The techniques that make prompting punch above its weight are unglamorous but real: precise role and task framing, &lt;strong&gt;few-shot examples&lt;/strong&gt; that demonstrate the exact output shape, chain-of-thought for multi-step reasoning, and rigid output contracts (structured/JSON) so downstream code can trust the result. Most "the model can't do this" conclusions are actually "we asked badly" conclusions. Squeezing the ceiling out of prompting before spending on anything heavier is a discipline in itself — it's the whole point of a &lt;a href="https://cursuri-ai.ro/courses/prompt-engineering-masterclass" rel="noopener noreferrer"&gt;prompt engineering masterclass&lt;/a&gt;, and the ROI of getting it right first is enormous because everything downstream inherits a better baseline.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The prompting ceiling — how you know you've hit it:&lt;/strong&gt; you've iterated seriously, added good examples, and the model &lt;em&gt;still&lt;/em&gt; fails — and the failure is either (a) it doesn't know facts it couldn't possibly know, or (b) it can't hold a consistent behavior across inputs no matter how you phrase the instruction. (a) points to RAG. (b) &lt;em&gt;might&lt;/em&gt; point to fine-tuning. Not before.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reach for RAG when the problem is knowledge
&lt;/h2&gt;

&lt;p&gt;RAG is the answer whenever the model needs to work with information it wasn't trained on: your internal documentation, a product catalog, last week's tickets, a knowledge base that updates daily, anything private or fresh.&lt;/p&gt;

&lt;p&gt;Choose RAG when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Answers must be &lt;strong&gt;grounded in a specific corpus&lt;/strong&gt; and you need to &lt;strong&gt;cite sources&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The knowledge &lt;strong&gt;changes&lt;/strong&gt; — pricing, policies, docs, inventory. You update an index, not a model.&lt;/li&gt;
&lt;li&gt;Hallucination on facts is unacceptable and you need an audit trail of &lt;em&gt;where&lt;/em&gt; an answer came from.&lt;/li&gt;
&lt;li&gt;The knowledge base is large, or partly access-controlled per user.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The reason RAG beats fine-tuning for knowledge isn't subtle: updating a document store is trivial and instant; updating weights is a training run. RAG gives you freshness, provenance, and per-user access control for free — none of which fine-tuning can offer. When your facts have a shelf life, retrieval is the &lt;em&gt;only&lt;/em&gt; correct architecture, and building it well (chunking, hybrid search, re-ranking) is where the real engineering lives — the substance of a dedicated &lt;a href="https://cursuri-ai.ro/courses/rag-retrieval-augmented-generation" rel="noopener noreferrer"&gt;course on RAG and retrieval-augmented generation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;RAG's own ceiling:&lt;/strong&gt; retrieval fixes &lt;em&gt;what the model knows&lt;/em&gt;, not &lt;em&gt;how it behaves&lt;/em&gt;. If your RAG answers are factually correct but come out in the wrong format, wrong tone, or don't follow your house style no matter how you prompt — that residual behavior gap is exactly where fine-tuning finally earns its place, &lt;em&gt;on top of&lt;/em&gt; RAG, not instead of it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fine-tune when the problem is behavior — and only then
&lt;/h2&gt;

&lt;p&gt;Fine-tuning is the right tool, but for a narrower set of problems than its reputation suggests. It shines at teaching &lt;em&gt;consistent behavior&lt;/em&gt; that's hard to specify in a prompt: a very specific output structure, a domain's tone and terminology, a classification or extraction task where you have lots of labeled examples, or a skill the base model does clumsily.&lt;/p&gt;

&lt;p&gt;Legitimately reach for fine-tuning when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You need &lt;strong&gt;consistent style, format, or structure&lt;/strong&gt; at a level prompting can't hold across the full input distribution.&lt;/li&gt;
&lt;li&gt;You have a &lt;strong&gt;narrow, high-volume, well-defined task&lt;/strong&gt; (classification, extraction, a specific transformation) and enough quality labeled data.&lt;/li&gt;
&lt;li&gt;You want to &lt;strong&gt;bake in a behavior&lt;/strong&gt; so you can drop it from the prompt — shorter prompts, lower per-call cost, faster responses at scale.&lt;/li&gt;
&lt;li&gt;Latency or cost at scale matters and a smaller fine-tuned model can match a bigger prompted one.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Two things make modern fine-tuning far less scary than its reputation. First, &lt;strong&gt;you almost never do full fine-tuning&lt;/strong&gt; — parameter-efficient methods like &lt;strong&gt;LoRA/QLoRA&lt;/strong&gt; train a tiny set of adapter weights, cutting the compute and memory cost by orders of magnitude while getting most of the benefit. Second, the bottleneck is &lt;strong&gt;data quality, not model choice&lt;/strong&gt;: a few hundred to a few thousand &lt;em&gt;clean, consistent, representative&lt;/em&gt; examples beat a huge noisy pile every time. The hard part of fine-tuning was never running the training job — it's building the dataset, choosing PEFT trade-offs, and evaluating the result without fooling yourself, which is precisely the ground a &lt;a href="https://cursuri-ai.ro/courses/fine-tuning-modele-ai" rel="noopener noreferrer"&gt;fine-tuning course&lt;/a&gt; has to cover to be worth anything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When fine-tuning is the &lt;em&gt;wrong&lt;/em&gt; answer — the red flags:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"We'll fine-tune it on our docs so it knows them." → No. That's RAG. Fine-tuned facts go stale and can't be cited.&lt;/li&gt;
&lt;li&gt;"We haven't really tried prompting." → Do that first; you may not need to train at all.&lt;/li&gt;
&lt;li&gt;"The requirements change weekly." → Fine-tuning bakes behavior in; if the target moves, you're re-training constantly. Keep it in the prompt until it stabilizes.&lt;/li&gt;
&lt;li&gt;"We have 40 examples." → Usually not enough for reliable behavior change; strong prompting with those 40 as few-shot examples will likely beat it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The combinations are the real answer
&lt;/h2&gt;

&lt;p&gt;Framing these as rivals is the beginner mistake. In production, the strongest systems &lt;strong&gt;combine&lt;/strong&gt; them, because they operate on different axes — knowledge, behavior, and instruction — and stack cleanly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;RAG + prompting&lt;/strong&gt; is the workhorse for most knowledge-grounded assistants: retrieve the right context, then a well-engineered prompt instructs the model to answer &lt;em&gt;only&lt;/em&gt; from it and cite sources. No training required.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fine-tuning + RAG&lt;/strong&gt; is the high end: fine-tune for the domain's &lt;em&gt;behavior&lt;/em&gt; (tone, format, task skill), and use RAG for the &lt;em&gt;facts&lt;/em&gt;. The model behaves exactly right &lt;em&gt;and&lt;/em&gt; stays current — behavior in the weights, knowledge in the index.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fine-tuning + prompting&lt;/strong&gt; collapses a long, brittle instruction into learned behavior, so your prompts get short and your inference gets cheaper.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Orchestrating these — deciding which layer owns which responsibility, and routing a request through retrieval, tools, and the model in the right order — is its own engineering discipline, and it's the core of a &lt;a href="https://cursuri-ai.ro/courses/advanced-llm-integration" rel="noopener noreferrer"&gt;course on advanced LLM integration&lt;/a&gt;. The mental model to keep: &lt;strong&gt;knowledge → retrieval, behavior → weights, instruction → prompt.&lt;/strong&gt; Put each requirement on the axis it actually lives on.&lt;/p&gt;

&lt;h2&gt;
  
  
  The decision, in one pass
&lt;/h2&gt;

&lt;p&gt;Run your problem through this, in order. Stop at the first that fits:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Have you genuinely exhausted prompting&lt;/strong&gt; — clear instructions, good few-shot examples, structured output? If not → &lt;strong&gt;prompt.&lt;/strong&gt; (This is where most projects should still be.)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Is the failure a knowledge gap&lt;/strong&gt; — missing, stale, or private facts; needs citations? → &lt;strong&gt;RAG.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Is the failure a behavior gap&lt;/strong&gt; — format/tone/task consistency the prompt can't hold, &lt;em&gt;and&lt;/em&gt; you have quality labeled data &lt;em&gt;and&lt;/em&gt; the target is stable? → &lt;strong&gt;fine-tune&lt;/strong&gt; (LoRA first).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Is it both?&lt;/strong&gt; → &lt;strong&gt;RAG for the facts, fine-tuning for the behavior.&lt;/strong&gt; In that order.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And underneath all of it: &lt;strong&gt;you cannot make this decision without evaluation.&lt;/strong&gt; "It seems better" is not data. Before you choose, build a small eval set — representative inputs with known-good outputs — so you can measure whether prompting already clears the bar, whether RAG actually retrieves the right context, and whether a fine-tune moved the metric or just moved the failures around. Teams that skip this pick techniques by vibes and discover the mistake in production; teams that treat &lt;a href="https://cursuri-ai.ro/courses/ai-evals-llm-productie" rel="noopener noreferrer"&gt;evals as first-class&lt;/a&gt; make the cheap correct choice on purpose. The eval set is what turns this framework from an opinion into a decision.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The reason so many LLM projects stall isn't a shortage of technique — it's reaching for the wrong one and mistaking motion for progress. Fine-tuning a model to "learn facts," RAG-ing a problem that was really a bad prompt, or grinding on prompts when the model fundamentally lacks the data: each fails in a way that looks like effort.&lt;/p&gt;

&lt;p&gt;Anchor on the split and you'll rarely go wrong. &lt;strong&gt;Knowledge that changes → RAG. Behavior you can't prompt into place → fine-tuning. Everything else → prompt, and prompt well.&lt;/strong&gt; Start cheap, measure honestly, and add complexity only when an eval — not a hunch — tells you the current layer has topped out. The best architecture isn't the most sophisticated one; it's the one that puts each requirement on the axis where it actually belongs.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Sources &amp;amp; further reading:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lewis et al. — &lt;a href="https://arxiv.org/abs/2005.11401" rel="noopener noreferrer"&gt;Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Hu et al. — &lt;a href="https://arxiv.org/abs/2106.09685" rel="noopener noreferrer"&gt;LoRA: Low-Rank Adaptation of Large Language Models&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Dettmers et al. — &lt;a href="https://arxiv.org/abs/2305.14314" rel="noopener noreferrer"&gt;QLoRA: Efficient Finetuning of Quantized LLMs&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;This article is educational content. Models, tooling, and cost trade-offs evolve quickly; validate any approach against your own data and current provider documentation before committing to it in production.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>monitoring</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Vector Embeddings Explained: Build Semantic Search in Python</title>
      <dc:creator>galian</dc:creator>
      <pubDate>Mon, 13 Jul 2026 11:25:24 +0000</pubDate>
      <link>https://dev.to/cursuri-ai/vector-embeddings-explained-build-semantic-search-in-python-2og1</link>
      <guid>https://dev.to/cursuri-ai/vector-embeddings-explained-build-semantic-search-in-python-2og1</guid>
      <description>&lt;p&gt;Search for "reset my password" in a keyword-based system and a help article titled "How to recover your account credentials" won't match — not one word overlaps. Yet any human knows they mean the same thing. Closing that gap between &lt;em&gt;characters&lt;/em&gt; and &lt;em&gt;meaning&lt;/em&gt; is what &lt;strong&gt;vector embeddings&lt;/strong&gt; do, and they're the quiet engine behind semantic search, RAG, recommendation systems, and most of the "AI that understands you" experiences shipped since 2023.&lt;/p&gt;

&lt;p&gt;This is a practical guide. We'll cover what an embedding actually is, why cosine similarity is the operation you'll use constantly, and then build a real, working semantic search engine in Python — first with pure NumPy so you see the mechanics, then with the tools you'd actually reach for in production. By the end you'll have code that runs and a mental model that transfers to every embedding-powered feature you build next.&lt;/p&gt;

&lt;h2&gt;
  
  
  What an embedding actually is
&lt;/h2&gt;

&lt;p&gt;An &lt;strong&gt;embedding&lt;/strong&gt; is a list of numbers — a vector — that represents a piece of content as a point in high-dimensional space. An embedding model (a neural network trained on enormous text corpora) reads your text and outputs, say, 384 or 1,536 floating-point numbers. The magic isn't the numbers themselves; it's the property the training instills: &lt;strong&gt;texts with similar meaning land close together in that space, and unrelated texts land far apart.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That's the whole idea. "How do I reset my password?" and "I forgot my login credentials" produce vectors that sit near each other. "What's the weather in Cluj?" produces a vector off in a completely different region. The model has effectively turned &lt;em&gt;meaning&lt;/em&gt; into &lt;em&gt;geometry&lt;/em&gt; — and geometry is something a computer can measure with plain arithmetic.&lt;/p&gt;

&lt;p&gt;A few properties worth internalizing before we write code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Dimensionality is fixed per model.&lt;/strong&gt; A given model always outputs the same length (e.g. 384 for &lt;code&gt;all-MiniLM-L6-v2&lt;/code&gt;, 1,536 for OpenAI's &lt;code&gt;text-embedding-3-small&lt;/code&gt;). You can't mix vectors from different models — they live in different spaces.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The individual numbers are not interpretable.&lt;/strong&gt; Dimension 200 doesn't mean "formality" or "topic." Meaning is distributed across all dimensions at once. Don't try to read them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Distance is the entire point.&lt;/strong&gt; You almost never care about a vector's absolute position — only how close it is to &lt;em&gt;other&lt;/em&gt; vectors.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Cosine similarity: the one operation you'll use everywhere
&lt;/h2&gt;

&lt;p&gt;To ask "how similar are these two texts?", you compare their vectors. The near-universal choice for text embeddings is &lt;strong&gt;cosine similarity&lt;/strong&gt;: it measures the angle between two vectors, ignoring their magnitude.&lt;/p&gt;

&lt;p&gt;Why the angle and not, say, straight-line (Euclidean) distance? Because for text embeddings, &lt;em&gt;direction&lt;/em&gt; encodes meaning while &lt;em&gt;length&lt;/em&gt; often encodes uninteresting things like text length or token count. Two documents about the same topic point the same way even if one is a sentence and the other a paragraph. Cosine similarity captures exactly that.&lt;/p&gt;

&lt;p&gt;The formula is just the dot product of the two vectors divided by the product of their magnitudes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cos(θ) = (A · B) / (‖A‖ · ‖B‖)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It returns a value from &lt;strong&gt;-1 to 1&lt;/strong&gt;, though for most modern text embeddings you'll see results land in roughly the 0-to-1 range:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;~1.0&lt;/strong&gt; — nearly identical meaning&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;~0.5&lt;/strong&gt; — loosely related&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;~0.0&lt;/strong&gt; — unrelated&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That single number, computed against a corpus of stored vectors, &lt;em&gt;is&lt;/em&gt; semantic search. Everything else is optimization.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build a semantic search engine from scratch
&lt;/h2&gt;

&lt;p&gt;Let's make it concrete. We'll use &lt;a href="https://www.sbert.net/" rel="noopener noreferrer"&gt;&lt;code&gt;sentence-transformers&lt;/code&gt;&lt;/a&gt;, which runs a capable embedding model locally — no API key, no network calls, so you can run this offline right now.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;sentence-transformers numpy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 1 — Embed a corpus
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;sentence_transformers&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;SentenceTransformer&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;numpy&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;

&lt;span class="c1"&gt;# A small, fast, widely used model. 384-dimensional output.
&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;SentenceTransformer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;all-MiniLM-L6-v2&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;documents&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;How to reset your account password&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Refund policy for annual subscriptions&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Setting up two-factor authentication&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Our office hours and contact details&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;How to recover a locked account&lt;/span&gt;&lt;span class="sh"&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;# Encode the whole corpus once. Shape: (5, 384)
&lt;/span&gt;&lt;span class="n"&gt;doc_embeddings&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="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;documents&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;doc_embeddings&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shape&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# (5, 384)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That &lt;code&gt;doc_embeddings&lt;/code&gt; array is your search index. In a real app you compute it &lt;strong&gt;once&lt;/strong&gt;, when a document is created or updated, and store it — never on every query.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2 — Cosine similarity in NumPy
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;cosine_similarity&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ndarray&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ndarray&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;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ndarray&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Cosine similarity between vector `a` and each row of matrix `b`.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;a_norm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;linalg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;norm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;b_norm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;linalg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;norm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;axis&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="n"&gt;keepdims&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&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;b_norm&lt;/span&gt; &lt;span class="o"&gt;@&lt;/span&gt; &lt;span class="n"&gt;a_norm&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ten lines, no dependencies beyond NumPy. This is the actual core of semantic search — the rest is plumbing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3 — Search
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;search&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;query_vec&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="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;scores&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;cosine_similarity&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query_vec&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;doc_embeddings&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;ranked&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;argsort&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="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="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;  &lt;span class="c1"&gt;# top-k, highest first
&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="n"&gt;documents&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="nf"&gt;float&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="n"&gt;i&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;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;ranked&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;doc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;search&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;I forgot my login credentials&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;score&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;  &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it, and you'll get something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0.62  How to reset your account password
0.55  How to recover a locked account
0.31  Setting up two-factor authentication
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice what happened: the query &lt;strong&gt;"I forgot my login credentials"&lt;/strong&gt; shares &lt;em&gt;zero words&lt;/em&gt; with "How to reset your account password," yet it ranked first. A keyword search would have returned nothing. That's the payoff — you matched on meaning, not on string overlap. This shift from lexical to semantic matching is the foundation every retrieval-augmented system builds on, and it's the starting point of a structured &lt;a href="https://cursuri-ai.ro/courses/rag-retrieval-augmented-generation" rel="noopener noreferrer"&gt;course on RAG and retrieval-augmented generation&lt;/a&gt; that goes from this toy index to production retrieval.&lt;/p&gt;

&lt;h2&gt;
  
  
  From toy to production: what changes
&lt;/h2&gt;

&lt;p&gt;The NumPy version is perfect for learning and fine for a few thousand documents. Past that, three things force an upgrade.&lt;/p&gt;

&lt;h3&gt;
  
  
  You need a vector database
&lt;/h3&gt;

&lt;p&gt;Computing cosine similarity against &lt;em&gt;every&lt;/em&gt; stored vector on every query is &lt;code&gt;O(n)&lt;/code&gt; — fine at 5 documents, painful at 5 million. Vector databases solve this with &lt;strong&gt;Approximate Nearest Neighbor (ANN)&lt;/strong&gt; indexes (HNSW is the common one) that trade a sliver of accuracy for enormous speed, returning near-neighbors in milliseconds over huge corpora.&lt;/p&gt;

&lt;p&gt;You have good open-source options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;pgvector&lt;/strong&gt; — a Postgres extension. If your data already lives in Postgres, this is often the pragmatic choice: vectors and relational data in one place, one backup story.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Chroma / Qdrant / Weaviate / Milvus&lt;/strong&gt; — purpose-built vector stores with richer filtering and scaling stories.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FAISS&lt;/strong&gt; — a library (not a server) from Meta for fast similarity search when you want to manage the index yourself.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A minimal Chroma example shows how little the mental model changes:&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="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;chromadb&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;chromadb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;collection&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;create_collection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;docs&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;collection&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;documents&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;documents&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ids&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;d&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;documents&lt;/span&gt;&lt;span class="p"&gt;))])&lt;/span&gt;

&lt;span class="n"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;collection&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;query_texts&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;I forgot my login credentials&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;n_results&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;results&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;documents&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Chroma embeds the text for you and handles the index. Same concept, production ergonomics.&lt;/p&gt;

&lt;h3&gt;
  
  
  Chunking matters more than the model
&lt;/h3&gt;

&lt;p&gt;You rarely embed whole documents. A 30-page PDF becomes one vector that's an average of everything and a good match for nothing. In practice you &lt;strong&gt;chunk&lt;/strong&gt; documents into passages (a few hundred tokens, often with slight overlap) and embed each chunk. Get chunking wrong and even a great embedding model returns mush — which is one of the most common reasons retrieval systems quietly underperform. Chunking strategy, overlap, and metadata are exactly the unglamorous details that separate a demo from a dependable system, and they're covered in depth in a &lt;a href="https://cursuri-ai.ro/courses/advanced-llm-integration" rel="noopener noreferrer"&gt;course on advanced LLM integration for production apps&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Choosing and swapping embedding models
&lt;/h3&gt;

&lt;p&gt;Embedding models differ in dimensionality, speed, cost, and language coverage — and critically, &lt;strong&gt;you must embed your corpus and your queries with the same model.&lt;/strong&gt; Change the model and you re-embed everything. For multilingual apps (Romanian included), pick a model with strong multilingual training rather than an English-first one, or your non-English recall will suffer silently. Public benchmarks like the &lt;strong&gt;MTEB&lt;/strong&gt; leaderboard on Hugging Face are the sane starting point for comparing models on retrieval quality rather than vibes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hybrid search: when semantic alone isn't enough
&lt;/h2&gt;

&lt;p&gt;Here's a lesson that surprises people: pure semantic search is &lt;em&gt;worse&lt;/em&gt; than keyword search for certain queries. Ask for an exact product code, a specific error like &lt;code&gt;ERR_CONN_REFUSED&lt;/code&gt;, a person's name, or an acronym, and embeddings can betray you — they match on &lt;em&gt;meaning&lt;/em&gt;, and a precise identifier has little semantic meaning to spread around. The embedding for &lt;code&gt;ERR_CONN_REFUSED&lt;/code&gt; sits near "connection problems" generally, so a document about a &lt;em&gt;different&lt;/em&gt; connection error can outrank the exact match.&lt;/p&gt;

&lt;p&gt;The production answer is &lt;strong&gt;hybrid search&lt;/strong&gt;: run both a keyword search (classic lexical scoring like BM25) and a semantic search, then combine the rankings. Keyword search nails exact terms, identifiers, and rare words; semantic search nails paraphrase and intent. Together they cover each other's blind spots.&lt;/p&gt;

&lt;p&gt;The standard way to merge the two result lists is &lt;strong&gt;Reciprocal Rank Fusion (RRF)&lt;/strong&gt; — a simple, robust formula that scores each document by its &lt;em&gt;rank&lt;/em&gt; in each list rather than by raw scores that live on incompatible scales:&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;def&lt;/span&gt; &lt;span class="nf"&gt;reciprocal_rank_fusion&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rankings&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;float&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Fuse multiple ranked lists of doc IDs into one score per doc.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;scores&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;float&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="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;ranking&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;rankings&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;            &lt;span class="c1"&gt;# e.g. [keyword_results, semantic_results]
&lt;/span&gt;        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;rank&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;doc_id&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;enumerate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ranking&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="n"&gt;doc_id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&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&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;doc_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;rank&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;sorted&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;items&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;reverse&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because RRF only looks at positions, you don't have to normalize BM25 scores against cosine similarities — a notorious apples-to-oranges trap. Most serious vector databases (Weaviate, Qdrant, and others) now offer hybrid search with RRF built in, precisely because "just embeddings" quietly underperforms on real, messy query logs. If you take one production lesson from this article, make it this: &lt;strong&gt;measure your recall on real queries, and reach for hybrid the moment exact-match queries show up.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Where embeddings show up beyond search
&lt;/h2&gt;

&lt;p&gt;Semantic search is the gateway, but the same vectors power a lot more:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;RAG (retrieval-augmented generation)&lt;/strong&gt; — retrieve relevant chunks by embedding similarity, then feed them to an LLM as grounding context. Embeddings are the &lt;em&gt;retrieval&lt;/em&gt; half; without good retrieval, generation hallucinates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deduplication &amp;amp; clustering&lt;/strong&gt; — near-duplicate detection and topic clustering fall out of distances almost for free.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Recommendations&lt;/strong&gt; — "items similar to this one" is a nearest-neighbor query in embedding space.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Classification&lt;/strong&gt; — embed labeled examples, then classify new items by nearest neighbors, often without training a dedicated model.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The through-line: any time you need "similar in meaning" rather than "matches exactly," embeddings are the tool. Building these features end to end — API to product, with the retrieval and orchestration wired up properly — is the spine of a hands-on &lt;a href="https://cursuri-ai.ro/courses/construire-aplicatii-ai-python-sdk" rel="noopener noreferrer"&gt;course on building AI applications in Python with the OpenAI and Anthropic SDKs&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common mistakes that cost you hours
&lt;/h2&gt;

&lt;p&gt;A few traps that catch almost everyone the first time:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Re-embedding the corpus on every query.&lt;/strong&gt; Embed documents once, store the vectors, embed only the incoming query at search time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mixing models.&lt;/strong&gt; Query vectors and document vectors must come from the &lt;em&gt;same&lt;/em&gt; embedding model. A silent mismatch produces garbage rankings with no error.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Forgetting to normalize.&lt;/strong&gt; If you compute raw dot products instead of cosine similarity (and your vectors aren't already unit-normalized), longer texts get an unfair boost. Normalize, or use a library that does.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Embedding documents that are too large.&lt;/strong&gt; One vector per giant document averages meaning into uselessness. Chunk first.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trusting a single similarity threshold forever.&lt;/strong&gt; The "good enough" cutoff depends on your model and data. Measure it on real queries; don't hardcode 0.8 because a blog post said so.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Vector embeddings are one of those ideas that feels like magic until you see the mechanics — and then it's just geometry. Text becomes a point in space, meaning becomes distance, and search becomes "find the nearest points." You built exactly that in a few lines of Python, from raw NumPy cosine similarity to a Chroma-backed index, and the same core idea scales from a toy corpus to millions of documents behind an ANN index.&lt;/p&gt;

&lt;p&gt;Start where we started: embed a handful of your own documents, run a query that shares no keywords with the right answer, and watch it surface anyway. Once that clicks, RAG, recommendations, and semantic features stop looking like separate topics and start looking like one tool applied five ways. If you want the structured path from here — retrieval, chunking, evaluation, and production wiring — &lt;a href="https://cursuri-ai.ro/courses/rag-retrieval-augmented-generation" rel="noopener noreferrer"&gt;Cursuri-AI.ro&lt;/a&gt; builds it step by step.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Sources &amp;amp; further reading:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sentence-Transformers — &lt;a href="https://www.sbert.net/" rel="noopener noreferrer"&gt;Official documentation&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Hugging Face — &lt;a href="https://huggingface.co/spaces/mteb/leaderboard" rel="noopener noreferrer"&gt;MTEB: Massive Text Embedding Benchmark leaderboard&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;pgvector — &lt;a href="https://github.com/pgvector/pgvector" rel="noopener noreferrer"&gt;Open-source vector similarity search for Postgres&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Chroma — &lt;a href="https://www.trychroma.com/" rel="noopener noreferrer"&gt;Open-source embedding database&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;This article is educational content. Model names, dimensions, and library APIs evolve; verify current details in the official documentation before building production systems.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Context Engineering for AI Agents: Beyond Prompt Engineering</title>
      <dc:creator>galian</dc:creator>
      <pubDate>Thu, 09 Jul 2026 13:08:24 +0000</pubDate>
      <link>https://dev.to/cursuri-ai/context-engineering-for-ai-agents-beyond-prompt-engineering-14ep</link>
      <guid>https://dev.to/cursuri-ai/context-engineering-for-ai-agents-beyond-prompt-engineering-14ep</guid>
      <description>&lt;p&gt;You wrote a great prompt. It worked beautifully in the playground — one question, one clean answer. Then you wired the same model into an agent that runs twenty steps, calls six tools, and reads back their output, and somewhere around step twelve it started forgetting the goal, calling the wrong tool, or confidently acting on something it misread three steps ago. The prompt didn't get worse. The &lt;em&gt;context&lt;/em&gt; did.&lt;/p&gt;

&lt;p&gt;This is the gap that context engineering fills. Prompt engineering is about writing one good instruction. Context engineering is about managing the entire set of tokens a model sees at inference time — across a long, multi-step run — so the signal stays high and the model keeps making good decisions. Anthropic frames it as &lt;a href="https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents" rel="noopener noreferrer"&gt;the natural progression of prompt engineering&lt;/a&gt;, and if you're building anything agentic in 2026, it's the discipline that separates a demo from a system.&lt;/p&gt;

&lt;h2&gt;
  
  
  What context engineering actually is
&lt;/h2&gt;

&lt;p&gt;Start with a precise definition. &lt;strong&gt;Context&lt;/strong&gt; is the full set of tokens you include when you sample from a large language model. Not just your prompt — the system instructions, the tool definitions, the examples, the running message history, the retrieved documents, the tool results fed back in. Everything in the window.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Context engineering&lt;/strong&gt; is the set of strategies for curating and maintaining the &lt;em&gt;optimal&lt;/em&gt; set of those tokens during inference. The goal, in one line: find the smallest set of high-signal tokens that reliably produces the outcome you want.&lt;/p&gt;

&lt;p&gt;The reason this is a distinct discipline from prompt engineering is the shape of the problem. A prompt is something you write once and it stays put. Context in an agent is &lt;em&gt;dynamic&lt;/em&gt; — it grows on every turn as the model reads files, calls tools, and accumulates history. You're not authoring a static string anymore; you're managing a budget that fills up on its own, and deciding continuously what earns a place in it and what gets thrown out. That's an engineering problem, and it's &lt;a href="https://cursuri-ai.ro/courses/prompt-engineering-masterclass" rel="noopener noreferrer"&gt;the foundation the whole prompt-to-production journey builds on&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why "just add more context" is the wrong instinct
&lt;/h2&gt;

&lt;p&gt;The intuitive move, when an agent makes a mistake, is to give it more: more instructions, more examples, more history, more retrieved documents. Sometimes that helps. Very often it makes things worse, and here's why.&lt;/p&gt;

&lt;p&gt;A model's effective attention is a finite resource. Every token you add competes with every other token for the model's limited ability to attend to what matters. Past a certain point, adding context doesn't add capability — it dilutes it. The relevant fact is now buried among ten irrelevant ones, and the model attends to the wrong thing.&lt;/p&gt;

&lt;p&gt;This shows up empirically. The "lost in the middle" effect — &lt;a href="https://arxiv.org/abs/2307.03172" rel="noopener noreferrer"&gt;documented by Liu et al.&lt;/a&gt; — found that models attend most reliably to information at the &lt;em&gt;start&lt;/em&gt; and &lt;em&gt;end&lt;/em&gt; of a long context, and least reliably to what's stuck in the middle. As context grows, retrieval of any single fact inside it gets less reliable, a degradation sometimes called &lt;em&gt;context rot&lt;/em&gt;. A 200K-token window does not mean you should put 200K tokens in it. Capacity is not the same as attention.&lt;/p&gt;

&lt;p&gt;So the mental model to internalize: &lt;strong&gt;context is a budget, not a bucket.&lt;/strong&gt; You're not trying to fill it. You're trying to spend it on the highest-signal tokens available and refuse everything else. Every technique below is a way to enforce that discipline.&lt;/p&gt;

&lt;h2&gt;
  
  
  The four things competing for your window
&lt;/h2&gt;

&lt;p&gt;Before the techniques, know your spenders. In a running agent, four categories of tokens fight for the same finite budget:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The system prompt&lt;/strong&gt; — your instructions, role, constraints. Usually small, high-value, and stable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool definitions&lt;/strong&gt; — the schemas describing every tool the agent can call. These are sneakily expensive: each tool's description sits in context on &lt;em&gt;every&lt;/em&gt; turn, whether or not it's used.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Message history&lt;/strong&gt; — the accumulating transcript of the conversation and the agent's own steps. This is the one that grows without bound and quietly eats the window.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retrieved / external data&lt;/strong&gt; — documents, search results, file contents, database rows pulled in to ground the model.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The overall guidance from Anthropic is worth memorizing: keep each of these &lt;strong&gt;informative yet tight&lt;/strong&gt;. Not empty — an under-specified system prompt or a missing tool leaves the model guessing. But not bloated either. The art is the calibration, and it's different for each category. Let's work through the techniques that manage them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Technique 1: Compaction — summarize the history before it drowns you
&lt;/h2&gt;

&lt;p&gt;Message history is the runaway spender. A long agent run accumulates hundreds of turns of "called tool, got 4KB of JSON back, reasoned about it, called the next tool." Most of those raw tool outputs are dead weight three steps later — you needed the &lt;em&gt;conclusion&lt;/em&gt;, not the 4KB.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Compaction&lt;/strong&gt; is the fix: periodically replace a chunk of verbose history with a tight summary that preserves the decisions, the key facts, and the current state, while dropping the raw noise. When the agent has finished investigating something, you don't need the full transcript of the investigation in context — you need "here's what I found and what it means for the task."&lt;/p&gt;

&lt;p&gt;Practical rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Compact at natural boundaries&lt;/strong&gt;, not mid-reasoning — after a sub-task completes, when a phase ends.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Preserve the load-bearing details&lt;/strong&gt;: open questions, decisions made, constraints discovered, current state. Drop the intermediate chatter and the raw dumps.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep the goal pinned.&lt;/strong&gt; The single most common long-run failure is the agent losing the plot on the original objective. The goal should survive every compaction.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Done well, compaction is what lets an agent run for hundreds of steps without either overflowing its window or forgetting why it started.&lt;/p&gt;

&lt;h2&gt;
  
  
  Technique 2: External memory — let the agent write things down
&lt;/h2&gt;

&lt;p&gt;The window is not the only place to keep information. The most effective long-running agents treat the context window as &lt;em&gt;working memory&lt;/em&gt; and offload durable state to &lt;strong&gt;external memory&lt;/strong&gt; — a file, a scratchpad, a structured store the agent reads from and writes to deliberately.&lt;/p&gt;

&lt;p&gt;Instead of carrying every fact in-context forever, the agent writes a note ("the auth module uses JWT with 15-minute expiry; the bug is in the refresh path") to a persistent store, and pulls it back only when relevant. The context window stays lean; the knowledge doesn't get lost. This is exactly how a human engineer works — you don't hold the entire codebase in your head, you keep notes and open the file when you need it.&lt;/p&gt;

&lt;p&gt;This pattern — persistent, deliberately-managed memory outside the window — is &lt;a href="https://cursuri-ai.ro/courses/context-engineering-memorie-agenti" rel="noopener noreferrer"&gt;the core of building agents that hold state over long horizons&lt;/a&gt;, and it's what turns a stateless model into something that can work a problem across a session without drowning.&lt;/p&gt;

&lt;h2&gt;
  
  
  Technique 3: Sub-agents — isolate context so the main thread stays clean
&lt;/h2&gt;

&lt;p&gt;Here's a structural technique that most people never turn on. When a sub-task is going to burn a lot of tokens — "find every call site of this function across the repo," "research these five libraries" — don't do it in the main agent's context. Delegate it to a &lt;strong&gt;sub-agent&lt;/strong&gt;: a separate agent instance with its own isolated window that does the noisy work and reports back a clean result.&lt;/p&gt;

&lt;p&gt;The win is context hygiene. The thousands of tokens of file contents and search output that the investigation churns through stay in the &lt;em&gt;sub-agent's&lt;/em&gt; context and die with it. The main agent gets back a two-paragraph summary, and its own window stays focused on the actual task instead of silting up with intermediate noise. As a bonus, independent sub-tasks run in parallel instead of serially.&lt;/p&gt;

&lt;p&gt;The rule of thumb: delegate when work is &lt;strong&gt;independent, parallelizable, or context-heavy&lt;/strong&gt;; keep it inline when it's sequential and cheap. Knowing when to fan out to sub-agents and how to orchestrate them without stepping on each other is &lt;a href="https://cursuri-ai.ro/courses/ai-agents-automatizare" rel="noopener noreferrer"&gt;a central skill in building AI agents and automation&lt;/a&gt;, and it's one of the highest-leverage context moves you have.&lt;/p&gt;

&lt;h2&gt;
  
  
  Technique 4: Just-in-time retrieval — pull data when needed, not upfront
&lt;/h2&gt;

&lt;p&gt;There are two ways to get external data into an agent. The naive way is to &lt;strong&gt;preload&lt;/strong&gt;: at the start, dump everything the agent might conceivably need into context — the whole document, all the schemas, every config file. The problem is obvious once you see it: you're spending your budget on maybes, and most of it goes unused while crowding out what matters.&lt;/p&gt;

&lt;p&gt;The better pattern is &lt;strong&gt;just-in-time retrieval&lt;/strong&gt;: give the agent the &lt;em&gt;ability&lt;/em&gt; to fetch data (a search tool, a file reader, a database query) and let it pull exactly what it needs, exactly when it needs it. Instead of "here are all 40 files," it's "here's a tool to read a file — go get the one you need." The agent loads the relevant chunk into context at the moment of use, acts on it, and (with compaction) lets it fall away afterward.&lt;/p&gt;

&lt;p&gt;This mirrors how retrieval-augmented systems already work, and getting the retrieval layer right — what to fetch, how to rank it, how much to bring back — is &lt;a href="https://cursuri-ai.ro/courses/advanced-llm-integration" rel="noopener noreferrer"&gt;where advanced LLM integration earns its keep&lt;/a&gt;. Preloading feels safer; just-in-time is what actually scales.&lt;/p&gt;

&lt;h2&gt;
  
  
  Technique 5: Tool curation — the failure mode hiding in plain sight
&lt;/h2&gt;

&lt;p&gt;Remember that tool definitions sit in context on every turn. That makes a bloated tool set a double tax: it burns tokens continuously, &lt;em&gt;and&lt;/em&gt; it degrades decisions. Anthropic calls out one of the most common failure modes directly — tool sets that cover too much functionality or create ambiguous, overlapping choices about which tool to use.&lt;/p&gt;

&lt;p&gt;The tell is a sharp one: &lt;strong&gt;if a human engineer can't say for certain which tool should be used in a given situation, an AI agent can't either.&lt;/strong&gt; Fifteen tools with fuzzy, overlapping responsibilities will produce worse behavior than six sharp, non-overlapping ones — and cost more tokens doing it.&lt;/p&gt;

&lt;p&gt;So curate the toolbox like you'd curate an API:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fewer, sharper tools.&lt;/strong&gt; Each with a clear, distinct job and an unambiguous "use this when…"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No overlap.&lt;/strong&gt; Two tools that could both plausibly handle the same request is a decision point where the agent will sometimes pick wrong.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prune ruthlessly.&lt;/strong&gt; A tool that's rarely the right choice is paying rent in your context on every single turn. Cut it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tool curation is the least glamorous technique here and often the highest-ROI. It's pure subtraction, and subtraction is exactly what context engineering rewards.&lt;/p&gt;

&lt;h2&gt;
  
  
  How you know it's working: measure it
&lt;/h2&gt;

&lt;p&gt;Every technique above is a change to your context, and changes to context are exactly the kind of thing that &lt;em&gt;feels&lt;/em&gt; better while being worse — or vice versa. If your only signal is "I ran a few queries and it seemed fine," you're tuning blind, and you'll ship a regression the day you compact one turn too aggressively and the agent starts forgetting a constraint.&lt;/p&gt;

&lt;p&gt;The fix is the same as anywhere in production ML: an evaluation set. Assemble representative tasks with known good outcomes, and re-run them every time you change how context is managed. Then you can say "compaction at phase boundaries held task success at 0.9 while cutting average tokens 40%" instead of "I think it's better now." Treating &lt;a href="https://cursuri-ai.ro/courses/ai-evals-llm-productie" rel="noopener noreferrer"&gt;evaluation as first-class rather than an afterthought&lt;/a&gt; is what turns context engineering from a craft into engineering — a number that moves when you change something, not a vibe.&lt;/p&gt;

&lt;h2&gt;
  
  
  Putting it together
&lt;/h2&gt;

&lt;p&gt;Context engineering isn't a framework you install; it's a posture you adopt toward the model's window. The whole discipline collapses to one principle applied relentlessly: &lt;strong&gt;spend the finite budget on the smallest set of high-signal tokens that does the job.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In practice, for a real agent, that means:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Compact&lt;/strong&gt; the history at natural boundaries so a long run doesn't drown in its own transcript.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Offload&lt;/strong&gt; durable state to external memory instead of carrying it forever.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Delegate&lt;/strong&gt; noisy, independent work to sub-agents so the main window stays clean.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retrieve just-in-time&lt;/strong&gt; instead of preloading everything you might need.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Curate the tools&lt;/strong&gt; hard — fewer, sharper, no overlap.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Measure&lt;/strong&gt; with evals so every change is verified, not hoped.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;None of these are exotic, and that's the point. The model is already capable. What makes the capability &lt;em&gt;hold up&lt;/em&gt; over a twenty-step run isn't a cleverer prompt — it's disciplined management of everything the model reads along the way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Prompt engineering taught us to write one good instruction. Context engineering is what you need the moment that instruction has to survive a long, tool-using, self-accumulating agent run — which is to say, the moment you build anything real. The failure you saw at step twelve was never the model getting dumber. It was the context getting noisier, and no one curating it.&lt;/p&gt;

&lt;p&gt;Adopt the budget mindset, apply the five techniques, and put an eval set behind every change. Do that, and the same model that fell apart at step twelve will run to step fifty and still know exactly what it's doing — because you engineered what it was looking at the whole way.&lt;/p&gt;

&lt;p&gt;The courses linked throughout are part of &lt;a href="https://cursuri-ai.ro/courses/context-engineering-memorie-agenti" rel="noopener noreferrer"&gt;Cursuri-AI.ro&lt;/a&gt;, an AI-learning platform with hands-on, current tracks on context engineering, AI agents, LLM integration, and evaluating AI systems in production.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Sources &amp;amp; further reading:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Anthropic — &lt;a href="https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents" rel="noopener noreferrer"&gt;Effective context engineering for AI agents&lt;/a&gt; (definition, the four context components, tool-set failure modes, compaction and memory)&lt;/li&gt;
&lt;li&gt;Anthropic — &lt;a href="https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents" rel="noopener noreferrer"&gt;Effective harnesses for long-running agents&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Liu et al. — &lt;a href="https://arxiv.org/abs/2307.03172" rel="noopener noreferrer"&gt;Lost in the Middle: How Language Models Use Long Contexts&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;This article is educational content. Model behavior, context limits, and tooling evolve quickly; validate approaches against your own workloads and current official documentation.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Run LLMs Locally with Ollama in 2026: The Practical Developer Guide</title>
      <dc:creator>galian</dc:creator>
      <pubDate>Sun, 05 Jul 2026 21:11:24 +0000</pubDate>
      <link>https://dev.to/cursuri-ai/run-llms-locally-with-ollama-in-2026-the-practical-developer-guide-48n</link>
      <guid>https://dev.to/cursuri-ai/run-llms-locally-with-ollama-in-2026-the-practical-developer-guide-48n</guid>
      <description>&lt;p&gt;For years, "run the model locally" was the option you mentioned and then didn't take: the models were too weak, the tooling too fiddly, and the cloud APIs too convenient. In 2026 that calculus has genuinely shifted. Open-weight models in the 12–35B range now handle real coding and agent workloads, Apple Silicon got a dedicated inference engine, and Ollama quietly became a drop-in backend for the same tools you already use against cloud APIs — including Claude Code.&lt;/p&gt;

&lt;p&gt;I teach practical AI engineering at &lt;a href="https://cursuri-ai.ro" rel="noopener noreferrer"&gt;Cursuri-AI.ro&lt;/a&gt;, Eastern Europe's AI education platform, and local inference has gone from a curiosity module to one of the questions companies ask us most — usually spelled "how do we use LLMs without sending our data anywhere?" This guide is the answer I give developers: what changed, what hardware you actually need, which models are worth pulling, and how to plug it all into a real workflow.&lt;/p&gt;

&lt;p&gt;As always with this space: versions and model rankings move monthly. Everything below is verified against Ollama's official blog and docs as of early July 2026 — re-check before you build a budget or an architecture on it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why local, and why now
&lt;/h2&gt;

&lt;p&gt;Three arguments have survived contact with production; the rest is mostly vibes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Privacy and data residency.&lt;/strong&gt; With a local model, prompts and outputs never leave your machine (or your VPC, if you self-host on a server). For anyone dealing with client data, medical text, legal documents, or GDPR-sensitive workloads, this eliminates the entire "what does the provider do with my data" conversation instead of managing it through contracts. This is the single biggest adoption driver we see in Europe, and it's the backbone of our &lt;a href="https://cursuri-ai.ro/courses/llm-locale-ollama-privacy-self-hosting" rel="noopener noreferrer"&gt;course on local LLMs, self-hosting, and privacy&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cost shape.&lt;/strong&gt; Cloud APIs bill per token; local inference bills you once, in hardware you may already own. For high-volume, latency-tolerant workloads — batch classification, summarization pipelines, internal tooling — a mid-range GPU that's already on someone's desk can absorb work that would otherwise be a real monthly line item. (For low-volume or frontier-quality work, cloud still wins. More on that below.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No external dependency.&lt;/strong&gt; A local model doesn't get deprecated, rate-limited, price-changed, or suspended out from under you. After the model-availability surprises of the last year, "at least one workload runs on weights we control" has become a reasonable line item in a resilience plan, not paranoia.&lt;/p&gt;

&lt;h2&gt;
  
  
  What actually changed in Ollama in 2026
&lt;/h2&gt;

&lt;p&gt;If you last touched Ollama when it was "a nice wrapper around llama.cpp," the 2026 releases are the reason to look again. All of this is from &lt;a href="https://ollama.com/blog" rel="noopener noreferrer"&gt;Ollama's official blog&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Anthropic API compatibility (January, v0.14.0).&lt;/strong&gt; Ollama now exposes a native Anthropic-style &lt;code&gt;/v1/messages&lt;/code&gt; endpoint. This is the sleeper feature of the year: Anthropic-native tools — most notably Claude Code — can talk to a local model directly, with no proxy or translation layer. There's a matching OpenAI-compatible endpoint too, so Codex and OpenAI-SDK apps work the same way.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;ollama launch&lt;/code&gt; (January).&lt;/strong&gt; A single command that configures and starts a coding agent against a local model — &lt;code&gt;ollama launch claude&lt;/code&gt; sets up Claude Code, prompts you to pick a model, and you're in.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Experimental image generation (January).&lt;/strong&gt; Early days, but the scope of "local model" is no longer text-only.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MLX engine on Apple Silicon (March preview → June release).&lt;/strong&gt; Ollama moved its Mac inference path to Apple's MLX framework, which exploits unified memory. Ollama's own framing for the June release: its highest performance on Apple Silicon yet — faster output with reduced memory usage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ollama 0.30 and 0.31 (June).&lt;/strong&gt; Version 0.30 brought improved performance and broader GGUF model compatibility through llama.cpp; 0.31 made Gemma 4 significantly faster on Apple Silicon via multi-token prediction (MTP), enabled by default.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The theme is clear: Ollama is positioning itself less as a hobbyist toy and more as the standard local backend for agentic tooling.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting started in five minutes
&lt;/h2&gt;

&lt;p&gt;Install (macOS and Windows have installers at &lt;a href="https://ollama.com/download" rel="noopener noreferrer"&gt;ollama.com/download&lt;/a&gt;; on Linux):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://ollama.com/install.sh | sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pull and run a model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ollama pull gemma4
ollama run gemma4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's a working local chat. Ollama also starts a local server on port &lt;code&gt;11434&lt;/code&gt;, which is where the interesting part begins — every API-based tool you have can point at it.&lt;/p&gt;

&lt;p&gt;Useful daily commands: &lt;code&gt;ollama ls&lt;/code&gt; (installed models), &lt;code&gt;ollama ps&lt;/code&gt; (what's loaded and where — CPU vs GPU), &lt;code&gt;ollama rm &amp;lt;model&amp;gt;&lt;/code&gt; (free disk space; models are multi-gigabyte).&lt;/p&gt;

&lt;h2&gt;
  
  
  Hardware: the honest sizing guide
&lt;/h2&gt;

&lt;p&gt;The rule of thumb that matters: a model quantized to 4 bits needs very roughly &lt;strong&gt;0.5–0.7 GB of memory per billion parameters&lt;/strong&gt;, plus overhead for context. Everything else follows from that.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Your hardware&lt;/th&gt;
&lt;th&gt;What runs comfortably&lt;/th&gt;
&lt;th&gt;Experience&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;8 GB RAM, no GPU&lt;/td&gt;
&lt;td&gt;3–8B models, quantized&lt;/td&gt;
&lt;td&gt;Fine for chat, drafting, classification. Slow but usable on CPU&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;16 GB RAM (Apple Silicon)&lt;/td&gt;
&lt;td&gt;8–14B models&lt;/td&gt;
&lt;td&gt;Good daily-driver territory; MLX made this tier notably faster in 2026&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;24 GB+ (M-series Pro/Max or a 24 GB GPU)&lt;/td&gt;
&lt;td&gt;27–35B models&lt;/td&gt;
&lt;td&gt;Where local coding models get genuinely useful&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;48 GB+ unified memory / multi-GPU&lt;/td&gt;
&lt;td&gt;Large MoE models&lt;/td&gt;
&lt;td&gt;Server-class local inference&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two nuances that save people disappointment:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Quantization is why any of this works.&lt;/strong&gt; Models ship in compressed 4–8 bit variants (the GGUF ecosystem) that trade a small quality loss for a 2–4× memory reduction. Ollama's default tags are already quantized — you rarely need to think about it, but it explains why a "27B model" fits in 24 GB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mixture-of-experts (MoE) models need memory for their &lt;em&gt;total&lt;/em&gt; parameters but compute like their &lt;em&gt;active&lt;/em&gt; subset.&lt;/strong&gt; NVIDIA's Nemotron-3-Super, for example, is a 120B model with 12B active parameters: it runs faster than its size suggests, but you still need the RAM to hold it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Context length eats memory too — an agent session with 32K+ tokens of context adds real overhead on top of the weights. If you're sizing for coding agents, budget for that, not just the model file.&lt;/p&gt;

&lt;h2&gt;
  
  
  The mid-2026 open-weight lineup worth knowing
&lt;/h2&gt;

&lt;p&gt;Rankings churn monthly, so treat this as a map, not a leaderboard. From &lt;a href="https://ollama.com/search" rel="noopener noreferrer"&gt;Ollama's model library&lt;/a&gt;, the families that matter right now:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gemma 4&lt;/strong&gt; (12B–31B) — Google's open family, currently the most-pulled model on Ollama. Multimodal, tuned for reasoning and agentic work, and the main beneficiary of the MLX/MTP speedups on Macs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Qwen3.5 / Qwen3.6&lt;/strong&gt; (0.8B–122B) — the ecosystem's Swiss army knife. Qwen3.5 spans everything from edge-tiny to server-large; Qwen3.6 (27B–35B) focuses on agentic coding. &lt;strong&gt;qwen3-coder&lt;/strong&gt; is Ollama's own recommendation for coding-agent use.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GLM-5 family&lt;/strong&gt; — flagship-class open weights (GLM-5 is 744B total / 40B active); strong at coding and long-horizon tasks. Too big for most desktops locally, but available as &lt;code&gt;:cloud&lt;/code&gt; variants (see below) and self-hostable on serious hardware.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nemotron-3-Super&lt;/strong&gt; (120B MoE, 12B active) — NVIDIA's entry, aimed at multi-agent applications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MiniMax-M3&lt;/strong&gt; — notable for a 1M-token context window, if your workload is long-document analysis.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Specialists&lt;/strong&gt;: GLM-OCR for document understanding, TranslateGemma (4B–27B, 55 languages) for translation, LFM2 (24B) for on-device deployment, Ornith (9B–35B) for agentic coding.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sensible defaults: on a 16 GB Mac, start with &lt;code&gt;gemma4:12b&lt;/code&gt;. On 24 GB+, try &lt;code&gt;qwen3-coder&lt;/code&gt; for code and &lt;code&gt;gemma4:27b&lt;/code&gt; for general work. Then run &lt;em&gt;your&lt;/em&gt; tasks on them — a model's rank on someone's benchmark tells you little about your use case.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part that changes your workflow: Ollama as a drop-in API
&lt;/h2&gt;

&lt;p&gt;Ollama's server speaks both major API dialects, which means "switch to a local model" is now a base-URL change, not a rewrite.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;OpenAI-compatible&lt;/strong&gt; (&lt;code&gt;/v1&lt;/code&gt;) — any OpenAI-SDK app works:&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="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&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="n"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;http://localhost:11434/v1&lt;/span&gt;&lt;span class="sh"&gt;"&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ollama&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;resp&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gemma4&lt;/span&gt;&lt;span class="sh"&gt;"&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="p"&gt;[{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Explain GGUF quantization in one paragraph.&lt;/span&gt;&lt;span class="sh"&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;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resp&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="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="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Anthropic-compatible&lt;/strong&gt; (&lt;code&gt;/v1/messages&lt;/code&gt;) — and this is the one with teeth, because it means &lt;strong&gt;Claude Code runs against local models&lt;/strong&gt;. Per &lt;a href="https://docs.ollama.com/api/anthropic-compatibility" rel="noopener noreferrer"&gt;Ollama's official docs&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;ANTHROPIC_AUTH_TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;ollama       &lt;span class="c"&gt;# accepted but not validated&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;ANTHROPIC_BASE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://localhost:11434

claude &lt;span class="nt"&gt;--model&lt;/span&gt; qwen3-coder
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or let Ollama do the wiring for you:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ollama launch claude
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Honest caveats before you get excited:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ollama recommends &lt;strong&gt;at least 32K tokens of context&lt;/strong&gt; for Claude Code, and its model suggestions for coding are &lt;code&gt;qwen3-coder&lt;/code&gt; locally (30B — you want 24 GB+ of VRAM/unified memory) or &lt;code&gt;glm-4.7:cloud&lt;/code&gt; / &lt;code&gt;minimax-m2.1:cloud&lt;/code&gt; via Ollama's cloud, which keeps the same API surface but runs the weights remotely.&lt;/li&gt;
&lt;li&gt;The compatibility layer doesn't cover everything: &lt;strong&gt;no prompt caching, no token-counting endpoint, no forced tool selection, no batches API, no PDF inputs&lt;/strong&gt; (images must be base64). If your workflow leans on those, you'll feel it.&lt;/li&gt;
&lt;li&gt;A 30B local model is not Opus, and it isn't trying to be. It's "capable pair of hands on an airplane / on confidential code," not "frontier reasoning."&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The pattern that actually works in practice is routing: local models for the private, high-volume, or offline work; frontier cloud models for the hard reasoning. Deciding which tier a task belongs to — and building the escalation path — is an architecture skill, and it's exactly the kind of decision we drill in our &lt;a href="https://cursuri-ai.ro/courses/ai-system-architecture" rel="noopener noreferrer"&gt;AI system architecture course&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  When local is the wrong choice
&lt;/h2&gt;

&lt;p&gt;Being a fan of local inference means knowing where it loses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Frontier-quality reasoning.&lt;/strong&gt; For the hardest tasks, top cloud models remain clearly ahead of anything you can run on a workstation. If wrong answers are expensive, don't fight this.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Low-volume workloads.&lt;/strong&gt; If you make a few thousand API calls a month, per-token billing is cheaper than any GPU. Local pays off at volume, at privacy constraints, or at both.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ops you don't want.&lt;/strong&gt; A self-hosted model is a service you now run: updates, monitoring, capacity. &lt;code&gt;ollama run&lt;/code&gt; on a laptop is trivial; a team-wide inference server is real infrastructure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multimodal breadth and long-tail capabilities.&lt;/strong&gt; Cloud APIs still bundle more (native PDF understanding, larger tool ecosystems, batch APIs) than the local stack replicates.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One more thing people conflate: running a model locally is different from &lt;em&gt;customizing&lt;/em&gt; one. If your actual goal is a model that speaks your domain language or follows your house style, that's a fine-tuning question — LoRA adapters on an open-weight base, then serving the result through Ollama. That pipeline (when to fine-tune vs when to just engineer the prompt) is its own discipline, covered in our &lt;a href="https://cursuri-ai.ro/courses/fine-tuning-modele-ai" rel="noopener noreferrer"&gt;fine-tuning course&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently asked questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Is Ollama free?
&lt;/h3&gt;

&lt;p&gt;The tool itself is open source and free. The models each carry their own licenses — Gemma, Qwen, GLM and friends have different terms, some with restrictions on commercial use. Check the license tab on the model's Ollama page before you ship a product on it. Ollama's optional cloud models are a paid service.&lt;/p&gt;

&lt;h3&gt;
  
  
  What hardware do I need to run LLMs locally in 2026?
&lt;/h3&gt;

&lt;p&gt;As a rule of thumb at 4-bit quantization: 8 GB of RAM runs 3–8B models, 16 GB runs 8–14B comfortably (especially on Apple Silicon with the MLX engine), and 24 GB+ opens up the 27–35B class where local coding models get genuinely useful. More context = more memory on top of the weights.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can a local model replace GPT or Claude?
&lt;/h3&gt;

&lt;p&gt;For a growing set of tasks — summarization, classification, drafting, routine coding on mid-size codebases — yes, credibly. For frontier reasoning and the highest-stakes accuracy, no. Production teams typically route: local for private/high-volume work, cloud for the hard 10%.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I really use Claude Code with Ollama?
&lt;/h3&gt;

&lt;p&gt;Yes. Since Ollama v0.14.0 (January 2026) there's native Anthropic Messages API compatibility: set &lt;code&gt;ANTHROPIC_BASE_URL=http://localhost:11434&lt;/code&gt;, run &lt;code&gt;claude --model qwen3-coder&lt;/code&gt; — or just &lt;code&gt;ollama launch claude&lt;/code&gt;. Expect a capable assistant, not Opus-level reasoning, and note that prompt caching and a few other API features aren't supported through the compatibility layer.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ollama vs llama.cpp vs vLLM — which should I use?
&lt;/h3&gt;

&lt;p&gt;Ollama for developer experience: one command, model management, dual API compatibility. llama.cpp (which powers Ollama's GGUF path) for maximum control and minimal footprint. vLLM for high-throughput multi-user serving on server GPUs. Most developers should start with Ollama and only move down the stack when they hit a concrete limit.&lt;/p&gt;

&lt;h2&gt;
  
  
  The skill underneath the tool
&lt;/h2&gt;

&lt;p&gt;Here's the uncomfortable part: pulling a model is the easy 5%. The value shows up when you can answer the questions around it — which model for which task, how to measure whether the local model is &lt;em&gt;good enough&lt;/em&gt; for your workload instead of guessing, how to build the routing and fallback so privacy-sensitive work stays local while hard problems escalate to a frontier model. That's engineering judgment, not tooling trivia.&lt;/p&gt;

&lt;p&gt;That judgment is what we teach at &lt;a href="https://cursuri-ai.ro" rel="noopener noreferrer"&gt;our AI education platform&lt;/a&gt; — hands-on courses built around real repositories and an interactive AI instructor, covering the full local-to-cloud spectrum: self-hosting and privacy, fine-tuning, architecture, and the agentic workflow on top.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In 2026, local LLMs crossed the line from hobby to infrastructure option. Ollama's dual API compatibility means your existing tools — including Claude Code — can run against open weights with a base-URL change; the MLX engine made a 16 GB MacBook a legitimate inference machine; and the open-weight lineup in the 12–35B range is good enough for a real slice of production work.&lt;/p&gt;

&lt;p&gt;The play isn't "cancel your API keys." It's knowing which slice of your workload belongs on weights you control — then running it there deliberately, measured, with an escalation path for everything else. Start with &lt;code&gt;ollama run gemma4&lt;/code&gt; tonight; you're one evening away from having an informed opinion.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Written by the team at &lt;a href="https://cursuri-ai.ro" rel="noopener noreferrer"&gt;Cursuri-AI.ro&lt;/a&gt; — practical, hands-on AI engineering courses for developers and professionals across Eastern Europe, from local LLMs and self-hosting to agentic coding, evals, and AI system architecture.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sources:&lt;/strong&gt; &lt;a href="https://ollama.com/blog" rel="noopener noreferrer"&gt;Ollama Blog&lt;/a&gt; · &lt;a href="https://docs.ollama.com/api/anthropic-compatibility" rel="noopener noreferrer"&gt;Anthropic API compatibility — Ollama Docs&lt;/a&gt; · &lt;a href="https://ollama.com/blog/claude" rel="noopener noreferrer"&gt;Claude Code with Anthropic API compatibility — Ollama&lt;/a&gt; · &lt;a href="https://ollama.com/search" rel="noopener noreferrer"&gt;Ollama Model Library&lt;/a&gt; · &lt;a href="https://ollama.com/download" rel="noopener noreferrer"&gt;Download Ollama&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Claude Sonnet 5 Just Made Running Agents Cheap — What Builders Actually Need to Know</title>
      <dc:creator>galian</dc:creator>
      <pubDate>Tue, 30 Jun 2026 22:06:37 +0000</pubDate>
      <link>https://dev.to/galian/claude-sonnet-5-just-made-running-agents-cheap-what-builders-actually-need-to-know-11j7</link>
      <guid>https://dev.to/galian/claude-sonnet-5-just-made-running-agents-cheap-what-builders-actually-need-to-know-11j7</guid>
      <description>&lt;p&gt;Anthropic shipped &lt;strong&gt;Claude Sonnet 5&lt;/strong&gt; on June 30, 2026, and the framing in the announcement is unusually blunt for a model launch: it's pitched as the most &lt;em&gt;agentic&lt;/em&gt; Sonnet yet — a model built to make plans, drive tools like browsers and terminals, and run autonomously at a level that, a few months ago, took something bigger and more expensive.&lt;/p&gt;

&lt;p&gt;For anyone building on top of these models — agents, pipelines, coding tools — that's the headline that matters. Not "it's smarter," but "near-frontier capability just got cheaper to run in a loop." I write and teach about agentic engineering at &lt;a href="https://cursuri-ai.ro" rel="noopener noreferrer"&gt;Cursuri-AI.ro&lt;/a&gt;, Eastern Europe's AI education platform, so I'll keep this grounded in what changes for people who actually ship on these APIs — not the launch-day benchmark theater.&lt;/p&gt;

&lt;p&gt;One disclaimer up front: model pricing and availability in this space change almost monthly, and this is a day-one snapshot. Verify the current numbers on Anthropic's official pages before you wire anything to a budget. I'm deliberately &lt;em&gt;not&lt;/em&gt; quoting benchmark scores here — the launch materials presented them in a way that's easy to misread, so for hard numbers go straight to the &lt;a href="https://www.anthropic.com/claude-sonnet-5-system-card" rel="noopener noreferrer"&gt;Sonnet 5 System Card&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The one-sentence version
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Sonnet 5 moves "good enough to run agents autonomously" down a price tier — and ships a new tokenizer that can quietly inflate your token counts by up to 35%.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Both halves of that sentence matter, and the second one is the part nobody puts on a launch slide. Let's take them in order.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's actually new
&lt;/h2&gt;

&lt;p&gt;Stripping the marketing down to verifiable claims from Anthropic's own announcement, here's what Sonnet 5 is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The most agentic Sonnet so far.&lt;/strong&gt; It's described as able to "make plans, use tools like browsers and terminals, and run autonomously," with improvements specifically in multi-step tool use — the exact workload that defines an agent rather than a chatbot.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Close to Opus 4.8 — at a lower price.&lt;/strong&gt; Anthropic's own phrasing is that its "performance is close to that of Opus 4.8, but at lower prices." That's the whole pitch: most of the capability, a fraction of the cost.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A real step up from Sonnet 4.6.&lt;/strong&gt; Called a "substantial improvement over its predecessor, Sonnet 4.6, on important aspects of agentic performance like reasoning, tool use, coding, and knowledge work."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Safer in agentic contexts.&lt;/strong&gt; Anthropic reports an "overall lower rate of undesirable behaviors than Sonnet 4.6," plus lower rates of hallucination and sycophancy — which matters more than it sounds when a model is acting in a loop without a human reading every step.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deliberately weaker at offensive cyber.&lt;/strong&gt; It shows "substantially poorer performance than models such as Opus 4.8" on dangerous cyber tasks and was "never able to develop a full working exploit." That's a safety design choice, not an oversight — worth knowing if security tooling is your domain.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Two things Anthropic did &lt;strong&gt;not&lt;/strong&gt; publish that I'm not going to invent for you: an official &lt;strong&gt;context window&lt;/strong&gt; and &lt;strong&gt;max output token&lt;/strong&gt; figure for Sonnet 5 weren't stated in the launch materials at the time of writing. If you need those for capacity planning, pull them from the official API docs rather than trusting a blog (including this one). Guessing is how teams ship broken truncation logic.&lt;/p&gt;

&lt;h2&gt;
  
  
  The economics shift is the real story
&lt;/h2&gt;

&lt;p&gt;Here's why builders should care more than end users.&lt;/p&gt;

&lt;p&gt;When you chat with a model, price-per-token is almost noise — you send a few thousand tokens and read the answer. When you run an &lt;strong&gt;agent&lt;/strong&gt;, the model is in a loop: read context, call a tool, read the result, reason, call another tool, repeat. A single "task" can burn hundreds of thousands of tokens across dozens of turns. At that volume, the price-per-million-tokens line &lt;em&gt;is&lt;/em&gt; your unit economics.&lt;/p&gt;

&lt;p&gt;So a model that lands near Opus-4.8 quality at Sonnet pricing doesn't just make chat cheaper — it changes which agent designs are economically viable at all. Workflows you'd previously gate behind Opus (multi-step research, autonomous refactors, long tool-using runs) become defensible on a Sonnet budget. That's the unlock.&lt;/p&gt;

&lt;p&gt;Here's the day-one pricing picture, with the rest of the current Anthropic lineup for context:&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;Input / 1M tokens&lt;/th&gt;
&lt;th&gt;Output / 1M tokens&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Sonnet 5&lt;/strong&gt; (intro, through Aug 31 2026)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$2&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$10&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Promotional launch pricing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Sonnet 5&lt;/strong&gt; (standard, from Sep 1 2026)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$3&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$15&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Same as Sonnet 4.6's tier&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Opus 4.8&lt;/td&gt;
&lt;td&gt;$5&lt;/td&gt;
&lt;td&gt;$25&lt;/td&gt;
&lt;td&gt;Top accuracy; default in Claude Code&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Haiku 4.5&lt;/td&gt;
&lt;td&gt;$1&lt;/td&gt;
&lt;td&gt;$5&lt;/td&gt;
&lt;td&gt;Cheapest / fastest tier&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A few honest notes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;introductory $2 / $10&lt;/strong&gt; runs through &lt;strong&gt;August 31, 2026&lt;/strong&gt;, then settles to &lt;strong&gt;$3 / $15&lt;/strong&gt; — the same standard tier Sonnet has occupied. So the long-run story isn't "Sonnet got cheaper"; it's "the Sonnet tier got dramatically more capable for the same price."&lt;/li&gt;
&lt;li&gt;Sonnet 5 is the &lt;strong&gt;default model on Free and Pro plans&lt;/strong&gt;, and is available to Max, Team, and Enterprise users — in Claude Code, the Claude platform, and the API. So if you're on Claude Code, you may already be one model-switch away from it.&lt;/li&gt;
&lt;li&gt;Against Opus 4.8 the price ratio is roughly &lt;strong&gt;1.7×&lt;/strong&gt; (output $25 vs $15). When you're running agents at scale, that multiple compounds fast — which is exactly why the "close to Opus" claim is worth pressure-testing on &lt;em&gt;your&lt;/em&gt; workload, not taking on faith.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The tokenizer gotcha that will mess up your cost math
&lt;/h2&gt;

&lt;p&gt;This is the part I most want builders to internalize, because it's the easiest way to get a nasty surprise on your next invoice.&lt;/p&gt;

&lt;p&gt;Sonnet 5 ships with an &lt;strong&gt;updated tokenizer&lt;/strong&gt;. Anthropic states that the same input text now maps to &lt;strong&gt;roughly 1.0–1.35× as many tokens&lt;/strong&gt; as before, depending on content type. Read that again: identical prompts can cost up to &lt;strong&gt;35% more tokens&lt;/strong&gt; on Sonnet 5 than the token count you measured on an older model — &lt;em&gt;before&lt;/em&gt; any change in per-token price.&lt;/p&gt;

&lt;p&gt;Why it bites:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your cost dashboards, budget alerts, and per-request estimates were calibrated on the old tokenizer. Swap the model without re-measuring and your "same" workload silently costs more.&lt;/li&gt;
&lt;li&gt;Code, structured data (JSON/XML), and non-English text tend to sit at the higher end of that multiplier — and those are precisely the inputs agentic and coding workloads are made of.&lt;/li&gt;
&lt;li&gt;It interacts with context windows and truncation: more tokens for the same text means you hit limits sooner than your old math predicts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The fix is boring and non-negotiable: re-baseline.&lt;/strong&gt; Before you flip production traffic to Sonnet 5, measure real token counts on a representative sample of &lt;em&gt;your&lt;/em&gt; prompts with the new tokenizer, recompute cost per task, and update your budgets and alerts. The headline price drop is real — but the effective saving is &lt;code&gt;(price delta) × (token inflation)&lt;/code&gt;, and you can't know the second factor without measuring. Anyone who tells you "it's 33% cheaper" did half the arithmetic.&lt;/p&gt;

&lt;p&gt;This is also where good &lt;strong&gt;evals&lt;/strong&gt; earn their keep. A model swap isn't just a cost change; it's a behavior change. Run your task suite on Sonnet 5 against the model you're replacing before you commit — quality, tool-call success rate, and cost together. If you don't have an eval harness yet, this is the launch that should convince you to build one; it's a discipline we treat as core, not optional, in our &lt;a href="https://cursuri-ai.ro/courses/ai-evals-llm-productie" rel="noopener noreferrer"&gt;course on building LLM evals for production&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to still reach for Opus 4.8
&lt;/h2&gt;

&lt;p&gt;"Close to Opus" is not "Opus." The honest read on where Sonnet 5 fits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Reach for Sonnet 5&lt;/strong&gt; as your default agent workhorse: high-volume tool-using loops, coding assistance, research and summarization, anything where you're paying per turn and the marginal quality of Opus isn't worth ~1.7× the output cost.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stay on Opus 4.8&lt;/strong&gt; for the hardest reasoning, the highest-stakes accuracy, and security-sensitive work where Sonnet 5 is &lt;em&gt;intentionally&lt;/em&gt; weaker (offensive-cyber tasks). When a wrong answer is expensive, the price gap is cheap insurance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The pattern most production teams land on isn't "pick one." It's a &lt;strong&gt;router&lt;/strong&gt;: Sonnet 5 handles the bulk of turns, and you escalate to Opus 4.8 for the steps that genuinely need it — with a human in the loop on the consequential ones. Getting that routing logic right (and knowing which task belongs in which tier) is a real engineering skill, and it's the through-line of our &lt;a href="https://cursuri-ai.ro/courses/comparatie-modele-ai" rel="noopener noreferrer"&gt;model-comparison course&lt;/a&gt;, which treats "which model for which job" as a decision you make with data rather than vibes.&lt;/p&gt;

&lt;h2&gt;
  
  
  A pragmatic migration checklist
&lt;/h2&gt;

&lt;p&gt;If you're considering moving an agent or pipeline to Sonnet 5, here's the order I'd do it in:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Re-baseline tokens.&lt;/strong&gt; Run a representative sample through the new tokenizer. Recompute cost per task. Update budget alerts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Run your evals.&lt;/strong&gt; Quality, tool-call success, latency, and cost, head-to-head against the model you're replacing. No eval suite? Build a small one first — even 30 representative tasks beats a gut call.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shadow, then canary.&lt;/strong&gt; Route a slice of real traffic to Sonnet 5, compare outputs, then scale gradually. Don't flip 100% on day one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep an escalation path.&lt;/strong&gt; Wire Opus 4.8 as the fallback for tasks that fail Sonnet 5's quality bar. Routing beats an all-or-nothing bet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Re-read your safety posture.&lt;/strong&gt; Lower hallucination and sycophancy is good news for autonomous runs, but "safer" isn't "supervise nothing." Keep guardrails and human checkpoints where consequences are real.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;None of this is exotic. It's the same discipline that separates teams who run agents in production from teams who demo them — and it's exactly the muscle we build in our hands-on track on &lt;a href="https://cursuri-ai.ro/courses/ai-agents-automatizare" rel="noopener noreferrer"&gt;AI agents and automation&lt;/a&gt;, taught around real repositories rather than toy notebooks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently asked questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Is Claude Sonnet 5 better than Opus 4.8?
&lt;/h3&gt;

&lt;p&gt;Not across the board. Anthropic positions Sonnet 5's performance as &lt;em&gt;close to&lt;/em&gt; Opus 4.8 at a lower price — so for high-volume agentic and coding work it's often the better &lt;em&gt;value&lt;/em&gt;, but Opus 4.8 still leads on the hardest reasoning, top-end accuracy, and (deliberately) on offensive-cyber capability. Match the tier to the task instead of picking a favorite.&lt;/p&gt;

&lt;h3&gt;
  
  
  How much does Claude Sonnet 5 cost?
&lt;/h3&gt;

&lt;p&gt;It launched with introductory pricing of &lt;strong&gt;$2 per million input tokens and $10 per million output tokens through August 31, 2026&lt;/strong&gt;, then moves to a standard &lt;strong&gt;$3 / $15&lt;/strong&gt; — the same tier Sonnet 4.6 occupied. Your &lt;em&gt;effective&lt;/em&gt; cost also depends on the new tokenizer (see below), so measure before you budget.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does the new tokenizer really change my costs?
&lt;/h3&gt;

&lt;p&gt;Yes. Anthropic states the same input can map to roughly &lt;strong&gt;1.0–1.35× as many tokens&lt;/strong&gt; under Sonnet 5's updated tokenizer, depending on content type — code and structured data sit at the higher end. Re-measure your real prompts before assuming the headline price drop equals your actual saving.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I use Sonnet 5 in Claude Code?
&lt;/h3&gt;

&lt;p&gt;Yes. It's available in Claude Code, the Claude platform, and the API, and it's the default model on Free and Pro plans (and available to Max, Team, and Enterprise). If you're already in Claude Code, switching is a model selection, not a migration.&lt;/p&gt;

&lt;h3&gt;
  
  
  Should I migrate my agents to Sonnet 5 immediately?
&lt;/h3&gt;

&lt;p&gt;Don't flip production on day one. Re-baseline token counts, run your eval suite head-to-head against your current model, then canary a slice of traffic before scaling — and keep an escalation path to Opus 4.8 for tasks that need it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The skill underneath the model
&lt;/h2&gt;

&lt;p&gt;Here's the part the launch posts skip: a cheaper, more agentic model doesn't make anyone a better builder. It just makes the &lt;em&gt;consequences&lt;/em&gt; of your design bigger — cheaper to be right at scale, and cheaper to be confidently wrong at scale. Point Sonnet 5's autonomy at a vague spec and you get a fast, plausible wall of actions you didn't design and can't fully audit.&lt;/p&gt;

&lt;p&gt;The developers getting real leverage from this launch aren't the ones who memorized the new price-per-token. They're the ones who understand agent architecture, context engineering, evals, and cost modeling well enough to know &lt;em&gt;when&lt;/em&gt; the cheap-and-autonomous option is the right call and when it's a trap. That foundation — taught around real repositories with an interactive AI instructor, not slide decks — is what we build at our &lt;a href="https://cursuri-ai.ro" rel="noopener noreferrer"&gt;Eastern European AI education platform&lt;/a&gt;, including a dedicated, hands-on track on &lt;a href="https://cursuri-ai.ro/courses/claude-code-mastery-coding-agentic" rel="noopener noreferrer"&gt;agentic coding with Claude Code&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Claude Sonnet 5 is a genuinely significant release for builders, but not for the reason most coverage leads with. The story isn't a benchmark number — it's that near-frontier agentic capability just moved down a price tier, which changes which agent designs are economically worth shipping. The catch is the new tokenizer: the real saving is the price drop &lt;em&gt;minus&lt;/em&gt; token inflation, and you only learn the second number by measuring.&lt;/p&gt;

&lt;p&gt;So don't migrate on the headline. Re-baseline your tokens, run your evals, canary your traffic, and keep Opus 4.8 one route away for the work that needs it. Do that, and Sonnet 5 is one of the better deals in the 2026 model lineup. Skip it, and you'll find out the hard way — on your invoice.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Written by the team at &lt;a href="https://cursuri-ai.ro" rel="noopener noreferrer"&gt;Cursuri-AI.ro&lt;/a&gt; — practical, hands-on AI engineering courses for developers and professionals across Eastern Europe, from agentic coding and AI agents to evals, context engineering, and the modern AI-native workflow.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sources:&lt;/strong&gt; &lt;a href="https://www.anthropic.com/news/claude-sonnet-5" rel="noopener noreferrer"&gt;Introducing Claude Sonnet 5 — Anthropic&lt;/a&gt; · &lt;a href="https://www.anthropic.com/claude-sonnet-5-system-card" rel="noopener noreferrer"&gt;Claude Sonnet 5 System Card&lt;/a&gt; · &lt;a href="https://platform.claude.com/docs/en/about-claude/pricing" rel="noopener noreferrer"&gt;Claude Platform — Pricing&lt;/a&gt; · &lt;a href="https://claude.com/pricing" rel="noopener noreferrer"&gt;Claude Pricing&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>cursor</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Cursor vs GitHub Copilot vs Claude Code: Which AI Coding Tool in 2026?</title>
      <dc:creator>galian</dc:creator>
      <pubDate>Mon, 29 Jun 2026 14:59:29 +0000</pubDate>
      <link>https://dev.to/cursuri-ai/cursor-vs-github-copilot-vs-claude-code-which-ai-coding-tool-in-2026-6c8</link>
      <guid>https://dev.to/cursuri-ai/cursor-vs-github-copilot-vs-claude-code-which-ai-coding-tool-in-2026-6c8</guid>
      <description>&lt;p&gt;If you write code for a living in 2026, you're not asking &lt;em&gt;whether&lt;/em&gt; to use an AI coding tool — you're asking &lt;em&gt;which one&lt;/em&gt;. And the three names that dominate every team's Slack debate are &lt;strong&gt;Cursor&lt;/strong&gt;, &lt;strong&gt;GitHub Copilot&lt;/strong&gt;, and &lt;strong&gt;Claude Code&lt;/strong&gt;. They look similar from a distance (type intent, get code) but they're built on three genuinely different bets about how software gets written.&lt;/p&gt;

&lt;p&gt;I've spent serious time in all three on real, multi-file, multi-repo work — not toy demos — and this is the comparison I wish someone had handed me before I burned a month figuring it out. I write and teach about agentic engineering at &lt;a href="https://cursuri-ai.ro" rel="noopener noreferrer"&gt;Cursuri-AI.ro&lt;/a&gt;, Eastern Europe's AI education platform, so I'll keep this grounded in how these tools actually behave in production, not in launch-day marketing.&lt;/p&gt;

&lt;p&gt;A note before we start: pricing and features in this category change almost monthly. Everything below is a mid-2026 snapshot — verify the current numbers on each tool's official page before you budget for a team.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR — three different philosophies
&lt;/h2&gt;

&lt;p&gt;Here's the one-sentence version of each, before we go deep:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cursor&lt;/strong&gt; is an &lt;strong&gt;AI-native editor&lt;/strong&gt; — it rebuilt the IDE around the agent. Best for developers who want fast, fluid, in-the-flow generation with deep editor integration.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Copilot&lt;/strong&gt; is the &lt;strong&gt;ecosystem play&lt;/strong&gt; — it lives where your code, issues, and PRs already are. Best for teams standardized on GitHub who want AI woven through the whole SDLC.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Claude Code&lt;/strong&gt; is the &lt;strong&gt;terminal-first agent&lt;/strong&gt; — it treats the command line as the primary surface and excels at autonomous, multi-step, multi-file work. Best for engineers comfortable orchestrating agents rather than babysitting autocomplete.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of them is "the best." They optimize for different moments, and the real skill is knowing which to reach for. Let's break down why.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Cursor?
&lt;/h2&gt;

&lt;p&gt;Cursor is an AI-native IDE built as a fork of VS Code, so the editor feels instantly familiar — your extensions, keybindings, and themes mostly carry over. What's different is that the AI isn't bolted on as a plugin; the whole editing experience is designed around it.&lt;/p&gt;

&lt;p&gt;Its signature features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Tab completion&lt;/strong&gt; — a multi-line, context-aware autocomplete that predicts your &lt;em&gt;next edit&lt;/em&gt;, not just the next token. It's the feature people miss most when they switch away.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Composer&lt;/strong&gt; — Cursor's agentic, multi-file editing mode. You describe a change in natural language and it edits across files, runs commands, and iterates. Cursor now ships &lt;strong&gt;Composer 2.5&lt;/strong&gt;, its own model trained specifically for agentic coding, alongside routing to frontier models from Anthropic, OpenAI, and Google.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloud Agents&lt;/strong&gt; — introduced in the Cursor 3.5 release (May 20, 2026), these run in isolated cloud VMs with terminal and browser access, can work across multiple repos in parallel, and report results back to your IDE asynchronously. It's Cursor's answer to "I want the agent working while I do something else."&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cursor's center of gravity is &lt;strong&gt;in-the-flow coding&lt;/strong&gt;: you stay in the editor, you see every diff, and the AI keeps pace with your thinking. It rewards developers who want speed without giving up granular control over the code.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is GitHub Copilot?
&lt;/h2&gt;

&lt;p&gt;Copilot is the most widely deployed of the three, and its biggest advantage is gravitational: it lives inside the tools and platform most teams already use. It runs in VS Code, JetBrains IDEs, Visual Studio, and on GitHub itself.&lt;/p&gt;

&lt;p&gt;By 2026 Copilot has grown well past autocomplete:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Agent mode&lt;/strong&gt; became generally available across both VS Code and JetBrains in March 2026 (previously VS Code only) — a multi-step agent that plans, edits across files, and runs commands inside your editor.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The autonomous coding agent&lt;/strong&gt; is the standout. You assign a GitHub issue to Copilot, and it works asynchronously in the background — analyzing the repo, making changes, and opening a ready-to-review pull request. Assign, walk away, come back to a PR. It's the closest any mainstream tool comes to "fire-and-forget" feature work.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agentic code review&lt;/strong&gt; gathers full project context before suggesting changes and can hand fixes straight to the coding agent.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Spark&lt;/strong&gt; lets you describe an app in plain English and get generated code with a live preview.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The strategic point: Copilot's value isn't any single feature — it's that AI is now threaded through the entire GitHub-centric SDLC, from issue to PR to review. If your team lives on GitHub, that integration is hard to beat.&lt;/p&gt;

&lt;p&gt;One billing change worth flagging: as of June 1, 2026, GitHub moved to &lt;strong&gt;GitHub AI Credits&lt;/strong&gt; (token-based billing) in place of the older Premium Request Units. You're now billed by tokens processed at published model rates, which makes heavy agent usage more transparent — and easier to accidentally overspend if you're not watching.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Claude Code?
&lt;/h2&gt;

&lt;p&gt;Claude Code, from Anthropic, takes the opposite stance from Cursor: instead of building an editor, it makes the &lt;strong&gt;terminal&lt;/strong&gt; the primary surface (with IDE extensions available on top). That sounds minimalist until you see what it does with full shell access.&lt;/p&gt;

&lt;p&gt;Its defining strengths:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Agentic, multi-file, repo-aware work&lt;/strong&gt; from the command line — it reads your codebase, makes coordinated changes across many files, runs your tests, and handles git operations and CI-aware workflows natively.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Subagents&lt;/strong&gt; — reusable agent configurations with their own custom prompts and tool access, so you can define a "reviewer," a "test-writer," or a "migration" agent and invoke it on demand.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agent teams and multi-agent orchestration&lt;/strong&gt; — coordinate multiple agent sessions working in parallel, with an agent view dashboard to manage them.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Claude Code runs on Anthropic's models — currently Claude Opus 4.8 as the default, with the newer Claude Fable 5 as the most capable tier — and it's deliberately model-opinionated rather than a router. The tradeoff is real: it's the most powerful for autonomous, complex tasks, and the least hand-holdy. It assumes you're comfortable thinking like an &lt;em&gt;orchestrator of agents&lt;/em&gt; rather than a writer of lines.&lt;/p&gt;

&lt;p&gt;A word of caution that applies to every agent platform but bites hardest here: &lt;strong&gt;parallel agents multiply your token spend.&lt;/strong&gt; Running ten agents at once consumes your quota roughly ten times faster. The autonomy is exhilarating; the bill is real. Set limits before you scale up.&lt;/p&gt;

&lt;h2&gt;
  
  
  Head-to-head: the dimensions that actually matter
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The editing model
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cursor&lt;/strong&gt; wins on &lt;em&gt;in-editor flow&lt;/em&gt;. Tab completion and inline diffs keep you in control of every change.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Copilot&lt;/strong&gt; wins on &lt;em&gt;breadth of surface&lt;/em&gt; — it's good everywhere your code already is.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Claude Code&lt;/strong&gt; wins on &lt;em&gt;autonomous depth&lt;/em&gt; — it goes furthest without supervision, but you give up the inline, line-by-line feel.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Agents and autonomy
&lt;/h3&gt;

&lt;p&gt;All three now have agents, but the philosophy differs. Cursor's Cloud Agents and Copilot's coding agent are both "assign work, get a result later." Claude Code goes further with explicit multi-agent orchestration and reusable subagents. If your work is increasingly &lt;em&gt;delegating&lt;/em&gt; rather than &lt;em&gt;typing&lt;/em&gt;, this is the dimension to weigh most — and it's exactly the shift that makes understanding &lt;a href="https://cursuri-ai.ro/courses/ai-agents-automatizare" rel="noopener noreferrer"&gt;AI agent architecture and automation&lt;/a&gt; a genuine career edge rather than a nice-to-have.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ecosystem and integration
&lt;/h3&gt;

&lt;p&gt;This is Copilot's home turf. The issue-to-PR loop, native code review, and presence across every major IDE make it the path of least resistance for GitHub-standardized teams. Cursor integrates deeply but inside &lt;em&gt;its&lt;/em&gt; editor; Claude Code integrates deeply with your &lt;em&gt;shell and git&lt;/em&gt;, which is either liberating or intimidating depending on your comfort with the command line.&lt;/p&gt;

&lt;h3&gt;
  
  
  Models
&lt;/h3&gt;

&lt;p&gt;Cursor routes across many frontier models and adds its own Composer model. Copilot offers a model picker. Claude Code is Anthropic-only by design. If model choice matters to you (and for some workloads it genuinely does), Cursor and Copilot give you more knobs; Claude Code bets that a tightly-integrated, top-tier model beats a buffet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pricing, side by side (mid-2026 snapshot)
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Entry&lt;/th&gt;
&lt;th&gt;Mid tier&lt;/th&gt;
&lt;th&gt;Power / team&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Cursor&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Hobby (free)&lt;/td&gt;
&lt;td&gt;Pro — $20/user/mo&lt;/td&gt;
&lt;td&gt;Teams — $40/user/mo (Standard), $120/user/mo (Premium)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;GitHub Copilot&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Free&lt;/td&gt;
&lt;td&gt;Pro — $10/mo · Pro+ — $39/mo&lt;/td&gt;
&lt;td&gt;Max — $100/mo · Business / Enterprise seats&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Claude Code&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Pro — $20/mo&lt;/td&gt;
&lt;td&gt;Max 5× — $100/mo&lt;/td&gt;
&lt;td&gt;Max 20× — $200/mo · API pay-per-token&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A few honest caveats on cost:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Copilot&lt;/strong&gt; has the cheapest entry paid tier ($10), but token-based AI Credits mean heavy agent use can climb fast beyond the included allotment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cursor's&lt;/strong&gt; $20 Pro includes a fixed amount of frontier-model usage; power users hit the ceiling and either upgrade or switch to its cheaper Auto/Composer routing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Claude Code's&lt;/strong&gt; Max tiers are priced for sustained, agent-heavy sessions — and again, parallel agents are a multiplier, not an add.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Prices and tiers shift constantly in this category. Treat the table as a snapshot, not a quote, and confirm before committing a team budget.&lt;/p&gt;

&lt;h2&gt;
  
  
  So which one should you choose?
&lt;/h2&gt;

&lt;p&gt;Here's the honest, persona-based answer:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Choose Cursor if&lt;/strong&gt; you want the best in-editor experience, you value fast inline generation and tight control over every diff, and you're happy living inside a (very good) VS Code fork. It's the most natural upgrade for a developer who loves their editor and wants AI to keep pace with their flow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Choose GitHub Copilot if&lt;/strong&gt; your team is standardized on GitHub and you want AI woven through the entire lifecycle — issues, PRs, reviews — across whatever IDEs your team already uses. The issue-to-PR autonomous agent alone can change how a team ships. It's the safest institutional bet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Choose Claude Code if&lt;/strong&gt; you're comfortable in the terminal, your work skews toward complex multi-file refactors and autonomous tasks, and you want to orchestrate agents rather than supervise autocomplete. It has the highest ceiling for autonomy — and asks the most of you in return.&lt;/p&gt;

&lt;p&gt;And the answer most senior engineers actually land on? &lt;strong&gt;More than one.&lt;/strong&gt; Plenty of us keep Cursor open for flow-state editing, lean on Copilot inside the GitHub workflow, and fire up Claude Code for the gnarly autonomous jobs. The tools overlap, but they're not redundant — they're a toolkit. The real meta-skill isn't loyalty to one editor; it's &lt;strong&gt;fluency across the category&lt;/strong&gt; so you instinctively reach for the right one per task.&lt;/p&gt;

&lt;h2&gt;
  
  
  The skill underneath the tools
&lt;/h2&gt;

&lt;p&gt;Here's the uncomfortable truth that the demos hide: these tools amplify the engineer you already are. Point a powerful agent at a vague intent and you get a fast, confident wall of code you didn't design and can't fully maintain. The developers getting outsized leverage from Cursor, Copilot, and Claude Code aren't the ones who learned the keyboard shortcuts — they're the ones who understand agent architecture, context engineering, and how to specify intent precisely enough that autonomy becomes an asset instead of a liability.&lt;/p&gt;

&lt;p&gt;That foundation is exactly what we build at &lt;a href="https://cursuri-ai.ro" rel="noopener noreferrer"&gt;our AI education platform&lt;/a&gt; for Eastern Europe — practical, project-based courses taught around real repositories with an interactive AI instructor, not slide decks. If you want to go from "I use these tools" to "I get serious leverage from them," we maintain dedicated, hands-on tracks for &lt;a href="https://cursuri-ai.ro/courses/cursor-pro" rel="noopener noreferrer"&gt;using Cursor as a pro&lt;/a&gt; and for &lt;a href="https://cursuri-ai.ro/courses/claude-code-mastery-coding-agentic" rel="noopener noreferrer"&gt;agentic coding with Claude Code&lt;/a&gt; — both built around real multi-file, real-repo workflows rather than toy examples.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In 2026, "AI coding tool" isn't one product category — it's three philosophies wearing similar clothes. Cursor bet on the editor, Copilot bet on the ecosystem, and Claude Code bet on the terminal-native agent. Each is genuinely excellent at the thing it optimized for, and genuinely compromised at the things it didn't.&lt;/p&gt;

&lt;p&gt;So don't ask "which is best." Ask "best at what, for whom, doing which task" — and then build the judgment to switch fluently between them. That judgment, not the tool, is what compounds over a career. Try each one on a real feature, not a demo, and you'll feel the differences fast.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Written by the team at &lt;a href="https://cursuri-ai.ro" rel="noopener noreferrer"&gt;Cursuri-AI.ro&lt;/a&gt; — practical, hands-on AI engineering courses for developers and professionals across Eastern Europe, from agentic coding and AI agents to context engineering and the modern AI-native IDE workflow.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sources:&lt;/strong&gt; &lt;a href="https://cursor.com/docs/models-and-pricing" rel="noopener noreferrer"&gt;Cursor Models &amp;amp; Pricing&lt;/a&gt; · &lt;a href="https://github.com/features/copilot/plans" rel="noopener noreferrer"&gt;GitHub Copilot Plans &amp;amp; Pricing&lt;/a&gt; · &lt;a href="https://docs.github.com/en/copilot/get-started/plans" rel="noopener noreferrer"&gt;GitHub Copilot Plans (Docs)&lt;/a&gt; · &lt;a href="https://claude.com/pricing" rel="noopener noreferrer"&gt;Claude Pricing&lt;/a&gt; · &lt;a href="https://platform.claude.com/docs/en/about-claude/pricing" rel="noopener noreferrer"&gt;Claude Platform Docs — Pricing&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Kiro: A Practical Guide to AWS's Spec-Driven Agentic IDE"</title>
      <dc:creator>galian</dc:creator>
      <pubDate>Fri, 26 Jun 2026 21:45:36 +0000</pubDate>
      <link>https://dev.to/galian/kiro-a-practical-guide-to-awss-spec-driven-agentic-ide-26o9</link>
      <guid>https://dev.to/galian/kiro-a-practical-guide-to-awss-spec-driven-agentic-ide-26o9</guid>
      <description>&lt;p&gt;If you've spent any time with AI coding assistants, you know the failure mode: you write a vague prompt, the agent generates a wall of plausible-looking code, and twenty minutes later you're debugging something you didn't design and don't fully understand. &lt;strong&gt;Kiro&lt;/strong&gt;, the agentic IDE from AWS, is a bet that the fix isn't a smarter autocomplete — it's making a &lt;em&gt;specification&lt;/em&gt; the unit of work instead of a prompt.&lt;/p&gt;

&lt;p&gt;I've been digging into how Kiro actually works, and this is the practical guide I wish I'd had on day one: what spec-driven development really means, how agent hooks and steering files change your workflow, where Kiro fits next to tools like Cursor and Claude Code, and when it's worth it. I write and teach about agentic engineering at &lt;a href="https://cursuri-ai.ro" rel="noopener noreferrer"&gt;Cursuri-AI.ro&lt;/a&gt;, Eastern Europe's AI education platform, so I'll keep this grounded in how these tools behave in real projects rather than in launch-day hype.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Kiro?
&lt;/h2&gt;

&lt;p&gt;Kiro is an agentic IDE built on the Code OSS platform — the same open-source foundation behind VS Code — which means the editor itself feels immediately familiar. What's different is the engine. Instead of treating each request as a one-off chat turn, Kiro is designed to turn a high-level prompt into a structured &lt;strong&gt;spec&lt;/strong&gt;, then drive implementation, tests, and documentation from that spec.&lt;/p&gt;

&lt;p&gt;The headline idea, in Kiro's own framing, is "moving beyond AI coding to agentic engineering." That sounds like marketing until you see the artifacts it produces. A feature request doesn't become a blob of code — it becomes three reviewable files: requirements, design, and tasks. You stay in the loop at each stage. The agent does the typing; you keep the judgment.&lt;/p&gt;

&lt;p&gt;It's worth being precise about what Kiro is &lt;em&gt;not&lt;/em&gt;: it isn't an AWS cloud service you provision in a console, and it doesn't lock you into AWS infrastructure to write code. It's a desktop IDE. You can point it at any project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Spec-driven development: the core idea
&lt;/h2&gt;

&lt;p&gt;Most AI coding tools optimize for speed-to-first-keystroke. Spec-driven development optimizes for &lt;em&gt;correctness-to-intent&lt;/em&gt; — does the code match what you actually meant? Kiro does this by formalizing the part of engineering we usually skip when we're moving fast: writing down what we're building before we build it.&lt;/p&gt;

&lt;p&gt;When you describe a feature, Kiro generates a spec in three phases:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Requirements
&lt;/h3&gt;

&lt;p&gt;Kiro turns your prompt into user stories with explicit acceptance criteria, written in &lt;strong&gt;EARS notation&lt;/strong&gt; (Easy Approach to Requirements Syntax). EARS is a lightweight, real technique for writing testable requirements — patterns like &lt;em&gt;"When [trigger], the system shall [response]"&lt;/em&gt;. The value is that ambiguity gets surfaced &lt;em&gt;before&lt;/em&gt; code exists. If your one-line prompt was underspecified, you'll see it in the requirements draft and can correct it in seconds, not after a debugging session.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Design
&lt;/h3&gt;

&lt;p&gt;Next, Kiro produces a technical design: the architecture, the components, the data flow, and the implementation approach. This is the document a senior engineer would normally write (or wish a junior had written) before touching the codebase. You review it, push back, and refine.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Tasks
&lt;/h3&gt;

&lt;p&gt;Finally, the design becomes a sequenced task list — discrete, trackable units of work the agent implements in order. Because tasks are explicit, you get accountability: you can see what's done, what's in progress, and what's left, instead of trusting a black box.&lt;/p&gt;

&lt;p&gt;The payoff is maintainability. A spec that lives in your repo is documentation that doesn't rot, because it &lt;em&gt;is&lt;/em&gt; the thing the agent built from. Six months later, the requirements and design files explain &lt;em&gt;why&lt;/em&gt; the code looks the way it does.&lt;/p&gt;

&lt;h2&gt;
  
  
  Agent hooks: automation that runs itself
&lt;/h2&gt;

&lt;p&gt;The second pillar is &lt;strong&gt;agent hooks&lt;/strong&gt; — automated triggers that fire agent prompts or shell commands when something happens in your IDE. Instead of remembering to run the linter, regenerate tests, or scan for secrets, you wire those actions to events once and forget about them.&lt;/p&gt;

&lt;p&gt;Hooks can be triggered by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;File events&lt;/strong&gt; — a file is created, saved, or deleted&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prompt and agent lifecycle events&lt;/strong&gt; — prompt submit, agent stop, pre/post tool use&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spec task events&lt;/strong&gt; — before or after a task executes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Manual triggers&lt;/strong&gt; — a button you press on demand&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Under the hood, hooks are just JSON files. Workspace-level hooks live in &lt;code&gt;.kiro/hooks/&lt;/code&gt;, and user-level hooks in &lt;code&gt;~/.kiro/hooks/&lt;/code&gt;. You can create them three ways: describe what you want in plain English and let Kiro generate the JSON, fill out a form, or write the JSON by hand. The practical version of this: every time you save a file, a hook can run your tests and a security scan automatically, so problems surface the moment they're introduced — not in CI an hour later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Steering files: stop repeating yourself
&lt;/h2&gt;

&lt;p&gt;If you've ever pasted "remember, we use tabs not spaces, we use Vitest not Jest, and never import from the legacy module" into chat for the hundredth time, &lt;strong&gt;steering files&lt;/strong&gt; are the fix. Steering gives Kiro persistent knowledge about your project through markdown files, so your conventions, libraries, and standards are applied consistently without re-explaining them every session.&lt;/p&gt;

&lt;p&gt;Steering files can be scoped two ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Workspace steering&lt;/strong&gt; lives in &lt;code&gt;.kiro/steering/&lt;/code&gt; and applies only to that project&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Global steering&lt;/strong&gt; applies across everything you build&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is essentially context engineering applied to a coding agent — encoding the durable knowledge an agent needs so it behaves like a teammate who's read your style guide, not a contractor seeing the repo for the first time. If you want to go deep on the discipline behind this, persistent memory and context strategy for agents is exactly what our &lt;a href="https://cursuri-ai.ro/courses/context-engineering-memorie-agenti" rel="noopener noreferrer"&gt;context engineering and agent memory course&lt;/a&gt; covers end to end.&lt;/p&gt;

&lt;h2&gt;
  
  
  MCP and agentic chat
&lt;/h2&gt;

&lt;p&gt;Beyond specs, hooks, and steering, Kiro ships the features you'd expect from a modern AI editor. It supports the &lt;strong&gt;Model Context Protocol (MCP)&lt;/strong&gt; for connecting external tools and data sources to the agent, and it includes an agentic chat with context providers for files, URLs, and docs for the ad-hoc work that doesn't justify a full spec.&lt;/p&gt;

&lt;p&gt;MCP support matters more than it sounds. It's the open standard that lets an agent reach your database, your ticketing system, your internal docs — without bespoke glue for each one. If MCP is new to you, building and integrating MCP servers is its own skill set; our &lt;a href="https://cursuri-ai.ro/courses/mcp-model-context-protocol" rel="noopener noreferrer"&gt;MCP course&lt;/a&gt; walks through standing up real servers and wiring them into agentic workflows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Your first hour with Kiro
&lt;/h2&gt;

&lt;p&gt;The fastest way to understand the workflow is to feel the loop once on a real, small feature. In practice it looks like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Describe the feature in plain language.&lt;/strong&gt; Not "build an app" — something concrete like "add an endpoint that returns a user's last five orders, paginated."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Review the requirements.&lt;/strong&gt; Kiro drafts user stories and acceptance criteria. This is where you catch the ambiguity: did you mean five orders total, or five per page? Fix it in the spec, where it costs nothing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Review the design.&lt;/strong&gt; Check that the proposed architecture matches your codebase's conventions — and if it doesn't, that's a sign your steering files need to capture those conventions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Let it work the task list.&lt;/strong&gt; The agent implements tasks in sequence; you watch and intervene where judgment is needed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wire one hook.&lt;/strong&gt; Even a single "run tests on save" hook changes how the session feels — feedback becomes immediate instead of deferred.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Do that once and the abstract pitch — "specs as the unit of work" — turns concrete. The discipline isn't heavy; it's front-loaded, and the front-loading is where the bugs you didn't ship were quietly avoided.&lt;/p&gt;

&lt;h2&gt;
  
  
  Kiro vs. vibe coding
&lt;/h2&gt;

&lt;p&gt;"Vibe coding" — prompting your way to an app on feel, accepting whatever the model produces — is genuinely useful for prototypes, throwaway scripts, and learning. It's also where a lot of teams get burned when that "prototype" quietly becomes production.&lt;/p&gt;

&lt;p&gt;Kiro is, in a sense, the structured opposite. The spec phase forces the requirements-and-design thinking that vibe coding skips. That doesn't make vibe coding wrong — it makes them tools for different moments. Reaching for a spec to build a one-off script is overkill; vibe-coding a payment flow is asking for trouble. Knowing &lt;em&gt;which mode fits which task&lt;/em&gt; is the actual skill, and it's the through-line of our &lt;a href="https://cursuri-ai.ro/courses/vibe-coding-prompt-la-aplicatie" rel="noopener noreferrer"&gt;vibe coding course&lt;/a&gt;, which treats prompt-to-app speed and structured engineering as complementary, not rival, philosophies.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Kiro compares to other agentic tools
&lt;/h2&gt;

&lt;p&gt;Kiro isn't alone — the agentic IDE space is crowded, and the tools overlap. A few honest distinctions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cursor&lt;/strong&gt; is an AI-native editor built around fast in-editor generation, multi-file edits, and an agent mode. Its center of gravity is fluid, in-the-flow coding.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Claude Code&lt;/strong&gt; is a terminal-first agentic tool that excels at multi-file changes, git operations, and CI-aware work from the command line.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Kiro&lt;/strong&gt; distinguishes itself by making the &lt;em&gt;spec&lt;/em&gt; the artifact — front-loading requirements and design before implementation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These aren't mutually exclusive; plenty of engineers use more than one and switch by task. The meta-skill is fluency across the category rather than loyalty to one editor. If you want a structured path through these tools, we maintain dedicated, hands-on courses on &lt;a href="https://cursuri-ai.ro/courses/claude-code-mastery-coding-agentic" rel="noopener noreferrer"&gt;agentic coding with Claude Code&lt;/a&gt; and on &lt;a href="https://cursuri-ai.ro/courses/cursor-pro" rel="noopener noreferrer"&gt;Cursor as a pro&lt;/a&gt; — both built around real multi-file, real-repo workflows rather than toy demos.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pricing
&lt;/h2&gt;

&lt;p&gt;At the time of writing, Kiro uses a credit-based model measured in &lt;strong&gt;agent interactions&lt;/strong&gt;, with no daily or weekly rate limits and pre-paid overages so you don't hit a hard wall mid-task:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Free&lt;/strong&gt; — 50 agent interactions per user per month (fine for experimentation, not serious daily work)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pro&lt;/strong&gt; — $19 per user per month for 1,000 agent interactions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pro+&lt;/strong&gt; — $39 per user per month for 3,000 interactions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pricing and tiers for tools in this category change often, so verify the current numbers on Kiro's official pricing page before you budget for a team. Treat the figures above as a snapshot, not a contract.&lt;/p&gt;

&lt;h2&gt;
  
  
  When Kiro is worth it — and when it isn't
&lt;/h2&gt;

&lt;p&gt;Spec-driven development has a cost: the spec phase is overhead. That overhead pays off when the work is durable and shared, and it's pure friction when the work is disposable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kiro shines when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You're building features meant to live and be maintained, not prototypes you'll throw away&lt;/li&gt;
&lt;li&gt;More than one person (or one agent) touches the codebase and conventions matter&lt;/li&gt;
&lt;li&gt;You want an auditable trail of &lt;em&gt;why&lt;/em&gt; the code is the way it is&lt;/li&gt;
&lt;li&gt;You're tired of re-explaining your standards every session&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Reach for something lighter when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You're exploring, prototyping, or scripting something you'll delete tomorrow&lt;/li&gt;
&lt;li&gt;The task is small enough that writing the spec costs more than writing the code&lt;/li&gt;
&lt;li&gt;You just need a quick answer or a one-file change&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The honest take: spec-driven development is a discipline, and Kiro is tooling that makes the discipline cheaper to follow. The tool won't supply the engineering judgment — it removes the excuse not to apply it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Want to go deeper?
&lt;/h2&gt;

&lt;p&gt;Tools like Kiro lower the cost of doing engineering properly, but they reward people who already understand specs, agent architecture, context management, and the MCP ecosystem underneath. That foundation is what turns an agentic IDE from a faster autocomplete into genuine leverage.&lt;/p&gt;

&lt;p&gt;At &lt;strong&gt;&lt;a href="https://cursuri-ai.ro" rel="noopener noreferrer"&gt;Cursuri-AI.ro&lt;/a&gt;&lt;/strong&gt;, Eastern Europe's AI education platform, we build practical, project-based courses on exactly this stack — agentic coding, MCP, context engineering, and the modern AI-native IDE workflow — taught around real repositories with an interactive AI instructor, not slide decks. If Kiro made you curious about &lt;em&gt;agentic engineering&lt;/em&gt; as a craft rather than a buzzword, that's the rabbit hole our catalog is built for.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Kiro's core bet is simple and, I think, correct: the bottleneck in AI-assisted development was never typing speed — it was the gap between what you meant and what the model built. By making specs the unit of work, adding agent hooks for automation and steering files for persistent context, Kiro turns "AI coding" into something closer to engineering with an agent.&lt;/p&gt;

&lt;p&gt;It won't replace judgment, and it isn't the right tool for every task. But for durable, maintainable software built with an AI in the loop, spec-driven development is a genuinely different — and more accountable — way to work. Try it on a real feature, not a toy, and you'll feel the difference fast.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Written by the team at &lt;a href="https://cursuri-ai.ro" rel="noopener noreferrer"&gt;Cursuri-AI.ro&lt;/a&gt; — practical, hands-on AI engineering courses for developers and professionals across Eastern Europe, from agentic coding and MCP to context engineering and AI-native IDE workflows.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sources:&lt;/strong&gt; &lt;a href="https://kiro.dev/" rel="noopener noreferrer"&gt;kiro.dev&lt;/a&gt; · &lt;a href="https://kiro.dev/docs/specs/" rel="noopener noreferrer"&gt;Kiro Specs docs&lt;/a&gt; · &lt;a href="https://kiro.dev/docs/hooks/" rel="noopener noreferrer"&gt;Kiro Hooks docs&lt;/a&gt; · &lt;a href="https://kiro.dev/docs/steering/" rel="noopener noreferrer"&gt;Kiro Steering docs&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Stop Vibe-Checking Your LLM: A Developer's Guide to Evals</title>
      <dc:creator>galian</dc:creator>
      <pubDate>Mon, 22 Jun 2026 08:24:22 +0000</pubDate>
      <link>https://dev.to/cursuri-ai/stop-vibe-checking-your-llm-a-developers-guide-to-evals-3oed</link>
      <guid>https://dev.to/cursuri-ai/stop-vibe-checking-your-llm-a-developers-guide-to-evals-3oed</guid>
      <description>&lt;p&gt;You tweaked the system prompt, ran the same two test questions you always run, the answers looked good, and you shipped. A week later support is forwarding you screenshots of the model confidently doing the exact thing your prompt was supposed to stop. You never saw it, because "did it get better?" was answered by vibes.&lt;/p&gt;

&lt;p&gt;This is the single most common failure mode in shipping LLM features, and it has nothing to do with which model you picked. &lt;strong&gt;If your only quality gate is reading a handful of outputs and nodding, every change you make is a coin flip.&lt;/strong&gt; You can't tell whether a prompt edit helped, hurt, or just moved the failures somewhere you didn't look. Evals are how you replace the nod with a number.&lt;/p&gt;

&lt;p&gt;This is a practical guide to building that number — from a 30-row eval set you can write this afternoon, through code-based checks and LLM-as-judge scoring, to wiring the whole thing into CI so regressions get blocked instead of discovered by users. No new framework to adopt; just the discipline that separates a demo from a system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why you can't just &lt;code&gt;assert output == expected&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Traditional tests work because the output space is small and exact. &lt;code&gt;add(2, 2)&lt;/code&gt; is &lt;code&gt;4&lt;/code&gt; or it's a bug. LLM output breaks all three assumptions that make &lt;code&gt;assertEqual&lt;/code&gt; work:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It's non-deterministic.&lt;/strong&gt; The same prompt can produce different text on two calls. Even at temperature 0 you are not guaranteed byte-identical output across runs or model versions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It's open-ended.&lt;/strong&gt; "Summarize this ticket" has thousands of correct answers. None of them are string-equal to your reference, and that's fine — a good summary isn't &lt;em&gt;the&lt;/em&gt; summary.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It fails softly.&lt;/strong&gt; A wrong answer isn't a stack trace. It's a fluent, plausible, well-formatted paragraph that happens to be incorrect. Nothing crashes. Nothing logs an error.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the goal of an eval isn't "is the output identical to the expected string." It's "does the output satisfy the &lt;em&gt;properties&lt;/em&gt; I care about" — is it grounded in the provided context, does it stay on policy, does it actually answer the question, is it valid JSON. You're testing behavior against criteria, not bytes against bytes. Once that clicks, the rest is mechanics.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with the eval set, not the metric
&lt;/h2&gt;

&lt;p&gt;The instinct is to reach for a fancy metric first. Wrong order. The asset that makes everything else work is a small, representative &lt;strong&gt;eval set&lt;/strong&gt;: a fixed collection of inputs paired with what a good output looks like (or the criteria a good output must meet). This is your golden dataset, your regression suite, your source of truth.&lt;/p&gt;

&lt;p&gt;You do not need thousands of examples to start. &lt;strong&gt;Thirty to fifty well-chosen pairs&lt;/strong&gt; turn LLM tuning from vibes into engineering, because now every change is measured against the same fixed bar. Build the set like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Mine real failures.&lt;/strong&gt; Every time the system gets something wrong in dev or prod, that exact input goes into the eval set with a note on what the right behavior is. Your bug reports &lt;em&gt;are&lt;/em&gt; your test cases. This is the highest-signal source you have.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cover the categories, not just the happy path.&lt;/strong&gt; Easy questions, ambiguous ones, adversarial ones, out-of-scope ones ("I don't know" is the correct answer and you should test that it says so), and the edge cases specific to your domain.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Freeze it and version it.&lt;/strong&gt; The eval set lives in your repo next to the code. When you add a case, that's a commit. A moving target can't measure progress.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep a holdout.&lt;/strong&gt; If you start tuning prompts &lt;em&gt;against&lt;/em&gt; the eval set, you'll overfit to it. Keep a slice you don't look at until you think you're done.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A minimal eval set is just data — JSON, a CSV, a Python list. Here's the shape:&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="c1"&gt;# evals/dataset.py
&lt;/span&gt;&lt;span class="n"&gt;EVAL_SET&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;refund-window-basic&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;question&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;What is our refund window?&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;context&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Refunds are accepted within 14 days of purchase.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;expected&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;14 days&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;must_not_say&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;30 days&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;no refunds&lt;/span&gt;&lt;span class="sh"&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;out-of-scope&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;question&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;What&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s the weather in Cluj tomorrow?&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;context&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Refunds are accepted within 14 days of purchase.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;expected&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;REFUSE&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;# correct behavior: decline, don't invent
&lt;/span&gt;    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="c1"&gt;# ... 30-50 of these, grown from real failures
&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's the foundation. Everything below scores outputs against this set.&lt;/p&gt;

&lt;h2&gt;
  
  
  The two halves of every LLM eval
&lt;/h2&gt;

&lt;p&gt;Separate two questions that get mushed together when you eval by eyeball, because they have different fixes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Did the system retrieve / set up the right context?&lt;/strong&gt; (a retrieval or pipeline question)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Given that context, did the model produce a good answer?&lt;/strong&gt; (a generation question)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you're building RAG, the first half is its own discipline — measuring recall@k and precision@k on questions with known relevant documents tells you whether the right chunk even reached the prompt. That's a deep enough topic that it deserves its own treatment; a dedicated &lt;a href="https://cursuri-ai.ro/courses/rag-retrieval-augmented-generation" rel="noopener noreferrer"&gt;course on RAG and retrieval-augmented generation&lt;/a&gt; spends real time there, and the failure modes are different from the ones below. This guide focuses on the second half: scoring the generated answer. The techniques split into two families — &lt;strong&gt;code-based checks&lt;/strong&gt; and &lt;strong&gt;model-based judges&lt;/strong&gt; — and you want both.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code-based checks: cheaper and more reliable than you think
&lt;/h2&gt;

&lt;p&gt;Before you reach for an LLM to grade an LLM, a surprising amount of quality is checkable with plain code. These checks are deterministic, free, instant, and never hallucinate. Use them for everything they can cover:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Structural validity.&lt;/strong&gt; If the output should be JSON matching a schema, validate it. A response that doesn't parse is a hard failure, no judgment call needed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Must-contain / must-not-contain.&lt;/strong&gt; The answer about a 14-day refund window must contain "14" and must not contain "30." Keyword and regex assertions catch a whole class of factual regressions for free.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Format and bounds.&lt;/strong&gt; Length limits, required citations present, no leaked system-prompt text, no forbidden phrases (the "as an AI language model" tax), valid enum values.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Semantic similarity.&lt;/strong&gt; For open-ended answers, embed the output and your reference answer and check cosine similarity passes a threshold. It's fuzzy, but it catches "the answer wandered off topic" without needing a judge model.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# evals/checks.py
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;check_structural&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;schema_keys&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&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="nb"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;data&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;output&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;JSONDecodeError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;schema_keys&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;check_must_not_say&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;banned&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&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="nb"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;low&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="nf"&gt;any&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;low&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;banned&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The rule of thumb: &lt;strong&gt;anything a regex or a schema can catch, don't pay a model to catch.&lt;/strong&gt; Reserve the expensive, fuzzy judge for the genuinely subjective stuff.&lt;/p&gt;

&lt;h2&gt;
  
  
  LLM-as-judge: powerful, biased, and fixable
&lt;/h2&gt;

&lt;p&gt;For the subjective half — "is this answer faithful to the source?", "is this helpful?", "is the tone right?" — you use a strong model to grade outputs. This is &lt;strong&gt;LLM-as-judge&lt;/strong&gt;, and it scales human-quality judgment to thousands of examples for the price of an API call. Two metrics carry most of the weight for RAG-style apps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Faithfulness / groundedness&lt;/strong&gt; — does every claim in the answer trace back to the provided context, or did the model invent things? This is your hallucination detector.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Answer relevance&lt;/strong&gt; — does the response actually address the question that was asked, or is it a fluent dodge?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The catch: &lt;strong&gt;LLM judges have well-documented biases&lt;/strong&gt;, and if you ignore them your eval numbers are noise dressed up as signal. The big ones, all reported in the research on using models as evaluators:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Position bias&lt;/strong&gt; — when comparing two answers, judges favor the one shown first (or in a fixed slot) regardless of quality.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Verbosity bias&lt;/strong&gt; — judges tend to rate longer, more elaborate answers higher even when a short answer is more correct.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Self-preference&lt;/strong&gt; — a judge model can favor text written in its own style or by its own family.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You don't abandon the technique; you engineer around the bias:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Score against a rubric, not a vibe.&lt;/strong&gt; Ask for a 1–5 score with explicit criteria for each level, and require the judge to output its reasoning &lt;em&gt;before&lt;/em&gt; the score. A judge forced to justify itself is more consistent.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;For pairwise comparisons, randomize and swap.&lt;/strong&gt; Run each comparison twice with the order flipped; only count it as a win if the judge picks the same answer both times. This cancels position bias directly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Calibrate against humans.&lt;/strong&gt; Hand-label 20–30 examples yourself, run the judge on them, and check it agrees with you. If it doesn't, fix the rubric before trusting it on 2,000. An uncalibrated judge is a random number generator with good grammar.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use a strong model as the judge.&lt;/strong&gt; Grading is harder than answering. Use a current frontier model for the judge even if your app runs on a smaller, cheaper one.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# evals/judge.py — sketch of a rubric-based faithfulness judge
&lt;/span&gt;&lt;span class="n"&gt;JUDGE_PROMPT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;You are grading whether an ANSWER is fully supported by the CONTEXT.

CONTEXT:
{context}

ANSWER:
{answer}

Rules:
- A claim is &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;supported&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt; only if the CONTEXT states or directly implies it.
- Outside knowledge does NOT count as support.

First write one sentence of reasoning. Then output a JSON object:
{{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;reasoning&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;, &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;faithful&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;: true|false}}&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;judge_faithfulness&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;context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&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="nb"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;resp&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;complete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;JUDGE_PROMPT&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;context&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="n"&gt;answer&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="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&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;resp&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;faithful&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Designing judges that hold up — picking the rubric, calibrating, knowing when a model is the wrong tool for the grade — is exactly the muscle a &lt;a href="https://cursuri-ai.ro/courses/ai-evals-llm-productie" rel="noopener noreferrer"&gt;course on AI evals in production&lt;/a&gt; builds, because it's the difference between "the new prompt feels better" and "faithfulness went from 0.78 to 0.91 on the holdout."&lt;/p&gt;

&lt;h2&gt;
  
  
  Wire it into CI, or it won't survive contact with deadlines
&lt;/h2&gt;

&lt;p&gt;An eval you run by hand when you remember to is an eval you'll stop running the week things get busy. The whole point is to make regressions &lt;em&gt;impossible to ship silently&lt;/em&gt;, and that means the eval runs automatically on every change to a prompt, a retrieval setting, or a model version.&lt;/p&gt;

&lt;p&gt;The pattern is a regression gate: run the eval set, compute the aggregate score, and &lt;strong&gt;fail the build if the score drops below a threshold&lt;/strong&gt; (or below the last known-good baseline). It looks like an ordinary test suite, because that's what it is.&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="c1"&gt;# tests/test_evals.py
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;pytest&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;evals.dataset&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;EVAL_SET&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;evals.checks&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;check_must_not_say&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;myapp&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;answer_question&lt;/span&gt;

&lt;span class="n"&gt;PASS_THRESHOLD&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.90&lt;/span&gt;  &lt;span class="c1"&gt;# 90% of eval cases must pass to ship
&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;run_case&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;case&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;answer_question&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;case&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;question&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;case&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;context&lt;/span&gt;&lt;span class="sh"&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;case&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;expected&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;REFUSE&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;i don&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;t know&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;can&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;t&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lower&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="nf"&gt;check_must_not_say&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;case&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;must_not_say&lt;/span&gt;&lt;span class="sh"&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;return&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;case&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;expected&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lower&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;test_eval_suite_meets_threshold&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;run_case&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&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;c&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;EVAL_SET&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;results&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;results&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;failed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="sh"&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;c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ok&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;zip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;EVAL_SET&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;results&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;ok&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;score&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;PASS_THRESHOLD&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Eval score &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;score&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; below &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;PASS_THRESHOLD&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;. Failed: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;failed&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A few practical notes that keep this sane in CI:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pin the model version.&lt;/strong&gt; Provider model IDs update, and an unpinned model means your eval baseline shifts under you for reasons unrelated to your code. Pin it, and treat a model upgrade as its own deliberate eval run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Budget for cost and flakiness.&lt;/strong&gt; LLM calls cost money and occasionally time out. Cache where you can, run the judge-heavy suite on a schedule rather than every commit if needed, and set a slightly forgiving threshold so one stochastic blip doesn't red-X a good PR.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Log the failures, not just the score.&lt;/strong&gt; When the gate trips, the output should name &lt;em&gt;which&lt;/em&gt; cases regressed so the fix is obvious. A bare "0.86 &amp;lt; 0.90" sends you debugging blind.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now a prompt change is a PR with a number attached. The reviewer sees faithfulness went up and refusal rate held steady, or they see it tanked and the build is red. That's the entire difference between hoping and knowing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Five mistakes that quietly poison your evals
&lt;/h2&gt;

&lt;p&gt;Even teams that build evals often undermine them. Watch for these:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Testing only the happy path.&lt;/strong&gt; If every case in your set is a question the system already answers well, your score is a flattering lie. Adversarial and out-of-scope cases are where the signal is.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tuning on your test set.&lt;/strong&gt; Optimize prompts against the same examples you grade on and you'll overfit to them. Keep a holdout you don't peek at.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An uncalibrated judge.&lt;/strong&gt; Trusting an LLM judge you never checked against your own labels is trusting a number you made up. Calibrate first.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One giant blended score.&lt;/strong&gt; A single average hides that faithfulness improved while refusals broke. Track metrics &lt;em&gt;separately&lt;/em&gt; so a regression in one can't be masked by a gain in another.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Letting the set rot.&lt;/strong&gt; Your product changes; cases that no longer reflect real usage drag the signal down. Prune and grow the set as part of normal work, the same way you maintain any test suite.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;None of these are exotic. They're the eval equivalent of not testing error paths — obvious in hindsight, easy to skip under deadline.&lt;/p&gt;

&lt;h2&gt;
  
  
  How this connects to the rest of your LLM stack
&lt;/h2&gt;

&lt;p&gt;Evals aren't a standalone chore; they're the measurement layer that makes every other improvement legible. When you tighten a prompt, evals tell you if it worked — which is why &lt;a href="https://cursuri-ai.ro/courses/prompt-engineering-masterclass" rel="noopener noreferrer"&gt;structured prompt engineering&lt;/a&gt; and a real eval loop are two halves of the same skill. When you redesign what goes into the context window — what to include, what to cut, how to order it — evals are how you know the redesign helped rather than just &lt;em&gt;felt&lt;/em&gt; cleaner; that discipline of deciding what earns a place in the prompt is increasingly called context engineering and has &lt;a href="https://cursuri-ai.ro/courses/context-engineering-memorie-agenti" rel="noopener noreferrer"&gt;its own dedicated course&lt;/a&gt;. And when you wire up function calling, multi-tool orchestration, and the production concerns of a real integration, evals are what keep the whole pipeline honest as it grows — the kind of end-to-end build covered in a deeper &lt;a href="https://cursuri-ai.ro/courses/advanced-llm-integration" rel="noopener noreferrer"&gt;course on advanced LLM integration&lt;/a&gt;. The pattern is always the same: build the measurement first, then every change becomes verifiable instead of hopeful.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The teams whose LLM features actually hold up in production aren't using a secret model or a magic prompt. They're disciplined about measurement. They have a versioned eval set grown from real failures, code-based checks for everything a regex can catch, calibrated LLM judges for the subjective rest, and a CI gate that blocks regressions before users find them.&lt;/p&gt;

&lt;p&gt;Start smaller than you think you can. Write thirty cases this afternoon — half of them things your system currently gets &lt;em&gt;wrong&lt;/em&gt; — add three code checks and one rubric-based judge, and put a threshold in your test suite. The first time a red build stops you from shipping a prompt change that would have quietly broken refusals, you'll never go back to vibe-checking. That's the moment an LLM demo becomes an LLM system people can trust.&lt;/p&gt;

&lt;p&gt;The courses linked throughout are part of &lt;a href="https://cursuri-ai.ro/courses/ai-evals-llm-productie" rel="noopener noreferrer"&gt;Cursuri-AI.ro&lt;/a&gt;, an AI-learning platform with hands-on, current tracks on evaluating AI systems in production, prompt engineering, RAG, and advanced LLM integration.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Sources &amp;amp; further reading:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Zheng et al. — &lt;a href="https://arxiv.org/abs/2306.05685" rel="noopener noreferrer"&gt;Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena&lt;/a&gt; (documents position, verbosity, and self-enhancement bias in LLM judges)&lt;/li&gt;
&lt;li&gt;Liu et al. — &lt;a href="https://arxiv.org/abs/2303.16634" rel="noopener noreferrer"&gt;G-Eval: NLG Evaluation using GPT-4 with Better Human Alignment&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Liang et al. — &lt;a href="https://arxiv.org/abs/2211.09110" rel="noopener noreferrer"&gt;Holistic Evaluation of Language Models (HELM)&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;This article is educational content. Techniques and tooling evolve quickly; validate approaches against your own data and current library documentation.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
      <category>llm</category>
    </item>
    <item>
      <title>How Click Fraud Works — and How to Detect Bot Clicks in Real Time</title>
      <dc:creator>galian</dc:creator>
      <pubDate>Thu, 18 Jun 2026 13:35:47 +0000</pubDate>
      <link>https://dev.to/galian/how-click-fraud-works-and-how-to-detect-bot-clicks-in-real-time-534d</link>
      <guid>https://dev.to/galian/how-click-fraud-works-and-how-to-detect-bot-clicks-in-real-time-534d</guid>
      <description>&lt;p&gt;Every time someone clicks your Google or Bing ad, you pay. The uncomfortable part:&lt;br&gt;
a meaningful share of those clicks were never going to become customers. They come&lt;br&gt;
from bots, competitors burning your budget, click farms, and misconfigured scripts&lt;br&gt;
hammering your landing page. Independent studies — and our own data at&lt;br&gt;
&lt;a href="https://protectads.com/?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=how-click-fraud-works" rel="noopener noreferrer"&gt;ProtectAds&lt;/a&gt; —&lt;br&gt;
put &lt;strong&gt;invalid traffic at roughly 15–30% of paid-search spend&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If you run PPC, that's not a rounding error. On a €10,000/month budget, it's&lt;br&gt;
€1,500–€3,000 quietly leaking out every month. This article breaks down how click&lt;br&gt;
fraud actually works, why the ad platforms don't fully stop it for you, and why the&lt;br&gt;
"just block the IP" approach falls apart at scale.&lt;/p&gt;

&lt;h2&gt;
  
  
  First, the vocabulary: invalid traffic vs. click fraud
&lt;/h2&gt;

&lt;p&gt;The ad industry (IAB/MRC) splits &lt;strong&gt;Invalid Traffic (IVT)&lt;/strong&gt; into two buckets:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GIVT — General Invalid Traffic:&lt;/strong&gt; the obvious stuff. Known data-center IPs,
declared bots and crawlers, spiders. Detectable with lists and simple rules.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SIVT — Sophisticated Invalid Traffic:&lt;/strong&gt; the expensive stuff. Hijacked devices,
headless browsers pretending to be Chrome, residential-proxy networks, click
farms with real fingerprints, automation that mimics human timing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Click fraud&lt;/strong&gt; is the malicious, intent-driven slice of IVT aimed specifically at&lt;br&gt;
your ads — a competitor draining your daily budget, or a click farm monetizing fake&lt;br&gt;
engagement. GIVT you can filter with a blocklist. SIVT is where real detection&lt;br&gt;
earns its keep. (We go deeper on this distinction&lt;br&gt;
&lt;a href="https://protectads.com/what-is-invalid-traffic?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=how-click-fraud-works" rel="noopener noreferrer"&gt;here&lt;/a&gt;.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the platforms don't fully solve this for you
&lt;/h2&gt;

&lt;p&gt;Google and Microsoft do filter obvious invalid clicks and issue some credits. But&lt;br&gt;
their filtering is conservative, opaque, and applied &lt;em&gt;after the fact&lt;/em&gt; — you find out&lt;br&gt;
in aggregate, weeks later, with little per-click evidence. They're also structurally&lt;br&gt;
conflicted: invalid clicks are still billed first and credited later, if at all.&lt;/p&gt;

&lt;p&gt;That leaves a gap for sophisticated invalid traffic that looks human enough to pass&lt;br&gt;
platform filters but never converts. Closing that gap is an engineering problem:&lt;br&gt;
score every click in real time and act on it before the budget is gone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why sophisticated click fraud is so hard to catch
&lt;/h2&gt;

&lt;p&gt;The obvious stuff (GIVT) is easy to filter. The expensive stuff (SIVT) is hard on&lt;br&gt;
purpose — it's built to look human:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It rotates through fresh IPs and residential proxies, so any static blocklist is
out of date the moment you save it.&lt;/li&gt;
&lt;li&gt;It runs on real or convincingly spoofed devices, so a single attribute rarely
gives it away.&lt;/li&gt;
&lt;li&gt;It mimics human timing and behavior well enough to slip past simple rules.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's why "detect fraud" isn't one trick — it's continuous analysis at scale,&lt;br&gt;
correlating signals across many clicks and campaigns over time, with thresholds&lt;br&gt;
tuned so you catch the bad traffic &lt;em&gt;without&lt;/em&gt; blocking real buyers. Doing that&lt;br&gt;
reliably, and fast enough to act before the budget is gone, is the hard part — and&lt;br&gt;
it's why most advertisers are better off with a dedicated system than a homegrown&lt;br&gt;
script. (Here's&lt;br&gt;
&lt;a href="https://protectads.com/how-it-works?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=how-click-fraud-works" rel="noopener noreferrer"&gt;how ProtectAds approaches it&lt;/a&gt;.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Why "just block the IP" doesn't scale
&lt;/h2&gt;

&lt;p&gt;The first instinct is a spreadsheet of bad IPs pasted into Google Ads exclusions.&lt;br&gt;
It breaks down fast:&lt;/p&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;Manual blocklist&lt;/th&gt;
&lt;th&gt;Automated protection&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;New IPs every day&lt;/td&gt;
&lt;td&gt;You're always behind&lt;/td&gt;
&lt;td&gt;Handled continuously&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Attackers rotate IPs constantly&lt;/td&gt;
&lt;td&gt;Whack-a-mole&lt;/td&gt;
&lt;td&gt;Doesn't rely on a static list&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ad platforms cap exclusion lists&lt;/td&gt;
&lt;td&gt;Fills up fast&lt;/td&gt;
&lt;td&gt;Prioritizes the worst offenders automatically&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Evidence for refund claims&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;Per-click log you can export&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Across many campaigns/accounts&lt;/td&gt;
&lt;td&gt;Doesn't&lt;/td&gt;
&lt;td&gt;Centralized&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;IPs are cheap and disposable for attackers; your manual list is neither. Sustainable&lt;br&gt;
protection has to run continuously, automate the exclusions, and keep an audit trail&lt;br&gt;
you can take back to the ad platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  Turning detection into protection
&lt;/h2&gt;

&lt;p&gt;Detection is only half the job — you have to &lt;em&gt;act&lt;/em&gt; on it. A working pipeline:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Observe&lt;/strong&gt; ad clicks as they hit your site.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Assess&lt;/strong&gt; each one in real time to tell genuine visitors from invalid traffic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Block&lt;/strong&gt; offending IPs by pushing them to your campaign exclusion lists
automatically — no manual copy-paste.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Report&lt;/strong&gt; with a per-click, per-campaign log so you can request ad credits with
evidence instead of vibes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is exactly what &lt;a href="https://protectads.com/features?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=how-click-fraud-works" rel="noopener noreferrer"&gt;ProtectAds&lt;/a&gt;&lt;br&gt;
does for &lt;strong&gt;Google Ads&lt;/strong&gt; (including Performance Max / PMax) and &lt;strong&gt;Microsoft (Bing)&lt;br&gt;
Ads&lt;/strong&gt;. You connect your account once, and it runs the detect → block → report loop&lt;br&gt;
continuously. Agencies running multiple client accounts and domains get dedicated&lt;br&gt;
&lt;a href="https://protectads.com/prices/agency?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=how-click-fraud-works" rel="noopener noreferrer"&gt;agency plans&lt;/a&gt;&lt;br&gt;
for managing protection at scale.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A note on scope: ProtectAds protects Google Ads and Bing Ads. Meta/Facebook Ads&lt;br&gt;
aren't covered — paid &lt;em&gt;search&lt;/em&gt; is where competitor and bot click fraud hits&lt;br&gt;
hardest, so that's where we focus.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  How much is this worth to you?
&lt;/h2&gt;

&lt;p&gt;Take your monthly paid-search spend and multiply by 15–30%. That range is your&lt;br&gt;
realistic exposure to invalid traffic. Even at the low end, recovering it usually&lt;br&gt;
dwarfs the cost of detection — which is the entire economic argument for automating&lt;br&gt;
this instead of eyeballing reports once a quarter. (You can sanity-check your own&lt;br&gt;
number with the&lt;br&gt;
&lt;a href="https://protectads.com/click-fraud-calculator?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=how-click-fraud-works" rel="noopener noreferrer"&gt;click fraud calculator&lt;/a&gt;.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it on your own campaigns
&lt;/h2&gt;

&lt;p&gt;If you're spending on Google or Bing ads and you've ever wondered why your&lt;br&gt;
click-through looks healthy but conversions don't follow, invalid traffic is a prime&lt;br&gt;
suspect. The fastest way to find out is to point real detection at your live&lt;br&gt;
campaigns and watch what it flags.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://protectads.com/free_trial?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=how-click-fraud-works" rel="noopener noreferrer"&gt;Start a free ProtectAds trial&lt;/a&gt;&lt;/strong&gt; —&lt;br&gt;
connect your Google Ads or Bing account, see the invalid clicks in your own data,&lt;br&gt;
and cancel anytime. Your ad budget is better spent on people who might actually buy.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Written by the team at &lt;a href="https://protectads.com/?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=how-click-fraud-works" rel="noopener noreferrer"&gt;ProtectAds&lt;/a&gt; —&lt;br&gt;
real-time click fraud detection and protection for Google Ads and Microsoft (Bing) Ads.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>marketing</category>
      <category>fraud</category>
      <category>security</category>
      <category>ai</category>
    </item>
    <item>
      <title>Model Context Protocol Explained: Build Your First MCP Server in Python</title>
      <dc:creator>galian</dc:creator>
      <pubDate>Thu, 18 Jun 2026 12:58:29 +0000</pubDate>
      <link>https://dev.to/galian/model-context-protocol-explained-build-your-first-mcp-server-in-python-ian</link>
      <guid>https://dev.to/galian/model-context-protocol-explained-build-your-first-mcp-server-in-python-ian</guid>
      <description>&lt;p&gt;If you've integrated an LLM with a database, a ticketing system, and an internal API, you've written the same glue three times — and you'll write it again for the next model and the next tool. That M×N integration problem is exactly what the &lt;strong&gt;Model Context Protocol (MCP)&lt;/strong&gt; was built to kill. Instead of every application hand-rolling a bespoke connector for every tool, MCP defines one open standard that any model and any tool can speak.&lt;/p&gt;

&lt;p&gt;The analogy its authors at Anthropic use is deliberately mundane: MCP is &lt;strong&gt;"a USB-C port for AI applications."&lt;/strong&gt; You don't wire each device to each laptop with a custom cable; you agree on one connector and everything interoperates. That framing is the whole point, and it's why MCP went from an Anthropic open-source release in late 2024 to something adopted across the industry — including by OpenAI and Google — by 2026.&lt;/p&gt;

&lt;p&gt;This is a practical guide. We'll cover what MCP actually is, the three-part architecture, the primitives you'll use every day, and then build a real, working MCP server in Python that a host like Claude Code or an IDE can call. No hand-waving — by the end you'll have code that runs.&lt;/p&gt;

&lt;h2&gt;
  
  
  What problem MCP actually solves
&lt;/h2&gt;

&lt;p&gt;Before MCP, "give the model access to our systems" meant writing function-calling glue specific to one provider's SDK, one tool's API, and one application's plumbing. Swap the model and you rewrote the tool layer. Add a tool and you touched every app that needed it. With &lt;em&gt;M&lt;/em&gt; applications and &lt;em&gt;N&lt;/em&gt; tools, you were on the hook for roughly &lt;em&gt;M×N&lt;/em&gt; integrations.&lt;/p&gt;

&lt;p&gt;MCP turns that into &lt;em&gt;M+N&lt;/em&gt;. Tool authors write &lt;strong&gt;one&lt;/strong&gt; MCP server. Application authors add &lt;strong&gt;one&lt;/strong&gt; MCP client. Any host that speaks MCP can use any server that speaks MCP — no per-pair glue. The server you write for your company's CRM works in Claude Code, in your custom agent, and in whatever host ships next year, without changes.&lt;/p&gt;

&lt;p&gt;That's the strategic shift: tools and models become decoupled, and the integration surface stops growing quadratically. Everything below is just the mechanics of how that's achieved.&lt;/p&gt;

&lt;h2&gt;
  
  
  The architecture: host, client, server
&lt;/h2&gt;

&lt;p&gt;MCP has exactly three roles. Getting these straight makes everything else click.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Host&lt;/strong&gt; — the LLM application the user interacts with. Claude Code, an AI-enabled IDE, a desktop assistant, or your own agent. The host orchestrates the model and decides which servers to connect to.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Client&lt;/strong&gt; — a connector that lives &lt;em&gt;inside&lt;/em&gt; the host. The host spins up one client per server, and each client keeps a dedicated &lt;strong&gt;1:1 connection&lt;/strong&gt; to its server. You rarely write this yourself; the host's framework provides it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Server&lt;/strong&gt; — a lightweight program that exposes capabilities (tools, data, prompt templates) over the protocol. &lt;strong&gt;This is what you build.&lt;/strong&gt; A server can wrap a local SQLite file, a SaaS API, a filesystem, or anything you can reach with code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Under the hood, client and server exchange &lt;strong&gt;JSON-RPC 2.0&lt;/strong&gt; messages over a transport. There are two you care about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;stdio&lt;/strong&gt; — the server runs as a local subprocess and communicates over standard input/output. Perfect for local tools, dev work, and anything that touches the user's own machine.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Streamable HTTP&lt;/strong&gt; — the server runs as a remote service reachable over HTTP, with streaming for long-running responses. This is the modern remote transport (it superseded the older HTTP+SSE approach) and it's what you deploy when the server lives somewhere central.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You write your server logic once; choosing stdio vs. HTTP is mostly a deployment decision, not a rewrite.&lt;/p&gt;

&lt;h2&gt;
  
  
  The three primitives you'll actually use
&lt;/h2&gt;

&lt;p&gt;MCP servers expose capability through three primitives. The distinction between them isn't bureaucratic — it encodes &lt;em&gt;who is in control&lt;/em&gt;, which matters enormously for safety and UX.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tools — model-controlled
&lt;/h3&gt;

&lt;p&gt;Tools are functions the &lt;strong&gt;model&lt;/strong&gt; decides to call: query a database, send an email, hit an API, run a calculation. They can have side effects, so a well-behaved host asks for user approval before executing one. If you've used function calling, tools are the MCP-native, portable version of it. This is the primitive you'll reach for most.&lt;/p&gt;

&lt;h3&gt;
  
  
  Resources — application-controlled
&lt;/h3&gt;

&lt;p&gt;Resources are read-only data the &lt;strong&gt;application&lt;/strong&gt; pulls into context: a file's contents, a database row, a config blob, a documentation page. They're identified by URI (for example &lt;code&gt;file:///logs/today.log&lt;/code&gt; or &lt;code&gt;db://customers/42&lt;/code&gt;) and they don't &lt;em&gt;do&lt;/em&gt; anything — they inform. The host decides when and whether to load them, which keeps the context window under deliberate control rather than at the model's whim.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prompts — user-controlled
&lt;/h3&gt;

&lt;p&gt;Prompts are reusable templates the &lt;strong&gt;user&lt;/strong&gt; invokes intentionally — think a slash-command like "summarize this PR" or "draft a release note." They standardize the high-value interactions your server enables so users don't have to re-type elaborate instructions.&lt;/p&gt;

&lt;p&gt;The mental model: &lt;strong&gt;tools are for the model, resources are for the app, prompts are for the user.&lt;/strong&gt; Designing on the correct side of that line is the difference between an integration that feels safe and predictable and one that surprises people. That separation of control is also at the heart of building reliable agents, which is why a structured &lt;a href="https://cursuri-ai.ro/courses/ai-agents-automatizare" rel="noopener noreferrer"&gt;course on designing autonomous AI agents&lt;/a&gt; spends real time on it rather than treating every capability as "just a tool."&lt;/p&gt;

&lt;h2&gt;
  
  
  Build your first MCP server in Python
&lt;/h2&gt;

&lt;p&gt;Enough theory. Let's build a server that exposes a tool, a resource, and a prompt — and actually runs.&lt;/p&gt;

&lt;p&gt;The official Python SDK ships a high-level helper, &lt;code&gt;FastMCP&lt;/code&gt;, that handles the JSON-RPC plumbing, schema generation, and transport for you. You describe capabilities with decorators; the SDK infers the input schema from your type hints and the description from your docstring.&lt;/p&gt;

&lt;h3&gt;
  
  
  Setup
&lt;/h3&gt;

&lt;p&gt;The modern toolchain uses &lt;a href="https://github.com/astral-sh/uv" rel="noopener noreferrer"&gt;&lt;code&gt;uv&lt;/code&gt;&lt;/a&gt;, but plain &lt;code&gt;pip&lt;/code&gt; works too:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# with uv (recommended)&lt;/span&gt;
uv init mcp-demo &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd &lt;/span&gt;mcp-demo
uv add &lt;span class="s2"&gt;"mcp[cli]"&lt;/span&gt;

&lt;span class="c"&gt;# or with pip&lt;/span&gt;
pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="s2"&gt;"mcp[cli]"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The server
&lt;/h3&gt;

&lt;p&gt;Create &lt;code&gt;server.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="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;mcp.server.fastmcp&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;FastMCP&lt;/span&gt;

&lt;span class="c1"&gt;# Name your server — hosts show this to the user.
&lt;/span&gt;&lt;span class="n"&gt;mcp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FastMCP&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;demo-tools&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="nd"&gt;@mcp.tool&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;word_count&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="nb"&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="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Count the number of words in a piece of text.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;len&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="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;


&lt;span class="nd"&gt;@mcp.tool&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;days_between&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&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="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Return the number of days between two ISO dates (YYYY-MM-DD).&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt;
    &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fromisoformat&lt;/span&gt;&lt;span class="p"&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;e&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fromisoformat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;days&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="nd"&gt;@mcp.resource&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;notes://team&lt;/span&gt;&lt;span class="sh"&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;team_notes&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Expose the team&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s shared notes as read-only context.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="c1"&gt;# In real life this would read a file, a DB row, or an API.
&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Release freeze starts Friday. Owner: platform team.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;


&lt;span class="nd"&gt;@mcp.prompt&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;code_review&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;language&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&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="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;A reusable prompt template for reviewing a code snippet.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="nf"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;You are a senior &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;language&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; engineer. Review the code below for &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;correctness, security, and readability. Be specific.&lt;/span&gt;&lt;span class="se"&gt;\n\n&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&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;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;# Default transport is stdio — ideal for local hosts.
&lt;/span&gt;    &lt;span class="n"&gt;mcp&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's a complete, valid MCP server. Notice what you did &lt;strong&gt;not&lt;/strong&gt; write: no JSON-RPC handling, no schema definitions, no transport code. The type hints on &lt;code&gt;word_count(text: str) -&amp;gt; int&lt;/code&gt; become the tool's input/output schema automatically, and the docstring becomes the description the model reads to decide &lt;em&gt;when&lt;/em&gt; to call it. That docstring is not decoration — it's the model's only instruction manual for the tool, so write it like an API contract.&lt;/p&gt;

&lt;h3&gt;
  
  
  Inspect it before wiring it to a model
&lt;/h3&gt;

&lt;p&gt;The SDK includes a dev inspector so you can poke at your server without an LLM in the loop:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;uv run mcp dev server.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This launches the &lt;strong&gt;MCP Inspector&lt;/strong&gt;, a local UI where you can list the server's tools, resources, and prompts, call them with hand-entered arguments, and see exactly what comes back. Debugging here — &lt;em&gt;before&lt;/em&gt; a model is involved — is the single biggest time-saver in MCP development. If a tool misbehaves with the inspector, the problem is your server, not the model.&lt;/p&gt;

&lt;h3&gt;
  
  
  Connect it to a host
&lt;/h3&gt;

&lt;p&gt;To use the server from Claude Code or another MCP-aware host, you register it. For Claude Code, that's a one-liner:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude mcp add demo-tools &lt;span class="nt"&gt;--&lt;/span&gt; uv run server.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For hosts configured by file, you add an entry pointing at the command that launches your server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"demo-tools"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"uv"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"run"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"server.py"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart the host, and your tools, resource, and prompt show up — the model can now call &lt;code&gt;word_count&lt;/code&gt;, the app can pull in &lt;code&gt;notes://team&lt;/code&gt;, and the user can invoke the &lt;code&gt;code_review&lt;/code&gt; prompt. The same &lt;code&gt;server.py&lt;/code&gt;, unchanged, works in every one of them. That portability is the entire payoff, and pushing a server like this from a local toy to something production-grade — auth, logging, error handling, deployment over Streamable HTTP — is exactly the jump covered in this hands-on course on &lt;a href="https://cursuri-ai.ro/courses/construire-aplicatii-ai-python-sdk" rel="noopener noreferrer"&gt;building real AI applications in Python&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  From toy to production: what the quickstart doesn't tell you
&lt;/h2&gt;

&lt;p&gt;The server above works, but shipping MCP to real users surfaces concerns the happy path hides. These are the ones that bite teams:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Authentication and authorization.&lt;/strong&gt; A remote MCP server is a service on the internet. Streamable HTTP servers support OAuth-based auth, and you need it — an unauthenticated tool that can query your database or send email is an incident waiting to happen. Treat the server's tool surface as your real attack surface.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The model can be tricked into calling tools.&lt;/strong&gt; Because tools are model-controlled, a prompt-injection payload hidden in a document or web page the model reads can try to coax it into calling a destructive tool. The mitigations are concrete: keep destructive tools behind user approval, scope each server's permissions narrowly, validate every argument server-side, and never assume the model's call is benign just because it's well-formed. This intersection of capability and risk is precisely why agentic systems need a security mindset, not just a features mindset — the subject of a dedicated &lt;a href="https://cursuri-ai.ro/courses/ai-security-ethics" rel="noopener noreferrer"&gt;course on AI security and ethical engineering&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tool descriptions are part of your context budget.&lt;/strong&gt; Every tool's name, description, and schema get loaded into the model's context. Twenty sprawling tools with verbose docstrings quietly eat thousands of tokens and degrade the model's ability to choose well. Curate your tool surface like an API you have to maintain: fewer, sharper tools beat a kitchen sink. Managing what occupies the context window — tools included — is its own discipline, which a &lt;a href="https://cursuri-ai.ro/courses/context-engineering-memorie-agenti" rel="noopener noreferrer"&gt;course on context engineering for AI agents&lt;/a&gt; treats as a first-class skill rather than an afterthought.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Errors must be legible to a model, not just a human.&lt;/strong&gt; When a tool fails, return a structured, descriptive error the model can reason about and recover from — not a raw stack trace. "Customer 42 not found; verify the ID" lets the model self-correct; a 500 with a Python traceback does not.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stateful vs. stateless.&lt;/strong&gt; stdio servers are naturally per-session and local; HTTP servers may serve many clients and need you to think about concurrency and isolation. Decide early, because retrofitting state handling is painful.&lt;/p&gt;

&lt;p&gt;None of these are reasons to avoid MCP — they're the normal engineering of turning a protocol demo into a dependable system, and the same skills you'd apply to any service boundary apply here.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters for how you build in 2026
&lt;/h2&gt;

&lt;p&gt;MCP's quiet significance is that it makes &lt;strong&gt;tools a portable asset instead of a per-app liability.&lt;/strong&gt; Write a great server for your internal systems once, and it appreciates: every new host, every new model, every teammate's agent can use it without you lifting a finger. That's the opposite of the function-calling glue we used to throw away every time a model changed.&lt;/p&gt;

&lt;p&gt;It also pushes good architecture by default. The host/client/server split forces a clean seam between "the model and the app" and "the capability," which is exactly the boundary you want when models get swapped, upgraded, or — as 2026 has reminded everyone — occasionally yanked. Building agents on top of well-designed MCP servers, with the right model routed to the right step, is where a lot of the real engineering leverage lives now; if you want that end-to-end picture, there's a focused &lt;a href="https://cursuri-ai.ro/courses/mcp-model-context-protocol" rel="noopener noreferrer"&gt;course on the Model Context Protocol and building enterprise integrations&lt;/a&gt; that goes far deeper than a single tutorial can.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The Model Context Protocol is not hype — it's plumbing, and good plumbing is what lets a field scale. It replaces &lt;em&gt;M×N&lt;/em&gt; bespoke integrations with &lt;em&gt;M+N&lt;/em&gt; reusable ones, gives you three clear primitives with sane control boundaries, and lets you ship a server in a dozen lines of Python that works across every MCP-aware host.&lt;/p&gt;

&lt;p&gt;Start small: build the &lt;code&gt;demo-tools&lt;/code&gt; server above, poke it with the inspector, wire it into a host you already use. Then point it at something real in your own stack — a read-only resource over your logs, a single well-scoped tool over an internal API. The first time you watch a model use a capability you exposed once and never re-integrated, the &lt;em&gt;M+N&lt;/em&gt; promise stops being abstract.&lt;/p&gt;

&lt;p&gt;Write the server once. Let every model use it.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Sources &amp;amp; further reading:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Anthropic — &lt;a href="https://www.anthropic.com/news/model-context-protocol" rel="noopener noreferrer"&gt;Introducing the Model Context Protocol&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Model Context Protocol — &lt;a href="https://modelcontextprotocol.io" rel="noopener noreferrer"&gt;Official specification and documentation&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Model Context Protocol — &lt;a href="https://github.com/modelcontextprotocol/python-sdk" rel="noopener noreferrer"&gt;Python SDK&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;This article is educational content. APIs and SDK details evolve; check the official MCP documentation for the current specification before building production systems.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>mcp</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Anthropic disables access to Fable 5 and Mythos 5 to comply with government directive</title>
      <dc:creator>galian</dc:creator>
      <pubDate>Sat, 13 Jun 2026 10:04:07 +0000</pubDate>
      <link>https://dev.to/galian/anthropic-disables-access-to-fable-5-and-mythos-5-to-comply-with-government-directive-2p77</link>
      <guid>https://dev.to/galian/anthropic-disables-access-to-fable-5-and-mythos-5-to-comply-with-government-directive-2p77</guid>
      <description>&lt;p&gt;On June 12, 2026, a frontier AI model disappeared overnight for everyone outside the United States. Not because of an outage, and not because the vendor changed its pricing — but because of a &lt;strong&gt;US government export-control directive&lt;/strong&gt;. Anthropic had to disable &lt;strong&gt;Claude Fable 5 and Claude Mythos 5&lt;/strong&gt; for &lt;em&gt;all&lt;/em&gt; customers, just three days after making Fable 5 — its first "Mythos-class" model — public.&lt;/p&gt;

&lt;p&gt;If you build on LLMs, the interesting part of this story isn't the geopolitics. It's the engineering question it forces: &lt;strong&gt;what happens to your application when your model is gone tomorrow morning, through no fault of your own?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is a practical guide to answering that question. We'll cover what actually happened (briefly, and sourced), why a piece of software can fall under export controls at all, and then spend most of our time on the part that matters: how to architect an LLM application so that no single model — from any provider — can take it down.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happened, briefly and sourced
&lt;/h2&gt;

&lt;p&gt;Anthropic published a statement titled "Statement on the US government directive to suspend access to Fable 5 and Mythos 5." Per that statement, the US government issued an &lt;strong&gt;export-control directive&lt;/strong&gt; requiring the company to suspend access to both models for &lt;strong&gt;any non-US national, whether inside or outside the United States&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;To comply, Anthropic disabled both models for &lt;strong&gt;all&lt;/strong&gt; customers — not just the targeted group. Everything else stayed online: the statement notes that "access to all other Anthropic models will not be affected." Opus, Sonnet, and Haiku kept working; only the Mythos-class tier went dark.&lt;/p&gt;

&lt;p&gt;The government's stated rationale was that it believed it had identified a method of &lt;strong&gt;jailbreaking&lt;/strong&gt; Fable 5's safeguards. Anthropic publicly disagreed with the reasoning — arguing the vulnerability was narrow, that comparable capabilities already exist in other public models (it named GPT-5.5), and that applying this standard across the board "would essentially halt all new model deployments for all frontier model providers." The company called it a misunderstanding and said it was working to restore access.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The takeaway for builders has nothing to do with whether Anthropic or the government is right. It's this: a model you depend on can become unavailable for reasons entirely outside both your control &lt;em&gt;and&lt;/em&gt; your vendor's control — and on essentially no notice.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Why software can be "export-controlled" in the first place
&lt;/h2&gt;

&lt;p&gt;It feels strange that an API you call over HTTPS can be subject to export law. It makes sense the moment you see frontier AI the way regulators do: as a &lt;strong&gt;dual-use technology&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A dual-use technology serves legitimate and potentially dangerous purposes at the same time. A sufficiently capable model can accelerate both useful research and things nobody wants proliferating — from assisting cyberattacks to sensitive biological domains. That's precisely why Anthropic layers safety classifiers (for cyber and bio) on top of its base model to produce the public Fable 5, while the unrestricted Mythos 5 ships only in a limited program.&lt;/p&gt;

&lt;p&gt;Under the US &lt;strong&gt;Export Administration Regulations (EAR)&lt;/strong&gt;, the government can restrict the export of strategic technology to non-US persons. The key concept is the &lt;strong&gt;"deemed export"&lt;/strong&gt;: giving a foreign national &lt;em&gt;access&lt;/em&gt; to controlled technology — even one physically located in the US — counts as an export in its own right. That's why the directive targeted "any non-US national, regardless of location," and why the simplest compliant move was to shut the models off for everyone rather than try to filter access by nationality in real time.&lt;/p&gt;

&lt;p&gt;If you're a developer in the EU, the UK, India, or anywhere outside the US, the practical reading is blunt: from the directive's point of view, &lt;strong&gt;you are the "foreign national,"&lt;/strong&gt; and the model can be pulled out from under you with no warning.&lt;/p&gt;

&lt;h2&gt;
  
  
  The real lesson: a model is a dependency, not a constant
&lt;/h2&gt;

&lt;p&gt;This episode is a textbook case of &lt;strong&gt;vendor risk&lt;/strong&gt; and &lt;strong&gt;business continuity&lt;/strong&gt;. The model wasn't deprecated, didn't get more expensive, and wasn't beaten by a competitor. It vanished for reasons external to your product and even to your vendor.&lt;/p&gt;

&lt;p&gt;For anyone who wired a product, an internal workflow, or a customer promise to one specific model, the message is clear: &lt;strong&gt;an LLM is an external dependency&lt;/strong&gt; — exactly like a cloud provider, a payments processor, or any third-party API. And you manage external dependencies with redundancy, not hope.&lt;/p&gt;

&lt;p&gt;The lesson is &lt;em&gt;not&lt;/em&gt; "don't use the best model" or "don't trust Anthropic." Anthropic remains one of the most serious vendors in the market, and the transparency of this disclosure proves it. The lesson is &lt;strong&gt;architectural&lt;/strong&gt;: don't build such that the disappearance of any single model stops your product.&lt;/p&gt;

&lt;h2&gt;
  
  
  Designing for provider resilience
&lt;/h2&gt;

&lt;p&gt;Resilience here doesn't mean running ten models in parallel. It means being able to &lt;strong&gt;switch&lt;/strong&gt; — quickly, deliberately, and without rewriting your application. Four building blocks get you there.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. An abstraction layer (don't call the SDK from everywhere)
&lt;/h3&gt;

&lt;p&gt;The single most damaging habit is sprinkling &lt;code&gt;client.messages.create(...)&lt;/code&gt; across dozens of files. When you need to switch providers, you're now doing surgery on your whole codebase under time pressure. Put one internal interface between your app and any vendor.&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="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;dataclasses&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;dataclass&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;typing&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Protocol&lt;/span&gt;

&lt;span class="nd"&gt;@dataclass&lt;/span&gt;
&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Completion&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="nb"&gt;str&lt;/span&gt;
    &lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;LLMProvider&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Protocol&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;complete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&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="n"&gt;max_tokens&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1024&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;Completion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="bp"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every provider — Anthropic, OpenAI, Google, a self-hosted model — implements the same &lt;code&gt;complete()&lt;/code&gt; contract. Your application only ever talks to &lt;code&gt;LLMProvider&lt;/code&gt;. Swapping a vendor becomes a config change, not a refactor. Designing these seams well is core system-architecture work; if you want the full treatment of boundaries, adapters, and scaling concerns, this &lt;a href="https://cursuri-ai.ro/courses/ai-system-architecture" rel="noopener noreferrer"&gt;course on AI system architecture at scale&lt;/a&gt; goes well beyond a single code sample.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. A router with failover and a circuit breaker
&lt;/h3&gt;

&lt;p&gt;With a common interface, the router becomes simple: try the primary, fall back on failure, and stop hammering a provider that's clearly down.&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="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ModelRouter&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;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;providers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;LLMProvider&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;cooldown_s&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&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="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;providers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;providers&lt;/span&gt;           &lt;span class="c1"&gt;# ordered: primary first
&lt;/span&gt;        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cooldown_s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cooldown_s&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_down_until&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;float&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="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;_available&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;LLMProvider&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;float&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;bool&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;now&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_down_until&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="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&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="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;complete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;kw&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;Completion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;monotonic&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;last_error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;providers&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;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_available&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
                &lt;span class="k"&gt;continue&lt;/span&gt;
            &lt;span class="k"&gt;try&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;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;complete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;kw&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;        &lt;span class="c1"&gt;# timeout, 4xx/5xx, or a hard 403 like a suspension
&lt;/span&gt;                &lt;span class="n"&gt;last_error&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;
                &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_down_until&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cooldown_s&lt;/span&gt;   &lt;span class="c1"&gt;# trip the breaker
&lt;/span&gt;        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;RuntimeError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;All providers unavailable; last error: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;last_error&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is deliberately small. The point is the &lt;em&gt;shape&lt;/em&gt;: an ordered list of interchangeable providers, a breaker that quarantines a failing one for a cooldown, and an app that never sees the difference. A sudden &lt;code&gt;403&lt;/code&gt;/access revocation — exactly what a suspension looks like to your code — is just another failure that trips the breaker and routes to the next provider.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Redundancy across jurisdictions, not just vendors
&lt;/h3&gt;

&lt;p&gt;Keep at least two providers ready, ideally under &lt;strong&gt;different regulatory regimes&lt;/strong&gt;. The Fable 5 episode is precisely why jurisdictional diversity matters and not just vendor diversity: a single government action took out one vendor's top tier for a whole class of users. Two US-based providers don't fully protect you from a US-wide policy event; a mix does.&lt;/p&gt;

&lt;p&gt;Choosing those alternates well — on real capability, cost, and now &lt;em&gt;exposure&lt;/em&gt; — is a skill in itself. If you want a structured, side-by-side framework instead of vibes, there's a dedicated &lt;a href="https://cursuri-ai.ro/courses/comparatie-modele-ai" rel="noopener noreferrer"&gt;AI model comparison course&lt;/a&gt; that covers how to evaluate and route across the 2026 lineup.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. A safety net you actually control
&lt;/h3&gt;

&lt;p&gt;For your most critical paths, keep an &lt;strong&gt;open-weight model you can self-host&lt;/strong&gt; (something from the Llama or Qwen families). It doesn't have to be the best model in the world — it has to be &lt;em&gt;yours&lt;/em&gt; and &lt;em&gt;good enough&lt;/em&gt; to keep you running. A model on infrastructure you control cannot be revoked by anyone's directive. That's the difference between "degraded service" and "outage" on the day a managed model disappears.&lt;/p&gt;

&lt;h3&gt;
  
  
  Portability and switch drills
&lt;/h3&gt;

&lt;p&gt;Two cross-cutting habits make all of the above real:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Portable prompts and evals.&lt;/strong&gt; If your prompts and evaluation suites are tuned to one model's quirks, you've created a hidden dependency. Treat them as portable artifacts and test them across providers, so a switch doesn't silently tank quality.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rehearsed failover.&lt;/strong&gt; A fallback plan you've never executed is an assumption, not a guarantee. Trigger a manual switch to your secondary on a schedule and watch what breaks — discover problems in a drill, not mid-incident.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If your application is agentic — multi-step loops, tool use, sub-agents — provider resilience gets harder, because a mid-loop failover has to preserve state and tool context. Building that correctly is its own discipline, covered in this &lt;a href="https://cursuri-ai.ro/courses/ai-agents-automatizare" rel="noopener noreferrer"&gt;course on designing autonomous AI agents&lt;/a&gt;, and the end-to-end practice of wiring real applications across SDKs (Anthropic, OpenAI, and self-hosted) is the focus of this hands-on course on &lt;a href="https://cursuri-ai.ro/courses/construire-aplicatii-ai-python-sdk" rel="noopener noreferrer"&gt;building AI apps in Python&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  A note on governance, not just plumbing
&lt;/h2&gt;

&lt;p&gt;There's a second, quieter lesson here for technical leaders. The trigger was a &lt;strong&gt;safety-and-governance&lt;/strong&gt; dispute: who decides, on what evidence, and how fast, that a frontier capability is too risky for some users. As AI moves deeper into critical systems, "is this model available?" becomes a governance question as much as an uptime one — and understanding &lt;em&gt;why&lt;/em&gt; safety classifiers, dual-use controls, and red-teaming exist is part of building responsibly. That intersection of security, ethics, and engineering is exactly what this &lt;a href="https://cursuri-ai.ro/courses/ai-security-ethics" rel="noopener noreferrer"&gt;course on AI security and ethical engineering&lt;/a&gt; is about.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The suspension of Fable 5 and Mythos 5 isn't, at its core, a story about a broken model. It's a story about how quickly a frontier capability can move from "available to everyone" to "unavailable by government order" — and about who pays the bill when it does. Not the vendor. The person who built on that model assuming it would always be there.&lt;/p&gt;

&lt;p&gt;Anthropic calls it a misunderstanding and is working to restore access; the models may well return in some form. But resilience isn't built on "probably." It's built on architecture: an abstraction layer, at least one fallback from a different jurisdiction, a safety net you control, and the habit of rehearsing the switch before you need it.&lt;/p&gt;

&lt;p&gt;Engineers who treat models like the external dependencies they are will look back on the Fable 5 episode as a useful lesson rather than a costly outage. The difference isn't which model you pick. It's the architecture you wrap around it.&lt;/p&gt;

&lt;p&gt;The courses linked throughout are part of &lt;a href="https://cursuri-ai.ro/courses/ai-system-architecture" rel="noopener noreferrer"&gt;Cursuri-AI.ro&lt;/a&gt;, an AI-learning platform with deep, hands-on tracks on system architecture, model selection, agent design, and the practical engineering of LLM applications — kept current with the 2026 lineup.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Sources:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Anthropic — &lt;a href="https://www.anthropic.com/news/fable-mythos-access" rel="noopener noreferrer"&gt;Statement on the US government directive to suspend access to Fable 5 and Mythos 5&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Anthropic — &lt;a href="https://www.anthropic.com/news/claude-fable-5-mythos-5" rel="noopener noreferrer"&gt;Claude Fable 5 and Claude Mythos 5&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;CNBC — &lt;a href="https://www.cnbc.com/2026/06/12/anthropic-disables-access-to-fable-5-and-mythos-5-to-comply-with-government-directive.html" rel="noopener noreferrer"&gt;Anthropic disables access to Fable 5 and Mythos 5 to comply with government directive&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;9to5Mac — &lt;a href="https://9to5mac.com/2026/06/12/anthropic-pulls-claude-mythos-5-and-claude-fable-5-following-us-government-directive/" rel="noopener noreferrer"&gt;Anthropic pulls Claude Mythos 5 and Claude Fable 5 following US government directive&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;U.S. Bureau of Industry and Security — &lt;a href="https://www.bis.gov/regulations" rel="noopener noreferrer"&gt;Export Administration Regulations (EAR)&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;This article is for informational purposes and is not legal advice. Dates and named individuals drawn from press reporting may be updated as the situation evolves; check official sources for the current access status.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>learning</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
