A free Workers AI tool: hash the input and check KV before calling the model
风易 (@Michael_liyang) shares a five-parameter loop for a free AI tool: clean and validate input, use a truncated SHA-256 hash as a KV cache key for 24 hours, and only call Workers AI on a cache miss, capping max_tokens.
- Products
- Workers AIKVWorkers
- Source
- Author experience𝕏 post
- Author
- 风易 (@Michael_liyang)
Key points
- His five parameters: input of at least 300 characters, a fixed 3 outputs, the first 16 hex characters of SHA-256 as the cache key, a 24-hour KV cache, and max_tokens 700 for the model.
- Order of steps: POST text → strip Markdown headings and dividers → validate length → look up the hash in KV → return on a hit → call Workers AI only on a miss → write the result back to KV.
- He uses llama-3.2-1b and says the free tier gives 10,000 Neurons a day, resetting at 8 a.m. Beijing time; the Workers AI pricing page read on 2026-10-28 lists 10,000 free Neurons per day and a daily reset at 00:00 UTC.
Original sources
Published
Original post
Read on 𝕏风易 (@Michael_liyang) shares a five-parameter loop for a free AI tool: clean and validate input, use a truncated SHA-256 hash as a KV cache key for 24 hours, and only call Workers AI on a cache miss, capping max_tokens.
风易 | AI 工具链
@Michael_liyang · Original 𝕏 post
一个免费 AI 小工具的最小闭环,我把参数压缩到 5 个: 输入至少 300 字;固定输出 3 条;SHA-256 取前 16 位做缓存键;KV 缓存 24 小时;模型 max_tokens 700。 配置顺序只有一条: POST 文本 → 清掉 Markdown 标题和分隔线 → 校验长度 → hash 查 KV → 命中直接返回 → 未命中才调 Workers AI → 结果写回 KV。 我用的是 llama-3.2-1b;免费档每天 10,000 neurons,北京时间早 8 点重置。 我是风易,只发我自己跑通过的方案。 你最想先抄哪一段:输入清洗、缓存键,还是 Worker 入口?
More to read
风易: On the free tier, what Cron fears most is task overlap; use a KV lock to skip rather than running again in parallel
On 2026-11-13, X user @Michael_liyang (风易) wrote an experience note about scheduled tasks on the Workers free tier: what is feared most is not failure, but overlap. Cron triggers once every 5 minutes; if the previous run has not finished, the next one arrives, and the same batch of data is processed twice. The approach the author gives is: take a KV lock before executing, and skip immediately if it cannot be obtained; the lock must carry an expiration time, so that a hung task does not leave the lock stuck; after the run finishes, write to D1 and then release the lock. The chain is trigger → take the lock → skip if not obtained → execute if obtained → write the result → release the lock. The author emphasizes: the lock prevents duplicates; it does not prevent slowness.
itsabhisheksood: a Cloudflare 3D Secure prompt asked to confirm a $275.68 monthly payment.
X user @itsabhisheksood (Abhishek Sood) posted a screenshot of a Cloudflare 3D Secure prompt asking to confirm a $275.68 payment, with the caption “A vibe coding mishap or something big in the making?” The prompt describes a monthly payment. X user @thisnaeem replied calling it a $275.68 monthly Cloudflare bill and asking whether an agent provisioned something or usage compounded. The product and cause are not stated. The public outcome is unknown.
棈澧: after a Worker bill “went up tenfold” overnight, Spend Management can pause Workers and Durable Objects
棈澧 (@hodu382759) wrote on 16 November 2026 that a Worker bill had “gone up tenfold” after a night’s sleep, with no dollar amount, and pointed to Spend Management launched on 13 November. The post says a limit stops new requests and cron jobs while static assets stay up, that the feature is beta and covers only Workers and Durable Objects (not KV or R2), and that blocking is not instant, so the official docs do not guarantee the invoice will not exceed the cap. The author describes the audience as Workers Paid users; official docs say pay-as-you-go.