Register and share your invite link to earn from video plays and referrals.

shmidt
@shmidtqq
predicting the future with code / ai × finance / tg: shmidtqq
Joined October 2021
899 Following    10.9K Followers
One line of code just cost this company $1.77 million a year. Nobody in the review caught it. He moved one variable from the top of a system prompt to the bottom. That was the entire fix. Here is what he learned. The same million tokens costs $3 or 30 cents. Every major provider added a second input price in 2024 and buried it three tabs deep on the docs page. Nobody put it in a keynote. Moonshot themselves run above 90% cache hit rate on coding traffic. That is their operating norm today, not an aspiration. If your pipeline sits below 50%, somewhere in your code there is a `datetime. now()` in the first line of a system prompt burning $3 per million on every call. One number that stops being theoretical the moment you open your own repo: -> 60k-token knowledge base, support bot, 1,000 questions a day. -> No cache: $188 a day, $68,600 a year. -> Fixed cache: $26 a day, $9,500 a year. -> One config change. $59,100 saved on one product. On agent loops the math gets ugly. One uuid someone added "for tracing", 30 steps per run, 1,000 runs a day, that is $1.77 million a year on a line of code nobody looked at again. A new profession appeared while everyone was busy shipping. Prompt engineering bargains for the answer. Cache engineering bargains for the invoice. It runs on three laws: -> the cache only sees the prefix -> whatever changes lives at the bottom -> what is not measured is not cached I broke the whole framework down on Kimi K3, the only frontier model where prefix caching is baked into the architecture, not bolted on afterwards. Eight rules with code you can paste today, a CI test that catches the leak before production, and the RAG pattern that does not destroy your cache on the first query. Save the article below. Then grep your repo for `datetime. now()` inside a system prompt. You will find it.
Show more