RouteWise.
A traffic director for requests to language models. RouteWise is a hosted FastAPI gateway that chooses a fast or reasoning route using simple rules, optionally calls a configured model provider, and tries an alternate provider for eligible retryable failures.
What is it, really?
Applications may want predictable routing behavior and a bounded fallback instead of tying every request to one upstream provider. RouteWise demonstrates that gateway logic transparently.
Imagine a receptionist directing ordinary questions to the quick-service desk and harder questions to the specialist. If the chosen desk is temporarily unavailable, a second desk may be tried. That is the routing pattern—without claiming the rules always pick the best model.
The practical use case
Applications may want predictable routing behavior and a bounded fallback instead of tying every request to one upstream provider. RouteWise demonstrates that gateway logic transparently.
Hosted demo API
Public source code, architecture documentation, tests and the labeled browser demo are linked below. The implementation boundaries are documented, not hidden.
Follow the architecture.
Select any stage below. The explanation shows what enters that part of the system, what it does and what comes out. This diagram explains real code architecture; it is not connected to the running backend.
Authenticate
A client sends a bounded chat request with a server-issued gateway bearer token. The API validates message roles, lengths, token count and rejects streaming, which this version doesn't implement.
The visual flow is an educational representation. For the exact code paths, open the source and engineering documentation.
What does it look like?
These simplified examples are drawn from the repository's documented behavior. They explain what to expect; they do not execute an API request from this page.
What you provide
POST /v1/chat/completions
Authorization: Bearer <server-issued gateway key>
{
"model": "auto",
"messages": [
{"role": "user", "content": "Analyze these architecture tradeoffs"}
]
}What the system determines
Selected route: reasoning Reason: keyword "analyze" Current hosted demo response: "Demo response from reasoning; no language model was called." With real configured providers, eligible 429, 5xx, network or timeout errors can trigger one alternate attempt.
This is an explanatory walkthrough of the implementation, not a live API call made by this page. The publicly hosted service is in no-provider mode. Never paste upstream provider keys into a browser.
Every component has a job.
Instead of a giant list of tools, these are the actual responsibilities each technology has in this project.
Hosts chat-shaped and metrics endpoints with request validation.
Makes configured HTTPS upstream requests and handles timeouts.
Uses message length and selected keywords to choose a tier.
Holds provider URLs, model identifiers and credentials outside the browser.
Show the working parts.
✓ Implemented
- Fast/reasoning selection uses explicit deterministic rules and optional overrides.
- Bearer authentication protects chat and metrics endpoints.
- Configured HTTPS providers can be called with at most two sequential attempts.
- Retry is limited to eligible transient errors.
- Unconfigured mode clearly labels fixture responses as demos.
○ Not claimed
- No actual LLM is connected to the public Railway deployment.
- The classifier is keyword/length based, not semantic or learned routing.
- No streaming, tool calling, caching or circuit breaker.
- Stored metrics are memory-only, limited to successes and reset on restart.
- No proven quality, latency or cost improvement compared with a baseline.
Understand the trade-offs.
Does the public API call GPT or Claude?
No. In its current configuration it returns a response explicitly saying no language model was called.
How does it decide between fast and reasoning?
It uses deterministic rules: text length, listed keywords or the client's explicit override.
Will it always retry failures?
No. It only retries eligible transient errors and requires a configured alternate provider.
Being clear about limitations is part of engineering: the project shows patterns and testable code, not a promise of production security, measured cost reduction or unconfigured model inference.
No jargon left behind.
- Gateway
- A service that receives a request and forwards it according to rules.
- Heuristic
- A transparent rule of thumb rather than a trained model.
- Fallback
- Trying an alternate provider after certain transient failures.
- Latency
- Elapsed time taken to process a request.