A $35 embedding bill made me filter earlier
Introduction
A $35.32 Voyage bill got my attention. It made me look at what Trend Seeker was paying to embed, and how much of that text we rejected afterwards.
Trend Seeker connects business ideas to evidence from sources such as podcasts, reviews and community posts. Embeddings help find related passages. A sponsor pitch and a useful customer problem both cost money to embed.
What happened to the cost?
Voyage reports $21.58 of usage in September and $9.01 in October. That is $12.57 less, a 58.2% reduction.
During October, I added token accounting, reused embeddings on retries, limited repeated context comparisons and routed calls through a shared budget.
October usage report
Reject obvious noise before the API call
The old podcast check could reject a passage after embedding it. By then we had paid for the vector.
The November rules run before the paid call. They remove repeated captions, housekeeping and promotional text. Passages with a concrete problem or work context stay eligible. Other discussion gets a stable 5% exploration sample, so unfamiliar wording still has a way through.
| Before | Now |
|---|---|
| Embed, then decide whether to keep the passage | Apply cheap rules, then embed the survivors |
| Old queued work follows the old decision | Check queued work again immediately before the API call |
The same policy runs in the producer, ingestion worker and embedding worker. That last check covers the backlog. Full transcripts stay in source storage.
What did the rules achieve?
I replayed the rules against 41,699 podcast evaluations from October 31 and November 1.
| Measure | Result |
|---|---|
| Paragraph input characters skipped | 56.83% |
| Stored matches retained | 52 of 55 |
| Paragraphs admitted | 17,387 of 41,699 |
The rules excluded three stored matches: two promotional passages and one about general product strategy.
Why I added a local model
The rules catch obvious noise, but they only cover cases I think to include. I wanted to use the decisions we already had to filter more text before paying for embeddings.
I built a small text classifier using a snapshot of 114,491 podcast observations. I trained it in Python on CPU and exported the weights for the Rust worker. It can score a passage locally before calling Voyage, without paying another API to make that decision.
I used TF-IDF to give common terms less weight and balanced the feeds so the largest ones had less influence. I kept episodes and duplicate text together when splitting the data, and reserved separate feeds for testing.
I also had to fix the labels. A useful passage can be attached to the wrong idea, and a matching passage can still be promotional noise. I separated usefulness from idea matching and used Codex to audit the content. Uncertain cases stay unlabeled.
Results so far
In development tests after the existing rules, the model filtered about 10% more paragraph input:
| Test | Useful passages retained | Extra paragraph bytes filtered |
|---|---|---|
| Later observations | 725 of 725 | 10.05% |
| Unseen feeds | 1,522 of 1,527 | 10.52% |
I also tested 23 useful passages selected while investigating filtering mistakes. The model would send 8 for embedding and incorrectly reject 15.
I’ll keep improving the labels and test whether more episode context helps with the missed passages. The next check is on fresh episodes and feeds, aiming to filter more input while keeping the useful evidence.
FAQ
Should I filter text before creating embeddings?
If you can identify text you consistently discard, apply those cheap checks before the paid call. I also recheck queued work immediately before embedding it, so the backlog follows the same policy as new input.
Did the new classifier cause the 58.2% cost reduction?
The September-to-October reduction came before the November classifier. During October I added token accounting, embedding reuse on retries, fewer repeated context comparisons and a shared budget. The classifier results here are development tests of additional filtering.
Is the local model ready to reject everything it flags?
The audit found 15 useful passages it would incorrectly reject out of 23 selected useful examples. That is a reason to improve the labels and test on fresh episodes and feeds before trusting it to discard more input.