Answers come back checked
Every AI response is tested against your schema before your code ever sees it.
Add AI features without babysitting messy model output.
You get one simple way to call AI from your server. Answers come back checked and typed, never as a messy string that crashes a feature. Swapping models is one config line, not a repo-wide hunt.
Interactive example
This walkthrough demonstrates the implemented backend contract without using an account, credentials, or provider calls.
Interactive example
Deterministic sample data only. No account, provider, or network connection is used by the interaction.
Highlights
Every AI response is tested against your schema before your code ever sees it.
Provider API keys live in server settings and never reach the browser.
One config file picks the provider and model, so upgrades never touch your features.
Without a shared foundation, every team rebuilds these edge cases — differently.
The model returns broken JSON at the worst moment. Your code trusted it. Now a customer-facing feature is crashing. Here, bad output fails loudly at the boundary, not in your UI.
AI calls get sprinkled wherever it's convenient. One lands client-side, and your API key ships to every visitor. Here, every call runs on the server. Full stop.
Your provider retires a model. Suddenly you're doing a find-and-replace across the whole codebase. Here, it's one line in one config file.
The mechanism end to end, as implemented in the repository.
You call it with a feature key
Your server code asks for text or a structured object, tagged with a feature key. One config file decides which provider and model handle it.
The call runs on the server
The matching OpenAI, Gemini, or Anthropic adapter runs with server credentials. Nothing AI-related ships to the browser.
The answer is checked at the door
The response is parsed against your schema before your code sees it. Broken output fails loudly instead of leaking through.
You get a typed result
Your code receives a clean object plus token usage, provider, and model. Never a raw string to re-parse.
Engineering guarantees
Three providers come wired in, but the kit won't auto-switch if one goes down. Live generation still needs your own provider key.
The boundary above is code, not a claim. These files carry the contract:
src/features/ai/runtime.tssrc/features/ai/contracts.tsconfig/ai.tsThese capabilities share contracts and boundaries with this one.
The docs describe the same contracts this page demonstrates.