51 Downloads Updated 4 weeks ago
ollama run fauxpaslife/arch-router:1.5b
A specialized 1.5B parameter model for intelligent routing between multiple LLMs based on domain and action preferences.
Overview Arch-Router learns to map user queries to domain-action preferences, enabling smart routing decisions in multi-model environments. It analyzes incoming prompts to determine the best-suited model for each request using structured routing logic.
Key Features:
Fast, deterministic routing decisions (<200ms) Structured XML input → JSON output format Transparent, configurable routing logic Production-ready for low-latency applications
Credits
| Original Model: katanemo/Arch-Router-1.5B |
| Paper: Preference-Aligned Routing (arXiv:2506.16655) |
| Project: Arch Gateway |
Usage
Define your routes with domain-action mappings:
ollama run arch-router:1.5b '
<routes>
[
{"name": "medical", "description": "Physical health concerns, pain, symptoms, medication questions"},
{"name": "emotional", "description": "Mental health, stress, anxiety, emotional support"},
{"name": "activity", "description": "Exercise, movement, daily activities, energy management"}
]
</routes>
<conversation>
[{"role": "user", "content": "My chronic pain is flaring up today"}]
</conversation>
Output the route name in JSON format: {"route": "route_name"}
Output: {“route”: “medical”}
Python Integration
pythonimport json
import requests
def route_query(user_message, routes):
prompt = f"""
<routes>
{json.dumps(routes)}
</routes>
<conversation>
[{{"role": "user", "content": "{user_message}"}}]
</conversation>
Output the route name in JSON format: {{"route": "route_name"}}
"""
response = requests.post("http://localhost:11434/api/generate", json={
"model": "arch-router:1.5b",
"prompt": prompt,
"stream": False,
"options": {"temperature": 0.0}
})
result = response.json()["response"].strip()
return json.loads(result)["route"]
# Example
routes = [
{"name": "code", "description": "Programming, debugging, code generation"},
{"name": "writing", "description": "Creative writing, editing, content creation"}
]
route = route_query("Help me fix this Python bug", routes)
print(route) # "code"
License Original model license applies. See HuggingFace model card for details.