{"slug": "designing-a-byok-ai-architecture-for-a-commercial-framer-template", "title": "Designing a BYOK AI Architecture for a Commercial Framer Template", "summary": "A developer has designed CounselForm AI 2.0, a Framer template for law firms, with a Bring Your Own Key (BYOK) architecture that lets buyers own their AI infrastructure. The template includes Ask Lexora, which offers deterministic guided discovery and an optional AI mode that uses buyer-owned OpenAI credentials via a Cloudflare companion, ensuring the seller does not control or subsidize inference. The design also incorporates a Knowledge Sync workflow to ground AI responses in approved firm content, avoiding hallucinated facts.", "body_md": "I Built an AI-Enabled Framer Template Without Owning the Buyer’s AI\n\nMost AI-enabled websites hide an architectural decision behind the interface:\n\nWho actually owns the AI?\n\nWhen 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.\n\nI didn't want to bundle inference into a subscription.\n\nAnd I definitely didn't want an OpenAI API key sitting somewhere in browser-side configuration.\n\nSo I designed the AI layer around a different principle:\n\nThe buyer owns the AI infrastructure.\n\nThat decision shaped almost everything behind CounselForm AI 2.0.\n\nThe product\n\nCounselForm started as a premium Framer template for law firms.\n\nFor 2.0, I wanted the website to do more than present pages.\n\nA potential client might arrive knowing they have a commercial problem without knowing:\n\nwhich practice area is relevant;\n\nwhich lawyer they should speak to;\n\nwhether the firm works in their industry;\n\nwhich existing insight is relevant;\n\nor even how to describe their problem.\n\nThat became the problem behind Ask Lexora.\n\nInstead of replacing the website, Ask Lexora sits on top of its information architecture and provides another way to explore it.\n\nThere are two modes.\n\nGuided Discovery\n\nGuided Discovery is deterministic.\n\nIt uses structured questions and the firm's trusted knowledge to help visitors navigate relevant expertise, people, industries and insights.\n\nNo LLM inference is required.\n\nThis was intentional.\n\nNot every interaction needs a model.\n\nAI Mode\n\nAI Mode is optional.\n\nHere the visitor can ask a natural-language question and receive a contextual answer based on the firm's trusted knowledge.\n\nBut the architecture introduces an important boundary.\n\nThe browser does not talk directly to OpenAI.\n\nAnd the template seller doesn't provide the OpenAI account.\n\nThe simplified flow looks like this:\n\nVisitor\n\n↓\n\nFramer / Ask Lexora\n\n↓\n\nBuyer-owned Cloudflare Companion\n\n↓\n\nTrusted firm context\n\n↓\n\nBuyer-owned OpenAI account\n\n↓\n\nStructured response\n\n↓\n\nAsk Lexora\n\nThe buyer supplies and controls the provider credentials.\n\nWhy BYOK?\n\nI settled on a Bring Your Own Key / Bring Your Own AI model.\n\nThe buyer owns:\n\nthe OpenAI account;\n\nthe API credentials;\n\nthe Cloudflare deployment;\n\nprovider usage;\n\nand the resulting inference costs.\n\nThe seller doesn't provide a shared API key and doesn't subsidize token usage.\n\nThere are a few reasons I prefer this architecture for commercially distributed AI templates.\n\nA secret placed in client-side JavaScript isn't a secret.\n\nThe Cloudflare Companion creates a server-side boundary between the Framer experience and the AI provider.\n\nIf 100 people buy a template, I don't want to become the inference provider for 100 unrelated businesses.\n\nEach buyer pays their own provider costs.\n\nThat also means the template doesn't need an artificial seller-managed AI subscription just to recover inference costs.\n\nThe customer isn't buying access to my OpenAI account.\n\nThey're buying the product and architecture.\n\nTheir AI remains theirs.\n\nThe other problem: what does the AI actually know?\n\nConnecting an LLM wasn't the difficult conceptual part.\n\nTrusting what it says was.\n\nA law firm's website contains specific claims about expertise, people, industries and published insights.\n\nI didn't want Ask Lexora improvising firm-specific facts simply because a language model could generate a plausible answer.\n\nSo CounselForm AI 2.0 uses a Knowledge Sync workflow.\n\nConceptually:\n\nApproved firm content\n\n↓\n\nKnowledge Sync\n\n↓\n\nTrusted knowledge\n\n↓\n\nDeterministic retrieval\n\n↓\n\nBounded context\n\n↓\n\nLLM\n\n↓\n\nAsk Lexora response\n\nThis isn't an autonomous crawler that magically \"learns\" the buyer's website.\n\nThe knowledge is deliberately maintained.\n\nAnd 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.\n\nNot everything needs AI\n\nOne of my favorite outcomes from the project is actually Guided Discovery.\n\nIt costs nothing in inference.\n\nThat matters because AI shouldn't be added simply because a product has an AI feature.\n\nSometimes structured interaction provides enough value.\n\nSo CounselForm can operate perfectly well without an OpenAI account.\n\nAI Mode is an enhancement, not a prerequisite for the website.\n\nThe public demo doesn't use OpenAI either\n\nThere was one more interesting problem.\n\nHow do you publicly demonstrate an AI-enabled commercial template without running every anonymous visitor through a seller-funded API?\n\nThe public Ask Lexora preview is therefore deterministic.\n\nIt demonstrates the interaction model using curated questions and responses without performing OpenAI inference.\n\nThe purchased product can then be configured by the buyer to enable real AI Mode using their own infrastructure.\n\nThat gives me a public interactive demo without turning the demo itself into an uncontrolled inference endpoint.\n\nWhat I ended up building\n\nCounselForm AI 2.0 combines:\n\nFramer;\n\nresponsive legal/editorial design;\n\nCMS-powered content;\n\nAsk Lexora;\n\ndeterministic Guided Discovery;\n\noptional AI Mode;\n\nKnowledge Sync;\n\na buyer-owned Cloudflare Companion;\n\nOpenAI BYOK;\n\nbuyer setup and troubleshooting documentation;\n\nand a commercially distributable template architecture.\n\nThe interesting part for me wasn't simply adding an LLM to a website.\n\nIt was figuring out where the AI should stop being my infrastructure and start being the buyer's infrastructure.\n\nThat distinction becomes increasingly important when AI functionality moves from prototypes into products that other people actually own.\n\nTry Ask Lexora\n\nCounselForm AI 2.0 is now live, and I've published an interactive preview of the Ask Lexora experience:\n\n[Live preview: CounselForm AI 2.0](https://contextual-days-463272.framer.app/)\n\n[Framer Marketplace: CounselForm AI 2.0](https://www.framer.com/marketplace/templates/counselform-2-0/)\n\nI'd be particularly interested in hearing how other developers are approaching BYOK, buyer-owned inference and trusted knowledge boundaries in commercially distributed AI products.", "url": "https://wpnews.pro/news/designing-a-byok-ai-architecture-for-a-commercial-framer-template", "canonical_source": "https://dev.to/davideagosti/designing-a-byok-ai-architecture-for-a-commercial-framer-template-2ano", "published_at": "2026-09-01 16:56:59+00:00", "updated_at": "2026-09-01 17:23:48.523247+00:00", "lang": "en", "topics": ["ai-products", "ai-tools", "developer-tools", "ai-infrastructure"], "entities": ["CounselForm AI 2.0", "Framer", "Ask Lexora", "OpenAI", "Cloudflare"], "alternates": {"html": "https://wpnews.pro/news/designing-a-byok-ai-architecture-for-a-commercial-framer-template", "markdown": "https://wpnews.pro/news/designing-a-byok-ai-architecture-for-a-commercial-framer-template.md", "text": "https://wpnews.pro/news/designing-a-byok-ai-architecture-for-a-commercial-framer-template.txt", "jsonld": "https://wpnews.pro/news/designing-a-byok-ai-architecture-for-a-commercial-framer-template.jsonld"}}