Intelligent AI Routing - Built from Your Contracts
One line of code changed. Millions of premium calls rerouted.
ModelGate is a contract-aware AI control plane that ingests customer contracts, extracts SLA/privacy/routing constraints, and generates an OpenAI-compatible endpoint that automatically routes every request to the optimal model. Simple queries go to cheap models. Complex queries go to premium ones. Contract compliance is enforced per request, automatically.
3rd Place
at the KSU Social Good Hackathon 2026 - Assurant Track.
Over 30 new LLMs launched in the past month alone. No team has time to evaluate them all - so they pick one premium model and send everything to it. The result: 50-90% of enterprise AI spend is wasted on over-provisioned models, and premium models consume 180x more energy per query than small ones.
ModelGate fixes this. You change one line of code - your
base_url
- and we handle model selection, contract compliance, and cost optimization automatically.
Results
MMLU Routing Benchmark (60 questions, 6 subjects)
We benchmarked ModelGate against always routing to GPT-5.4 (default reasoning):
GPT-5.4 Direct
ModelGate Router
Delta
Overall Accuracy
90%
85%
-5pp
Hard Accuracy
80%
80%
0
Cost
$0.023
$0.0095
-59%
The router sent 68% of queries to Gemini Flash Lite, 17% to GPT-4o-mini, and only 15% to GPT-5.4. Hard questions were routed correctly - the cost savings come from not overpaying on easy ones.
Projected at 10k requests/month:
$1.58 vs $3.83
(59% savings).
Fine-Tuned Classification Model (GRPO Reinforcement Learning)
We fine-tuned ModelGate-Router (based on Arch-Router-1.5B) using GRPO to fix a critical blind spot: the stock model misclassified 86% of medium-complexity queries as complex.
git clone https://github.com/Aaryan-Kapoor/ModelGate-Hackathon
cd ModelGate-Hackathon
# Add your API keycp .env.example .env# Edit .env with your OPENROUTER_API_KEY# Run everythingchmod +x scripts/start.sh
./scripts/start.sh
Proxy endpoint:
POST http://localhost:8000/v1/{customer_id}/chat/completions
Benchmarking
# Run MMLU benchmark against any OpenAI-compatible endpoint
python scripts/bench_mmlu.py run \
--base-url http://localhost:8000/v1 \
--api-key dummy \
--model auto \
--label router
# Compare two runs
python scripts/bench_mmlu.py compare results/run_a.json results/run_b.json
# Benchmark the classification model (GGUF)
python finetuning/bench_gguf.py
Fine-Tuning
The fine-tuning pipeline lives in
finetuning/
. See
finetuning/README.md
for full details.
# Train (2.5 min on RTX 3080 8GB)
python finetuning/grpo_run_nocot.py
# Export to GGUF
python finetuning/export_gguf.py nocot
# Benchmark stock vs fine-tuned
python finetuning/bench_gguf.py
Project Structure
backend/
main.py # FastAPI app
services/
classifier.py # ModelGate-Router inference (llama.cpp)
extractor.py # Contract → Customer AI Profile (LLM)
router_engine.py # Model scoring and selection
provider_registry.py # Model catalog with pricing/capabilities
frontend/ # Next.js dashboard
finetuning/
grpo_run_nocot.py # GRPO training script
grpo_training_data.json # 172 labeled training prompts
grpo_eval_data.json # 54 held-out eval prompts
export_gguf.py # LoRA merge + GGUF conversion
bench_gguf.py # GGUF benchmark (accuracy + latency)
ModelGate-Router.Q8_0.gguf # Production model (1.6 GB)
scripts/
bench_mmlu.py # MMLU benchmark runner
mmlu_questions.json # 60 real MMLU questions from HuggingFace
start.sh # One-command startup
Runs of AaryanK ModelGate on huggingface.co
97
Total runs
0
24-hour runs
0
3-day runs
-12
7-day runs
12
30-day runs
More Information About ModelGate huggingface.co Model
ModelGate huggingface.co is an AI model on huggingface.co that provides ModelGate's model effect (), which can be used instantly with this AaryanK ModelGate model. huggingface.co supports a free trial of the ModelGate model, and also provides paid use of the ModelGate. Support call ModelGate model through api, including Node.js, Python, http.
ModelGate huggingface.co is an online trial and call api platform, which integrates ModelGate's modeling effects, including api services, and provides a free online trial of ModelGate, you can try ModelGate online for free by clicking the link below.
AaryanK ModelGate online free url in huggingface.co:
ModelGate is an open source model from GitHub that offers a free installation service, and any user can find ModelGate on GitHub to install. At the same time, huggingface.co provides the effect of ModelGate install, users can directly use ModelGate installed effect in huggingface.co for debugging and trial. It also supports api for free installation.