QuickRouter is an ultra-lean, zero-bloat AI routing bridge designed for SaaS architects and developers. It intercepts code drafts, commands, and prompts copied from the x.ai/bot (Grok) interface and intelligently channels them across local and cloud LLM tiers without heavy autonomous frameworks (No CrewAI, No LangChain, No AutoGen).
ββββββββββββββββββββββββββββββ
β x.ai / Grok Web Interface β
β (Code Drafts & Prompts) β
βββββββββββββββ¬βββββββββββββββ
β
[ QuickRouter Engine ]
(Smart Heuristic Classifier)
β
βββββββββββββββββββββββββββΌββββββββββββββββββββββββββ
βΌ βΌ βΌ
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββββ
β Tier: easy β β Tier: hard β β Tier: free β
β Ollama Local β β Antigravity β β Free Cloud API β
β (Zero Cost) β β Architecturalβ β Failover Pool β
ββββββββ¬ββββββββ ββββββββ¬ββββββββ βββββββββ¬βββββββββ
β β β
Multi-Model: Multi-Model: Multi-Provider:
- fast (codegemma) - architect-v1 - Groq (LLaMA 3.3)
- coder (gpt-oss) - coder-pro - OpenRouter Free
- reasoning (gemma4) - Google Gemini Free
- Mistral AI
- Ollama (Local Engine - Zero Cost):
- Ideal for boilerplate templates, CRUD endpoints, regex, file utilities, and quick scripts.
- Multi-Model Support: Built-in presets (
fast,coder,reasoning) and dynamic model discovery from local host (http://localhost:11434/api/tags).
- Antigravity (Architectural Heavy Lifting):
- Built for complex SaaS architectures, distributed systems, microservices, security protocols, and heavy algorithmic components.
- Free Cloud API Pool (Multi-Provider Fallback):
- High-speed fallback chain across Groq, OpenRouter, Google Gemini, and Mistral. If a provider encounters a rate limit or failure, QuickRouter automatically cascades to the next active provider.
- Environment-Driven (
.env): No hardcoded secrets or plaintext keys. All configuration is managed via.envor system environment variables. - Strict Git Exclusion:
.envis permanently excluded via.gitignore. - Secret Masking: Plaintext tokens are never printed in logs or terminal streams (e.g.
sk-1...cdefor[PLACEHOLDER]). - Path Traversal Protection: Input files are canonicalized; attempts to read
.envas a prompt are blocked. - Built-in Security Audit: Run
python router.py --auditat any time to verify git ignore status and secret isolation.
git clone https://github.com/Tiyatrotist/QuickRouter.git
cd QuickRouterCopy the template and adjust your settings:
cp .env.example .envEdit .env with your preferred models and keys:
# Ollama
OLLAMA_ENABLED=true
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=codegemma:2b
OLLAMA_MODEL_FAST=codegemma:2b
OLLAMA_MODEL_CODER=gpt-oss:20b
OLLAMA_MODEL_REASONING=gemma4:26b
# Antigravity
ANTIGRAVITY_ENABLED=true
ANTIGRAVITY_BASE_URL=https://api.antigravity.ai/v1
ANTIGRAVITY_API_KEY=your_antigravity_api_key_here
ANTIGRAVITY_MODEL=antigravity-architect-v1
# Free API Pool
GROQ_ENABLED=true
GROQ_API_KEY=your_groq_api_key_here
GROQ_MODEL=llama-3.3-70b-versatilepip install -r requirements.txt
# Or install in editable mode:
pip install -e .# 1. Automatic heuristic tier detection
python router.py "Create a distributed transaction pattern using Saga in Python"
# 2. Force local Ollama (easy tier) with debug logs
python router.py "Write a FastAPI CRUD boilerplate for users" --tier easy --debug
# 3. Use a specific model preset (e.g. fast, coder, reasoning)
python router.py "Write a binary search algorithm in Python" -t easy -m fast
# 4. Save output directly to a file
python router.py "PostgreSQL database connection pool class" -t hard -o db_pool.py
# 5. Copy response directly to OS clipboard
python router.py "Generate a regex for validating UUID v4" -t easy --clipSafely process long code snippets or prompts exported from Grok:
python router.py -f grok_prompt.txt -t hard -o architecture_solution.py# List all installed Ollama models and configured cloud providers
python router.py --models
# Run the automated security and secret exposure audit
python router.py --auditKeep a session open while working with Grok:
python router.py --interactive[QuickRouter] >>> [easy] write a python script to parse a csv file
[QuickRouter] >>> [hard] design a multi-tenant database schema with tenant isolation
[QuickRouter] >>> :models
[QuickRouter] >>> :audit
from quickrouter import GrokBridgeRouter
# Initialize router (loads from .env automatically)
router = GrokBridgeRouter(debug=True)
# 1. Automatic classification based on prompt complexity
prompt = "Design a fault-tolerant microservice architecture for billing"
response = router.route(prompt)
print(response)
# 2. Explicit tier selection ('easy', 'hard', 'free')
easy_code = router.route("Generate UUID helper function", tier="easy", model="fast")
print(easy_code)
# 3. Safe file routing
result = router.route_file("grok_task.txt", tier="hard")
print(result)Run the test suite with pytest:
pytestQuickRouter; x.ai/Grok ΓΌzerinden kopyalanan SaaS kod taslaklarΔ±nΔ± ve komutlarΔ± harici aΔΔ±r kΓΌtΓΌphaneler (CrewAI, LangChain vb.) kullanmadan yΓΆneten saf Python tabanlΔ± bir yΓΆnlendiricidir:
- .env YapΔ±landΔ±rmasΔ±: TΓΌm anahtarlar
.envdosyasΔ±nda gΓΌvenli bir Εekilde saklanΔ±r; Git'e sΔ±zmasΔ±.gitignoreve dahili gΓΌvenlik kontrolleri ile engellenir. - Γoklu Model DesteΔi: Ollama ΓΌzerinde tek bir modelle sΔ±nΔ±rlΔ± kalmaz;
fast,coder,reasoningΓΆn ayarlarΔ±yla sistemde yΓΌklΓΌ modelleri otomatik algΔ±lar. Antigravity ve Γcretsiz Havuzda da yedek (fallback) modeller sunar. - GΓΌvenlik Denetimi:
python router.py --auditkomutu ile projedeki gizli anahtar izolasyonunu istediΔiniz an test edebilirsiniz.
This project is licensed under the MIT License - see the LICENSE file for details.