What Can We Test Without Calling a Model?

An agent framework can run our tools, but a test model and a real model answer different questions. Build contract checks before spending time on live evaluations.

13 sections · 4 questions · 1 coding challenge

1 / 13

A Test Double Gives Us Control Over One Boundary

BOTIE

Agent frameworks inherit a familiar software-testing problem: a dependency may be slow, costly or variable when we need a reproducible failure. Pydantic AI provides TestModel and FunctionModel so tests can replace model behaviour. LangChain documents unit tests using mock models alongside tests that call real providers.

The useful idea is control. Supply a known response at the model boundary and check the application’s reaction. Replacing that boundary deliberately removes evidence about the real model, so integration tests and task evaluations still have work to do.

Sources for this history