Three Model Swaps Behind a Self-Hosted Memory Bank
Six weeks of Gemini, then three replays against my own documents. The line item that decided it was reasoning tokens, not list price.
I run an agent called Hermes with a long-term memory service called Hindsight behind it. Hindsight reads every conversation turn, pulls out facts worth keeping (one LLM call, the extraction pass), and later merges them into longer-lived observations (a background consolidation pass that dedupes and combines). The service runs on my own hardware, in Docker with embedded Postgres, and the embeddings and reranking happen locally on the box. So the only cloud spend in the whole system is those two calls, which makes the bill a clean measurement of exactly two model choices.
For about six weeks, extraction ran on Google's Gemini Flash Lite family. The mistake was not in the reasoning. At install time I picked the candidate with the best structured-output behaviour per dollar. Extraction is a structured-output task, so that was the right axis to judge on. Gemini 3.5 Flash Lite scored 85.0% on GPQA-D and 77.6% on TAU-Bench, with structured-output error between 0.08% and 0.26%, at $0.30 per million input tokens and $2.50 per million output. I also rejected Gemini 2.5 Flash, correctly, because a cheaper sibling dominated it.
The problem was the candidate set. Every model in it was a Gemini variant. I had compared Gemini to Gemini and called the result a decision.
Method
I replay the same 12 real documents from my own bank into a throwaway Hindsight instance. Each candidate extracts facts from all 12. A separate model then judges the two sets blind, with A/B order randomised per document and the key held back until the scores are in. Where I ran the judging myself it was a Google model, sitting outside the Anthropic and DeepSeek comparison. Judge models have a measurable preference for whichever set they read first.
The other rule is never to judge a candidate against the live bank. Its facts accumulated from incremental deltas over months, so a cold extraction compared against it measures history rather than the model.
Twelve documents is a small sample and I will come back to that. It was still enough to overturn three convictions.
Round one: Gemini 3.5 Flash Lite against Claude Haiku 5.5
Haiku won all 12 documents. It scored 4.75 for completeness against 2.33, 4.58 for accuracy against 4.17, and 3.17 for redundancy against 3.83, where lower is better on that last one. Cost was $0.13 to $0.18 per run against roughly $0.27 for the Gemini route.
It also extracted about 2.5 times as many facts from the same documents, 196 against 80 on the trial batch. More facts looked like thoroughness at the time.
Round two: Haiku 5.5 against a local model
The obvious next question was whether I needed to pay anyone at all. I had a 20B open-weight model (gpt-oss-20b) on a CPU box, and local inference would have made extraction cost zero.
Haiku won 10 of 12. Accuracy came out 4.67 against 3.83, completeness 4.50 against 3.67, usefulness 4.25 against 3.08. The judge flagged 3 unsupported or misattributed facts in Haiku's output and 16 in the local model's. The local model was also about 50 times slower.
The interesting part is the fact counts. The local model extracted 334 facts to Haiku's 196 and still lost by a wide margin. It stored the assistant's own suggestions as if they were decisions, and it carried errors from an earlier document in the run forward into the summary of a later one. Volume went up because it was recording conversations rather than extracting facts.
Fact count is not thoroughness in either direction. A model can be terse because it is precise, and it can be verbose because it is confused.
The line item I was not looking at
Up to this point I had been pricing the work from token counts and list prices. Then I read the Prometheus counters instead of my invoices. 57% of extraction output tokens were reasoning tokens. On consolidation it was 73%.
Those tokens are billed as output, they were the majority of output on both lanes, and I had been estimating cost from the visible text. My arithmetic was short by roughly a factor of two on extraction and nearly four on consolidation.
Hindsight exposes a reasoning-effort knob, an extra-body knob, and a consolidation-only extra-body override, so this was testable. I ran two experiments.
The first was to disable reasoning for extraction. Billed output dropped 41% and cost dropped 26%, which sounds like free money until you look at quality. The blind judge gave the baseline 7 document-wins to 3, and completeness came in at 4.42 against 4.25. Reasoning was doing real work. Deciding what counts as a durable fact is a judgement call, and the model gets better at it when it is allowed to think.
The second was to disable reasoning only for consolidation, and leave extraction alone. That was the win.
Both arms made 29 calls. Cost came in at $0.1341 with reasoning on and $0.0747 with it off, a 44% reduction, and wall clock went from about 11 minutes to about 4. The reasoning arm stored 330 observations, the other 207, at identical average length. A blind audit of the no-reasoning output scored coverage 5/5, accuracy 4/4, specificity 5/5, and unsupported facts 1/1. No quality was given up.
That reads like a contradiction until you separate the two tasks. Extraction is deliberation about what a fact is. Consolidation is merging facts you already have, and there is nothing to deliberate about. The model was thinking hard about a clerical task and billing me for it. That change went live.
Round three: Haiku 5.5 against DeepSeek V4.1 Flash 1017
The last comparison was against DeepSeek V4.1 Flash 1017 on a zero-data-retention endpoint that supports strict structured outputs. DeepSeek won 8 documents to 1. Accuracy was tied at 4.67, completeness came out 4.67 against 3.83, and usefulness 4.83 against 4.33. Extraction cost fell 66% on the same 12 documents, and consolidation cost fell 48%.
The reason was not the list price. 81% of DeepSeek's input tokens hit the provider's prompt cache at about one thirty-third of the normal input rate. The Anthropic route I was using returned zero cache hits across three consecutive identical 7.8k-token prefixes. Since extraction resends a large stable instruction block on every call, that difference reorganised the cost ranking.
None of that is visible on a pricing page. Prompt caching is a property of the endpoint you pin, not of the model name. Two providers serving the same weights can have very different effective input costs.
Latency roughly doubled, from 10.3 seconds median to 21.4 seconds, with a 65 second worst case. For background lanes that is fine; for anything a user waits on, it is not. DeepSeek went live for both lanes, with consolidation reasoning still off.
What this changed about how I buy models
A pricing page would have gotten two of these three decisions wrong, in opposite directions. Local inference at zero marginal cost sounded like the endgame and lost badly to a hosted model. DeepSeek's headline rate was higher than Haiku's on both input and output, while the endpoint I actually pinned was cheaper on both, before cache hits took another third off. Haiku, by contrast, was cheaper than Gemini Flash Lite on list price and won all twelve documents, which is the one result the pricing page and the replay agreed on. That agreement should have told me six weeks earlier that my candidate set was one vendor wide.
I no longer price a model swap from list price times token counts. I replay my own documents through the candidate and read the counters. It takes an afternoon and it has been right every time, which is a better record than my judgement has earned.
Reasoning tokens are the hidden line item and they behave differently by task. On extraction, deliberation pays. On consolidation, it buys nothing. If a service gives you a per-lane override, use it, and measure both lanes separately rather than setting one global knob.
Prompt caching is worth checking before you check anything else. It can move a model from third place to first on its own.
A vendor-family-only comparison is not a decision. Six weeks of Gemini was not a mistake in analysis, it was a mistake in scope. The analysis was sound and the candidate set was one vendor wide. Nothing was wrong with the answer because nothing else was in the room.
Scale and caveats
The live bank holds roughly 34,000 nodes across about 820 documents, and a single daily window measured about 114 extraction calls and about 188 consolidation calls. That is small enough that I could have ignored it. I did not, because the ratio is the part that transfers. At ten times the volume the consolidation toggle alone is the difference between a comfortable bill and an annoying one.
Twelve documents per comparison is small. It caught large effects reliably and would not have caught a 3% difference. Each round used one judge model, so a judge with a bias toward a particular output style would have shifted every round the same way. I mitigated that with blind A/B and randomised order, not with a panel. A vendor's own leaderboard is not evidence about my documents, whatever the benchmark name suggests.
The honest trade on the last swap is doubled per-call latency for a 66% cut in extraction cost. That is a good trade for a background lane and a bad one for an interactive one. If Hindsight ever needs to answer inside a request, something faster goes in and I will re-run the replay rather than guess.
The one thing I would do differently is write down the candidate set alongside the decision. The reasoning was fine; the scope was the bug, and a note reading "four models, all Gemini" would have shown it six weeks earlier.