Prompt caching for LLM automations: cut repeat input costs
How prompt caching works at Anthropic, OpenAI and Google, how to order prompts so the cache hits, and the maths that tells you when it saves money.
Read articleTheAILAB blog
We write about the things we build: automating everyday business work, running AI on your own hardware, and turning trading rules into automated systems. When we state a fact, we link to where it came from.
RSS feed36 articles
How prompt caching works at Anthropic, OpenAI and Google, how to order prompts so the cache hits, and the maths that tells you when it saves money.
Read articleHow offset, cursor and page-token pagination work, the mistakes that make syncs silently skip records, and a tested Python loop that avoids them.
Read articleHow to change a live PostgreSQL schema without locking out users: lock timeouts, safe column and index changes, and the expand-and-contract pattern.
Read articleWhy scheduled automations skip or run twice when clocks change, how cron, AWS and Google Cloud schedulers differ, and how to schedule jobs safely.
Read articleHow HMAC webhook signatures work, why you need the raw body, constant-time checks and a timestamp window, with tested Python and GitHub, Stripe and Slack docs.
Read articleHow to tell when an automation has quietly stopped working: heartbeat checks, outcome-based alerts, useful logs and alert rules people won't learn to ignore.
Read articleHow to set recovery targets, back up a custom app's database properly and run restore tests that show your backups actually work.
Read articleWhat a paper trading simulator actually models, what it leaves out, and how to use a paper run so the gap to live trading doesn't surprise you.
Read articleWhich failures to retry, how to back off, and how idempotency keys and deduplication stop a retried automation from charging, emailing or invoicing twice.
Read articleWhich pre-trade limits, loss limits and kill switches an automated trading system needs, based on SEC, ASIC, FIA and CME guidance and the Knight Capital case.
Read articleHow market, limit, stop and stop-limit orders actually fill, where slippage comes from, and what an automated trading system should log and handle.
Read articleHow to automate email triage safely: sort with headers and rules first, keep the LLM to labelling, and avoid auto-reply loops and risky forwarding.
Read articleHow to measure the time an automation really saves: take a baseline, count the new work it creates, use a comparison group and avoid selection effects.
Read articleA practical method to map a business process before automating it: set the boundaries, map what really happens, record the data and find the exceptions.
Read articleHow to tell when a business process has outgrown Excel, what the evidence says about spreadsheet errors, and what to try before building an app.
Read articleWhat maintaining custom software actually involves after launch, the outside deadlines that force the work, and how to budget for it honestly.
Read articleHow walk-forward testing works, how to choose window sizes, and a runnable Python example showing how far in-sample results can mislead.
Read articleA short set of questions for deciding whether to build, buy or configure an internal tool, drawn from government guidance and engineering practice.
Read articleWhat OpenAI, Anthropic and Google say happens to the text you paste into ChatGPT, Claude and Gemini: training, human review, retention and business plans.
Read articleHow to measure hallucinations in a document Q&A or RAG system: claim-level faithfulness, citation checks, published benchmarks and hand grading.
Read articleWhere to put human approval in an AI workflow, what the reviewer should see, and how to stop approvals turning into a rubber stamp.
Read articleHow to build retrieval-augmented generation that never leaves your hardware: embeddings, storage, hybrid search, prompting and the security gaps to close.
Read articleWhat 4-bit and 8-bit LLM quantisation costs in quality, why benchmark averages hide it, and how to test a quantised model on your own tasks.
Read articleHow to tell which steps in a workflow need a language model and which are better as plain code or rules, with a simple test and a hybrid pattern.
Read article