Skip to content

Repository files navigation

⚡ ZeroRoute SaaS

Open-Source Multi-Cloud AI Gateway & Autonomous Embeddable Widget Platform

License: MIT Next.js 16 React 19 Tailwind CSS v4 Cloudflare D1 Dodo Payments

Zero Cost. Max Route. 100% Uptime Across 11 Free AI Cloud Providers.

Live DemoDocumentationReport Bug


🌟 What is ZeroRoute?

ZeroRoute is a production-grade, OpenAI-compatible AI API Gateway and turnkey SaaS platform built on Next.js 16 (Turbopack). It intelligently aggregates 11 high-performance AI cloud provider free tiers into a unified, zero-cost, high-availability cluster with sub-8ms dynamic load balancing.

Whether you need a 1-line embeddable AI customer support chatbot trained on your live website, or a resilient OpenAI-compatible gateway for your Cursor, Claude Code, Python, or TypeScript applications, ZeroRoute ensures you enjoy continuous, uninterrupted uptime.


✨ Key Features

🌐 1. High-Availability Multi-Cloud Routing Matrix

  • 11 Configured Free AI Cloud Providers: Groq, Cerebras, SambaNova, Mistral AI, Cohere, Google Gemini, OpenRouter, NVIDIA NIM, Cloudflare Workers AI, Hugging Face, and BazaarLink AI.
  • Intra-Provider Model Chains: Each provider has an optimized model chain that dynamically routes through models for maximum speed and throughput.
  • Dynamic Smart Routing Engine: Dynamically routes requests across healthy clouds in <8ms with zero downtime.

💬 2. 1-Line Embeddable Chatbot Widget

  • Embed on any website with a single <script> tag:
    <script
      src="https://zeroroute.mapki.in/widget.js"
      data-bot-id="bot_your_bot_id_here"
      defer
    ></script>
  • Floating glassmorphism chat window, live streaming SSE token typewriter effect, customizable quick-action pills, brand accent colors, and custom avatar.

🧠 3. Smart Semantic RAG & 1-Click URL Crawler

  • 1-Click Web Scraper: Index public websites, Notion documents, Google Docs (/pub), and GitHub raw markdown (.md) with built-in SSRF protection.
  • BM25 Token Scorer: Retrieves relevant context snippets based on user queries and injects verified business details directly into system prompts.
  • Zero Hallucination Directives: Restricts the AI from inventing fake prices, phone numbers, or URLs not present in the verified knowledge base.

👑 4. Master Admin Console (/admin)

  • Visual Fallback Chain Reordering: Drag-and-drop or use 1-click controls to promote/demote clouds and models.
  • Multi-Cloud Benchmark Race: Race all 11 clouds simultaneously with 1 click to measure live latencies.
  • Subscriber Directory & Quota Management: Monitor paying tenants, rotate API keys, inspect usage meters, and suspend/activate tenants.
  • Live Gateway Traffic & Failover Log Inspector: Inspect full user prompts, model responses, tokens, and multi-cloud failover trails.

👤 5. Subscriber Console (/app) & 10,000 Monthly Quota

  • 10,000 Monthly AI Requests (~330 req/day): Generous multi-cloud allocation per subscriber with automated monthly cycle resets.
  • Self-Service Dashboard: Rotate live API keys, customize AI persona/tone/greetings, manage knowledge docs, and copy integration code.
  • Domain Whitelisting (CORS): Lock down widget usage to authorized customer domains.
  • Turnkey Subscription Billing: Powered by Dodo Payments with automated activation, renewal, and cancellation webhooks.

🗄️ 6. Dual-Engine Database Architecture

  • Edge Mode: Zero-cold-start Cloudflare D1 Serverless Database.
  • Local / Node.js Mode: Embedded high-speed SQLite via @libsql/client (data/zeroroute.db).

🏗️ Architecture & Fallback Hierarchy

flowchart TD
    User["Client / Widget / OpenAI SDK"] --> Gateway["ZeroRoute API Gateway (/v1/chat/completions)"]
    
    Gateway --> RAG["RAG Retrieval Engine"]
    RAG --> Cache{"Response Cache"}
    
    Cache -->|"Cache Hit (0ms)"| Immediate["Cached Instant Response"]
    Cache -->|"Cache Miss"| ProviderPool["Dynamic Multi-Cloud Pool"]

    subgraph Matrix["11 Cloud Routing Matrix"]
        P1["1. Groq — Llama 3.3 / GPT-OSS"]
        P2["2. Cerebras — Ultra-Fast 120B"]
        P3["3. SambaNova — MiniMax / Gemma 4"]
        P4["4. Mistral AI — Nemo / Ministral"]
        P5["5. Cohere — Command R+"]
        P6["6. Google Gemini — 2.0 / 2.5 Flash"]
        P7["7. OpenRouter — Nemotron Super 120B"]
        P8["8. NVIDIA NIM — Nemotron 30B"]
        P9["9. Cloudflare AI — Llama 3.1 8B"]
        P10["10. Hugging Face — Llama 3.1 8B"]
        P11["11. BazaarLink AI — Qwen 2.5"]
    end

    ProviderPool --> P1
    P1 -->|"Sub-8ms Route"| P2
    P2 -->|"Sub-8ms Route"| P3
    P3 -->|"Sub-8ms Route"| P4
    P4 -->|"Sub-8ms Route"| P5
    P5 -->|"Sub-8ms Route"| P6
    P6 -->|"Sub-8ms Route"| P7
    P7 -->|"Sub-8ms Route"| P8
    P8 -->|"Sub-8ms Route"| P9
    P9 -->|"Sub-8ms Route"| P10
    P10 -->|"Sub-8ms Route"| P11
Loading

⚡ Quickstart & Local Setup

1. Clone the Repository

git clone https://github.com/amjadlle/zeroroute.git
cd zeroroute

2. Install Dependencies

npm install

3. Configure Environment Variables

Copy .env.example to .env.local:

cp .env.example .env.local

Edit .env.local with your configuration:

# Application Base URL
APP_URL=http://localhost:3000

# Superadmin Access
ADMIN_EMAIL=mapkisolutions@gmail.com
ADMIN_PASSWORD=your_secure_password
ADMIN_KEY=zr_admin_master_secret_key
ROUTER_API_KEY=zr_admin_master_secret_key

# (Optional) Add your free provider API keys
GROQ_API_KEY=gsk_...
GEMINI_API_KEY=...
MISTRAL_API_KEY=...
CEREBRAS_API_KEY=...

4. Run the Development Server

npm run dev

Open http://localhost:3000 in your browser:

  • Landing Page: http://localhost:3000
  • Subscriber Console: http://localhost:3000/app
  • Master Admin Console: http://localhost:3000/admin

💻 API Gateway Usage (OpenAI Compatible)

ZeroRoute is a drop-in replacement for https://api.openai.com/v1.

JavaScript / TypeScript (Official OpenAI SDK)

import OpenAI from "openai";

const openai = new OpenAI({
  baseURL: "https://zeroroute.mapki.in/v1", // or http://localhost:3000/v1
  apiKey: "zr_live_YOUR_API_KEY",
});

async function main() {
  const completion = await openai.chat.completions.create({
    model: "auto", // Automatically routes across 11 pooled AI clouds with zero downtime
    messages: [
      { role: "system", content: "You are a helpful assistant." },
      { role: "user", content: "Explain quantum computing in one sentence." }
    ],
    stream: true,
  });

  for await (const chunk of completion) {
    process.stdout.write(chunk.choices[0]?.delta?.content || "");
  }
}

main();

Python (Official OpenAI SDK)

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://zeroroute.mapki.in/v1",
    api_key="zr_live_YOUR_API_KEY"
)

response = client.chat.completions.create(
    model="auto",
    messages=[
        {"role": "user", "content": "How does intelligent multi-cloud routing work?"}
    ]
)

print(response.choices[0].message.content)

cURL

curl -X POST https://zeroroute.mapki.in/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer zr_live_YOUR_API_KEY" \
  -d '{
    "model": "auto",
    "messages": [
      {"role": "user", "content": "Ping test"}
    ],
    "stream": false
  }'

🚀 Production Deployment

See DEPLOYMENT.md for detailed deployment walkthroughs across:

  • Vercel (1-Click Deployment)
  • Cloudflare Pages / OpenNext (Cloudflare D1 edge database)
  • Docker / VPS / PM2 (Node.js standalone server)

👨‍💻 Creator & Maintainer

Amjad P A


📄 License

This project is open-source and licensed under the MIT License.

About

Never pay for LLMs again. ⚡ The $0/mo Multi-Cloud AI Gateway: pool free tiers across Groq, SambaNova, Mistral, Gemini, NVIDIA NIM, Cloudflare & Cohere into one unstoppable, zero-downtime OpenAI-compatible API. Ultra-fast, self-healing, streaming SSE, and RAM cache. Built for founders, startups & indie hackers.

Topics

Resources

Contributing

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages