Skip to content

Repository files navigation

πŸ”₯ GrokRoute β€” Free AI Router for Grok Build

GrokRoute Logo

npm downloads stars license last commit

πŸ”Œ Multi-provider AI router for Grok Build.
Route Grok Build through free & local AI providers. Auto-fallback, zero config.


πŸ’‘ What It Does

GrokRoute is a smart local proxy that sits between Grok Build and AI providers. It routes your requests to free cloud providers (Agnes, Groq, Zhipu, Laguna) or your local Ollama models β€” giving you more choice, better speed, and zero cost.

⚑ One command. Multiple providers. All the AI power.

npm install -g grokroute; grokroute install; grokroute

✨ Why GrokRoute?

Default GrokRoute
Cost πŸ’Έ Subscription πŸ†“ FREE
Providers 1 built-in 5+ with auto-fallback
Local models ❌ No βœ… Ollama
Offline mode ❌ No βœ… With Ollama
Privacy Cloud-only Your data β†’ your choice
Admin UI ❌ CLI only βœ… Web UI at :8083/admin

πŸš€ Quick Start

GrokRoute Terminal

# 1. Install globally
npm install -g grokroute

# 2. Auto-configure Grok Build to use the proxy
grokroute install

# 3. Launch!
grokroute
#    ^ press ENTER to start Grok Build β€” it now uses FREE providers!

That's it. Grok Build now runs through GrokRoute, routing to free providers automatically.


πŸ”„ Smart Auto-Fallback

GrokRoute tries providers in priority order. If one fails, the next one takes over seamlessly:

Agnes AI  ──→  Groq  ──→  Zhipu  ──→  Laguna  ──→  Ollama
(fast,     (fastest,  (GLM,     (coding,    (local,
free tier) 280+ t/s)  free)     free tier)  fully free)
  • Streaming mode: tries providers one by one, 5s timeout per attempt
  • Non-streaming mode: parallel race β€” fastest good response wins 🏎️

πŸ’Έ Providers

Provider Free Tier Speed Sign-up
Agnes AI βœ… Free credits ⚑ Fast apihub.agnes-ai.com
Groq βœ… Free tier ⚑⚑⚑ 280+ tok/s console.groq.com
Zhipu AI βœ… Free GLM models ⚑ Medium z.ai/model-api
Laguna βœ… Free tier ⚑ Medium poolside.ai
Ollama βœ… Fully free πŸ–₯️ Local ollama.com

πŸ”‘ All providers offer free tiers. You can start with zero cost.


πŸŽ›οΈ Commands

Command What it does
grokroute Β· groute Β· gfree Start proxy β†’ press ENTER to launch Grok Build
grokroute admin Open web admin UI (configure keys visually)
grokroute install Auto-configure ~/.grok/config.toml
grokroute status Check proxy health & active provider
grokroute uninstall Restore original Grok Build config

πŸ–₯️ Admin UI

GrokRoute Admin UI

Open http://127.0.0.1:8083/admin in your browser β€” configure all providers, test connections, and manage settings.

🎨 Modern dark-theme UI with real-time status, provider testing, and one-click save.


πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     HTTP/SSE      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     API calls     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Grok     β”‚ ────────────────→ β”‚  GrokRoute   β”‚ ────────────────→ β”‚ Agnes AI   β”‚
β”‚ Build    β”‚ ←──────────────── β”‚   Proxy      β”‚ ←──────────────── β”‚ Groq       β”‚
β”‚ (client) β”‚   OpenAI format   β”‚  :8083       β”‚   OpenAI format   β”‚ Zhipu      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                   β”‚  Python 3.8+ β”‚                   β”‚ Laguna     β”‚
                               β”‚  + Node.js   β”‚                   β”‚ Ollama     β”‚
                               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • Zero external dependencies β€” the proxy is a single Python file
  • Your prompts never leave your machine (except to the provider you choose)
  • OpenAI-compatible API β€” works with any tool, not just Grok Build

βš™οΈ Configuration

// ~/.grokroute/grokroute-config.json
{
  "provider": "auto",
  "groq_api_key": "gsk_...",
  "groq_model": "llama-3.1-8b-instant",
  "agnes_api_key": "sk-...",
  "max_tokens": 4096,
  "temperature": 0.3,
  "enable_streaming": true
}

Or just use the Admin UI (grokroute admin) β€” no manual JSON editing needed.


🐧 Install Without npm

# Direct Python run β€” no Node.js needed
git clone https://github.com/wxstdo-boop/grokroute.git
cd grokroute
python grokroute-proxy.py

# Windows: run install.ps1 as admin, then start.bat

πŸ§ͺ Tests

python tests/test_proxy.py
# βœ“ /health
# βœ“ /v1/models
# βœ“ /v1/chat/completions (non-streaming)
# βœ“ /v1/chat/completions (streaming)
# βœ“ /admin UI loaded
# All tests passed.

πŸ”§ Troubleshooting

Problem Fix
"No provider available!" Add at least 1 API key in admin UI or start Ollama
Port 8083 in use Set GROK_FREE_PORT=8084 env var
Grok Build uses default API Re-run grokroute install and restart Grok Build
Slow first response Normal β€” proxy probes providers; cached after first request

πŸ—ΊοΈ Roadmap

  • Auto-fallback with sequential & parallel modes
  • Web admin UI
  • Ollama local model support
  • Streaming SSE support
  • Multi-provider race mode
  • Docker image
  • System tray app (Windows/Mac)
  • Usage statistics dashboard
  • Custom provider plugins

🀝 Contributing

PRs welcome! See CONTRIBUTING.md.

πŸ”’ Security

See SECURITY.md.

πŸ“œ License

MIT β€” free as in freedom. Do whatever you want.

🌍 Languages

πŸ‡·πŸ‡Ί Π§ΠΈΡ‚Π°Ρ‚ΡŒ Π½Π° русском


⭐ Star this repo if it saves you money!
Made with πŸ”₯ by graysik & the open-source community

About

Free AI router for Grok Build. Auto-fallback: Agnes > Groq > Zhipu > Laguna > Ollama

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages