llm-client is a local Node.js service that turns your existing ChatGPT, Claude, and Gemini browser sessions into a free structured JSON API — no API keys, no cost, no limits.
- ⚖️ Smart Load Balancing: Automatically rotates requests across available LLMs (Round-Robin) to maximize throughput and avoid rate limits.
- 🧬 Multi-Provider Parallelism: Dynamically manages isolated browser sessions for ChatGPT, Claude, and Gemini simultaneously.
- 🛡️ Anti-Detection Engine: Built on Playwright with advanced stealth plugins to bypass automation detection.
- 🔄 Self-Correction Pipeline: Built-in Zod validation that automatically re-prompts the LLM with error details if the JSON output is invalid.
- 💾 Persistent Sessions: Saves browser profiles locally—log in once, stay logged in across restarts.
- 📦 Schema-Driven: Simply provide a JSON object defining your desired structure, and llm-client handles the rest.
graph TD
User["/api/v1/balanced/transform"] --> Pool["SessionPool"]
Pool --> Rotator["Round-Robin Balancer"]
Rotator --> P1["ChatGPT Adapter"]
Rotator --> P2["Claude Adapter"]
Rotator --> P3["Gemini Adapter"]
P1 --> B1["Browser Window 1"]
P2 --> B2["Browser Window 2"]
P3 --> B3["Browser Window 3"]
- Node.js (v18+)
- npm or pnpm
- Google Chrome or Chromium installed
git clone https://github.com/your-repo/llm-client.git
cd llm-client
npm install
npx playwright install chromiumCreate a .env file in the root directory:
PROVIDERS=chatgpt,claude,gemini
HEADLESS=false
PORT=3333npm run devImportant
On the first run, keep HEADLESS=false. Windows will pop up for each provider. Log in to your accounts manually. These sessions will be saved in ./browser-profile.
Automatically picks the next available provider.
curl -X POST http://localhost:3333/api/v1/balanced/transform \
-H "Content-Type: application/json" \
-d '{
"task": "Extract product details",
"schema": { "name": "string", "price": "number" },
"input": "The Gadget is $99. It is waterproof."
}'| Endpoint | Method | Description |
|---|---|---|
/:provider/transform |
POST | Single transformation using a specific provider. |
/balanced/transform |
POST | Smart round-robin transformation. |
/:provider/batch |
POST | Process multiple inputs sequentially. |
/queue/status |
GET | View pending/processing tasks across all workers. |
/session/status |
GET | Check if providers are logged in and ready. |
/:provider/rescue |
POST | Capture a screenshot of a browser session (for debug). |
├── src/
│ ├── adapters/ # LLM provider implementations
│ ├── browser/ # Session pooling and browser management
│ ├── routes/ # API endpoint handlers
│ ├── queue/ # Concurrency & worker logic
│ ├── validator/ # Schema validation & retry pipeline
│ └── templates/ # System prompts & extraction templates
├── browser-profile/ # Persisted login data (Git-ignored)
└── .env # Global configurationThis project is for educational or automation purposes. Ensure your usage complies with the Terms of Service of the respective LLM providers.