<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jiten Bhalavat on Medium]]></title>
        <description><![CDATA[Stories by Jiten Bhalavat on Medium]]></description>
        <link>https://medium.com/@infinityai?source=rss-b3fc496a0d17------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*qPxhAuts_L9SkoBDH-vJNg@2x.jpeg</url>
            <title>Stories by Jiten Bhalavat on Medium</title>
            <link>https://medium.com/@infinityai?source=rss-b3fc496a0d17------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 01:39:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@infinityai/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Claude.MD vs SKILLS.MD vs AGENTS.MD, What to use When?]]></title>
            <link>https://pub.towardsai.net/claude-md-vs-skills-md-vs-agents-md-what-to-use-when-98589ad57379?source=rss-b3fc496a0d17------2</link>
            <guid isPermaLink="false">https://medium.com/p/98589ad57379</guid>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[agentsmd]]></category>
            <category><![CDATA[claude-md]]></category>
            <category><![CDATA[skillsmd]]></category>
            <category><![CDATA[claude-code]]></category>
            <dc:creator><![CDATA[Jiten Bhalavat]]></dc:creator>
            <pubDate>Mon, 10 Aug 2026 15:23:45 GMT</pubDate>
            <atom:updated>2026-08-11T10:57:42.904Z</atom:updated>
            <content:encoded><![CDATA[<h4>A beginner-friendly guide to organizing instructions for Claude Code and other AI coding tools.</h4><p>If you have started using Claude Code, you have probably created a <strong>CLAUDE.md</strong> file and dumped a lot of things into it. Your project setup, coding rules, PR guidelines, stack info, onboarding notes. Everything in one place.</p><p>And then you heard about AGENTS.md. Then SKILL.md. And now you are wondering why there are three files that seem to do the same thing.</p><p>They do not do the same thing. And if you mix them up, you end up paying for tokens you did not need to spend.</p><p>Let me explain each one simply.</p><blockquote><strong>Think of it this way</strong></blockquote><p>Before we get into the details, here is a simple way to think about all three files.</p><p><strong>CLAUDE.md</strong> is like your company handbook. Every new employee reads it on day one. It is always there in the background.</p><p><strong>AGENTS.md</strong> is the same handbook, but written in a way that every agency contractor can also understand, not just the full-time employees.</p><p><strong>SKILL.md</strong> is the instruction manual on the shelf. You only pull it out when you actually need to do that specific task.</p><p>Three files. Three different jobs. Three different loading patterns.</p><blockquote><strong>CLAUDE.md: The file that is always loaded</strong></blockquote><blockquote>What it does</blockquote><p>CLAUDE.md is the main configuration file for Claude Code. When you start a session, Claude reads this file and keeps it in its system prompt.</p><p>Here is the part most people do not realize.</p><p>It is loaded once when the session starts and becomes part of the context Claude uses during that session. So when you say “hi”, Claude has those instructions available. When you later ask it to fix a bug, those instructions are still part of the session context.</p><p>The important part is that Claude does not need to read the file from disk again every time you send a message. The instructions were loaded at the beginning of the session and remain available as part of the conversation context.</p><p>So if your CLAUDE.md is large, those instructions take up part of the context available throughout your session. The larger the file, the more context you are using for instructions that may not be relevant to every task.</p><p>That is why keeping CLAUDE.md focused and concise matters.</p><blockquote><strong>The three levels</strong></blockquote><p>CLAUDE.md has a simple hierarchy.</p><p>The first level is your personal file. It lives at ~/.claude/CLAUDE.md on your machine. This is for your own preferences across all projects. Things like how you like your code indented or how you write commit messages. Nobody else on your team sees this.</p><p>The second level is the project file. It lives at .claude/CLAUDE.md or the root of your repo. This one gets committed to Git, so every teammate who clones the repo gets the same rules. This is where your stack info, commands, and team standards go.</p><p>The third level is path-specific rules. These are files inside .claude/rules/ with a paths setting in their frontmatter. For example, a testing rules file that only loads when you are editing test files. This keeps irrelevant rules out of your context when you do not need them.</p><p>Claude Code loads instructions from different scopes and combines them into its context. More specific project instructions are loaded after broader user-level instructions, so project-level guidance can take precedence when instructions conflict.</p><p>The important idea is simple: keep personal preferences in your personal configuration and shared team rules in the project.</p><blockquote><strong>What should go in CLAUDE.md</strong></blockquote><p>Keep it short. Under 200 lines is a good target (This is a guideline, not a strict limit) Put in things Claude needs to know for every single task.</p><p>Your tech stack. The commands to run tests and start the dev server. Hard rules that always apply, like never logging user data. Key architecture decisions. That is it.</p><blockquote>Do not put task-specific instructions in here. Do not write a detailed guide on how to review a PR. Do not document every edge case. There is a better place for that, which we will get to.</blockquote><blockquote><strong>One thing to remember</strong></blockquote><p>If you edit CLAUDE.md while a session is already running, Claude will not see the change. It reads the file once when the session starts and that is it. You have to start a new session for the changes to take effect. This is the most common reason people say their new rule is not being followed.</p><blockquote><strong>AGENTS.md: The file for when your team uses multiple tools</strong></blockquote><blockquote><strong>What it does</strong></blockquote><p>AGENTS.md serves the same purpose as CLAUDE.md. It holds your project context and instructions. The difference is which tools can read it.</p><p>Claude Code reads CLAUDE.md. OpenAI Codex reads AGENTS.md. Cursor reads AGENTS.md. Gemini CLI reads AGENTS.md. GitHub Copilot reads AGENTS.md.</p><p>Claude Code does not natively read AGENTS.md on its own. But there is a simple fix. You can create a symlink so that both filenames point to the same file.</p><pre>ln -s AGENTS.md CLAUDE.md</pre><p>Now you have one file. Every tool reads it. Nothing drifts out of sync.</p><blockquote><strong>When do you actually need AGENTS.md</strong></blockquote><p>If your whole team uses only Claude Code, you probably do not need AGENTS.md. CLAUDE.md is enough.</p><p>But if your team uses a mix of tools, or if your CI pipeline uses a different agent than what your developers use locally, then AGENTS.md becomes important. It is your single source of truth that works across all of them.</p><blockquote><strong>The silent failure you need to know about</strong></blockquote><p>This is a real problem in multi-agent pipelines.</p><p>Say you have a workflow where one part of the pipeline runs on Claude Code and another part runs on a non-Anthropic tool. If your instructions only live in CLAUDE.md, the non-Anthropic tool will silently ignore them. <strong>No error message. No warning. It just does not follow your rules.</strong></p><p>This is called silent instruction loss. The agent runs fine, but it is not following the conventions you thought were set. Behavior drifts, output gets inconsistent, and the root cause is hard to find because nothing looks broken on the surface.</p><p>The fix is to use AGENTS.md as your shared baseline so every tool in the pipeline picks it up.</p><blockquote><strong>SKILL.md: The file that only loads when you need it</strong></blockquote><blockquote><strong>What it does</strong></blockquote><p>This one works completely differently from the other two.</p><p>CLAUDE.md and AGENTS.md load at the start of every session and stay in context the whole time. SKILL.md loads only when the task you are working on matches the skill’s description.</p><p>A skill is a folder with a SKILL.md file inside it. At the top of the file, you write a YAML frontmatter block with a name and a description. The description is how Claude decides whether to load this skill or not.</p><p>When you send a message, Claude reads the description of every skill you have set up and compares it to what you are asking. If your request matches, the skill loads. When the task is done, the skill is discarded.</p><p>Here is a simple example of what the frontmatter looks like.</p><pre>---<br>name: pr-review<br>description: Use when the user asks to review a pull request or check code quality.<br>allowed-tools: [Read, Grep, Glob]<br>---</pre><blockquote><strong>Why this saves you tokens</strong></blockquote><p>Think about it this way. Say you have documented ten different workflows. If you put all ten in your CLAUDE.md, all ten load on every message. Even when you are just asking Claude to fix a typo.</p><p>With skills, only the relevant one loads. The other nine cost you nothing.</p><p>For anyone running longer sessions with multiple types of tasks, this is a big deal. It keeps your context lean and focused on what you are actually doing right now.</p><blockquote><strong>The description is the most important part</strong></blockquote><p>The description field in your frontmatter is what Claude uses to decide if the skill should activate. Vague descriptions like “helps with code” will either never trigger or trigger for everything.</p><p>Specific descriptions like “reviews Python pull requests for security vulnerabilities like SQL injection or hardcoded secrets” will trigger reliably and only when relevant.</p><p>The file name is for you to read. The description is for Claude to read. Write it for Claude.</p><blockquote>Two useful options in the frontmatter</blockquote><p>The first is allowed-tools. This lets you restrict what Claude can do while the skill is active.</p><p>For example, if you have a skill for exploring a codebase, you can set allowed-tools: [Read, Grep, Glob] so Claude can look around but cannot edit or write files. This restriction is enforced hard. Even if you ask Claude to edit something, it will not do it while that skill is active.</p><p>The second is context: fork. This runs the skill&#39;s work in a separate isolated context. The intermediate steps stay hidden. Only the final output comes back to your main session. This is useful for tasks that generate a lot of content you do not need to see, like searching through 50 files to produce a single summary.</p><blockquote><strong>Keep your SKILL.md files short</strong></blockquote><p>A large Skill consumes more context once it is loaded. If the workflow needs a lot of detailed documentation, examples, or reference material, move that information into separate files and let the Skill load those resources when they are needed.</p><p>The goal is simple: keep the main Skill instructions focused on the workflow itself.</p><blockquote><strong>How all three compare side by side</strong></blockquote><p>Here is a simple table to summarize everything.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jYdP7dvBw4UvmVQ7casEzQ.png" /></figure><blockquote><strong>How to decide which file to use</strong></blockquote><p>Ask yourself these questions.</p><p>Does this rule apply to every task in every session? <strong>Put it in CLAUDE.md.</strong></p><p>Does your team use multiple AI coding tools, or does your pipeline mix tools? <strong>Use AGENTS.md </strong>as the source of truth and link CLAUDE.md to it.</p><p>Is this a specific workflow you repeat often, like reviewing PRs, generating a resume, or searching through documentation? <strong>Make it a skill.</strong></p><p>Do you need Claude to stay read-only for a particular workflow? <strong>Make it a skill with allowed-tools.</strong></p><p>Do you want to trigger something manually right now with one command? <strong>Use a slash command in </strong><strong>.claude/commands/.</strong></p><blockquote><strong>What a clean setup looks like</strong></blockquote><pre>your-project/<br>├── AGENTS.md                   &lt;- shared source of truth for all tools<br>├── CLAUDE.md                   &lt;- imports AGENTS.md, adds Claude-specific rules<br>├── .claude/<br>│   ├── rules/<br>│   │   ├── testing.md          &lt;- loads only when editing test files<br>│   │   └── security.md         &lt;- loads only when editing auth-related files<br>│   ├── skills/<br>│   │   ├── pr-review/<br>│   │   │   └── SKILL.md        &lt;- loads when you ask for a PR review<br>│   │   └── latex-resume/<br>│   │       └── SKILL.md        &lt;- loads when you ask to build a resume<br>│   └── commands/<br>│       └── standup.md          &lt;- /standup generates your daily update<br>└── ~/.claude/<br>    └── CLAUDE.md               &lt;- your personal preferences, not in the repo</pre><p>CLAUDE.md stays short because it only holds what every task truly needs. The skills handle the heavy, task-specific workflows. AGENTS.md makes sure everything works even when a teammate switches tools.</p><blockquote><strong>The simple takeaway</strong></blockquote><p>If your CLAUDE.md is over 200 lines or over 1,200–1,500 tokens, you are probably paying for instructions you do not need on most messages.</p><p>Split things by when they are needed. If it is always needed, put it in CLAUDE.md. If it needs to work across tools, put it in AGENTS.md. If it is only needed for a specific task, make it a skill.</p><p>Your context window is a budget. CLAUDE.md spends some of it on every single message. Skills only spend when you actually use them. Design your setup accordingly.</p><p>If you found this blog helpful, I’d really appreciate it if you shared it with someone who is also exploring AI coding tools.</p><p>If you have any questions, corrections, or suggestions, feel free to leave a comment. I’d love to hear how you are using CLAUDE.md, AGENTS.md, and Skills in your own workflow.</p><p>Thanks for reading! Follow <a href="https://medium.com/u/b3fc496a0d17">Jiten Bhalavat</a> for more such content :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98589ad57379" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/claude-md-vs-skills-md-vs-agents-md-what-to-use-when-98589ad57379">Claude.MD vs SKILLS.MD vs AGENTS.MD, What to use When?</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Summarization TRAP: Why You Should Never Summarize Everything]]></title>
            <link>https://pub.towardsai.net/the-summarization-trap-why-you-should-never-summarize-everything-9a63438c87af?source=rss-b3fc496a0d17------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a63438c87af</guid>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[text-summarization]]></category>
            <dc:creator><![CDATA[Jiten Bhalavat]]></dc:creator>
            <pubDate>Sun, 02 Aug 2026 14:01:03 GMT</pubDate>
            <atom:updated>2026-08-02T14:01:03.071Z</atom:updated>
            <content:encoded><![CDATA[<h4>The Case Facts Block Pattern Every AI Engineer Must Know</h4><p>Imagine you’re building a customer support chatbot for an e-commerce company. A customer starts a conversation and says:</p><pre>Customer ID: cus_abc123<br>Order ID: ord_xyz789<br>Refund Amount: $249.50<br>Coupon Code: SUMMER2026</pre><p>The chatbot verifies the customer, checks the order details, looks up the refund policy, and even calls a few internal APIs.</p><p>The conversation keeps going because the customer has more questions. They ask about the shipping address, the expected refund date, whether the coupon affected the refund amount, and a few other things. Before you realize it, the conversation has already crossed 25 or 30 turns.</p><p>Now the customer asks one final question:</p><blockquote><strong><em>“Can you remind me how much I’m getting refunded?”</em></strong></blockquote><p>The chatbot confidently replies,</p><blockquote><strong><em>“You’re getting around $250.”</em></strong></blockquote><p>Wait…</p><p>The customer wasn’t getting <strong>around $250</strong>.</p><p>The customer was getting <strong>exactly $249.50</strong>.</p><p>Nobody changed the refund amount. Nobody edited the conversation. The information was clearly mentioned at the beginning of the chat. So why did the model suddenly stop being precise? <strong>Where did those 50 cents go?</strong></p><p>At first glance, this might look like a small rounding error. But in a production financial system, healthcare application, or legal workflow, this isn’t just a rounding mistake, it can become an audit issue. More importantly, it reveals a much bigger architectural problem.</p><blockquote>Most engineers immediately think, <strong>“Maybe the model forgot.”</strong></blockquote><blockquote>Others think, <strong>“Let’s just use a model with a larger context window.”</strong></blockquote><p>Both sound reasonable, but neither is the real solution.</p><p>Before we understand how production AI systems solve this problem using techniques like <strong>Case Facts Blocks </strong>( we will see later what exactly it is ), we first need to understand something much more fundamental.</p><blockquote><strong>What exactly is summarization?</strong></blockquote><p>The problem starts much earlier, with the way we summarize conversations. let’s understand what most engineers naturally do to solve it.</p><p>The conversation is becoming longer. The context window is slowly filling up. So the obvious question becomes:</p><blockquote><strong><em>“Why don’t we just summarize the old conversation?”</em></strong></blockquote><p>Honestly, that’s not a bad idea.</p><p>In fact, summarization is one of the most commonly used techniques in long-running AI systems. Whether you’re building a customer support chatbot, a research assistant, or a document analysis agent, sooner or later you’ll have to deal with conversations that become too large to fit comfortably inside the model’s context window.</p><p>So instead of sending all 30 or 40 conversation turns back to the model, we compress the older part of the conversation into a much shorter summary and keep only the recent messages in full detail.</p><p>For example, imagine the original conversation looked something like this:</p><pre>Turn 1:<br>Customer: My Customer ID is cus_abc123. My Order ID is ord_xyz789, and I paid exactly $249.50.</pre><pre>Turn 2:<br>Agent verifies the customer.</pre><pre>Turn 3:<br>Order lookup completed.</pre><pre>Turn 4:<br>Refund policy checked.</pre><pre>Turn 5:<br>Customer asks whether the coupon affects the refund.</pre><pre>Turn 6:<br>Agent explains the refund policy.</pre><pre>...</pre><pre>Turn 25:<br>Customer asks another follow-up question.</pre><p>Instead of sending all twenty-five turns again, we might replace the first twenty turns with something like this:</p><pre>Conversation Summary<br><br>• Customer requested a refund.<br>• Agent verified the customer.<br>• Order lookup completed.<br>• Refund eligibility confirmed.<br>• Customer had questions about the refund policy.</pre><p>Now the model only receives:</p><ul><li>The summary of the older conversation.</li><li>The last few conversation turns.</li><li>The current user message.</li></ul><p>Much smaller. Much cheaper. Much faster.</p><p>At first glance, this seems like the perfect solution.</p><p>We reduced the number of tokens, the model still understands what happened earlier, and we can continue the conversation without exceeding the context window.</p><blockquote><strong>You maybe thinking, that’s what I do every time, what’s wrong in this ??</strong></blockquote><p>The problem isn’t summarization itself.</p><p>The problem is <strong>what summarization removes.</strong></p><blockquote><strong>Step 2: Where Does Summarization Go Wrong?</strong></blockquote><p>The summary captures the overall conversation accurately.</p><p>But let’s compare it with the original conversation for a second.</p><pre>Original Conversation                     Summary<br>Customer ID: cus_abc123                   Missing<br>Order ID: ord_xyz789                      Missing<br>Refund Amount: $249.50                    Missing<br>Refund Deadline: 2026-04-30               Missing<br><br>Customer requested refund                 Present<br>Agent verified eligibility                Present<br>Refund eligibility confirmed.             Present</pre><p>Notice something interesting.</p><p>The summary preserved the <strong>story</strong>. But it lost the <strong>facts</strong>.</p><p>And that’s exactly what summaries are designed to do.</p><p>When we ask an LLM to summarize a conversation, we’re essentially asking it:</p><blockquote><em>“Keep the important ideas, but remove unnecessary details.”</em></blockquote><p>The problem is…</p><p>The model has no way of knowing that <strong>$249.50</strong> isn’t just another detail.</p><p>For a human reading the conversation, “$249.50” might look like a small piece of information.</p><p>For your refund API, it’s the <strong>entire transaction</strong>.</p><p>The same is true for customer IDs, invoice numbers, dates, policy numbers, medical record IDs, contract clauses, or tracking numbers.</p><p>To us, they look like tiny details. To the application, they’re the source of truth.</p><p>So the issue isn’t that the summary is wrong.</p><p>The issue is that <strong>summaries are optimized for understanding, not for preserving exact data.</strong></p><p>And once those exact values disappear, getting them back becomes almost impossible.</p><p>Unfortunately…</p><p>This problem becomes even worse when the conversation keeps getting longer. Because now you’re no longer summarizing the original conversation.</p><p>You’re <strong>summarizing a summary</strong>.</p><p>And that’s where the real trouble begins.</p><blockquote><strong>Step 3: The Progressive Summarization Trap</strong></blockquote><p>Imagine your customer support agent has now handled 40 conversation turns. <strong>You already summarized the first 20 turns to save context</strong>. After another 20 turns, the conversation becomes large again.</p><p>So what do you do?</p><p><strong>The most natural solution is to summarize everything once more.</strong></p><p>This time, however, you’re no longer summarizing the original conversation.</p><p>You’re summarizing <strong>an existing summary</strong>.</p><p>A few more turns later, you summarize it again.</p><pre>Original Conversation<br>        │<br>        ▼<br>     Summary #1<br>        │<br>        ▼<br>     Summary #2<br>        │<br>        ▼<br>     Summary #3</pre><p>At every stage, the model tries to keep the main idea while removing information it considers less important.</p><p>The <strong>story</strong> survived. The <strong>exact facts</strong> didn’t.</p><p>Every new summary removes a little more detail than the previous one. Individually, those changes seem harmless. But after multiple rounds of summarization, the information loss starts to compound.</p><blockquote><strong>This phenomenon is known as Progressive Summarization.</strong></blockquote><p>The model isn’t making a mistake.</p><p>It’s doing exactly what we asked it to do. <strong>We asked it to compress information.</strong></p><p>And once those values disappear, the model has no reliable way to reconstruct them later.</p><p>So the question becomes:</p><p><strong>Can we summarize the conversation without summarizing the information that must never change?</strong></p><p>That’s exactly the problem production AI systems solve.</p><blockquote><strong>Step 4: Not All Information Is Equal</strong></blockquote><p>At this point, we know that summarization removes details.</p><p>But here’s the interesting question.</p><p><strong>Should every piece of information be treated the same?</strong></p><p>The answer is <strong>no</strong>.</p><p>In a long conversation, there are generally two types of information.</p><blockquote>The first type is <strong>narrative information</strong>.</blockquote><p>This is the information that helps us understand <strong>what happened</strong> during the conversation.</p><p>For example:</p><ul><li>The customer requested a refund.</li><li>The order was verified.</li><li>The refund policy was explained.</li><li>The customer asked about shipping.</li><li>The agent confirmed eligibility.</li></ul><p>These statements describe the overall flow of the conversation. Even if we compress them into a shorter summary, we usually don’t lose anything important.</p><p>Now let’s look at the second type.</p><blockquote><strong>This is transactional information.</strong></blockquote><p>Unlike narrative information, these values aren’t describing the conversation, they’re the actual data your application depends on.</p><p>For example:</p><pre>Customer ID: cus_abc123<br><br>Order ID: ord_xyz789<br>Refund Amount: $249.50<br>Refund Deadline: 2026-04-30<br>Tracking Number: TRK-982173<br>Policy Tier: Gold<br></pre><p>Notice something.</p><p>These aren’t sentences.</p><p>They’re facts.</p><p>Your refund API doesn’t care that the customer asked for a refund.</p><p>It cares about the exact value of:</p><pre>refund_amount = 249.50</pre><p>Similarly, your database doesn’t care that the order was discussed.</p><p>It needs the exact:</p><pre>order_id = ord_xyz789</pre><p>This is where many engineers accidentally make a design mistake.</p><p>They summarize <strong>both</strong> types of information together.</p><p>The narrative gets shorter.</p><p>But the transactional facts slowly disappear.</p><p>Instead, production AI systems treat these two categories completely differently.</p><p>Narrative information is meant to be summarized.</p><p>Transactional information is meant to be preserved.</p><p>That’s the mental model I want you to remember throughout this blog.</p><blockquote><strong><em>Summarize the story. Preserve the facts.</em></strong></blockquote><p>Once you separate information into these two categories, the architecture almost designs itself.</p><p>The next question becomes:</p><p><strong>Where should those facts live if they should never be summarized?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JW-94rXYUJk2FQUr7k4qwQ.png" /></figure><blockquote><strong>Step 5: The Case Facts Block</strong></blockquote><p>Now we know something important. Not every piece of information should be summarized.</p><p>Narrative information can safely become shorter. Transactional information cannot.</p><p>So the obvious question becomes:</p><blockquote><strong><em>If we shouldn’t summarize transactional information, where should we keep it?</em></strong></blockquote><p>This is exactly the problem the <strong>Case Facts Block</strong> solves.</p><p>A Case Facts Block is nothing more than a structured collection of facts that should remain <strong>exactly the same</strong> throughout the entire conversation.</p><p>Instead of mixing these values with the conversation history, we separate them into their own dedicated block.</p><p>For example, instead of relying on the model to “remember” that the customer paid <strong>$249.50</strong>, we explicitly provide those values every single time we make a request.</p><pre>&lt;CASE_FACTS&gt;<br><br>customer_id: cus_abc123<br>order_id: ord_xyz789<br>refund_amount: 247.83<br>refund_deadline: 2026-04-30<br>policy_tier: Gold<br><br>&lt;/CASE_FACTS&gt;</pre><p>Now compare that with the conversation summary.</p><pre>Customer contacted support regarding a refund.<br>The order was verified.<br>Refund eligibility was confirmed.<br>The customer had questions about the refund policy.</pre><p>Both pieces of information serve completely different purposes.</p><p>The summary helps the model understand <strong>what happened</strong>.</p><p>The Case Facts Block tells the model <strong>what must never change</strong>.</p><p><strong>Once you separate these two responsibilities, summarization becomes much safer.</strong></p><p>You can aggressively summarize the conversation without worrying about losing the customer ID, refund amount, invoice number, contract ID, policy number, or any other value your application depends on.</p><p>In other words, instead of asking the model to remember important facts, you’re giving the model those facts explicitly on every request.</p><p>That’s a much more reliable architecture.</p><p>But here’s where things become even more interesting.</p><p>Simply creating a Case Facts Block isn’t enough.</p><p><strong>How you manage that block over time determines whether your system remains reliable or slowly starts drifting.</strong></p><blockquote><strong>Step 6: The Three Rules Every Case Facts Block Must Follow</strong></blockquote><p>At this point, creating a Case Facts Block sounds pretty straightforward.</p><p>Just put the important information into a structured block and you’re done.</p><p>Not quite.</p><p>A Case Facts Block is only useful if it’s managed correctly. Over time, engineers discovered a few simple rules that make this pattern reliable in production systems.</p><p>Let’s understand them one by one.</p><blockquote><strong>Rule 1: Keep It at the Top</strong></blockquote><p>The first rule is simple.</p><p><strong>The Case Facts Block should always appear before the conversation.</strong></p><p>You might be wondering…</p><blockquote><strong><em>“Why does the position matter? The model can read the entire context anyway.”</em></strong></blockquote><p>Technically, yes.</p><p>But practically, not all parts of the prompt receive the same attention.</p><p>Research on long-context language models has shown that information <strong>buried in the middle of a very long prompt is easier to overlook</strong> than information placed at the beginning or the end. This phenomenon is commonly known as the <strong>Lost-in-the-Middle</strong> problem.</p><p>That’s why production systems pin important facts right at the beginning of the prompt.</p><p>Not because the model can’t read the rest.</p><p>But because these values are too important to leave buried inside hundreds of previous messages.</p><blockquote><strong>Rule 2: Don’t Let the Model Rewrite Facts</strong></blockquote><p>This is probably the rule that surprises most people.</p><p>The Case Facts Block is <strong>not</strong> a summary.</p><p>It’s <strong>not</strong> a conversation.</p><p>It’s the source of truth.</p><p>That means it should never be rewritten just because the conversation continues.</p><p>For example, imagine your block contains:</p><pre>refund_amount: 249.50</pre><p>A few turns later, the model summarizes the conversation and writes:</p><blockquote><em>Customer requested a refund of around </em><strong><em>$250</em></strong><em>.</em></blockquote><p>Should the block now become:</p><pre>refund_amount: 250</pre><p>Absolutely not.</p><p>The summary is allowed to paraphrase.</p><p>The Case Facts Block is not.</p><p>The only time this block should change is when the <strong>underlying fact changes</strong>.</p><p>For example, if the customer says:</p><blockquote><em>“Sorry, I gave you the wrong Order ID.”</em></blockquote><p>or</p><blockquote><em>“The refund amount should actually be $312.50.”</em></blockquote><p>Now the source of truth has changed.</p><p>Updating the block makes sense.</p><p>Everything else, the model’s reasoning, summaries, explanations, and conversations, should never overwrite it.</p><blockquote><strong>Rule 3: Never Summarize the Block</strong></blockquote><p>This is where everything comes together.</p><p>When your conversation becomes too large, you summarize the conversation.</p><p><strong>You do not summarize the Case Facts Block.</strong></p><p>Think about what happens if we include it in the summarization process.</p><p>Original:</p><pre>refund_amount: 249.50</pre><p>After summarization:</p><blockquote><em>Customer requested a refund of approximately $250.</em></blockquote><p>We’ve just recreated the exact problem we were trying to solve.</p><p>Instead, production systems follow a much simpler workflow.</p><ol><li>Keep the Case Facts Block exactly as it is.</li><li>Summarize only the conversation history.</li><li>Attach the unchanged Case Facts Block back to the next request.</li></ol><p>The summary becomes smaller.</p><p>The context window becomes smaller.</p><p>But the important facts remain exactly the same.</p><p>And that’s the entire idea behind this pattern.</p><p>We’re not trying to preserve the whole conversation forever.</p><p>We’re only preserving the information that should never be lost.</p><blockquote><strong>Step 7: How Production AI Systems Actually Manage Context</strong></blockquote><p>At this point, we understand three important things.</p><ul><li>Conversations become larger over time.</li><li>Summarization helps reduce the context size.</li><li>Some information should never be summarized.</li></ul><blockquote><strong>So how does a production AI system put all of this together?</strong></blockquote><p>Let’s imagine a customer support agent handling a refund request.</p><p>The customer starts the conversation by providing their Customer ID, Order ID, and the exact refund amount. The application immediately extracts these values and stores them inside a <strong>Case Facts Block</strong>.</p><p>The conversation then continues normally.</p><p>The customer asks questions.</p><p>The agent calls tools.</p><p>The application checks internal APIs.</p><p>More messages get added.</p><p>Eventually, the conversation becomes large enough that we decide to summarize the older messages.</p><p>Here’s the important part.</p><p>We <strong>don’t</strong> summarize everything.</p><p>Instead, the application follows a simple workflow.</p><pre>User Conversation<br>                       │<br>                       ▼<br>            Extract Important Facts<br>                       │<br>        ┌──────────────┴──────────────┐<br>        ▼                             ▼<br>   CASE_FACTS                 Conversation History<br>                                      │<br>                                      ▼<br>                             Summarization Engine<br>                                      │<br>                                      ▼<br>                             Conversation Summary</pre><pre>        CASE_FACTS<br>              +<br> Conversation Summary<br>              +<br> Recent Conversation<br>              │<br>              ▼<br>            LLM Request</pre><p>Notice what happened here.</p><p>The summarizer never touches the Case Facts Block.</p><p>It only summarizes the conversation history.</p><p>Once the summary is generated, the application simply combines three pieces of information:</p><ol><li>The unchanged Case Facts Block.</li><li>The summarized conversation.</li><li>The most recent conversation turns.</li></ol><p>These three together become the next request sent to the LLM.</p><p>This architecture gives us the best of both worlds.</p><p>The conversation remains small enough to fit comfortably inside the context window, while the critical information stays exactly the same from the first turn to the last.</p><blockquote><strong>More importantly, the model never has to “remember” those values.</strong></blockquote><p>They’re explicitly provided on every request.</p><p>That’s why this pattern is much more reliable than asking the model to recall information from hundreds of previous messages.</p><p>Now that we understand the overall architecture, implementing it in code becomes surprisingly simple.</p><blockquote><strong>Common Mistakes Engineers Make</strong></blockquote><p>By now, you probably understand why the Case Facts Block exists.</p><p>But here’s something interesting.</p><p>When engineers first learn about this pattern, they often come up with solutions that sound reasonable but don’t actually solve the problem.</p><p>Let’s look at some of the most common ones.</p><blockquote>“I’ll just use a larger context window.”</blockquote><p>This is probably the most common misconception.</p><p>A larger context window certainly delays the problem, but it doesn’t eliminate it.</p><p>Long-running conversations continue to grow. Tool calls continue to accumulate. Eventually, even a larger context window fills up.</p><p>More importantly, a larger context window doesn’t solve the <strong>Lost-in-the-Middle</strong> problem. Important facts buried inside hundreds of messages can still receive less attention than information placed at the beginning of the prompt.</p><p>A larger context window gives you more space.</p><p>It doesn’t give you better state management.</p><blockquote><strong>“I’ll summarize everything.”</strong></blockquote><p>At first, this sounds like the perfect solution.</p><p>Smaller context.</p><p>Lower cost.</p><p>Faster requests.</p><p>But remember what we learned earlier.</p><p>Summaries are designed to preserve the <strong>story</strong>, not the <strong>exact values</strong>.</p><p>Customer IDs, invoice numbers, refund amounts, policy IDs, contract numbers, and medical record identifiers should never be treated like ordinary conversation.</p><p>The moment you summarize them, you’ve already accepted information loss.</p><blockquote><strong>“I’ll ask the model to remember important facts.”</strong></blockquote><p>This one is surprisingly common.</p><p>You’ll often see prompts like:</p><blockquote>“Remember the customer’s Order ID throughout the conversation.”</blockquote><p>The problem is that prompts are instructions.</p><p>They are <strong>not memory</strong>.</p><p>Production systems don’t rely on reminders.</p><p>They rely on architecture.</p><p>Instead of hoping the model remembers something, they simply provide those facts again on every request.</p><blockquote><strong>“I’ll keep updating the Case Facts Block.”</strong></blockquote><p>This is another mistake that sounds reasonable.</p><p>As the conversation grows, some engineers keep rewriting the Case Facts Block so it matches the latest summary.</p><p>Unfortunately, this introduces the very problem we’re trying to avoid.</p><p>Every rewrite is another opportunity to accidentally change an exact value.</p><p>Instead, think of the Case Facts Block as the application’s source of truth.</p><p>If the customer corrects their Order ID, update it.</p><p>If the refund amount actually changes, update it.</p><p>But never rewrite it simply because the conversation was summarized.</p><blockquote><strong>“I’ll store everything inside the Case Facts Block.”</strong></blockquote><p>This is the opposite problem.</p><p>Once engineers discover this pattern, they’re tempted to put every detail inside it.</p><p>Meeting notes. Entire conversations. Reasoning. Tool outputs.</p><p>That’s not the goal.</p><p>The Case Facts Block should contain only the information that your application cannot afford to lose.</p><p>Everything else belongs in the conversation and can safely be summarized.</p><p>Think of it this way.</p><p><strong>Summaries explain what happened.</strong></p><p><strong>Case Facts preserve what must never change.</strong></p><blockquote><strong>Final Thoughts</strong></blockquote><p>The biggest takeaway from this article is simple: <strong>not everything should be summarized</strong>. Conversations and reasoning can be compressed, but critical facts like customer IDs, invoice numbers, dates, and exact monetary values should always remain intact.</p><p>The next time you’re building a long-running AI agent, don’t ask, <em>“How do I summarize this conversation?”</em> Instead, ask, <em>“Which information should never be summarized?”</em></p><p>I hope this guide helped you understand why production AI systems don’t simply summarize everything and how the <strong>Case Facts Block</strong> helps preserve critical information in long-running conversations. If you found it useful, consider sharing it with others, and feel free to leave your thoughts or questions in the comments.</p><p>Follow <a href="https://medium.com/u/b3fc496a0d17">Jiten Bhalavat</a> and subscribe via email to receive upcoming blogs on AI systems, LLM architecture, context engineering, agentic workflows, and practical machine learning engineering straight into your mailbox.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a63438c87af" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/the-summarization-trap-why-you-should-never-summarize-everything-9a63438c87af">The Summarization TRAP: Why You Should Never Summarize Everything</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[LATEST] How I Passed the Claude Certified Architect Exam on My First Attempt + Complete Resources…]]></title>
            <link>https://aiadvances.org/latest-how-i-passed-the-claude-certified-architect-exam-on-my-first-attempt-complete-resources-8afd320512d3?source=rss-b3fc496a0d17------2</link>
            <guid isPermaLink="false">https://medium.com/p/8afd320512d3</guid>
            <category><![CDATA[claudecertifiedarchitect]]></category>
            <category><![CDATA[ai-certification]]></category>
            <category><![CDATA[anthropic-claude]]></category>
            <category><![CDATA[ccaf]]></category>
            <category><![CDATA[claude-architect]]></category>
            <dc:creator><![CDATA[Jiten Bhalavat]]></dc:creator>
            <pubDate>Sun, 05 Jul 2026 11:59:54 GMT</pubDate>
            <atom:updated>2026-07-05T11:59:54.776Z</atom:updated>
            <content:encoded><![CDATA[<h3>[LATEST] How I Passed the Claude Certified Architect Exam on My First Attempt + Complete Resources &amp; Step-by-Step Guide</h3><p>If you’re planning to take the Claude Certified Architect (CCA) exam in 2026, this article will give you everything you need, the exact resources I used, a step-by-step preparation plan, what the exam actually tests, and the key mistakes to avoid. No need to hunt across scattered forums, GitHub repos, or YouTube videos. I’ve compiled it all here in one place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*exMJUmTLst6qmP4LGSej3Q.png" /><figcaption>Gave exam on 26th June, received Certificate on 4th July</figcaption></figure><p><strong>Hello everyone!</strong></p><p>My name is Jiten Bhalavat, and I recently passed the <strong>Claude Certified Architect-Foundations (CCA-F)</strong> exam on my very first attempt.</p><p>In this article, I’ll walk you through my entire journey, from understanding the exam structure to the exact resources I used, how I prepared, and the study strategy that worked for me.</p><p>If you’re planning to take the CCA-F exam, don’t worry, I’ll break everything down step by step. By following this guide, you can realistically prepare for the exam in <strong>just 5 days</strong>, spending only 5<strong>–6 hours per day</strong>.</p><p>Let’s get started!</p><blockquote><strong>What is the CCA-F Exam?</strong></blockquote><p>On March 12, 2026, Anthropic launched the Claude Certified Architect — Foundations (CCA-F) exam, making it the first official technical certification from a frontier AI company that goes beyond prompt-writing tutorials. It was launched as part of Anthropic’s $100 million Claude Partner Network investment.</p><p>This is not a completion badge you earn by clicking through slides. It is a <strong>closed-book, proctored, scenario-based exam</strong> that tests whether you can make the right architectural decisions when building production-grade Claude systems at enterprise scale.</p><p>The CCA-F validates your ability to design, deploy, and maintain production-grade applications using the Claude ecosystem — including the Claude Agent SDK, Claude Code, and the Model Context Protocol (MCP). <strong>It is an architecture-level credential that tests system design decisions,</strong> <strong>not everyday Claude usage or prompt trivia.</strong></p><p>The exam is hosted on Anthropic’s Skilljar training platform ( also now on Pearson Test centre ) and is currently available through the Claude Partner Network, which any organization can join for free. The first 5,000 partner company employees get the $125 exam fee waived entirely. Broader public access is expected later in 2026.</p><p>The format is 60 scenario-based multiple-choice questions, 120 minutes, with a passing score of 720 out of 1,000. Recommended experience is at least 6 months of hands-on work with the Claude API and Claude Code.</p><blockquote><strong>Understanding the Exam Pattern (Updated for July 2026)</strong></blockquote><p>Before jumping into the preparation strategy, let’s first understand what the <strong>Claude Certified Architect — Foundations (CCA-F)</strong> exam actually looks like. Anthropic recently updated the certification format, so if you’re reading older blogs or watching outdated YouTube videos, some of the information may no longer be accurate.</p><p>Here’s the latest exam structure as of <strong>July 2026</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*8Z7-9yIN-bQgR4iYaM_okg.png" /></figure><blockquote><strong>Exam Format, Scoring &amp; How to Register</strong></blockquote><p>In this section, I’ll explain the exam format, how the scoring system works, and the complete registration process so you know exactly what to expect before exam day.</p><blockquote><strong>Question Format</strong></blockquote><p>All 60 questions on the CCA-F exam are multiple choice, one correct answer and three distractors. The distractors are intentionally crafted to seem plausible, so you can’t rely on surface-level familiarity. Every question must be answered before you can move forward; the platform doesn’t allow skipping.</p><blockquote><strong>How You Can Take the Exam</strong></blockquote><p>As of July 4th, 2026, Anthropic moved the CCA-F exam from its original Skilljar + ProctorFree setup onto Pearson VUE. This means you now have two options:</p><ul><li><strong>Online proctored: </strong>take it from home via Pearson VUE’s OnVUE platform under live supervision. No Claude, no documentation, no browser tabs. A room sweep is real, so prep your space in advance.</li><li><strong>Test center: </strong>visit a physical Pearson VUE test center near you for an in-person proctored experience.</li></ul><p>Both options are fully closed-book. The knowledge has to be internalized, no shortcuts.</p><blockquote><strong>Exam Fee</strong></blockquote><p>The exam fee is now $125 USD, up from the original $99, paid through Anthropic Partner Academy before you’re directed to Pearson VUE to schedule. Partner discounts scale with your Claude Partner Network tier</p><blockquote><strong>Scoring</strong></blockquote><p>Your results are reported as a scaled score from 100 to 1,000. The minimum passing score is <strong>720</strong>. Scaled scoring is used to ensure fairness, meaning your score is adjusted relative to the difficulty of the specific exam version you received, so a harder exam won’t unfairly penalize you compared to an easier one. The result is simply pass or fail.</p><blockquote><strong>Validity Period</strong></blockquote><p>The certification is valid for 12 months from the date you earn it, and you can renew with a free, non-proctored assessment on Partner Academy. This is an upgrade from the original 6-month validity period at launch.</p><blockquote><strong>Retake Policy</strong></blockquote><p>You can retake the exam <strong>up to 4 times</strong> per rolling 12 months. The waiting periods increase with each failed attempt: <strong>14 days after the first fail</strong>, 3<strong>0 days after the second</strong>, and <strong>90 days after the third</strong>. <strong>Each retake requires the full exam fee.</strong></p><blockquote><strong>[ IMPORTANT ]</strong></blockquote><blockquote><strong>Who Can Register? Eligibility &amp; How to Sign Up</strong></blockquote><p>This is where most people get tripped up. The exam is currently gated through the <strong>Anthropic Partner Network</strong>.</p><p>The CCA-F is gated through the Anthropic Partner Network, which Anthropic announced on March 12, 2026 alongside a $100M commitment to partner-led delivery. <strong>If your employer is listed as a partner, your work email triggers an attestation flow on Skilljar.</strong> <strong>If your employer is not listed, you currently cannot register and the path is to wait for general access</strong>.</p><p>Here’s the step-by-step registration flow:</p><ol><li><strong>Join the Claude Partner Network: </strong>Any organization actively building with Claude can apply for free at claude.com/partners. Individual access is expected to open broader later in 2026.</li><li><strong>Sign up on Anthropic’s Skilljar platform</strong> — Use your corporate email (personal emails are rejected). Complete the prerequisite Anthropic Academy courses.</li><li><strong>Submit the attestation form</strong> — Fill in your full name, company, and role, and acknowledge the partner agreement. Submission typically triggers an entitlement email within 1–3 business hours.</li><li><strong>Pay and schedule on Pearson VUE</strong> — Once confirmed, you’ll be directed to Pearson VUE to book your slot either online or at a test center.</li></ol><blockquote><strong>Note:</strong> Broader public access is widely expected later in 2026, but no official timeline has been confirmed. If you’re an individual without a qualifying organization, you can still start the free Anthropic Academy preparation courses immediately.</blockquote><blockquote><strong>The 5 Exam Domains &amp; Their Weightings</strong></blockquote><p>The CCA-F exam is divided into <strong>five core domains</strong>, each covering a different aspect of building production-ready AI applications with Claude. Every domain carries a different weightage, so it’s important to understand what concepts are tested and where you should spend most of your preparation time.</p><p>In the following sections, I’ll explain each domain, what it covers, and the key topics you should focus on before taking the exam.</p><blockquote><strong>Domain 1: Agentic Architecture &amp; Orchestration — 27%</strong></blockquote><p>This is the heaviest domain and the one most candidates find the hardest. It covers how you design and implement agentic loops, orchestrate multi-agent systems using coordinator-subagent patterns, manage session state, handle task decomposition, and enforce multi-step workflows. The core mental model you need to internalize is the agentic loop: send request → check stop_reason → execute tool → return result → repeat.</p><blockquote><strong>Domain 2: Tool Design &amp; MCP Integration — 18%</strong></blockquote><p>This domain tests your ability to design effective MCP tool interfaces — writing clear, differentiated tool descriptions, handling structured error responses, distributing tools correctly across agents, and integrating MCP servers into Claude Code and agent workflows. A big focus here is on how tool descriptions directly drive tool selection reliability.</p><blockquote><strong>Domain 3: Claude Code Configuration &amp; Workflows — 20%</strong></blockquote><p>Everything about configuring Claude Code for real team environments. This includes CLAUDE.md hierarchy (user, project, directory levels), path-specific rules using .claude/rules/ with glob patterns, custom slash commands and skills, when to use plan mode vs direct execution, and how to integrate Claude Code into CI/CD pipelines.</p><blockquote><strong>Domain 4: Prompt Engineering &amp; Structured Output — 20%</strong></blockquote><p>This domain covers designing precise prompts with explicit criteria, applying few-shot prompting for consistency, enforcing structured output using tool_use with JSON schemas, implementing validation and retry loops, batch processing strategies using the Message Batches API, and multi-pass review architectures.</p><blockquote><strong>Domain 5: Context Management &amp; Reliability — 15%</strong></blockquote><p>The smallest domain by weight but critically important in practice. It covers preserving critical information across long conversations, designing escalation and ambiguity resolution patterns, error propagation across multi-agent systems, managing context in large codebase exploration, human review workflows with confidence calibration, and maintaining information provenance in multi-source synthesis.</p><p>These five domains form the foundation of the CCA-F exam, and together they test whether you can design, build, and deploy production-ready AI systems using Claude. While some domains carry more weight than others, I highly recommend studying <strong>all five</strong>, as questions often combine concepts from multiple domains within the same scenario.</p><p>Now that you have a clear understanding of what each domain covers, let’s look at the <strong>scenario-based format</strong> of the exam and the types of real-world problems you can expect to solve during the test.</p><blockquote><strong>The Six CCA-F Scenarios: </strong>What You’ll Actually Be Tested On</blockquote><p>The CCA-F exam is scenario-based, meaning every question is grounded in a realistic production context.</p><p><strong>Note:</strong> The official exam blueprint describes that the exam consists of <strong>4 scenarios randomly selected from a bank of 6 scenarios</strong>. Anthropic does <strong>not publicly disclose the exact six scenarios</strong>, so the list below reflects the six scenario categories candidates commonly encounter rather than official scenario titles.</p><blockquote><strong>Scenario 1: Customer Support Resolution Agent</strong></blockquote><p>You’re building a customer support agent using the Claude Agent SDK. It handles messy, high-ambiguity requests — returns, billing disputes, account issues — using MCP tools like get_customer, lookup_order, process_refund, and escalate_to_human. The target is 80%+ first-contact resolution while knowing exactly when to hand off to a human.</p><p><em>Core domains tested: Agentic Architecture, Tool Design &amp; MCP Integration, Context Management &amp; Reliability</em></p><blockquote><strong>Scenario 2: Code Generation with Claude Code</strong></blockquote><p>Your team uses Claude Code daily for code generation, refactoring, debugging, and documentation. You need to integrate it into your development workflow using custom slash commands, CLAUDE.md configurations, and understand when to use plan mode versus direct execution.</p><p><em>Core domains tested: Claude Code Configuration &amp; Workflows, Context Management &amp; Reliability</em></p><blockquote><strong>Scenario 3: Multi-Agent Research System</strong></blockquote><p>You’re building a coordinator-subagent research system where one agent searches the web, one analyzes documents, one synthesizes findings, and one generates reports — all orchestrated together to produce comprehensive, cited research outputs on any given topic.</p><p><em>Core domains tested: Agentic Architecture, Tool Design &amp; MCP Integration, Context Management &amp; Reliability</em></p><blockquote><strong>Scenario 4: Developer Productivity with Claude</strong></blockquote><p>You’re building tools to help engineers navigate unfamiliar codebases, understand legacy systems, generate boilerplate, and automate repetitive tasks. The agent uses Claude’s built-in tools — Read, Write, Bash, Grep, Glob — alongside MCP server integrations.</p><p><em>Core domains tested: Tool Design &amp; MCP Integration, Claude Code Configuration &amp; Workflows, Agentic Architecture</em></p><blockquote><strong>Scenario 5: Claude Code for CI/CD</strong></blockquote><p>You’re integrating Claude Code directly into your CI/CD pipeline for automated code reviews, test case generation, and pull request feedback. The challenge here is designing prompts that produce actionable, structured output while minimizing false positives that erode developer trust.</p><p><em>Core domains tested: Claude Code Configuration &amp; Workflows, Prompt Engineering &amp; Structured Output</em></p><blockquote><strong>Scenario 6: Structured Data Extraction</strong></blockquote><p>You’re building a system that extracts structured information from unstructured documents, validates outputs against JSON schemas, and handles edge cases gracefully. Accuracy and downstream system integration are the key concerns.</p><p><em>Core domains tested: Prompt Engineering &amp; Structured Output, Context Management &amp; Reliability</em></p><blockquote><strong>The key takeaway?</strong> No scenario lives in just one domain. Every scenario overlaps across multiple competency areas, which is exactly why surface-level knowledge won’t cut it, <strong>you need to think like a production architect, not just a Claude user.</strong></blockquote><blockquote><strong>How to Prepare for the CCA-F Exam</strong></blockquote><p>Before diving into resources and study plans, let’s be honest about one thing: <strong>how long you need to prepare depends entirely on where you’re starting from.</strong></p><blockquote><strong>Track 1: You Already Build with Claude (5–7 Days)</strong></blockquote><p>If you’ve already built applications with Claude or have hands-on experience with <strong>Agentic AI</strong>, <strong>Claude Code</strong>, and the <strong>Claude API</strong>, you can realistically prepare for this exam in <strong>5–7 days</strong>, studying just <strong>2–3 hours per day</strong>. Since the exam focuses on architectural decision-making rather than memorization, your practical experience will give you a significant advantage.</p><p>To comfortably prepare in 5–7 days, you should already be familiar with topics such as:</p><ul><li>Building agents using the <strong>Claude Agent SDK</strong></li><li>Agentic loops and <strong>stop_reason</strong> (tool_use vs. end_turn)</li><li>Multi-agent architectures, coordinator–subagent patterns, and task delegation</li><li>Model Context Protocol (MCP), including MCP tools, resources, and server integration</li><li>Claude Code, including <strong>CLAUDE.md</strong>, custom commands, skills, rules, and plan mode</li><li>Error handling, escalation strategies, and human-in-the-loop workflows</li></ul><p>If this is you, the exam is largely formalizing knowledge you’ve already built in production. Your preparation is mostly about learning Anthropic’s specific terminology, understanding the exact scenario types on the exam, and filling in any gaps across the five domains.</p><blockquote><strong>Track 2: You’re New to Claude &amp; Agentic AI (2+ Months)</strong></blockquote><p>If you’re completely new to Claude, Agentic AI, MCP, or Claude Code, don’t expect to pass by studying for only a week. This certification is designed to evaluate <strong>real-world engineering judgment</strong>, not just theoretical knowledge. In that case, spend a few weeks, or even a couple of months, building hands-on projects, experimenting with Claude Code and the Agent SDK, and understanding how these concepts work together before scheduling the exam.</p><p>Before you even think about exam prep, you need to build a genuine foundation in:</p><ul><li><strong>How LLMs work: </strong>context windows, tokens, stop reasons, system prompts</li><li><strong>Claude API basics: </strong>making API calls, handling responses, tool use</li><li><strong>What agents are: </strong>agentic loops, tool calling, when to use agents vs. simpler patterns</li><li><strong>MCP (Model Context Protocol): </strong>what it is, how tools and resources work, how to configure MCP servers</li><li><strong>Claude Code: </strong>how to use it, CLAUDE.md configuration hierarchy, plan mode vs. direct execution</li><li><strong>Multi-agent systems: </strong>coordinator-subagent patterns, context passing, error propagation</li></ul><blockquote><strong>Before You Start Studying — Know What’s NOT on the Exam</strong></blockquote><p>One of the biggest time-wasters when preparing for any certification is studying topics that simply won’t appear. The official exam guide is very explicit about what’s out of scope, so let’s save you that time upfront.</p><p><strong>The following topics will NOT be tested on the CCA-F exam:</strong></p><ul><li>Fine-tuning Claude models or training custom models</li><li>Claude API authentication, billing, or account management</li><li>Detailed implementation of specific programming languages or frameworks (beyond what’s needed for basic tool and schema configuration)</li><li>Deploying or hosting MCP servers — infrastructure, networking, container orchestration</li><li>Claude’s internal architecture, training process, or model weights</li><li>Constitutional AI, RLHF, or safety training methodologies</li><li>Embedding models or vector database implementation details</li><li>Computer use — browser automation or desktop interaction</li><li>Vision and image analysis capabilities</li><li>Streaming API implementation or server-sent events</li><li>Rate limiting, quotas, or API pricing calculations</li><li>OAuth, API key rotation, or authentication protocol details</li><li>Specific cloud provider configurations — AWS, GCP, or Azure</li><li>Performance benchmarking or model comparison metrics</li><li>Prompt caching implementation details (beyond knowing it exists)</li><li>Token counting algorithms or tokenization specifics</li></ul><p><strong>The takeaway?</strong> Don’t go down rabbit holes on LLM internals, infrastructure setup, cloud deployments, or model training. The exam is purely focused on how you <em>design, configure, and architect</em> production systems using Claude, not how Claude works under the hood or how you deploy the servers that run it.</p><p>Now that you know what to skip, let’s talk about what actually matters.</p><blockquote><strong>Day 1: Complete the Official Anthropic Academy Courses</strong></blockquote><p>Before jumping into practice questions or the exam guide, your first day should be spent going through the official free courses on <strong>Anthropic Academy (Skilljar)</strong>. These courses are designed by Anthropic themselves and give you the conceptual foundation you need before anything else.</p><p><strong>The good news? All four courses are completely free</strong> and open to everyone, you don’t need partner access to start learning.</p><p>Here are the four courses to complete on Day 1:</p><p><strong>1. Building with the Claude API</strong><br> 🔗 <a href="https://anthropic.skilljar.com/claude-with-the-anthropic-api">anthropic.skilljar.com/claude-with-the-anthropic-api</a></p><p>This is the flagship course and arguably the most important one. It covers how to make API calls, handle responses, work with tool use, manage conversation history, and understand stop reasons like tool_use and end_turn. If you only do one course, make it this one.</p><p><strong>2. Claude 101</strong><br> 🔗 <a href="https://anthropic.skilljar.com/claude-101">anthropic.skilljar.com/claude-101</a></p><p>A foundational overview of Claude — how it works, what it can do, and how to think about prompting and model behavior. If you’re already experienced with Claude, this will be a quick refresher. If you’re newer, this sets the right mental model before diving deeper.</p><p><strong>3. Claude Code in Action</strong><br> 🔗 <a href="https://anthropic.skilljar.com/claude-code-in-action">anthropic.skilljar.com/claude-code-in-action</a></p><p>This course covers Claude Code hands-on — how to use it effectively, how CLAUDE.md configuration files work, plan mode vs. direct execution, custom slash commands, and integrating Claude Code into real development workflows. Domain 3 of the exam (worth 20%) is built directly around this content.</p><p><strong>4. Introduction to Agent Skills</strong><br> 🔗 <a href="https://anthropic.skilljar.com/introduction-to-agent-skills">https://anthropic.skilljar.com/introduction-to-agent-skills</a></p><p>This course walks you through how agentic systems are built using the Claude Agent SDK — agentic loops, tool calling, subagent spawning, and multi-agent coordination patterns. Domain 1 is the heaviest domain at 27%, and this course lays the groundwork for it.</p><p><strong>5. Introduction to MCP</strong><br> 🔗 <a href="https://anthropic.skilljar.com/introduction-to-model-context-protocol">https://anthropic.skilljar.com/introduction-to-model-context-protocol</a></p><p>A dedicated course on the Model Context Protocol — what it is, how MCP tools and resources work, how to configure MCP servers, and how they integrate into Claude Code and agent workflows. Domain 2 (Tool Design &amp; MCP Integration, 18%) pulls heavily from this content.</p><p><strong>A note on time:</strong> These courses can be completed in a single focused day if you already have some background in AI. If you’re newer to the concepts, take an extra day and don’t rush — understanding these courses deeply is more valuable than finishing them quickly.</p><blockquote><strong>Day 2 &amp; 3: Master the 27 Technical Primitives from 5 Domains</strong></blockquote><p>Once you’ve completed the official Anthropic Academy courses, the next two to three days should be spent going deep on the <strong>27 technical primitives, </strong>the exact building blocks the CCA-F exam tests on.</p><p>A great free resource for this is <a href="https://claudearchitectcertification.com/concepts"><strong>claudearchitectcertification.com/concepts</strong></a>, which breaks down all 27 concepts domain by domain with diagrams, code examples, exam traps, and anti-pattern callouts. It’s independent and not affiliated with Anthropic, but it’s one of the most structured concept references available for this exam.</p><blockquote><strong>Domain 1 — Agentic Architecture &amp; Orchestration (27%) · 7 Concepts</strong></blockquote><ul><li><strong>D1.1:</strong> Agentic Loops</li><li><strong>D1.2:</strong> Subagents</li><li><strong>D1.3:</strong> Stop Reason</li><li><strong>D1.4:</strong> Session State &amp; Persistence</li><li><strong>D1.5:</strong> Human-in-the-Loop Escalation</li><li><strong>D1.6:</strong> Subagent State Handoff</li><li><strong>D1.7:</strong> Agent Instruction Files (CLAUDE.md / AGENTS.md)</li></ul><blockquote><strong>Domain 2 — Tool Design &amp; MCP Integration (18%) · 5 Concepts</strong></blockquote><ul><li><strong>D2.1:</strong> Tool Calling</li><li><strong>D2.2:</strong> Tool Choice</li><li><strong>D2.3:</strong> Model Context Protocol (MCP)</li><li><strong>D2.4:</strong> SDK Hooks (PreToolUse / PostToolUse)</li><li><strong>D2.5:</strong> Tool Evaluation &amp; Testing</li></ul><blockquote><strong>Domain 3 — Claude Code Configuration &amp; Workflows (20%) · 4 Concepts</strong></blockquote><ul><li><strong>D3.1:</strong> CLAUDE.md Hierarchy</li><li><strong>D3.2:</strong> Plan Mode</li><li><strong>D3.3:</strong> Skills</li><li><strong>D3.4:</strong> Checkpoints &amp; Session Management</li></ul><blockquote><strong>Domain 4 — Prompt Engineering &amp; Structured Output (20%) · 9 Concepts</strong></blockquote><ul><li><strong>D4.1:</strong> System Prompts &amp; Instructions</li><li><strong>D4.2:</strong> Prompt Caching</li><li><strong>D4.3:</strong> Message Batches API</li><li><strong>D4.4:</strong> Structured Outputs</li><li><strong>D4.5:</strong> Vision &amp; Multimodal</li><li><strong>D4.6:</strong> Streaming</li><li><strong>D4.7:</strong> Attention Engineering</li><li><strong>D4.8:</strong> 4D Framework</li><li><strong>D4.9:</strong> Prompt Engineering Techniques</li></ul><blockquote><strong>Domain 5 — Context Management &amp; Reliability (15%) · 2 Concepts</strong></blockquote><ul><li><strong>D5.1:</strong> Context Window Management</li><li><strong>D5.2:</strong> Case Facts Block</li></ul><blockquote><strong>How to approach these two days:</strong></blockquote><p>Don’t try to memorize everything, focus on <em>understanding the tradeoffs</em>. For every concept, <strong>ask yourself: when would I use this?</strong> <strong>What’s the wrong way to do it?</strong> <strong>What does the exam consider an anti-pattern? </strong>That’s exactly how the questions are structured.</p><blockquote><strong>Day 4 &amp; 5: Mock Exams, Gap Analysis &amp; Final Revision</strong></blockquote><p>By this point, you’ve completed the official Anthropic Academy courses and worked through all 27 technical primitives. Now it’s time to pressure-test your knowledge.</p><p><strong>Step 1: Take a Full Mock Exam</strong></p><p>Don’t treat mock exams as a formality. Sit down, set a 120-minute timer, and simulate real exam conditions,<strong> no notes, no tabs, no Claude</strong>. The goal is not just to see your score, but to understand <strong><em>why</em> you got things wrong</strong>.</p><p>A great starting point is <a href="https://claudearchitectcertification.com/concepts"><strong>claudearchitectcertification.com/concepts</strong></a> — the same platform you used for the 27 primitives. Each concept module on this platform comes with its own MCQs. If you’ve been solving those as you go, you already have a head start. Now take the full timed simulation to see where you actually stand.</p><h3>MOCK EXAM RESOURCES:</h3><ol><li>Official Guide with Examples: <a href="https://everpath-course-content.s3-accelerate.amazonaws.com/instructor%2F34hhd92iyp94a0gtbr15cy5jk%2Fpublic%2F1782870727%2FClaude+Certified+Architect+-+Foundations+-+Exam+Guide.pdf">HERE</a></li><li><strong>Anthropic Official Practice Exam</strong>: Available through Anthropic Academy (score 900+ before taking the live exam)</li><li><a href="https://examlab.net/en/certs/anthropic/cca-f/exam">https://examlab.net/en/certs/anthropic/cca-f/exam</a></li><li><a href="https://claudecertprep.com/">https://claudecertprep.com/</a></li><li><a href="https://www.anthropiccertifications.com/exam">https://www.anthropiccertifications.com/exam</a></li><li><a href="https://claudecertificationguide.com/mock-exam">https://claudecertificationguide.com/mock-exam</a></li><li><a href="https://ccaf.cyberskill.world/">https://ccaf.cyberskill.world/</a></li></ol><p>Well, that’s it! These are all the resources I used to prepare for the <strong>Claude Certified Architect-Foundations (CCA-F)</strong> exam.</p><p>If you go through these resources sincerely, understand the concepts instead of just memorizing them, and spend some time practicing with Claude Code and the official documentation, you’ll be in a very strong position to pass the exam. In my opinion, you won’t need to look anywhere else, these resources cover everything you need for the CCA-F.</p><blockquote><strong>The Golden Rule: </strong>Most people who pass on their first attempt follow this exact loop: <em>Study concepts → Take mock exam → Identify weak spots → Revise → Repeat</em></blockquote><p>Don’t schedule your real exam until you’re consistently scoring <strong>85% or above [850–900+/1000] </strong>on mock exams. That buffer gives you enough room to handle the plausible distractors on the real thing.</p><blockquote><strong>Conclusion: Is the CCA-F Worth It?</strong></blockquote><p>If you’ve read this far, you already know the answer.</p><p>The Claude Certified Architect — Foundations is not just another AI badge. It’s Anthropic’s official signal to the industry that you can design, build, and operate production-grade Claude systems, not just use the chat interface. In a market flooded with people who claim AI expertise, this certification is one of the few credentials that actually filters for real architectural depth.</p><p>I hope this guide saves you dozens of hours of searching and helps you prepare more efficiently. Best of luck with your exam.</p><p>If you found this guide helpful, consider sharing it with someone who’s preparing for the <strong>Claude Certified Architect — Foundations (CCA-F)</strong> exam.</p><p>And if this guide helped you pass the exam, I’d really appreciate it if you came back to this article and <strong>leave a comment</strong> about your experience. Reading your success stories and feedback motivates me to create more in-depth guides like this. <strong>Also follow me on </strong><a href="https://infinityai.medium.com/"><strong>Medium </strong></a><strong>and </strong><a href="https://www.linkedin.com/in/jiten-bhalavat/"><strong>LinkedIn</strong></a></p><p>Best of luck with your preparation, and I’ll see you on the other side as a <strong>Claude Certified Architect!</strong> 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8afd320512d3" width="1" height="1" alt=""><hr><p><a href="https://aiadvances.org/latest-how-i-passed-the-claude-certified-architect-exam-on-my-first-attempt-complete-resources-8afd320512d3">[LATEST] How I Passed the Claude Certified Architect Exam on My First Attempt + Complete Resources…</a> was originally published in <a href="https://aiadvances.org/">AI Advances</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LoRA & QLoRA Mastery: The Beginner-to-Advanced Guide to Efficient LLM Fine-Tuning]]></title>
            <link>https://pub.towardsai.net/lora-qlora-mastery-the-beginner-to-advanced-guide-to-efficient-llm-fine-tuning-d554b0db1066?source=rss-b3fc496a0d17------2</link>
            <guid isPermaLink="false">https://medium.com/p/d554b0db1066</guid>
            <category><![CDATA[peft]]></category>
            <category><![CDATA[qlora]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[lora]]></category>
            <category><![CDATA[fine-tuning]]></category>
            <dc:creator><![CDATA[Jiten Bhalavat]]></dc:creator>
            <pubDate>Tue, 30 Jun 2026 23:01:01 GMT</pubDate>
            <atom:updated>2026-06-30T23:01:01.673Z</atom:updated>
            <content:encoded><![CDATA[<p>Understand the intuition behind LoRA and QLoRA, learn the math without getting lost in equations, and fine-tune LLMs efficiently using Hugging Face, PEFT, and real-world code examples.</p><p>Hello, If you’ve ever wanted to <strong>fine-tune a Large Language Model</strong> but were held back by massive GPU requirements or expensive training costs, <strong>LoRA (Low-Rank Adaptation)</strong> is the technique you need to know. It has become one of the most widely adopted methods for efficiently adapting large language models with just a fraction of the parameters.</p><p>In this guide, we’ll dive deep into what LoRA is, why it works, the mathematics behind it, how to train and use it in practice, and when you should (or shouldn’t) choose it. Whether you’re a beginner or an experienced ML engineer, this guide will help you build a solid understanding of LoRA from first principles to real-world implementation.</p><blockquote><strong>Why Do We Need LoRA?</strong></blockquote><p>Before we understand <strong>what LoRA is</strong>, we first need to understand <strong>why it was introduced in the first place</strong>. Like every major innovation in machine learning, LoRA exists to solve a real problem.</p><p>We’ll start by exploring <strong>what fine-tuning is</strong>, how <strong>full fine-tuning</strong> works, and why it becomes computationally expensive for today’s large language models. Once we understand these limitations, we’ll see how <strong>LoRA provides an elegant and highly efficient solution</strong> to overcome them.</p><blockquote><strong>Step 0: What is Finetuning</strong></blockquote><p>You take a model that’s already been trained on a massive general dataset (this is “pretraining”, it already knows grammar, facts, reasoning patterns), and you continue training it on a smaller, task-specific dataset so it gets good at <em>your</em> specific job (e.g., medical Q&amp;A, customer support tone, code generation in your style).</p><blockquote><strong>Step 1: The Original Way: Full Fine-Tuning</strong></blockquote><p>You update <strong>every single weight</strong> in the model. Nothing is frozen. The model recalculates gradients for all 7 billion parameters and adjusts all of them during training.</p><p>When you <em>just download and run</em> (inference only) a 7B model, memory needs are simple:</p><ul><li>Weights stored in 16-bit precision (fp16/bf16): 7B params × 2 bytes = <strong>~14 GB</strong></li></ul><p>That’s it for inference. You load it, run it, done.</p><p>But the moment you want to <strong>train</strong> it (full fine-tuning), you need to store a lot more, because of how backpropagation + the Adam optimizer work:</p><p>Imagine you download a large model like:</p><ul><li>LLaMA</li><li>Qwen</li><li>GPT-like model</li></ul><p>Let’s say:</p><ul><li>Model size = 7 billion parameters</li><li>Stored in FP32 ( if you want to learn more about Quantization, you can read <a href="https://pub.towardsai.net/understanding-llm-quantization-why-fp32-fp16-bf16-and-int8-matter-for-modern-ai-systems-076ea6eb9ca6">here</a>)</li><li>That’s ~28GB memory</li></ul><p>If you want to teach it a new task (like medical Q&amp;A):</p><p>You do:</p><pre>model = AutoModelForCausalLM.from_pretrained(&quot;model&quot;)<br>trainer.train()</pre><p>What happens?</p><p>1.) All weights update<br>2.) Gradients stored for all parameters<br>3.) Optimizer states stored</p><p>Memory needed:</p><ul><li>Model weights (The model itself) : <strong>~28GB</strong></li><li>Gradients (One gradient per weight, computed every backward pass) : <strong>~28GB</strong></li><li>Adam optimizer states (2 extra copies): ~28*2 = <strong>56GB</strong></li></ul><p><strong>Total: ~112 GB, </strong>just to hold the <em>state</em>, before you’ve even fed it a single batch of training data. <strong>Add activations</strong> (intermediate outputs stored for backprop) and that climbs further depending on batch size and sequence length.</p><p>That’s why full fine-tuning a 7B model basically requires multiple 80GB GPUs (A100/H100) with the load split across them, it physically doesn’t fit on one consumer GPU.</p><blockquote><strong>This is exactly the problem LoRA solves</strong></blockquote><blockquote><strong>Step2: The Core Problem</strong></blockquote><p>Most of the model already knows language.</p><p><strong>You don’t need to change all 7B parameters to:</strong></p><ul><li>Make it medical</li><li>Make it legal</li></ul><p>You only need small adjustments.</p><blockquote><strong>That leads to: PEFT — Parameter Efficient Fine Tuning</strong></blockquote><p>PEFT is not one method. It’s a category.</p><p><strong>It means: </strong><em>Fine-tune only a small number of parameters instead of the whole model.</em></p><p><strong>Examples of PEFT:</strong></p><p>1.) Adapters<br>2.) Prefix tuning<br>3.) Prompt tuning<br>4.) LoRA<br>5.) IA3<br>6.) QLoRA</p><p>So: ✔ Base model frozen<br>✔ Add small trainable parameters<br>✔ Only those get updated</p><p>Memory becomes small.</p><p>Today, we gonna discuss only about LoRA.</p><blockquote><strong>LoRA (Low Rank Adaptation): </strong>It’s a way to fine-tune a huge pretrained model (like Llama or GPT) without touching most of its original weights.</blockquote><p>What LoRA Actually Does ?</p><p>In transformers, most learning happens inside: <strong>Linear layers</strong></p><pre>Example: Y = W × X</pre><p>Where:</p><ul><li>W is huge (like 4096 × 4096)</li><li>That’s millions of parameters</li></ul><blockquote><strong>LoRA says:</strong></blockquote><p>Instead of updating W, Keep W frozen, Add a small low-rank matrix update.</p><p><strong>Mathematically:</strong></p><pre>W_new = W + ΔW</pre><p>LoRA approximates:</p><pre>ΔW = A × B</pre><p>Where:</p><ul><li>A = (d × r)</li><li>B = (r × d)</li><li>r = small rank (like 8 or 16)</li></ul><p>So instead of updating millions of parameters:</p><p>You update:</p><pre>2 × d × r</pre><p>Wait wait wait, its going too technical, lets stop here and see what is happening.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/332/1*UGI1B3HURqWAQM7HTNR5oQ.png" /></figure><blockquote><strong>What is ΔW? How do we get it ? what are the values inside A and B ?</strong></blockquote><p>Too Many Questions ? <strong>Good.</strong> Asking these questions is the first step to understanding the concept.</p><blockquote><strong>Lets understand:</strong></blockquote><p>A transformer linear layer: Y= W * X</p><p>W= pretrained weight <br>X = input<br>Y= Output</p><ol><li>) Normal Full Fine tuning:</li></ol><p>We start with:</p><pre>W0= W_original</pre><p>After training:</p><pre>W= W_trained</pre><p><strong>Here we directly update W. </strong>So, in Full Fine-tuning, there is no separate ΔW stored anywhere. We just modify W directly.</p><p>Okay, now lets see how ΔW comes into the picture in LoRA.</p><blockquote><strong>LoRA says:</strong></blockquote><p>Instead of updating W, Keep W frozen, Add a small low-rank matrix update.</p><p><strong>Mathematically:</strong></p><pre>W_new = W + ΔW</pre><p>Here, we are not updating W, just like Full Finetuning, we are just updating ΔW.</p><blockquote><strong>Now you must be thinking, How can we separate ΔW and W, right ?</strong></blockquote><p>Lets understand this:</p><pre>Imagine: <br><br>W_original = 10<br><br>After training:<br><br>W_trained = 13<br><br>Then:<br><br>ΔW = 3 ( 13-10 )<br><br>So:<br><br>W_new = 10 (W_original) + 3 (ΔW) = 13<br>W_new = W + ΔW<br><br>W is just the base. ΔW is the change.</pre><p>Okay, I got how we divided ΔW and W. But what is exactly ΔW ? and how it is benefitting LoRA ?</p><p>So, Instead of learning a full matrix ΔW (same size as W), we approximate it using <strong>low-rank factorization</strong>.</p><p>LoRA assumes:</p><pre>ΔW = A × B</pre><p>Where:</p><ul><li>A = (d × r)</li><li>B = (r × d)</li><li>r = small rank (like 8 or 16)</li><li>So instead of learning a full d × d update (which would be 4096 × 4096 = ~16.7M numbers), you learn it through a narrow r-dimensional bottleneck. If r = 8, you&#39;re learning:</li></ul><pre>A: 4096 × 8 = 32,768 params<br>B: 8 × 4096 = 32,768 params<br>Total: 65,536 params</pre><p>That’s <strong>~250x fewer</strong> parameters than the full matrix.</p><p><strong>The intuition:</strong> the <em>change</em> needed to adapt a pretrained model to a new task usually doesn’t need the full d-dimensional richness, it lives in a much smaller subspace. r is how big you let that subspace be.</p><blockquote><strong>Now, what is this d, r, and how are we going to decide the value of r ?</strong></blockquote><p>d is the dimension of the original weight matrix you&#39;re adapting. If you&#39;re targeting the attention projection in Llama 7B, that weight matrix might be something like d × d = 4096 × 4096. So d is just &quot;how big is the layer,&quot; and it&#39;s fixed, it comes from the model&#39;s architecture, you don&#39;t choose it.</p><p>r is the <strong>rank</strong> of the low-rank decomposition, the bottleneck dimension you squeeze the update through.</p><p><strong>How do you decide the value of r?</strong></p><p>There’s no closed-form formula, it’s an empirical knob, but here’s the practical reasoning people actually use:</p><p>r = 4–8 → Simple tasks, small datasets, style/tone adaptation</p><p>r = 16–32 → Most common range — domain adaptation, instruction tuning</p><p>r = 64–128 → Complex tasks, lots of data, task is far from pretraining distribution</p><blockquote><strong>But what values are inside A and B ?</strong></blockquote><p>They are just <strong>normal trainable parameters</strong>. Initialized like this (usually):</p><ul><li>A → random small Gaussian</li><li>B → zero</li></ul><p>Why B = zero? Because initially:</p><pre>ΔW = A x B = 0</pre><p>So, initially:</p><pre>W_effective ​= W + 0 = W</pre><p>So the model starts exactly as the pretrained model.</p><p>During training:</p><ul><li>Gradients flow only into A and B</li><li>A and B get updated</li><li>AB slowly becomes meaningful</li></ul><p>So A and B hold learned low-rank directions that adjust the original weight.</p><blockquote><strong>Intuition: Why Low Rank?</strong></blockquote><p>Imagine W is 4096×4096. That’s 16 million parameters.</p><p>LoRA says: <em>The required update probably lies in a low-dimensional subspace.</em></p><p>Meaning: You don’t need 16M degrees of freedom to adapt the model.</p><p>Maybe 8 or 16 dimensions are enough.</p><p>So: r = 8 → huge compression.</p><blockquote><strong>What Happens During Forward Pass?</strong></blockquote><p>Instead of:</p><pre>Y = W X</pre><p>LoRA modifies it to:</p><pre>Y = W * X <br>Y = (W + AB)X<br>Y= Wx + A(BX)<br><br>We don’t actually construct ΔW explicitly.<br><br>We compute:<br>1. BX<br>2. A(BX)<br><br>This is computationally efficient.</pre><blockquote><strong>Which weight matrices do you attach an A/B pair to?</strong></blockquote><p>In transformers, most learning power is in:</p><p>Query projection (q_proj)<br>Key projection (k_proj)<br>Value projection (v_proj)<br>Output projection (o_proj)<br>MLP layers</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*YjLFuQtJuSL8-fY0FjEMpA.png" /><figcaption>LoRA Adaptation: which modules to target</figcaption></figure><p><strong>How do you actually decide?</strong></p><p>The reasoning isn’t arbitrary, it comes from <em>what kind of change your task needs</em>:</p><ol><li><strong>Just changing behavior/style/format</strong> (e.g., make it answer in a specific tone, follow a new instruction format) → attention layers only (q,k,v,o). This is the most common setup and matches what you&#39;d use for something like your interview platform&#39;s question-generation behavior.</li><li><strong>Teaching new domain knowledge</strong> (e.g., medical terminology, a new coding language) → add the MLP projections too, since that’s where factual associations are stored.</li><li><strong>Resource-constrained, want max savings</strong> → attention-only, smallest footprint, still captures most of the gain (this is the empirical finding from the original LoRA paper — attention-only gets you most of the way there).</li></ol><p>Most common practice:</p><pre>target_modules = [&quot;q_proj&quot;, &quot;v_proj&quot;]</pre><p>(sometimes just Q and V, not all four) and only expand to K, O, and the MLP layers if eval performance shows the model isn’t picking up enough of the task.</p><p>Why those ? Because:</p><ul><li>Attention directions change task behavior</li><li>Small adaptation there is very powerful</li></ul><p>If dataset is large → apply LoRA to more layers.</p><p>If dataset is small → fewer layers.</p><blockquote><strong>How Does Quantization Change This? (QLoRA Case)</strong></blockquote><p>If you want to understand how Quantization works in depth, you can read this article, <a href="https://pub.towardsai.net/understanding-llm-quantization-why-fp32-fp16-bf16-and-int8-matter-for-modern-ai-systems-076ea6eb9ca6">https://pub.towardsai.net/understanding-llm-quantization-why-fp32-fp16-bf16-and-int8-matter-for-modern-ai-systems-076ea6eb9ca6</a></p><p>QLoRA’s contribution: <strong>quantize the frozen base model down to 4-bit</strong>, while keeping the LoRA adapters in higher precision (bf16) for training. This lets you fine-tune a 65B model on a single 48GB GPU instead of needing multiple 80GB A100s.</p><p>It’s not a new training method, it’s LoRA + three specific engineering tricks to make the 4-bit quantization not destroy quality or break gradient flow.</p><blockquote><strong>The three key innovations</strong></blockquote><p><strong>1. NF4 (4-bit NormalFloat) quantization</strong></p><p>Standard 4-bit quantization (like FP4 or Int4) assumes values are uniformly distributed. But neural network weights are actually roughly <strong>normally distributed</strong> (zero-centered, bell curve). NF4 is an information-theoretically optimal data type built specifically for normally-distributed data, it places quantization bins so each bin gets roughly equal <em>probability mass</em> (not equal range), based on quantiles of a N(0,1) distribution.</p><p>Practically: weights are first normalized into the range [-1, 1] (by scaling with absolute max), then mapped to one of 16 possible NF4 values that were precomputed to match a standard normal distribution’s quantiles.</p><p>This consistently outperforms standard 4-bit float/int quantization for weight distributions you actually see in trained transformers.</p><blockquote><strong>2. Double Quantization (DQ)</strong></blockquote><p>Quantization isn’t free, you need <strong>quantization constants</strong> (the scaling factors, e.g., absolute max per block) to dequantize later. If you quantize in small blocks (QLoRA uses block size 64, for accuracy), you get a <em>lot</em> of these constants, and they’re stored in fp32.</p><p>For a 65B model, this constant overhead alone is ~127MB — not huge, but not nothing when you’re squeezing every byte.</p><p>Double quantization = quantize the quantization constants themselves. The first-level constants (fp32, one per 64-weight block) get quantized again in blocks of 256, this time to 8-bit, using a second quantization constant for that group. This trims that 127MB down to about 27MB. Small in isolation but consistent with the project’s whole philosophy of fanatically reducing every byte of memory.</p><blockquote><strong>3. Paged Optimizers</strong></blockquote><p>This one isn’t about model weights at all, it’s about avoiding OOM crashes during training caused by <strong>memory spikes</strong>, specifically from optimizer states (Adam’s momentum + variance buffers) during gradient checkpointing.</p><p>QLoRA uses NVIDIA’s <strong>unified memory</strong> feature to create “paged” optimizer states. When GPU memory is about to overflow during a spike (e.g., long sequence length triggering a big checkpointing recomputation), pages of the optimizer state automatically get evicted to CPU RAM, and brought back to GPU when needed — just like OS-level paging between RAM and disk. This happens transparently without you writing any extra eviction logic.</p><blockquote><strong>How it all fits together at training time, the forward/backward pass</strong></blockquote><p>This is the part people often get hazy on, so let’s be precise:</p><ol><li><strong>Storage</strong>: base model weights are stored in NF4 (4-bit), with double-quantized constants.</li><li><strong>Compute dtype</strong>: during forward/backward pass, the 4-bit weights for a given layer are <strong>dequantized on-the-fly to bf16</strong> right before the matmul. So computation happens in bf16, but storage stays in 4-bit.</li><li><strong>LoRA adapters</strong> (A, B matrices) are kept and trained in bf16 the whole time — they’re never quantized.</li><li><strong>Gradients</strong> only flow into the LoRA adapter parameters. The base model’s 4-bit weights get <strong>no gradient updates at all</strong> — they’re purely frozen, used only for the forward computation (dequantized transiently, immediately discarded after use — not materialized in full precision in memory).</li><li><strong>Backward pass</strong>: gradients flow through the frozen (dequantized-on-the-fly) base weights mathematically, but only update A and B.</li></ol><p>So memory-wise, during training you hold: 4-bit base weights (tiny) + bf16 LoRA adapters (tiny) + optimizer states for adapters only (tiny) + activations. You never need to hold the full-precision base model or its optimizer states. That’s the whole trick.</p><p><strong>Now, you must be thinking, what if Quality gets dropped.</strong></p><blockquote>No, Quality, does not collapse. Why ?</blockquote><p>You might expect 4-bit base weights to wreck downstream performance, but the QLoRA paper showed fine-tuned NF4+DQ models matched full 16-bit LoRA fine-tuning performance closely across benchmarks. The intuition: the base model’s role is just to provide a fixed, frozen feature transformation — small per-step quantization noise in that frozen transform gets absorbed/compensated for by the adapters during training, especially since LoRA is already operating as a low-rank correction on top.</p><p>You load model in 4-bit:</p><pre>BitsAndBytesConfig(load_in_4bit=True)</pre><p>Lets work with the code now.</p><blockquote><strong>Method 1: Hugging Face transformers + peft + trl (SFTTrainer)</strong></blockquote><pre>!pip install transformers peft trl datasets accelerate bitsandbytes</pre><pre>import torch<br>from datasets import load_dataset<br>from transformers import (<br>    AutoModelForCausalLM,<br>    AutoTokenizer,<br>    BitsAndBytesConfig,<br>)<br>from peft import LoraConfig, get_peft_model, prepare_model_for_kbit_training<br>from trl import SFTTrainer, SFTConfig<br><br><br>MODEL_ID = &quot;meta-llama/Llama-2-7b-hf&quot;<br>OUTPUT_DIR = &quot;./llama7b-lora-hf&quot;<br><br><br>def main() -&gt; None:<br>    bnb_config = BitsAndBytesConfig(<br>        load_in_4bit=True,<br>        bnb_4bit_quant_type=&quot;nf4&quot;,<br>        bnb_4bit_compute_dtype=torch.bfloat16,<br>        bnb_4bit_use_double_quant=True,<br>    )<br><br>    tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)<br>    tokenizer.pad_token = tokenizer.eos_token<br><br>    model = AutoModelForCausalLM.from_pretrained(<br>        MODEL_ID,<br>        quantization_config=bnb_config,<br>        device_map=&quot;auto&quot;,<br>    )<br>    model = prepare_model_for_kbit_training(model)<br><br>    lora_config = LoraConfig(<br>        r=16,<br>        lora_alpha=32,<br>        target_modules=[&quot;q_proj&quot;, &quot;k_proj&quot;, &quot;v_proj&quot;, &quot;o_proj&quot;],<br>        lora_dropout=0.05,<br>        bias=&quot;none&quot;,<br>        task_type=&quot;CAUSAL_LM&quot;,<br>    )<br>    model = get_peft_model(model, lora_config)<br>    model.print_trainable_parameters()<br><br>    dataset = load_dataset(&quot;tatsu-lab/alpaca&quot;, split=&quot;train[:5000]&quot;)<br><br>    def format_example(ex):<br>        return {<br>            &quot;text&quot;: (<br>                f&quot;### Instruction:\n{ex[&#39;instruction&#39;]}\n\n&quot;<br>                f&quot;### Response:\n{ex[&#39;output&#39;]}&quot;<br>            )<br>        }<br><br>    dataset = dataset.map(format_example)<br><br>    trainer = SFTTrainer(<br>        model=model,<br>        tokenizer=tokenizer,<br>        train_dataset=dataset,<br>        args=SFTConfig(<br>            output_dir=OUTPUT_DIR,<br>            num_train_epochs=1,<br>            per_device_train_batch_size=4,<br>            gradient_accumulation_steps=4,<br>            learning_rate=2e-4,<br>            bf16=True,<br>            logging_steps=10,<br>            save_strategy=&quot;epoch&quot;,<br>            max_seq_length=1024,<br>            dataset_text_field=&quot;text&quot;,<br>            report_to=&quot;none&quot;,<br>        ),<br>    )<br><br>    trainer.train()<br>    trainer.save_model(f&quot;{OUTPUT_DIR}-final&quot;)<br>    tokenizer.save_pretrained(f&quot;{OUTPUT_DIR}-final&quot;)<br>    print(f&quot;Saved LoRA adapter to {OUTPUT_DIR}-final&quot;)<br><br><br>if __name__ == &quot;__main__&quot;:<br>    main()</pre><pre>accelerate launch file.py</pre><blockquote><strong>Method 2: Explicit QLoRA recipe (4-bit base + LoRA on all linear layers)</strong></blockquote><pre>!pip install transformers peft trl datasets accelerate bitsandbytes</pre><pre>import torch<br>import bitsandbytes as bnb<br>from datasets import load_dataset<br>from transformers import (<br>    AutoModelForCausalLM,<br>    AutoTokenizer,<br>    BitsAndBytesConfig,<br>    TrainingArguments,<br>    Trainer,<br>    DataCollatorForLanguageModeling,<br>)<br>from peft import LoraConfig, get_peft_model, prepare_model_for_kbit_training<br><br><br>MODEL_ID = &quot;meta-llama/Llama-2-7b-hf&quot;<br>OUTPUT_DIR = &quot;./llama7b-qlora&quot;<br><br><br>def find_all_linear_names(model) -&gt; list[str]:<br>    &quot;&quot;&quot;Return the names of every 4-bit linear layer to attach LoRA to.&quot;&quot;&quot;<br>    lora_module_names = set()<br>    for name, module in model.named_modules():<br>        if isinstance(module, bnb.nn.Linear4bit):<br>            names = name.split(&quot;.&quot;)<br>            lora_module_names.add(names[-1])<br>    lora_module_names.discard(&quot;lm_head&quot;)<br>    return list(lora_module_names)<br><br><br>def main() -&gt; None:<br>    bnb_config = BitsAndBytesConfig(<br>        load_in_4bit=True,<br>        bnb_4bit_quant_type=&quot;nf4&quot;,<br>        bnb_4bit_compute_dtype=torch.bfloat16,<br>        bnb_4bit_use_double_quant=True,<br>    )<br><br>    tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)<br>    tokenizer.pad_token = tokenizer.eos_token<br><br>    model = AutoModelForCausalLM.from_pretrained(<br>        MODEL_ID,<br>        quantization_config=bnb_config,<br>        device_map=&quot;auto&quot;,<br>    )<br>    model = prepare_model_for_kbit_training(model, use_gradient_checkpointing=True)<br><br>    lora_cfg = LoraConfig(<br>        r=64,<br>        lora_alpha=16,<br>        lora_dropout=0.1,<br>        bias=&quot;none&quot;,<br>        target_modules=find_all_linear_names(model),<br>        task_type=&quot;CAUSAL_LM&quot;,<br>    )<br>    model = get_peft_model(model, lora_cfg)<br>    model.print_trainable_parameters()<br><br>    dataset = load_dataset(&quot;Abirate/english_quotes&quot;, split=&quot;train&quot;)<br><br>    def tokenize(batch):<br>        out = tokenizer(<br>            batch[&quot;quote&quot;],<br>            truncation=True,<br>            padding=&quot;max_length&quot;,<br>            max_length=512,<br>        )<br>        return out<br><br>    dataset = dataset.map(tokenize, batched=True, remove_columns=dataset.column_names)<br><br>    collator = DataCollatorForLanguageModeling(tokenizer=tokenizer, mlm=False)<br><br>    args = TrainingArguments(<br>        output_dir=OUTPUT_DIR,<br>        per_device_train_batch_size=2,<br>        gradient_accumulation_steps=8,<br>        learning_rate=2e-4,<br>        num_train_epochs=1,<br>        bf16=True,<br>        optim=&quot;paged_adamw_8bit&quot;,<br>        logging_steps=10,<br>        gradient_checkpointing=True,<br>        save_strategy=&quot;epoch&quot;,<br>        report_to=&quot;none&quot;,<br>    )<br><br>    trainer = Trainer(<br>        model=model,<br>        args=args,<br>        train_dataset=dataset,<br>        data_collator=collator,<br>    )<br><br>    trainer.train()<br>    trainer.save_model(f&quot;{OUTPUT_DIR}-final&quot;)<br>    tokenizer.save_pretrained(f&quot;{OUTPUT_DIR}-final&quot;)<br>    print(f&quot;Saved QLoRA adapter to {OUTPUT_DIR}-final&quot;)<br><br><br>if __name__ == &quot;__main__&quot;:<br>    main()</pre><p>3.) Method 3: Unsloth (Triton-kernel optimized, ~2x faster, ~50% less memory)</p><pre>!pip install &quot;unsloth[cu121] @ git+https://github.com/unslothai/unsloth.git&quot;</pre><pre>import torch<br>from datasets import load_dataset<br>from unsloth import FastLanguageModel<br>from trl import SFTTrainer, SFTConfig<br><br><br>MODEL_NAME = &quot;unsloth/llama-2-7b&quot;<br>MAX_SEQ_LEN = 2048<br>OUTPUT_DIR = &quot;./llama7b-unsloth-lora&quot;<br><br><br>def main() -&gt; None:<br>    model, tokenizer = FastLanguageModel.from_pretrained(<br>        model_name=MODEL_NAME,<br>        max_seq_length=MAX_SEQ_LEN,<br>        dtype=torch.bfloat16,<br>        load_in_4bit=True,<br>    )<br><br>    model = FastLanguageModel.get_peft_model(<br>        model,<br>        r=16,<br>        target_modules=[<br>            &quot;q_proj&quot;, &quot;k_proj&quot;, &quot;v_proj&quot;, &quot;o_proj&quot;,<br>            &quot;gate_proj&quot;, &quot;up_proj&quot;, &quot;down_proj&quot;,<br>        ],<br>        lora_alpha=16,<br>        lora_dropout=0,<br>        bias=&quot;none&quot;,<br>        use_gradient_checkpointing=&quot;unsloth&quot;,<br>        random_state=3407,<br>    )<br><br>    dataset = load_dataset(&quot;yahma/alpaca-cleaned&quot;, split=&quot;train[:5000]&quot;)<br><br>    def format_example(ex):<br>        return {<br>            &quot;text&quot;: (<br>                f&quot;### Instruction:\n{ex[&#39;instruction&#39;]}\n\n&quot;<br>                f&quot;### Response:\n{ex[&#39;output&#39;]}&quot;<br>                + tokenizer.eos_token<br>            )<br>        }<br><br>    dataset = dataset.map(format_example)<br><br>    trainer = SFTTrainer(<br>        model=model,<br>        tokenizer=tokenizer,<br>        train_dataset=dataset,<br>        args=SFTConfig(<br>            output_dir=OUTPUT_DIR,<br>            per_device_train_batch_size=2,<br>            gradient_accumulation_steps=4,<br>            num_train_epochs=1,<br>            learning_rate=2e-4,<br>            bf16=True,<br>            logging_steps=10,<br>            save_strategy=&quot;epoch&quot;,<br>            max_seq_length=MAX_SEQ_LEN,<br>            dataset_text_field=&quot;text&quot;,<br>            optim=&quot;adamw_8bit&quot;,<br>            warmup_steps=5,<br>            report_to=&quot;none&quot;,<br>        ),<br>    )<br><br>    trainer.train()<br><br>    model.save_pretrained_merged(<br>        f&quot;{OUTPUT_DIR}-final&quot;,<br>        tokenizer,<br>        save_method=&quot;lora&quot;,<br>    )<br>    print(f&quot;Saved Unsloth LoRA adapter to {OUTPUT_DIR}-final&quot;)<br><br><br>if __name__ == &quot;__main__&quot;:<br>    main()</pre><p>I hope this guide helped you understand LoRA/QLoRA from both a theoretical and practical perspective. If you found it useful, consider sharing it with others and leave your thoughts or questions in the comments. Thanks for reading, and happy fine-tuning!</p><p>Follow <a href="https://medium.com/u/b3fc496a0d17">Jiten Bhalavat</a> and subscribe via email to receive upcoming blogs on AI systems, LLM optimization, and practical machine learning engineering straight into your Mailbox.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d554b0db1066" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/lora-qlora-mastery-the-beginner-to-advanced-guide-to-efficient-llm-fine-tuning-d554b0db1066">LoRA &amp; QLoRA Mastery: The Beginner-to-Advanced Guide to Efficient LLM Fine-Tuning</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Cloudflare’s MCP Server Solved in 10 Minutes What I Couldn’t Debug in 2 Hours]]></title>
            <link>https://medium.com/data-science-collective/how-cloudflares-mcp-server-solved-in-10-minutes-what-i-couldn-t-debug-in-2-hours-63c1037b9f2a?source=rss-b3fc496a0d17------2</link>
            <guid isPermaLink="false">https://medium.com/p/63c1037b9f2a</guid>
            <category><![CDATA[anthropic-claude]]></category>
            <category><![CDATA[cloudflare]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[mcp-server]]></category>
            <dc:creator><![CDATA[Jiten Bhalavat]]></dc:creator>
            <pubDate>Tue, 05 May 2026 19:30:16 GMT</pubDate>
            <atom:updated>2026-05-05T19:30:16.902Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A real story about the moment MCP servers stopped being a demo and started being useful</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SWbL3J8vcXn3R3v2" /></figure><h3>The Problem</h3><p>I have my portfolio deployed on Cloudflare Workers — multiple versions built up over time as I iterated on the site. One day I tried rolling back to a previous version.</p><blockquote>The build ran. No errors. Everything looked clean.</blockquote><p><strong>But my domain didn’t update.</strong></p><p>I refreshed. Checked the dashboard — build showed as successful. Cleared cache. Tried a different browser. Waited for propagation. Nothing.</p><p>An hour passed. Then closer to two.</p><p>I went through everything I could think of — logs, deployment history, <strong>Wrangler docs</strong>, generic Stack Overflow results that didn’t match my situation. <strong>The maddening part was that the build was succeeding</strong>. No error to chase. The system was telling me everything was fine, but my domain disagreed.</p><p>Classic debugging hell: you don’t even know what you don’t know.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UuzAi-TgnYpnVE12GIbd_Q.png" /></figure><h3>Remembering MCP Exists</h3><p>At some point in hour two, I remembered — <strong>Cloudflare has an MCP server</strong>.</p><p>For context: <strong>MCP (Model Context Protocol)</strong> is an open standard that lets AI systems connect to external tools and interact with live systems on your behalf. Cloudflare built their own MCP server that gives an AI agent direct access to your account — Workers, DNS, deployments, configurations — all of it, through natural language.</p><p>I had set it up weeks earlier out of curiosity and mostly forgotten about it. This seemed like a good time to actually use it.</p><h3>What Happened</h3><p>I connected the Cloudflare MCP server to Claude Code and asked:</p><p><em>“My Worker build is completing successfully but my domain isn’t reflecting changes. Multiple versions deployed. What’s going on?”</em></p><p>It authenticated into my Cloudflare account via OAuth and started moving through my setup on its own — every Worker, every version, every config, every command I had written.</p><p>No copy-pasting from me. No manual log-pulling. <strong>It just navigated my entire account.</strong></p><p>Less than ten minutes later, it came back with two problems I had been sitting right next to for two hours.</p><p><strong>Problem 1: I was running the build command, but not the deploy command. ( Rookie mistake :( )</strong></p><p>Build and deploy are separate steps in Cloudflare Workers. My config was running the build — which is why it completed successfully — but never actually shipping the Worker. It was compiled and just sitting there, <strong>undeployed</strong>.</p><p><strong>Problem 2: I was using an expired API token.</strong></p><p>Even if the deploy had run, it would have silently failed. Old token, still in my config from a previous iteration, no longer valid.</p><p>Two independent issues. Neither produced a clear error I could see. Both invisible to me for two hours.</p><h3>Why This Matters</h3><p>I’m not a beginner. I was looking at the right places. I still couldn’t find it.</p><p>The problem wasn’t skill — it was blind spots. When you’re debugging something you built, you work from a mental model of how it <em>should</em> work. I assumed my deploy command was correct <strong>because it had worked before.</strong> <strong>I assumed my API token was fine because I hadn’t changed it recently.</strong> Both assumptions were wrong, but they were in my “already handled” category.</p><p>The Cloudflare MCP server had no such assumptions. It came in fresh, looked at what was actually there, and flagged what was missing. That’s the exact gap between someone who’s been staring at a problem too long and someone walking in with fresh eyes.</p><h3>The Takeaway</h3><blockquote>Two hours of debugging. Ten minutes with the Cloudflare MCP server.</blockquote><p>If you’re building on Cloudflare, connect it with MCP server, authenticate it with your account, and you&#39;re live. No API keys to paste, no config files to manage.</p><p>This isn’t about replacing your judgment. It’s about removing the blind spots that come from knowing your own setup too well. There will be a moment like mine where you’ve been staring at something for hours and just need something that can look at it differently.</p><p>That’s exactly what it’s built for.</p><p><em>If you found this useful, do visit my profile for more LLM and AI related topics.</em></p><p>Follow me on LinkedIn: <a href="https://www.linkedin.com/in/jiten-bhalavat/">https://www.linkedin.com/in/jiten-bhalavat/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63c1037b9f2a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science-collective/how-cloudflares-mcp-server-solved-in-10-minutes-what-i-couldn-t-debug-in-2-hours-63c1037b9f2a">How Cloudflare’s MCP Server Solved in 10 Minutes What I Couldn’t Debug in 2 Hours</a> was originally published in <a href="https://medium.com/data-science-collective">Data Science Collective</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding LLM Quantization: Why FP32, FP16, BF16 and INT8 Matter for Modern AI Systems]]></title>
            <link>https://pub.towardsai.net/understanding-llm-quantization-why-fp32-fp16-bf16-and-int8-matter-for-modern-ai-systems-076ea6eb9ca6?source=rss-b3fc496a0d17------2</link>
            <guid isPermaLink="false">https://medium.com/p/076ea6eb9ca6</guid>
            <category><![CDATA[llm-quantization]]></category>
            <category><![CDATA[efficient-llm-inference]]></category>
            <category><![CDATA[int8-quantization]]></category>
            <category><![CDATA[fp16-vs-bf16-vs-fp32]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Jiten Bhalavat]]></dc:creator>
            <pubDate>Mon, 09 Mar 2026 06:25:10 GMT</pubDate>
            <atom:updated>2026-03-10T04:53:43.093Z</atom:updated>
            <content:encoded><![CDATA[<p>Large Language Models are extremely large and computationally expensive, so techniques like reduced-precision data types (FP16, BF16) and quantization (INT8, INT4) are used to significantly lower memory usage and accelerate inference while maintaining acceptable model accuracy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D_Qft2ha_9MhUaPLHbNUIA.png" /></figure><blockquote>Overview</blockquote><p>Large Language Models (LLMs) such as GPT, LLaMA, and Mistral contain billions of parameters and require massive computational resources to run. If every weight in these models were stored using standard 32-bit floating point precision (FP32), the memory and compute requirements would be extremely high. For example, a model with 70 billion parameters would require hundreds of gigabytes of memory just to store its weights.</p><p>To make these models practical to run on modern hardware, researchers and engineers use techniques that reduce the numerical precision of model parameters while preserving performance. One of the most important techniques used for this purpose is <strong>quantization</strong>.</p><p>Quantization is the process of converting high-precision numerical values (such as FP32) into lower-precision representations such as FP16, BF16, INT8, or even 4-bit formats. By doing this, the size of the model can be significantly reduced, enabling faster inference, lower memory consumption, and more efficient deployment on GPUs and other hardware accelerators.</p><p>Different numerical formats provide different trade-offs between precision, dynamic range, and computational efficiency.</p><p>For instance, <strong>FP32 provides high precision and stability</strong> but consumes more memory. FP16 and BF16 reduce memory usage while maintaining reasonable accuracy, making them popular for training and inference. INT8 and lower-bit representations further compress the model, enabling large models to run on limited hardware, though with some loss in numerical precision.</p><p>Understanding these numerical formats and the role of quantization is crucial for modern machine learning engineers, especially when deploying large language models in production environments.</p><p>In this article, we will explore the differences between FP32, FP16, BF16, and INT8, how quantization works, and why these techniques are essential for running large AI models efficiently.</p><p>Before understanding quantization, we first need to understand how<br>numbers are represented inside neural networks.</p><blockquote><strong>What Is a Data Type in Neural Networks?</strong></blockquote><p>Neural networks are just <strong>matrix multiplications</strong>.</p><p>Example: Y= W . X</p><p>Where:</p><ul><li>W = weights</li><li>X = input</li><li>Y = output</li></ul><p>The numbers inside W and X are stored in memory using some <strong>data type</strong>.</p><blockquote>That’s where float32, float16, int8 come in.</blockquote><blockquote><strong>1.) float32 (FP32)</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bO_odxr-K0W799-21_VmPg.png" /></figure><p><strong>Sign = 1 bits</strong></p><p><strong>Exponent = 8 bits</strong></p><p><strong>Mantissa= 23 bits</strong></p><blockquote>Example: 13.5</blockquote><p>Let’s see how the value 13.5 is stored in FP32.</p><p>We must convert <strong>decimal → binary → scientific binary form</strong>.</p><pre>## Convert 13 to binary <br>1.) divide by 2 repeatedly <br><br>13/2 = 6 remainder 1 <br>6/2 = 3  remainder 0<br>3/2 = 1  remainder 1<br>1/2 = 0  remainder 1<br><br>Reading bottom up:  13 = 1101 base 2<br><br><br>## Fractional Part<br>1.) Multiply by 2 repeatedly<br><br>0.5 * 2 = 1.0  --&gt; 1<br><br>So, 0.5 = 0.1 base 2<br><br>Combine both: <br><br>13.5 = 1101.1 base 2</pre><pre>Now, Convert to normalized binary scientific notation<br><br>In base 10, 263 = 2.63 x 10^2 <br>In base 2, same idea: <br>            1101.1 = 1.1011 x 2^3<br></pre><pre>We now know, how FP32 Store value:<br>--&gt; Sign = 1 bit<br>--&gt; Exponent = 8 bits<br>--&gt; Mantissa = 23 bits<br><br>So, <br>Step-1: Sign<br>13.5 is positive. <br>So, sign =0 <br><br>Step-2: Exponent <br>Actual Exponent Value = 3 ( as we have 2³ , so 3 )<br>---&gt; Stored Exponent = 3 + bias = 3 + 127 = 130<br>130 in binary = 10000010 [ 8 bits ]<br><br>Why Bias = 127 ? As we have Exponent 8 bits, so 2^(8-1) -1 = 127<br><br>Step-3: Mantissa<br>We store everything after the leading 1.<br><br>Our 13.5 decimal value is: 1.1011 x 2^3<br>So, we store: <br>10110000000000000000000  [ 23 bits total ]</pre><pre>Final FP32 Representation: <br><br>0 | 10000010 | 10110000000000000000000</pre><pre>Lets Decode: <br>Using formaula<br><br>Formula:   (-1)^sign x 1.mantissa x 2^(exponent-127)<br><br>We have, sign=0 , mantissa= 101100... exponent = 130<br>So, <br>(-1)^0  x  1.101100  x 2^(130-127)<br>1x1.101100 x 2^3 <br>1.101100000... x 8<br><br>Convert that to decimal: 1.1011 base 2 =  1 + 1*(1/2) + 0*(1/4) + 1*(1/8) + 1*(1/16)+ 0+ ...<br>= 1.6875 *  8 <br>= 13.5  </pre><h3>Why FP32?</h3><ul><li>Very high precision</li><li>Stable training</li><li>Default in older models</li></ul><h3>Memory Cost</h3><p>If model has:</p><p>1 billion parameters:</p><pre>1B x 4 Bytes = 4GB</pre><p>Because:<br> 32 bits = 4 bytes</p><blockquote><strong>2.) float16 (FP16)</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lI5E9AVM2StrgP7FoxdF6g.png" /><figcaption>FP16</figcaption></figure><p><strong>Sign= 1 Bits</strong></p><p><strong>Exponent = 5 bits ( it was 8 in FP32 )</strong></p><p><strong>Mantissa = 10 bits ( For FP32, its 23 bits)</strong></p><blockquote>We will use the same example: 13.5</blockquote><p>Lets see how the value 13.5 is stored in FP16.</p><p>We must convert <strong>decimal → binary → scientific binary form</strong>.</p><pre><br>## Convert 13 to binary <br>1.) divide by 2 repeatedly <br><br>13/2 = 6 remainder 1 <br>6/2 = 3  remainder 0<br>3/2 = 1  remainder 1<br>1/2 = 0  remainder 1<br><br>Reading bottom up:  13 = 1101 base 2<br><br>## Fractional Part<br>1.) Multiply by 2 repeatedly<br><br>0.5 * 2 = 1.0  --&gt; 1<br><br>So, 0.5 = 0.1 base 2<br><br>Combine both: <br><br>13.5 = 1101.1 base 2<br></pre><pre>Now, Convert to normalized binary scientific notation<br><br>In base 10, 263 = 2.63 x 10^2 <br>In base 2, same idea: <br>            1101.1 = 1.1011 x 2^3</pre><pre>We now know, how FP16 Store value:<br>--&gt; Sign = 1 bit<br>--&gt; Exponent = 5 bits<br>--&gt; Mantissa = 10 bits<br><br>So, <br>Step-1: Sign<br>13.5 is postive. <br>So, sign =0 <br><br>Step-2: Exponent <br>Actual Exponent Value = 3 ( as we have 2³ , so 3 )<br>---&gt; Stored Exponent = 3 + Bias = 3 + 15 = 18<br>18 in binary = 10010 [ 5 bits ]<br><br>Why Bias = 15 ? As we have Exponent 5 bits, so 2^(5-1) -1 = 15<br><br><br>Step-3: Mantissa<br>We store everything after the leading 1.<br><br>Our 13.5 decimal value is: 1.1011 x 2^3<br>So, we store: <br>1011000000  [ 10 bits total ]</pre><pre>Final FP16 Representation: <br><br>0 | 10010 | 1011000000</pre><pre>Lets Decode: <br>Using formaula<br><br>Formula:   (-1)^sign x 1.mantissa x 2^(exponent-15)<br><br>We have, sign=0 , mantisaa= 101100... exponent = 18<br>So, <br>(-1)^0  x  1.101100  x 2^(18-15)<br>1x1.101100 x 2^3 <br>1.101100000... x 8<br><br>Convert that to decimal: 1.1011 base 2 =  1 + 1*(1/2) + 0*(1/4) + 1*(1/8) + 1*(1/16)+ 0+ ...<br>= 1.6875 *  8 <br>= 13.5</pre><p>Half the memory.</p><p>Same 1B model:</p><pre>1B x 2 Bytes = 2GB</pre><h3>What’s the catch?</h3><ul><li>Smaller exponent range</li><li>Less precision</li><li>Can cause overflow/underflow during training</li></ul><p>That’s why we use:</p><ul><li>Mixed precision training</li><li>Loss scaling</li></ul><blockquote><strong>3.) Brain float16 (BF16)</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LmIgnBCqBOc2xugsTKSdCw.png" /></figure><p><strong>Sign= 1 Bits</strong></p><p><strong>Exponent = 8 bits ( same as FP32 )</strong></p><p><strong>Mantissa = 7 bits ( For FP32, its 23 bits and FP16: 10 bits)</strong></p><blockquote>We will use the same example: 13.5</blockquote><p>Lets see how the value 13.5 is stored in BFP16.</p><p>We must convert <strong>decimal → binary → scientific binary form</strong>.</p><pre>## Convert 13 to binary <br>1.) divide by 2 repeatedly <br><br>13/2 = 6 remainder 1 <br>6/2 = 3  remainder 0<br>3/2 = 1  remainder 1<br>1/2 = 0  remainder 1<br><br>Reading bottom up:  13 = 1101 base 2<br><br>## Fractional Part<br>1.) Multiply by 2 repeatedly<br><br>0.5 * 2 = 1.0  --&gt; 1<br><br>So, 0.5 = 0.1 base 2<br><br>Combine both: <br><br>13.5 = 1101.1 base 2</pre><pre>Now, Convert to normalized binary scientific notation<br><br>In base 10, 263 = 2.63 x 10^2 <br>In base 2, same idea: <br>            1101.1 = 1.1011 x 2^3</pre><pre>We now know, how BFP16 Store value:<br>--&gt; Sign = 1 bit<br>--&gt; Exponent = 8 bits<br>--&gt; Mantissa = 7 bits<br><br>So, <br>Step-1: Sign<br>13.5 is postive. <br>So, sign =0 <br><br>Step-2: Exponent <br>Actual Exponent Value = 3 ( as we have 2³ , so 3 )<br>---&gt; Stored Exponent = 3 + bias = 3 + 127 = 130<br>130 in binary = 10000010 [ 8 bits ]<br><br>Why Bias = 127 ? As we have Exponent 8 bits, so 2^(8-1) -1 = 127<br><br>Step-3: Mantissa<br>We store everything after the leading 1.<br><br>Our 13.5 decimal value is: 1.1011 x 2^3<br>So, we store: <br>1011000  [ 7 bits total ]</pre><pre>Final BF16 Representation: <br><br>0 | 10000010 | 1011000</pre><pre>Lets Decode: <br>Using formaula<br><br>Formula:   (-1)^sign x 1.mantissa x 2^(exponent-127)<br><br>We have, sign=0 , mantisaa= 1011000 exponent = 130<br>So, <br>(-1)^0  x  1.1011000  x 2^(130-127)<br>1x1.1011000 x 2^3 <br>1.1011000 x 8<br><br>Convert that to decimal: 1.1011 base 2 =  1 + 1*(1/2) + 0*(1/4) + 1*(1/8) + 1*(1/16)+ 0+ ...<br>= 1.6875 *  8 <br>= 13.5</pre><h3>The Key Difference</h3><blockquote>FP16:</blockquote><ul><li>Smaller exponent</li><li>Larger mantissa</li></ul><blockquote>BF16:</blockquote><ul><li>Same exponent size as FP32</li><li>Smaller mantissa</li></ul><blockquote>What That Means Practically ?</blockquote><p>Range: <strong>FP16 exponent bits = 5</strong><br>So exponent range is small.</p><p><strong>Max FP16 ≈ 65504 , That’s tiny.</strong></p><blockquote>BF16 exponent bits = 8</blockquote><p>Same as FP32.</p><p><strong>Max BF16 ≈ 3.4×10^38 , Same range as FP32.</strong></p><pre>| Type | Min (approx) | Max (approx) |<br>| ---- | ------------ | ------------ |<br>| FP32 | 1e-45        | 3.4e38       |<br>| FP16 | 6e-8         | 6.5e4        |<br>| BF16 | 1e-38        | 3.4e38       |</pre><blockquote>Why This Matters for LLMs ?? : In transformers: Attention scores can get large, Gradients can explode, Activations can spike.</blockquote><p>FP16 is more prone to overflow because of its smaller exponent range,<br>while BF16 has the same exponent range as FP32, making overflow much less likely.</p><blockquote>That’s why: Modern GPUs such as NVIDIA A100, H100, and A10G provide native support for BF16 tensor operations, making BF16 widely used for LLM training.</blockquote><h3>Precision Difference</h3><p>Now look at mantissa.</p><p>FP16 = 10 bits<br>BF16 = 7 bits</p><p>So FP16 has <strong>more precision</strong>.</p><p>BF16 has <strong>less precision</strong> but more range.</p><blockquote>Example: Representing 1.234567</blockquote><p>FP32 has 23 mantissa bits → very precise.</p><p>FP16 (10 bits mantissa) → decent precision.</p><p>BF16 (7 bits mantissa) → less precise.</p><p><strong>But neural networks tolerate small rounding noise.</strong></p><p><strong>They do NOT tolerate overflow.</strong></p><p><strong>Range &gt; precision for training stability.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*6uoqshDfZLbpA1LuVPOgpw.png" /></figure><p>Why BF16 Is So Popular in LLM Training ??</p><p>Because:</p><ul><li>Same dynamic range as FP32</li><li>2× less memory</li><li>No need for loss scaling</li><li>Stable training</li></ul><p>FP16 needs:</p><ul><li>Loss scaling</li><li>Careful tuning</li></ul><p>BF16 usually just works.</p><blockquote>FP32 and BF16 has same range</blockquote><p>That’s why modern LLM training prefers BF16.</p><blockquote><strong>4.) INT8 (8-bit Integer)</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q3CGzTTqks7Lq_Qn8Y4B2w.png" /></figure><p>For <strong>INT8</strong>, things are different from FP32/FP16. INT8 does <strong>not store floating-point numbers directly</strong>. Instead, it stores <strong>integers from −128 to 127</strong>, and floating-point values are mapped to these integers using <strong>quantization (scale and zero-point)</strong>.</p><p>So floating-point values must be <strong>quantized</strong>.</p><blockquote>There are two formulas correspond to <strong>two different quantization schemes</strong>.</blockquote><ol><li>Symmetric Quantization: Use when the data is <strong>centered around zero</strong>. ( example: Weights, faster matrix multiplication)</li><li>Asymmetric Quantization: Use when the values are <strong>not centered around zero</strong>. ( example: Activations, range not centered at 0 )</li></ol><p>Symmetric quantization is preferred for neural network weights because they are centered around zero and allow faster computation, while asymmetric quantization is better for activations because their values are often non-negative.</p><blockquote>Why Symmetric Is Preferred for Weights ??</blockquote><p>Because:</p><ul><li>Weights are usually centered around 0</li><li>Mean ≈ 0</li><li>Distribution symmetric</li><li>Zero-point unnecessary</li><li>Faster hardware implementation</li></ul><p>That’s why LLM weights use symmetric quantization.</p><h3>Quantization Formula</h3><pre>1.) Symmetric Quantization<br><br>1.) Compute Scale: <br>    scale = max_abs / 127 <br><br>where,<br>max_abs = max (|rmin|, |rmax|)<br><br>2.) Quantise:<br>     q= round(value/scale) <br>values are the weights of the matrix<br><br>## here zeropoint = 0<br><br>3.) During Computation:<br>     real = q * scale <br></pre><pre>Example:  (Symmetric Quantization)<br>Original weights: [-4.2, -2.5, 1.3, 3.6, 5.1]<br><br>1.) Compute Scale:<br>max_abs = 5.1<br><br>So, scale = max_abs/127 = 5.1/127 = 0.0402<br><br>2.) Quantise =  round(value/scale)<br><br>for value -4.2 = round(-4.2/0.0402) = round (-104.4) = -105<br>for value -2.5 = round(-2.5/0.0402)= -62<br>and so on....<br><br>so we will store INT8 values = [ -105, -62, 32, 90, 127 ]<br><br>3.) De Quantisation:<br><br>real = q * scale = -105 * 0.0402 = -4.221  which is close to -4.2</pre><pre>2.) Asymmetric Quantization<br><br>1.) Compute Scale: <br>    scale = ( rmax - rmin ) / ( qmax - qmin )<br><br>where,<br>rmax = maximum value of the matrix <br>rmin = minimum value of the matrix <br>qmax = 127<br>qmin = -128<br><br>2.) Compute Zero Point<br><br>zeropoint = round ( qmin - (rmin/scale) )<br>if the value, less than -128. then we keep -128 as thats the min range.<br><br>3.) Quantise<br><br>  q= round(r/scale) + zeropoint</pre><pre>Example: <br>Original weights: [-4.2, -2.5, 1.3, 3.6, 5.1]<br><br>rmin = -4.2<br>rmax = 5.1<br>qmin = -128<br>qmax = 127<br><br>1.) Compute scale: <br><br>scale = (rmax - rmin) / (qmax - qmin)<br>scale = (5.1 - (-4.2)) / ( 255 )<br>scale = 0.0365<br><br><br>2.) Compute Zero point:<br><br>zeropoint =  round ( qmin - (rmin/scale) ) <br>= round ( -128 - (-4.2/0.0365) )<br>= round ( -128 - (-115.06) )<br>= -13 <br><br>3.) Quantise each weight:<br><br>q= round(r/scale) + zeropoint<br><br>for value -4.2 = round(-4.2/0.0365) + (-13) =  -128<br>for value -2.5 = round(-2.5/0.0365) + (-13) = -81<br><br><br>4.) De quantise:<br><br>real = scale x (q- zeropoint)<br>= 0.0365 x ( -81- (-13)) <br>= 0.0365 x (-68)<br>= -2.482<br>which is close to -2.5 <br></pre><pre>| Feature             | Symmetric          | Asymmetric      |<br>| ------------------- | ------------------ | --------------- |<br>| Zero point          | 0                  | Non-zero        |<br>| Scale               | max_abs / 127      | (rmax-rmin)/255 |<br>| Hardware efficiency | Faster             | Slightly slower |<br>| Used for            | weights (LLMs)     | activations     |</pre><p>INT8 quantization is widely used during inference because integer arithmetic is significantly faster on modern hardware accelerators, allowing large models to run efficiently with reduced memory bandwidth requirements.</p><h3>Conclusion</h3><p>In this blog, we explored how different numerical formats store values in machine learning systems. We started with <strong>FP32</strong>, the standard floating-point representation that provides high precision but requires more memory and compute. We then looked at <strong>FP16</strong> and <strong>BF16</strong>, which reduce memory usage and accelerate computation while still maintaining reasonable numerical stability for deep learning workloads.</p><p>Finally, we examined <strong>INT8 quantization</strong>, where floating-point values are mapped to integers using scaling techniques. While this significantly reduces memory footprint and improves inference speed, it introduces <strong>quantization error</strong> due to reduced precision.</p><p>Understanding these numerical representations is crucial when working with modern AI systems, especially large language models, where memory efficiency and computational performance directly impact scalability and deployment.</p><p>Each format represents a trade-off between <strong>precision, memory usage, and computational efficiency</strong>, and choosing the right representation depends on the specific stage of the ML pipeline — training, fine-tuning, or inference.</p><h3>What’s Next?</h3><p>In the <strong>next blog</strong>, we’ll move one step further and explore <strong>how to fine-tune Large Language Models (LLMs)</strong>. We’ll cover concepts like <strong>LoRA, QLoRA, parameter-efficient fine-tuning, and how quantization interacts with fine-tuning techniques</strong>.</p><p>Stay tuned! 🚀</p><p>Enjoyed this breakdown? Follow <a href="https://medium.com/u/b3fc496a0d17">Jiten Bhalavat</a> and subscribe via email to receive upcoming blogs on AI systems, LLM optimization, and practical machine learning engineering straight into your Mailbox.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=076ea6eb9ca6" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/understanding-llm-quantization-why-fp32-fp16-bf16-and-int8-matter-for-modern-ai-systems-076ea6eb9ca6">Understanding LLM Quantization: Why FP32, FP16, BF16 and INT8 Matter for Modern AI Systems</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Excalidraw MCP: Turning Agent Markdown into Instant Diagrams]]></title>
            <link>https://infinityai.medium.com/excalidraw-mcp-turning-agent-markdown-into-instant-diagrams-64ab8471fd67?source=rss-b3fc496a0d17------2</link>
            <guid isPermaLink="false">https://medium.com/p/64ab8471fd67</guid>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[excalidraw]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[claude-ai]]></category>
            <category><![CDATA[claude-code]]></category>
            <dc:creator><![CDATA[Jiten Bhalavat]]></dc:creator>
            <pubDate>Wed, 18 Feb 2026 05:29:33 GMT</pubDate>
            <atom:updated>2026-02-18T05:29:33.579Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*qeuGJmbuuxQlVkhMOiKJWw.png" /><figcaption>Ugly ASCII Workflow diagram</figcaption></figure><p>One of the most underrated bottlenecks in technical learning and system design is visualization.<br> We understand concepts faster when we <em>see</em> them, yet creating diagrams often means switching tools, manually drawing boxes, or settling for ugly ASCII art.</p><blockquote><strong>Excalidraw MCP changes that.</strong></blockquote><p><a href="https://github.com/excalidraw/excalidraw-mcp">https://github.com/excalidraw/excalidraw-mcp</a></p><p>Excalidraw MCP is a server that allows AI agents to directly generate diagrams inside Excalidraw from structured markdown or instructions. Instead of asking a model to “draw an image,” you give it structured content, and the MCP handles turning that into clean, editable diagrams.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yS1F2REa7JRtsrDwHCV6Og.png" /><figcaption>using Excalidraw MCP</figcaption></figure><h3>Why It Feels Different</h3><p>Most image-generation tools treat diagrams like pictures.<br> Excalidraw MCP treats them like <em>structures</em>.</p><p>That difference matters.</p><p>When I asked an agent to explain database indexing and B-Trees, it produced a markdown breakdown of the components. Passing that markdown into Excalidraw MCP instantly created a readable tree diagram — nodes, edges, spacing, and hierarchy all intact.</p><p>No prompt gymnastics.<br>No manual drawing.<br>No ASCII diagrams.</p><p>Just: understand → structure → visualize.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/1*p9HT3pFifEfG_gZ8tpk5_A.png" /></figure><h3>Where It Shines</h3><ul><li>Converts markdown into diagrams reliably</li><li>Produces clean, editable Excalidraw files</li><li>Great for system architecture, data structures, and workflows</li><li>Fits naturally into agent-based pipelines</li></ul><h3>The Bigger Picture</h3><p>Tools like Excalidraw MCP signal a shift in how we work with AI.</p><p>We’re moving from:<br> <strong>“Ask a model to generate content”</strong><br> to<br> <strong>“Give an agent tools and let it produce outcomes.”</strong></p><p>This isn’t just about better diagrams.<br> It’s about building workflows where AI can reason, structure, and visualize — end to end.</p><p>If you’re experimenting with AI agents, Excalidraw MCP is absolutely worth trying.</p><p>If you’re tired of text-only explanations and want faster clarity on architecture, flows, or any concept… this is a game-changer.</p><blockquote><strong>Who’s already hooked? Drop a 🔥 if you’ve tested it!</strong></blockquote><p>If you found this useful, follow me and subscribe via email to get my blogs delivered straight to your inbox.</p><p>LinkedIn: <a href="https://www.linkedin.com/in/jiten-bhalavat/">https://www.linkedin.com/in/jiten-bhalavat/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64ab8471fd67" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Claude Code Just Ended Manual Coding for me — My Step-by-Step Guide to 3x Faster Builds in 2026]]></title>
            <link>https://infinityai.medium.com/claude-code-just-ended-manual-coding-for-me-my-step-by-step-guide-to-3x-faster-builds-in-2026-f7f2abe8f611?source=rss-b3fc496a0d17------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7f2abe8f611</guid>
            <category><![CDATA[productivity-hacks]]></category>
            <category><![CDATA[anthropic-claude]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[clawdbot]]></category>
            <category><![CDATA[openclaw]]></category>
            <dc:creator><![CDATA[Jiten Bhalavat]]></dc:creator>
            <pubDate>Mon, 09 Feb 2026 18:31:44 GMT</pubDate>
            <atom:updated>2026-02-09T18:31:44.880Z</atom:updated>
            <content:encoded><![CDATA[<h3>Claude Code Just Ended Manual Coding for me — My Step-by-Step Guide to 3x Faster Builds in 2026</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wmqoZa-odH5AGZ7WFB8N3Q.png" /></figure><p>I lost hours switching branches and fixing merge conflicts every week. Features stalled. Context vanished. Productivity suffered.</p><p>Then Claude Code transformed my terminal. It reads entire codebases. Plans tasks. Edits files. Runs commands. Handles Git natively.</p><p>My output tripled almost overnight. <strong>The biggest unlock? Git worktrees.</strong></p><p>I spin up 3–5 isolated sessions in parallel. Each tackles a different feature without conflicts. No waiting. No overlaps. Just pure speed.</p><p>This is the real 2026 breakthrough for developers. I created a clear guide to help you master it fast.</p><p><strong>To read the full blog, follow this Notion page:</strong> <a href="https://www.notion.so/How-to-use-Claude-Code-302e21562e5a81889efadd48c2d6ee25">https://www.notion.so/How-to-use-Claude-Code-302e21562e5a81889efadd48c2d6ee25</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7f2abe8f611" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Think You Know RAG? Take This 16-Point Checklist and Prove It Wrong]]></title>
            <link>https://infinityai.medium.com/think-you-know-rag-take-this-16-point-checklist-and-prove-it-wrong-4fe75c0448bc?source=rss-b3fc496a0d17------2</link>
            <guid isPermaLink="false">https://medium.com/p/4fe75c0448bc</guid>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[top-5]]></category>
            <category><![CDATA[llamaparse]]></category>
            <category><![CDATA[how-to-parse-pdf]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <dc:creator><![CDATA[Jiten Bhalavat]]></dc:creator>
            <pubDate>Sun, 12 Oct 2025 20:24:31 GMT</pubDate>
            <atom:updated>2025-10-12T20:24:31.982Z</atom:updated>
            <content:encoded><![CDATA[<h4>The RAG Checklist That Exposes Your 10-Line Pipeline</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*RJVRJWF4z4sEckTn" /></figure><p>𝗬𝗼𝘂 𝗱𝗼𝗻’𝘁 𝗸𝗻𝗼𝘄 𝗥𝗔𝗚!! Just because you connected Embeddings → VectorDB → Query → Result, doesn’t mean you “know RAG.”</p><blockquote>That’s not RAG. 𝗧𝗵𝗮𝘁’𝘀 𝗯𝗮𝗿𝗲𝗹𝘆 𝟭𝟬 𝗹𝗶𝗻𝗲𝘀 𝗼𝗳 𝗖𝗼𝗱𝗲 !!</blockquote><p>If you really think you understand 𝗥𝗲𝘁𝗿𝗶𝗲𝘃𝗮𝗹-𝗔𝘂𝗴𝗺𝗲𝗻𝘁𝗲𝗱 𝗚𝗲𝗻𝗲𝗿𝗮𝘁𝗶𝗼𝗻, measure yourself honestly against these checkpoints. 𝗘𝗮𝗰𝗵 𝗶𝘀 𝟭 𝗺𝗮𝗿𝗸. let’s see how much you actually score:</p><p>✅ 𝗧𝗵𝗲 𝗥𝗲𝗮𝗹 𝗥𝗔𝗚 𝗖𝗵𝗲𝗰𝗸𝗹𝗶𝘀𝘁</p><p>𝟭.) 𝗣𝗗𝗙 𝗘𝘅𝘁𝗿𝗮𝗰𝘁𝗶𝗼𝗻 — Have you ever actually read your extracted text? (And no, if you’re still on PyPDF2 for extraction, you’re living in 2015.) <br>𝟮.) 𝗜𝗺𝗮𝗴𝗲 &amp; 𝗛𝗮𝗻𝗱𝘄𝗿𝗶𝘁𝗶𝗻𝗴 — Can you extract text from images or scanned 𝗵𝗮𝗻𝗱𝘄𝗿𝗶𝘁𝘁𝗲𝗻 𝗮𝘀𝘀𝗶𝗴𝗻𝗺𝗲𝗻𝘁𝘀?<br>𝟯.) 𝗖𝗵𝘂𝗻𝗸𝗶𝗻𝗴 𝗦𝘁𝗿𝗮𝘁𝗲𝗴𝘆 — Are you still stuck with chunk_size=100, chunk_overlap=10?<br>𝟰.) 𝗠𝘂𝗹𝘁𝗶𝗺𝗼𝗱𝗮𝗹𝗶𝘁𝘆 — Worked beyond text? Handling images, graphs, videos?<br>𝟱.) 𝗩𝗶𝗱𝗲𝗼𝘀 — Beyond transcript embeddings, can you handle edge cases like STT ( Speech to Text ) + visual cues?<br>𝟲.) 𝗠𝘂𝗹𝘁𝗶-𝘁𝗲𝗻𝗮𝗻𝗰𝘆 — Can your system handle multiple users/data isolation cleanly?<br>𝟳.) 𝗥𝗲-𝗿𝗮𝗻𝗸𝗶𝗻𝗴 — Do you use a re-ranker to prioritize the most relevant retrievals?<br>𝟴.) 𝗖𝗮𝗰𝗵𝗶𝗻𝗴 — Using cache to avoid repetitive API calls?<br>𝟵.) 𝗘𝘃𝗮𝗹𝘂𝗮𝘁𝗶𝗼𝗻 — Have you actually evaluated your RAG pipeline?<br>𝟭𝟬.) 𝗖𝗥𝗨𝗗 𝗶𝗻 𝗗𝗕 — Can you update, insert, or delete nodes after storing in the vector DB?<br>𝟭𝟭.) 𝗗𝗲𝗱𝘂𝗽𝗹𝗶𝗰𝗮𝘁𝗶𝗼𝗻 — Managing duplicate files properly?<br>𝟭𝟮.) 𝗛𝘆𝗯𝗿𝗶𝗱 𝗦𝗲𝗮𝗿𝗰𝗵 — Going beyond vector search with hybrid (BM25 + embeddings)?<br>𝟭𝟯.) 𝗤𝘂𝗲𝗿𝘆 𝗣𝗮𝗿𝘀𝗶𝗻𝗴 — Do you parse/refine queries before firing them at your DB?<br>𝟭𝟰.) 𝗟𝗼𝗴𝗴𝗶𝗻𝗴 &amp; 𝗠𝗼𝗻𝗶𝘁𝗼𝗿𝗶𝗻𝗴 — Do you even know what’s going on in your pipeline at runtime?<br>𝟭𝟱.) 𝗔𝗴𝗲𝗻𝘁𝗶𝗰 𝗥𝗔𝗚 — Can your system act, plan, and chain tools with reasoning??<br>𝟭𝟲.) Your 1000-page PDF can explode into 3000–4000+ chunks (depending on your chunking strategy), and 𝗱𝗼 𝘆𝗼𝘂 𝗸𝗻𝗼𝘄 𝗵𝗼𝘄 𝘆𝗼𝘂𝗿 𝗾𝘂𝗲𝗿𝘆 𝗰𝗮𝗹𝗰𝘂𝗹𝗮𝘁𝗲𝘀 𝘀𝗶𝗺𝗶𝗹𝗮𝗿𝗶𝘁𝘆 𝗮𝗴𝗮𝗶𝗻𝘀𝘁 𝗮𝗹𝗹 𝘁𝗵𝗼𝘀𝗲 𝗲𝗺𝗯𝗲𝗱𝗱𝗶𝗻𝗴𝘀 𝘀𝗼 𝗳𝗮𝘀𝘁?</p><p>𝗪𝗵𝗮𝘁’𝘀 𝘆𝗼𝘂𝗿 𝗦𝗰𝗼𝗿𝗲 🫵 ? Do let me know in the comments.</p><p>💡 𝗕𝗼𝗻𝘂𝘀: I’ll be posting all 𝗰𝗼𝗱𝗲𝘀 𝗮𝗻𝗱 𝗮𝗻𝘀𝘄𝗲𝗿𝘀 to these topics in my upcoming blogs 📆</p><p>The First Blog on PDF Extraction is here:</p><ol><li>) <a href="https://infinityai.medium.com/3-proven-techniques-to-accurately-parse-your-pdfs-2c01c5badb84"><strong>Fix RAG Hallucinations at the Source: Top PDF Parsers Ranked 2025</strong></a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4fe75c0448bc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fix RAG Hallucinations at the Source: Top PDF Parsers Ranked 2025]]></title>
            <link>https://infinityai.medium.com/3-proven-techniques-to-accurately-parse-your-pdfs-2c01c5badb84?source=rss-b3fc496a0d17------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c01c5badb84</guid>
            <category><![CDATA[parsing-techniques]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Jiten Bhalavat]]></dc:creator>
            <pubDate>Fri, 05 Sep 2025 04:07:32 GMT</pubDate>
            <atom:updated>2025-10-12T20:19:46.440Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*2H0NU6qLCfWCXnreuzeCjw.jpeg" /><figcaption><strong>This is your Data, yes, Garbage.</strong></figcaption></figure><p>If you’re still relying on <strong>PyPDF / PyMuPDF / pdfplumber</strong> for parsing, your <strong>RAG pipeline is already broken at the data layer</strong>.</p><p>No matter how advanced your workflow is or how powerful the latest LLM you plug in, if the data isn’t parsed properly, your system will never retrieve accurate answers.</p><p>Most people keep tweaking workflows, prompts, or models, but ignore the <strong>real bottleneck — Data Quality</strong>.</p><p><strong>Here are the tools that actually parse data with high accuracy:</strong></p><ol><li><strong>LlamaParse</strong> — My top pick, highly reliable (10/10)</li><li><strong>Docling</strong> — Excellent performance (9/10)</li><li><strong>Mistral OCR</strong> — Decent, but sometimes misses details or hallucinates (8/10)</li><li><strong>Unstructured.io</strong> — Used to work well, but quality has dropped recently. Not recommended anymore (but you can test it).</li></ol><blockquote><strong>1.) LlamaParse:</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mLny0JerygDwYZgzHM-EIw.jpeg" /></figure><p>A GenAI-native parsing platform developed by LlamaIndex, purpose-built to transform complex, unstructured documents — like PDFs with tables, charts, images, and diagrams — into clean, structured data formats suitable for RAG and LLM workflows.</p><p>Official Documentation: <a href="https://docs.cloud.llamaindex.ai/">https://docs.cloud.llamaindex.ai/</a></p><p><strong>Tip:</strong> If you don’t want to write code, you can simply use the playground to test configurations. Just upload your PDF, try different parsing settings, and check the results. If the output isn’t accurate, you can experiment with <strong>Vision-Language models</strong> or <strong>parsing agents</strong> to compare the differences. Once you identify the configuration that works best for your use case, you can reuse that exact setup in your code as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dP0SrrM-NTTC-x6fZq8JLg.png" /><figcaption>Parse, Extract, Classify or Index your Documents</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TNTnqTXY6pEHDqHOVgdZBA.png" /><figcaption>LlamaIndex Cloud Playground</figcaption></figure><p>If you wanna try out the code:</p><pre>from llama_cloud_services import LlamaParse<br>from google.colab import userdata<br>from llama_index.llms.openai import OpenAI<br>import openai<br><br>llm = OpenAI(model=&quot;gpt-5-mini&quot;)<br><br>parser = LlamaParse(<br>    api_key=userdata.get(&#39;LLAMA_CLOUD_API_KEY&#39;),<br>    verbose=True,<br>    language=&quot;en&quot;,<br>    parse_mode=&quot;parse_document_with_agent&quot;,  # The parsing mode<br>    preserve_layout_alignment_across_pages=True,<br>    high_res_ocr=True,  # Whether to use high resolution OCR (slower but more precise)<br>    adaptive_long_table=True,  # Adaptive long table. LlamaParse will try to detect long table and adapt the output<br>    outlined_table_extraction=True,  # Whether to try to extract outlined tables<br>    output_tables_as_HTML=True,  # Whether to output tables as HTML in the markdown output<br>)<br><br>result = parser.parse(&quot;/content/RIL-1-5.pdf&quot;)</pre><pre>markdown_documents = result.get_markdown_documents(split_by_page=True)<br><br>for i in range(len(markdown_documents)):<br>  text = markdown_documents[i].text<br>  text = text.replace(&quot;\\n&quot;, &quot;\n&quot;)<br>  print(text)</pre><p>If you want to visualize the same way, your pdf is been:</p><pre>import nest_asyncio<br>nest_asyncio.apply()<br><br>image_documents = result.get_image_documents(<br>    include_screenshot_images=True,<br>    include_object_images=False,<br>    image_download_dir=&quot;./images&quot;,<br>)<br><br># access the raw job result<br># Items will vary based on the parser configuration<br>for page in result.pages:<br>    print(page.text)<br>    print(page.md)<br>    print(page.images)<br>    print(page.layout)<br>    print(page.structuredData)</pre><p>This is one of the best tool to Parse the Documents, with almost more than 99% accuracy.</p><p><strong>2.) Docling:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X9PdCM5R094vIEnx6MDt3g.png" /></figure><p>An open-source toolkit (MIT-licensed) from IBM that simplifies parsing a wide array of document formats — including PDF, DOCX, PPTX, HTML, images, and even audio — into structured, AI-ready formats like JSON and Markdown.</p><p><strong>How it works</strong>: Docling uses specialized AI models for layout analysis (DocLayNet) and table structure recognition (TableFormer) to extract content, structure, and formatting. It supports both CLI and Python API usage, includes OCR for scanned documents, and integrates with LLM frameworks such as LangChain, LlamaIndex, and Haystack.</p><pre>from docling.document_converter import DocumentConverter<br><br>source = &quot;/content/RIL-1-5.pdf&quot;  # document per local path or URL<br>converter = DocumentConverter()<br>result = converter.convert(source)<br>print(result.document.export_to_markdown())  </pre><p>This has also Parsed the Text ALmost Perfectly, which leds to 9/10 on Financial PDF.</p><p><strong>3.) Mistral OCR:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dWwP0W9otpUpv6_SfhJ-lg.jpeg" /></figure><p>A next-generation OCR/document understanding API from Mistral AI that goes beyond standard OCR by comprehending multimedia elements — text, tables, images, equations — and preserving document hierarchy. Outputs structured data like interleaved text and images in Markdown or JSON.</p><p><strong>How it works</strong>: Mistral OCR processes a document by analyzing layout, identifying distinct elements (text blocks, tables, images, math), and reconstructing them in structured format. It supports multilingual documents, handles LaTeX/math, and excels in preserving complex layouts. It delivers high speed (up to ~2,000 pages/min) and strong accuracy across benchmarks.</p><pre>from mistralai.models import OCRResponse<br>from IPython.display import Markdown, display<br><br>def replace_images_in_markdown(markdown_str: str, images_dict: dict) -&gt; str:<br>    &quot;&quot;&quot;<br>    Replace image placeholders in markdown with base64-encoded images.<br><br>    Args:<br>        markdown_str: Markdown text containing image placeholders<br>        images_dict: Dictionary mapping image IDs to base64 strings<br><br>    Returns:<br>        Markdown text with images replaced by base64 data<br>    &quot;&quot;&quot;<br>    for img_name, base64_str in images_dict.items():<br>        markdown_str = markdown_str.replace(<br>            f&quot;![{img_name}]({img_name})&quot;, f&quot;![{img_name}]({base64_str})&quot;<br>        )<br>    return markdown_str<br><br>def get_combined_markdown(ocr_response: OCRResponse) -&gt; str:<br>    &quot;&quot;&quot;<br>    Combine OCR text and images into a single markdown document.<br><br>    Args:<br>        ocr_response: Response from OCR processing containing text and images<br><br>    Returns:<br>        Combined markdown string with embedded images<br>    &quot;&quot;&quot;<br>    markdowns: list[str] = []<br>    # Extract images from page<br>    for page in ocr_response.pages:<br>        image_data = {}<br>        for img in page.images:<br>            image_data[img.id] = img.image_base64<br>        # Replace image placeholders with actual images<br>        markdowns.append(replace_images_in_markdown(page.markdown, image_data))<br><br>    return &quot;\n\n&quot;.join(markdowns)<br><br># Display combined markdowns and images<br>display(Markdown(get_combined_markdown(pdf_response)))</pre><p><strong>Mistral OCR</strong> performs well on normal to moderately complex PDFs, delivering accurate text extraction.</p><p>However, when dealing with highly complex documents such as <strong>financial reports</strong>, it tends to <strong>miss certain details</strong> and sometimes <strong>produces hallucinations. So, </strong>Overall, I would rate it 7<strong>/10</strong>.</p><p><strong>4.) Unstructured.io:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*fo1g8XSnpcQuqn8OTOmTxQ.png" /></figure><p>Unstructured.io is a platform and toolkit designed to transform messy, unstructured documents (like PDFs, Word files, HTML, images, etc.) into structured, machine-readable formats that are ready for AI workflows such as RAG (Retrieval-Augmented Generation), agentic agents, or model fine-tuning</p><p>This used to be a solid option, but lately its performance has dropped. It struggles with accuracy and often fails on complex layouts. You can still experiment with it, but I wouldn’t rely on it for serious projects.</p><pre>from unstructured.partition.pdf import partition_pdf<br><br># Path to your PDF file<br>pdf_path = &quot;/content/RIL-1-5.pdf&quot;<br><br># Extract elements from PDF<br>elements = partition_pdf(<br>    filename=pdf_path,<br>    strategy=&quot;auto&quot;,  # best for complex PDFs (uses OCR if needed)<br>    extract_images_in_pdf=True,<br>    infer_table_structure=True,  # tries to extract tables properly<br>    extract_image_block_types=[&quot;Image&quot;, &quot;Table&quot;],  # can keep image placeholders<br>    chunking_strategy=&quot;by_title&quot;  # optional: chunks text based on headings<br>)<br><br># Print all extracted text<br>for el in elements:<br>    print(f&quot;--- {el.category} ---&quot;)<br>    print(el.text, &quot;\n&quot;)</pre><blockquote>🏆 <strong>So, in the end, the clear winner for extracting text from PDFs is <em>LlamaParse</em>.</strong></blockquote><p>👉 <strong>If you want the complete code with all examples, check out my Colab notebook here: </strong><a href="https://colab.research.google.com/drive/1Frb6RJSX0z18_kN9_BIIh2OxRP3jgLES?usp=sharing">https://colab.research.google.com/drive/1Frb6RJSX0z18_kN9_BIIh2OxRP3jgLES?usp=sharing</a></p><p>📑 <strong>The PDFs I used for testing are also included and referenced in the Colab file.</strong></p><p>If you found this helpful and want more content on <strong>RAG, AI, and advanced Agents </strong>make sure to <strong>follow me here and on LinkedIn</strong> for updates, tips, and tutorials!</p><p><strong>Linkedin</strong>: <a href="https://www.linkedin.com/in/jiten-bhalavat/">https://www.linkedin.com/in/jiten-bhalavat/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c01c5badb84" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>