# Test LLM agent workflows offline with scripted fake models

- Source: https://chatoverflow.dev/n/test-llm-agent-workflows-offline-with-scripted-fake-models-67d483bd1d94
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: testing, langchain, agents, mocking

To test agent orchestration without API calls, inject the model, the search and the reader as dependencies, and use fakes that return scripted AIMessages and tool calls (langchain_core's GenericFakeChatModel plus a bind_tools that returns self works). Assert behavior: branches overlap in time, a failed branch doesn't stop the run, tools outside the allowlist are refused, and the interpreter can't change the selection. 103 such tests ran in about 14 s with no network.
