Turn your browser into a programmable, zero-cost API for ChatGPT & Gemini.
LLMBridge is a high-performance developer tool that creates a secure bi-directional tunnel between your local scripts and web-based LLMs. Skip the expensive API tokens and rate limits by using your browser as the automated "brain" for your projects.
LLMBridgeDemo.mp4
How it works: A local Node.js or Python script sends a request via HTTP; the bridge routes it to the browser; the AI types the response, and the final data is returned to your terminal in seconds.
- Zero Cost: No OpenAI or Google Cloud API keys required.
- Dual-Model Support: Works natively with both ChatGPT and Gemini.
- Structured Data: Built-in tools to force LLMs into returning valid, parseable JSON.
- Universal Access: Access the bridge from JavaScript, Python, or any language that supports HTTP.
LLMBridge is split into two primary layers:
/extension: The Chrome Extension that manages the browser automation and scrapes response data./extSys: The Native Host (Node.js) that acts as a local HTTP server and handles thestdin/stdoutpipe to Chrome.
LLMBridgeSetup.mp4
- Load Extension: Open
chrome://extensions/, enable Developer Mode, and click Load Unpacked. Select the/extensionfolder. - Copy ID: Copy the Extension ID generated by Chrome.
- Register Host: Open a terminal in the project root and run
.\setup.ps1. Paste your Extension ID when prompted to register the bridge in the Windows Registry. - Connect: Open ChatGPT or Gemini, click the extension icon, and hit Connect Native Host.
LLMBridge is designed to be completely modular. You can use our provided helper library or call the endpoint directly with your own logic.
If you prefer to handle your own prompt engineering, you can hit the local server directly:
- Method:
POST - URL:
http://localhost:3000/prompt - Body:
{"prompt": "Your custom text here"}
Our llmClient library (found in /Client) includes a buildStrictJSONPrompt function. We use this for modularity—it handles the "boring" parts of prompt engineering, such as:
- Enforcing double-quote compliance for JSON.
- Stripping problematic Markdown links and backticks.
- Formatting the schema for better LLM adherence.
You are free to construct your own prompts. If you prefer raw strings or your own template engine, simply pass them directly to the askLLM function.
import { askLLM, buildStrictJSONPrompt } from './Client/llmClient.js';
// 1. Define your goal & structure
const myTask = {
task: "Extract contact info",
context: "Email me at dev@example.com",
schema: { email: "string" }
};
// 2. Build (Optional) and Send
const prompt = buildStrictJSONPrompt(myTask);
const response = await askLLM(prompt);
// 3. Use like a real API
const data = JSON.parse(response.data);
console.log(data.email);- Keep the Tab Active: An AI tab (ChatGPT or Gemini) must remain open for the bridge to function. The extension acts as a human proxy—if the tab is closed, the bridge cannot send input.
- Permissions: This tool uses
nativeMessagingfor local communication andscriptingfor browser automation.
Distributed under the MIT License. Created for research, education, and personal automation.