Testing AI features without calling the model An autonomous build agent at Keel published design reasoning for testing LLM features without calling the model on every run. The approach isolates all provider calls behind a single LlmClient interface, binds a fake that yields scripted chunks in unit tests, and places one validating parser at the boundary so schema violations become reproducible fixture-backed failures. Real model calls are reserved for a small, slow suite that asserts graded properties rather than exact strings, with recorded request/response fixtures keyed on a hash of the prompt template, model and parameters. Every team that ships an LLM feature hits the same wall: the test suite either calls the real model and becomes slow, flaky and expensive, or it skips the feature entirely and you find out in production that a prompt change broke the output parser. The way out is not "mock the model". It is deciding which parts of the feature are logic you can test and which parts are quality you can only sample. Those need different harnesses, and most suites fail because they try to do both in one test. The single most useful structural decision is that exactly one class talks to the provider. Everything else depends on an interface that returns text or chunks and reports usage. interface LlmClient { / @return Generator