MBMadhav Bhasininblog.madhav.dev·2d ago · 6 min readTesting AI-Dependent Code: Mocking LLMs, Evaluating Outputs, and Avoiding Flaky TestsThe test checked whether the extracted invoice total matched the expected value. It passed nine times out of ten. On the tenth run, the model formatted the number differently — "1,234.56" instead of "37NASAE
MBMadhav Bhasininblog.madhav.dev·5d ago · 6 min readRedis Patterns Every Backend Engineer Should KnowRedis gets reached for because it's fast. That's often the wrong reason. Speed isn't a pattern — it's a property. Using Redis correctly means understanding what each pattern is actually good at and, j20
MBMadhav Bhasininblog.madhav.dev·Sep 29 · 6 min readPrompt Versioning and Cost Control: Running LLMs Responsibly in ProductionThe monthly bill was ten times the estimate. Investigation took two hours. Three things were wrong. A retry loop was calling the model on every validation error — including schema mismatches that woul00
MBMadhav Bhasininblog.madhav.dev·Sep 27 · 5 min readAsync AI Pipelines in FastAPI: Streaming, Queuing, and Long-Running RequestsThe document extraction endpoint was synchronous. A request came in, the service sent the document to OpenAI, waited for the full response, parsed it, wrote to the database, and returned. Each request00
MBMadhav Bhasininblog.madhav.dev·Sep 21 · 6 min readGitHub Actions I Set Up on Every ProjectMost engineers using GitHub Actions daily know how to write a basic workflow — checkout, install dependencies, run tests, deploy. That covers 80% of what they need. The other 20% is a set of features 13LKM