What is the best way to build AI Chatbot for documentation pages built with Hugo and hosted on S3?

First option → I was thinking of using some vector store in the cloud like Supabase and Langchain.js npm package together with Open AI embeddings. The problem here is how to hide Open AI key if I write all JS logic inside Hugo project? I know about HUGO_PARAMS but I can’t find out if that somehow hides my Open AI key and other vector store keys.

Second option → Writing my JS logic for Supabase or AWS lambda edge functions, but the problem here is unpredictable requests and limitations; I can’t actually predict how many requests will come to an edge function and what the cost will it be.

Third option → write JS logic in Node.js on a VPS, The problem here is that is hosted in one location, and my webpage is deployed all over the world with CloudFront, so probably there will be an extra delay in the response.

I need advice on which approach I should choose. Is there anyone who has already built an AI Chatbot (or RAG) for your docs?