InteliRouter

Vercel
application badge
Created by team Beyond the Stack on July 10, 2026
Hybrid Token-Efficient Routing Agent

Hybrid Router is a small FastAPI service that accepts OpenAI-style chat completion requests and sends them to the cheapest model that should handle the prompt well. Simple prompts go to a local Ollama model. More difficult prompts go to one of three Fireworks harness model families: cheap, strong, or code. Responses are returned in an OpenAI-compatible format with extra routing metadata. How It Works A client sends a POST /v1/chat/completions request with chat messages. main.py validates the request and extracts the last user message. router_logic.py scores that message using a lightweight heuristic. If the score is low, workers.py calls Ollama through OLLAMA_URL. If the score is high, config.py chooses the best Fireworks harness tier for the task: cheap general, strong general, or code-specialized. workers.py calls Fireworks through the OpenAI-compatible SDK using the selected remote model. The API returns a normal chat-completions payload plus a usage object that shows which route was chosen.

Category tags: