6 Downloads Updated 3 weeks ago
ollama run peeyush_16/supra-router
Supra-Router-51M is an ultra-lightweight, high-speed infrastructure traffic controller optimized for localized edge orchestration. With only 51.7 million parameters, this micro-LLM acts as a defensive gateway for multi-model ecosystems, accurately determining when user requests can be processed locally by an Edge SLM or when they must be triaged to a cloud-hosted frontier intelligence layer.
The model was built by fine-tuning a pre-trained 51M base on the SupraLabs/Prompt-Routing-Dataset (992 rows). Rather than acting as a naive binary classifier, it uses Multi-Task Sequence Generation to map out the underlying properties of a prompt before predicting the final routing token, anchoring its attention heads to robust language and structural logic features.
To run inference, wrap your user query inside the structural framing tokens used during training (Task: [Prompt]\nAnalysis:). The model will output a deterministic, pipe-separated string containing the full telemetry of the prompt’s cognitive requirements.
Domain: [Semantic Field] | Complexity: [1-5] | Math: [True/False] | Code: [True/False] | Route: [small model/big model] | Justification: [Rule-driven infrastructure reasoning]
By forcing a sub-100M parameter model to calculate the semantic domain, structural complexity, and technical flags before it emits the final Route token, the network effectively runs an internal feature-activation map. This multi-task sequence prevents localized weight collapse and guarantees stable routing boundaries.
eval_loss: 0.1342). To eliminate late-stage micro-model memorization and validation drift, the training state was automatically rewound and saved at this numerical peak.ollama run peeyush_16/supra-router "Task: Write a movie script about a chef who gets lost at sea.
Analysis: "
Ollama enforces greedy decoding by default when temperature=0, matching the upstream do_sample=False recommendation for maximum decision stability.
curl http://localhost:11434/api/generate -d '{
"model": "peeyush_16/supra-router",
"prompt": "Task: Write a movie script about a chef who gets lost at sea.\nAnalysis: ",
"stream": false,
"options": { "temperature": 0, "num_predict": 128 }
}'
Use this direct script to test or wrap the model inside a live production orchestrator or FastAPI gateway. It enforces greedy decoding (do_sample=False) for maximum decision stability.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
MODEL_ID = "SupraLabs/Supra-Router-51M"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = AutoModelForCausalLM.from_pretrained(
MODEL_ID,
dtype=torch.bfloat16,
device_map="auto",
)
model.eval()
user_prompt = "Write a movie script about a chef who gets lost at sea."
formatted_input = f"Task: {user_prompt}\nAnalysis: "
inputs = tokenizer(formatted_input, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=128,
do_sample=False,
pad_token_id=tokenizer.pad_token_id,
eos_token_id=tokenizer.eos_token_id,
)
generated_ids = outputs[0][inputs["input_ids"].shape[1]:]
print(tokenizer.decode(generated_ids, skip_special_tokens=True).strip())
During edge validation testing, Supra-Router-51M demonstrated robust resilience against adversarial prompt strings:
Complexity: 3, automatically triggering a big-model route override.Original model by SupraLabs. This Ollama distribution repackages the upstream weights for local inference via Ollama.