2
3 Comments

If your AI pipeline is eating 70% of your tokens on navigation footers and ads, you're not scaling - you're leaking cash.

Most teams treat data cleaning as an afterthought. They just dump raw HTML into the context window and pray for good output.

I’ve been building custom pipelines that strip the "noise" at the source before the LLM even sees it.

The Result: 60%+ token efficiency and higher conversion rates.

The Workflow: I’m using a mix of structured extraction and rule-based filtering that keeps the signal-to-noise ratio high.

Building stable data-enrichment pipelines is a grind, especially when dealing with chaotic scraping environments.

Are you building a data-heavy AI product? Let’s talk about how you’re managing your context window costs. I’m looking to trade notes on cleaning stacks.

#indiehackers #buildinpublic #webscraping #saas #ai #datacollection #automation #techfounders

on June 3, 2026
  1. 1

    The 70% on boilerplate matches what we saw, but the leak that came back was rule drift: a site changes its template, your filter quietly passes the footer again, and the savings decay a few weeks later. What caught it for us was tracking tokens-in per successful extraction as a regression signal, plus cost per source so the expensive scrape targets stand out instead of hiding in one aggregate number. Are you watching the signal-to-noise ratio over time, or is drift still a manual check?

  2. 0

    Strong point, and the "strip noise at the source before the model sees it" principle holds well beyond scraping. My token leak came from a different direction — I run a fleet of role-shaped bots for my own company, and the waste wasn't dirty input HTML, it was context: the same background being re-sent every call, bots passing bloated context between each other, system prompts carrying weight they didn't need. Same lesson as yours though — the fix was upstream of the model, not in the prompt. Trimming what each bot actually needs to see per call, and being ruthless about what gets passed along, did more for cost than any model swap.

    Curious whether your cleaning stack is mostly rule-based, or whether you've ended up using a cheap model to pre-filter for a more expensive one downstream? That second pattern is the bit I keep going back and forth on — the pre-filter pass can pay for itself, but only sometimes.

    1. 1

      That is a massive insight you’re absolutely right. It’s a common trap to focus on 'clean input' while ignoring the 'context drift' happening within bot-to-bot communication and redundant system prompts. Being 'ruthless' about state management is definitely an underrated engineering skill in AI development.

      Regarding your question on the cleaning stack: I’ve landed on a hybrid pre-filtering pattern, and here is how I decide when to use a 'cheap-to-expensive' model chain:

      Rule-based Layer (The First Pass): I always keep a deterministic, rule-based layer at the very front. It handles the 'low-hanging fruit' stripping boilerplate, boilerplate headers/footers, and obvious noise. This is basically free and saves a lot of unnecessary LLM calls.

      Cheap Model Filter (The Second Pass): If the data is semi-structured or highly variable, I use a high-throughput, low-cost model (like a distilled version or a smaller parameter model) to summarize and structure the data into JSON.

      Expensive Model (The Final Reasoning): I only pass the refined JSON to the 'reasoning' model.

      The 'pre-filter pay-off' for me has been consistent only when the input length exceeds a certain token threshold. For short, predictable scrapes, the cheap-model pass actually adds latency and cost without enough quality gain.

      Are you using a caching layer (like Redis or vector similarity checks) between these passes to prevent re-running the filter on recurring data? That’s the next bottleneck I’m looking at.