<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Anshul Prakash</title>
    <description>The latest articles on DEV Community by Anshul Prakash (@theanshulprakash).</description>
    <link>https://dev.to/theanshulprakash</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3830445%2F55fd2a30-26df-4ce9-bd43-93fdb609bae6.png</url>
      <title>DEV Community: Anshul Prakash</title>
      <link>https://dev.to/theanshulprakash</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/theanshulprakash"/>
    <language>en</language>
    <item>
      <title>PrePaste -- building it again, but better ❤️</title>
      <dc:creator>Anshul Prakash</dc:creator>
      <pubDate>Mon, 12 Oct 2026 04:55:00 +0000</pubDate>
      <link>https://dev.to/theanshulprakash/prepaste-building-it-again-but-better-3kmi</link>
      <guid>https://dev.to/theanshulprakash/prepaste-building-it-again-but-better-3kmi</guid>
      <description>&lt;p&gt;It all started with a pretty simple thought.&lt;/p&gt;

&lt;p&gt;We copy and paste things hundreds of times every day. Sometimes it's just normal text, sometimes it's an API key, password, personal information, or something we really shouldn't be sharing.&lt;/p&gt;

&lt;p&gt;And most of the time, we don't even realize it.&lt;/p&gt;

&lt;p&gt;This is actually becoming a pretty big concern for companies too.&lt;/p&gt;

&lt;p&gt;With everyone using third-party AI tools these days, employees can unknowingly end up sharing their company's internal data, client information, PII, API keys, or other sensitive secrets with external services.&lt;/p&gt;

&lt;p&gt;Not because they mean to, but simply because it's so easy to copy something and paste it into an AI chatbot without thinking twice.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;And that's exactly the problem I wanted PrePaste to solve.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A small, privacy-first desktop app that helps catch sensitive information before it accidentally leaves your hands.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it all started
&lt;/h2&gt;

&lt;p&gt;I originally built PrePaste during an OpenAI hackathon.&lt;/p&gt;

&lt;p&gt;It was one of those ideas I really wanted to turn into something real, and the hackathon gave me the perfect excuse to do it.&lt;/p&gt;

&lt;p&gt;The first version was built pretty quickly, with a fair bit of vibe coding involved hehe.&lt;/p&gt;

&lt;p&gt;It worked, and I was genuinely happy with it.&lt;/p&gt;

&lt;p&gt;But there's a difference between something that works for a hackathon and something people can actually trust and use every day, especially when privacy is involved.&lt;/p&gt;

&lt;p&gt;So I decided to rebuild it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Same idea, but this time, everything from scratch.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The part I didn't expect ❤️
&lt;/h2&gt;

&lt;p&gt;After sharing PrePaste, something really sweet happened.&lt;/p&gt;

&lt;p&gt;People actually started reaching out.&lt;/p&gt;

&lt;p&gt;I got messages from developers in &lt;strong&gt;Germany, Korea, the USA&lt;/strong&gt;, and quite a few others through Devpost, Discord, and LinkedIn.&lt;/p&gt;

&lt;p&gt;Some wanted to try it, some had suggestions, some wanted to contribute, and some simply asked me to keep building it.&lt;/p&gt;

&lt;p&gt;And honestly, that meant a lot.&lt;/p&gt;

&lt;p&gt;It's one thing to build something because you think it's useful, but seeing people from completely different parts of the world interested in your little project is a completely different feeling.&lt;/p&gt;

&lt;p&gt;A lot of my motivation to continue came from these people.&lt;/p&gt;

&lt;p&gt;So thank you. Really.&lt;/p&gt;

&lt;h2&gt;
  
  
  So here we are, building PrePaste again!
&lt;/h2&gt;

&lt;p&gt;This time, I want it to feel like a proper little product.&lt;/p&gt;

&lt;p&gt;Something simple, polished, and genuinely nice to use.&lt;/p&gt;

&lt;p&gt;I'm rebuilding it with a much cleaner foundation, a far more premium experience, and a little personality of its own, just like all my other projects.&lt;/p&gt;

&lt;p&gt;I want PrePaste to fit naturally into your everyday workflow, without making privacy feel like another complicated thing you have to worry about.&lt;/p&gt;

&lt;p&gt;And yes, &lt;strong&gt;it's going to be completely free and open source.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No subscriptions, no unnecessary paywalls. Just a useful little tool anyone can use.&lt;/p&gt;

&lt;h2&gt;
  
  
  A little glimpse 👀
&lt;/h2&gt;

&lt;p&gt;I've also been working on the website, and I'm pretty excited about how it's turning out.&lt;/p&gt;

&lt;p&gt;Here's a little glimpse of what's coming hehe.&lt;/p&gt;

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

&lt;p&gt;I'm hoping to have a stable release ready within the next week. Fingers crossed!&lt;/p&gt;

&lt;h2&gt;
  
  
  One last thing ❤️
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;To everyone who's supported PrePaste so far, take my heart. ❤️❤️&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;More soon, hehe.&lt;/p&gt;

</description>
      <category>security</category>
      <category>opensource</category>
      <category>python</category>
      <category>presidio</category>
    </item>
    <item>
      <title>Optimizing LLM Context for OpenAPI: A Deterministic Approach to Token Reduction</title>
      <dc:creator>Anshul Prakash</dc:creator>
      <pubDate>Tue, 11 Aug 2026 05:09:11 +0000</pubDate>
      <link>https://dev.to/theanshulprakash/optimizing-llm-context-for-openapi-a-deterministic-approach-to-token-reduction-da2</link>
      <guid>https://dev.to/theanshulprakash/optimizing-llm-context-for-openapi-a-deterministic-approach-to-token-reduction-da2</guid>
      <description>&lt;h3&gt;
  
  
  How deterministic context batching reduced approximate token usage by ~81.7% while building an agentic API testing prototype
&lt;/h3&gt;

&lt;h2&gt;
  
  
  See It in Action
&lt;/h2&gt;

&lt;p&gt;I also recorded a short demo showing the complete workflow, from loading the OpenAPI specification to generating and executing tests, and auto healing:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/IN6aou9RRco" rel="noopener noreferrer"&gt;Watch the demo on YouTube&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;I originally built this as part of my &lt;strong&gt;GSoC 2026 proposal for foss42&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I wasn't selected for GSoC, but while working on the proposal I had already built a working prototype of the system I wanted to contribute: an agentic API testing workflow that could read an OpenAPI specification, generate tests, execute them, and reason about failures.&lt;/p&gt;

&lt;p&gt;And while building it, I ran into a problem that had little to do with HTTP itself.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The OpenAPI specification was becoming too large to send to an LLM efficiently.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That led me to build &lt;strong&gt;OpenAPI Context Batching&lt;/strong&gt; -- a deterministic approach for giving an LLM only the relevant part of an OpenAPI specification instead of repeatedly sending the entire API.&lt;/p&gt;

&lt;p&gt;In my prototype experiment, this reduced approximate token usage from &lt;strong&gt;~50,000 tokens to ~9,200 tokens&lt;/strong&gt; across the same five-interaction workflow; an &lt;strong&gt;81.7% reduction&lt;/strong&gt;🤯.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Problem: OpenAPI Specs are Massive
&lt;/h3&gt;

&lt;p&gt;The original goal of my project was to let an AI agent read an OpenAPI specification, generate test plans, and analyze API failures. But I quickly ran into a huge problem.&lt;/p&gt;

&lt;p&gt;Real OpenAPI specifications are gigantic. They contain hundreds of endpoints, nested schemas, and complex validation rules. If you dump that entire JSON file into an LLM prompt, you run into two major problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It burns through thousands of tokens per single session.&lt;/li&gt;
&lt;li&gt;The model gets completely overwhelmed and starts hallucinating fake endpoints.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If I just want the AI agent to test a &lt;code&gt;/categories&lt;/code&gt; endpoint, it absolutely does not need to see the schemas for &lt;code&gt;/payments&lt;/code&gt; or &lt;code&gt;/cart&lt;/code&gt; or the endpoints not related to it. I realized I needed a way to give the model a smarter context instead of just a bigger one.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Golden Rule: AI Plans, Dart Executes
&lt;/h3&gt;

&lt;p&gt;Before I could optimize the tokens, I had to lock down the core architecture. I established one strict rule for the whole system: &lt;strong&gt;the AI figures out what to test, and Dart does the actual testing&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Letting an LLM directly execute HTTP calls is a terrible idea because it can easily invent fake responses. To prevent this, the model is constrained to generate a structured JSON test plan.&lt;/p&gt;

&lt;p&gt;I built a standalone, headless Dart execution class called &lt;code&gt;ApiTestRunner&lt;/code&gt;. This runner ingests the JSON test plan and performs the real HTTP requests using the networking layer of API Dash. The AI never touches the network directly.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Solution: Deterministic Context Batching
&lt;/h3&gt;

&lt;p&gt;So, how do we actually shrink a massive OpenAPI spec? We do not ask another AI to summarize it. We use deterministic code because OpenAPI is highly structured. &lt;/p&gt;

&lt;p&gt;I wrote a custom Dart algorithm called OpenAPI Context Batching. Instead of sending the full specification, the script parses it and breaks it apart deterministically. Here is exactly how it works under the hood:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Domain Splitting:&lt;/strong&gt; The script reads the raw OpenAPI JSON and splits the endpoints by their root domain, such as &lt;code&gt;/auth&lt;/code&gt; or &lt;code&gt;/categories&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Recursive Reference Resolution:&lt;/strong&gt; OpenAPI heavily uses &lt;code&gt;$ref&lt;/code&gt; to reuse shared schemas. If you only extract the endpoint path, the AI will not know what the data payload actually looks like. I built a recursive resolver that digs through the endpoint and finds every &lt;code&gt;$ref&lt;/code&gt;. &lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Deep Schema Extraction:&lt;/strong&gt; The resolver pulls in only the specific, deeply nested schemas required for that exact endpoint. This completely avoids sending the bloated &lt;code&gt;components/schemas&lt;/code&gt; object.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Focused Context Map:&lt;/strong&gt; The output is a clean &lt;code&gt;Map&amp;lt;String, String&amp;gt;&lt;/code&gt; where each entry is the fully resolved, batched schema for just one domain.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When the agent needs to reason about a request, it only receives this highly focused batched schema. Because the algorithm is deterministic, the exact same OpenAPI specification always produces the exact same endpoint partitions every time.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Guardrailed Retry Loop
&lt;/h3&gt;

&lt;p&gt;To make the system even smarter, I built a conversational agentic mode with a self healing loop. &lt;/p&gt;

&lt;p&gt;If the Dart execution engine runs a test and gets a failing non 2xx status code, it intercepts the error. It then injects the exact status code and response body back into the LLM prompt, asking the agent to fix the parameters automatically. &lt;/p&gt;

&lt;p&gt;To make sure this does not result in an AI driven infinite loop that drains credits, I hardcoded a strict limit of three maximum retries. &lt;/p&gt;




&lt;h3&gt;
  
  
  The Results: 81.7% Token Reduction
&lt;/h3&gt;

&lt;p&gt;I benchmarked this approach on a custom &lt;code&gt;shop.json&lt;/code&gt; OpenAPI specification during my prototype development. The result was significant: approximately 81.7% fewer input tokens for the tested workflow.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Approach&lt;/th&gt;
&lt;th&gt;Approximate Token Usage&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Entire OpenAPI specification&lt;/td&gt;
&lt;td&gt;~50,000 tokens&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Context Batching&lt;/td&gt;
&lt;td&gt;~9,200 tokens&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;By only sending the dependency aware context, I achieved an &lt;strong&gt;81.7% reduction&lt;/strong&gt; in token usage for a five step conversation workflow. Not only did it save a massive amount of tokens, but the focused context meant the AI responded faster and stopped hallucinating.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Approach&lt;/th&gt;
&lt;th&gt;Visualization&lt;/th&gt;
&lt;th&gt;Approx tokens&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Entire OpenAPI passed at once&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjvglzwjm4qp40hjjkuux.png" alt="Without Context Batching" width="800" height="574"&gt;&lt;/td&gt;
&lt;td&gt;~50,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OpenAPI Context Batching&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa9ydclfrm2085d5h0p3e.png" alt="With Context Batching" width="800" height="566"&gt;&lt;/td&gt;
&lt;td&gt;~9,200&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  The Biggest Takeaway
&lt;/h3&gt;

&lt;p&gt;The coolest thing I learned from this project is that we should not use LLMs for everything. &lt;/p&gt;

&lt;p&gt;Parsing files, finding dependencies, and executing HTTP requests are tasks best handled by deterministic software. Generating test plans and reasoning about edge cases are where the LLM actually shines. &lt;/p&gt;

&lt;p&gt;Building this engine independently of the Flutter UI also allowed me to expose it as an MCP server, meaning external tools like Claude Desktop can trigger real test runs. It was an incredible learning experience, and I am super excited to keep exploring how we can build smarter, more efficient developer tools!&lt;/p&gt;

&lt;h4&gt;
  
  
  See my full documentation of the approach here: &lt;a href="https://drive.google.com/file/d/1Xn8WAjBSm_zdii5F92pRRiuoE6cY2aXm/view" rel="noopener noreferrer"&gt;Google Drive&lt;/a&gt;
&lt;/h4&gt;

&lt;h4&gt;
  
  
  My working repo: &lt;a href="https://github.com/TheAnshulPrakash/APIDash_AgenticAPITesting" rel="noopener noreferrer"&gt;AgenticAPITesting (forked from foss42/apidash)&lt;/a&gt;
&lt;/h4&gt;

</description>
      <category>ai</category>
      <category>tokenoptimization</category>
      <category>openapi</category>
      <category>algorithms</category>
    </item>
  </channel>
</rss>
