AI as an Optional Capability, Not an Application Dependency WorldScript Studio, an open-source writing studio, is architected so its AI features are optional rather than load-bearing: all AI capabilities route through a single provider seam (Gemini, OpenAI, OpenRouter, Anthropic, and OpenAI-compatible local servers), with policy gates enforced as throwing code in aiPolicy.ts and a fallback layer permitted to report that no fallback exists. The project's author reports that cloud providers are blocked in local and eco modes, and that LoRA fine-tuning is restricted by allowlist to local providers so manuscript data never leaves the device. The code references come from repository commit 2d9157c0, release v1.28.8. Try a small experiment with your favorite AI-powered app: revoke the API key, switch off the network, and open it again. A surprising number of products fail this test — not the AI features, the product . Spinners that never resolve. A settings page that errors out. A startup sequence blocked on a model ping. Somewhere between the demo and the release, the AI integration stopped being a feature and became load-bearing infrastructure. WorldScript Studio is an open-source writing studio where AI assists with things like outlines, character work, and prose feedback. It is also, by design, fully usable with no key, no model, and no network. This article is about the mechanisms that keep it that way — a provider seam, policy gates in code, honest failure semantics, and a fallback layer that is allowed to say "no fallback exists." Code references are from the repository at commit 2d9157c0 2026-09-28 , release v1.28.8; simplified excerpts are labeled. Plenty of apps have an "AI: off" switch. Fewer have an architecture where off is a real, tested state. The difference shows up the first time a provider has an outage and your error handling turns out to be a toast notification saying "something went wrong" above a dead feature. I ended up with a rule: the AI layer may fail in every way it wants, as long as the failure is typed, explained, and contained. Four mechanisms enforce it. Every AI capability in the app — text generation, structured JSON, streaming, image generation — goes through one unified provider service. Providers sit behind it as adapters: Gemini, OpenAI, OpenRouter, Anthropic, and any OpenAI-compatible local server Ollama, LM Studio selected by base URL. A small factory normalizes them into a single LanguageModel type from the Vercel AI SDK: // services/ai/providerFactory.ts excerpt, comments trimmed export type WorldScriptLanguageModelConfig = | { provider: 'gemini'; modelId: string; apiKey: string } | { provider: 'openai'; modelId: string; apiKey: string; headers?: Record