# Designing a BYOK AI Architecture for a Commercial Framer Template

> Source: <https://dev.to/davideagosti/designing-a-byok-ai-architecture-for-a-commercial-framer-template-2ano>
> Published: 2026-09-01 16:56:59+00:00

I Built an AI-Enabled Framer Template Without Owning the Buyer’s AI

Most AI-enabled websites hide an architectural decision behind the interface:

Who actually owns the AI?

When I started building CounselForm AI 2.0, a Framer template for modern law firms, I didn't want buyers to depend on an API key that I controlled.

I didn't want to bundle inference into a subscription.

And I definitely didn't want an OpenAI API key sitting somewhere in browser-side configuration.

So I designed the AI layer around a different principle:

The buyer owns the AI infrastructure.

That decision shaped almost everything behind CounselForm AI 2.0.

The product

CounselForm started as a premium Framer template for law firms.

For 2.0, I wanted the website to do more than present pages.

A potential client might arrive knowing they have a commercial problem without knowing:

which practice area is relevant;

which lawyer they should speak to;

whether the firm works in their industry;

which existing insight is relevant;

or even how to describe their problem.

That became the problem behind Ask Lexora.

Instead of replacing the website, Ask Lexora sits on top of its information architecture and provides another way to explore it.

There are two modes.

Guided Discovery

Guided Discovery is deterministic.

It uses structured questions and the firm's trusted knowledge to help visitors navigate relevant expertise, people, industries and insights.

No LLM inference is required.

This was intentional.

Not every interaction needs a model.

AI Mode

AI Mode is optional.

Here the visitor can ask a natural-language question and receive a contextual answer based on the firm's trusted knowledge.

But the architecture introduces an important boundary.

The browser does not talk directly to OpenAI.

And the template seller doesn't provide the OpenAI account.

The simplified flow looks like this:

Visitor

↓

Framer / Ask Lexora

↓

Buyer-owned Cloudflare Companion

↓

Trusted firm context

↓

Buyer-owned OpenAI account

↓

Structured response

↓

Ask Lexora

The buyer supplies and controls the provider credentials.

Why BYOK?

I settled on a Bring Your Own Key / Bring Your Own AI model.

The buyer owns:

the OpenAI account;

the API credentials;

the Cloudflare deployment;

provider usage;

and the resulting inference costs.

The seller doesn't provide a shared API key and doesn't subsidize token usage.

There are a few reasons I prefer this architecture for commercially distributed AI templates.

A secret placed in client-side JavaScript isn't a secret.

The Cloudflare Companion creates a server-side boundary between the Framer experience and the AI provider.

If 100 people buy a template, I don't want to become the inference provider for 100 unrelated businesses.

Each buyer pays their own provider costs.

That also means the template doesn't need an artificial seller-managed AI subscription just to recover inference costs.

The customer isn't buying access to my OpenAI account.

They're buying the product and architecture.

Their AI remains theirs.

The other problem: what does the AI actually know?

Connecting an LLM wasn't the difficult conceptual part.

Trusting what it says was.

A law firm's website contains specific claims about expertise, people, industries and published insights.

I didn't want Ask Lexora improvising firm-specific facts simply because a language model could generate a plausible answer.

So CounselForm AI 2.0 uses a Knowledge Sync workflow.

Conceptually:

Approved firm content

↓

Knowledge Sync

↓

Trusted knowledge

↓

Deterministic retrieval

↓

Bounded context

↓

LLM

↓

Ask Lexora response

This isn't an autonomous crawler that magically "learns" the buyer's website.

The knowledge is deliberately maintained.

And when the available information isn't sufficient, the safer behavior is to acknowledge that limitation or direct the visitor toward the appropriate contact path rather than inventing an answer.

Not everything needs AI

One of my favorite outcomes from the project is actually Guided Discovery.

It costs nothing in inference.

That matters because AI shouldn't be added simply because a product has an AI feature.

Sometimes structured interaction provides enough value.

So CounselForm can operate perfectly well without an OpenAI account.

AI Mode is an enhancement, not a prerequisite for the website.

The public demo doesn't use OpenAI either

There was one more interesting problem.

How do you publicly demonstrate an AI-enabled commercial template without running every anonymous visitor through a seller-funded API?

The public Ask Lexora preview is therefore deterministic.

It demonstrates the interaction model using curated questions and responses without performing OpenAI inference.

The purchased product can then be configured by the buyer to enable real AI Mode using their own infrastructure.

That gives me a public interactive demo without turning the demo itself into an uncontrolled inference endpoint.

What I ended up building

CounselForm AI 2.0 combines:

Framer;

responsive legal/editorial design;

CMS-powered content;

Ask Lexora;

deterministic Guided Discovery;

optional AI Mode;

Knowledge Sync;

a buyer-owned Cloudflare Companion;

OpenAI BYOK;

buyer setup and troubleshooting documentation;

and a commercially distributable template architecture.

The interesting part for me wasn't simply adding an LLM to a website.

It was figuring out where the AI should stop being my infrastructure and start being the buyer's infrastructure.

That distinction becomes increasingly important when AI functionality moves from prototypes into products that other people actually own.

Try Ask Lexora

CounselForm AI 2.0 is now live, and I've published an interactive preview of the Ask Lexora experience:

[Live preview: CounselForm AI 2.0](https://contextual-days-463272.framer.app/)

[Framer Marketplace: CounselForm AI 2.0](https://www.framer.com/marketplace/templates/counselform-2-0/)

I'd be particularly interested in hearing how other developers are approaching BYOK, buyer-owned inference and trusted knowledge boundaries in commercially distributed AI products.
