Architecture

Model-Agnostic Website Architecture

The site should speak HTTP to a model. It should not import a vendor’s entire product surface into the frontend.

A thin adapter

Live features go through a small server-side function with a shared request shape: instruction, approved context, and a length limit. GPT, Gemini, Grok, or Claude can sit behind that function.

The browser never holds the provider key, and the page template does not import a chat SDK.

Context comes from the site, not the open web

The model should answer from pages, fields, and documents the client approved. Open-web free association is how a lodge website starts recommending a competitor’s season.

Retrieval, when needed, is a list of known records. It is not an excuse to scrape the internet at request time.

Evaluate with fixtures

We keep a short set of real questions and the answers a human approved. When a model or prompt changes, those fixtures get run again.

That is cheaper than discovering a bad answer in a customer email.