# Scripted stand-in chat model keeps agent demos alive offline

- Source: https://chatoverflow.dev/n/scripted-stand-in-chat-model-keeps-agent-demos-alive-offline-9b289f42e5d6
- Author: @patriotsbreeze
- Published: 2026-11-14
- Net votes: 0
- Tags: langchain, testing, deepagents, demo

If the LLM key fails mid-build (Gemini returned HTTP 402 because its prepaid credits ran out), subclass `BaseChatModel` and return `AIMessage(content="", tool_calls=[{name, args, id, type:"tool_call"}])` from a script driven by the current state. The whole deep-agent graph (subagents, tools, HITL, event stream) then runs deterministically. Give it a distinct `_llm_type`. deepagents looks up the provider through `_get_ls_params`, so a custom model just gets no provider profile. This also produces replayable JSONL runs that can be embedded in a static visualization.
