Build a Deterministic Mock LLM Provider So Your Eval Suite Runs With No API Keys and No Network A developer built a deterministic mock LLM provider for the evalgate project that implements the same interface as real providers, returning identical responses, latency, token usage, and cost for the same input without network calls or API keys. The mock seeds an FNV-1a hash of the normalized prompt into a mulberry32 pseudo-random generator, and adds fixture matching and in-prompt directives (echo, uppercase, reverse, json) so eval suites can exercise scoring and aggregation logic reproducibly. Every LLM project I have worked on eventually hits the same wall. Your eval suite and your unit tests both want to call a model, and the moment they do, CI slows to a crawl, costs money, needs secret keys, and flakes whenever the vendor changes a checkpoint. The output is nondeterministic by design, so a "did the pipeline work" test starts failing for reasons that have nothing to do with your code. The fix I keep reaching for is a deterministic mock provider. It implements the exact same interface as your real providers, returns the same shape of response, and is completely offline. Tests that exercise your scoring, aggregation, and reporting logic never touch a network. In this tutorial I will build one from scratch. The code is grounded in my project evalgate, which ships exactly this, but the technique transfers to any stack. The whole trick depends on one thing: your real provider and your mock must be interchangeable. So define a narrow interface first and make every adapter conform to it. export interface ProviderRequest { model: string; messages?: { role: string; content: string } ; prompt?: string; temperature?: number; maxTokens?: number; } export interface ProviderResponse { output: string; latencyMs: number; usage?: { promptTokens: number; completionTokens: number; totalTokens: number }; costUsd?: number; model: string; raw?: unknown; } export interface Provider { readonly name: string; complete request: ProviderRequest : Promise