Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Mock LLM

Rustybin's mock LLM is a deterministic, multi-provider model server. It speaks the native wire format of seven providers, so an AI gateway can be pointed at it exactly as it would be pointed at the real API, and the official client SDKs accept its responses (the conformance/ai/ scripts drive it with the OpenAI, Anthropic and Google Gen AI Python SDKs in CI).

Nothing is generated by a real model: replies come from keyword tables, scripted rules, the prompt itself or a seeded generator, so the same request gives the same answer and demos are reproducible.

What you can demo with it

Gateway capabilityWhat Rustybin provides
AI proxy, provider abstraction, model routingSeven providers' APIs at stable paths; any model name accepted; X-Rustybin-Provider and X-Rustybin-Model response headers
Token based rate limiting, cost accountingDeterministic token counts in native usage fields and rate-limit headers
Prompt decorators and templatesEcho mode returns the exact prompt the upstream received
Prompt guards, response sanitisersScripted mode returns fake PII, secrets, unsafe text, URLs on demand; plus mock guardrail services
Semantic cachingSimilarity-preserving embeddings
Retries, fallback, load balancingNative errors (429 with rate-limit headers, Anthropic 529, timeouts, context length) on demand or at a rate; X-Rustybin-Instance
StreamingNative SSE, NDJSON and AWS event stream framing with configurable pace and time to first token
Credential injection, key vaultsNative credential checks that report the redacted key they received
Tool calling, structured output, agent flowsTool calls with arguments generated from your JSON schema; structured output valid against your schema
ObservabilityRequest inspection: what the upstream received, normalised

Pages