Multi-Model Architecture for an Office Platform: Gateway, Routing, and Evaluation Practices
This article examines how an office platform evolved from offering three model tiers to exposing more than a dozen models from multiple vendors, and the engineering work required to support that shift. It breaks the design into five layers: a unified model gateway that normalizes authentication, request formats, streaming, and error semantics behind a single contract; intent-driven task routing across rule, classification, and feedback layers; context and prompt governance to control token budgets and per-model prompt differences; a three-tier evaluation and canary strategy with circuit breaking; and cost controls such as quotas, caching, and retrieval before inference. It closes with a suggested rollout order of gateway first, routing second, and evaluation as the safety net.
From Three Tiers to a Dozen Models on One Platform
A recent update to an office platform expanded its model picker from three options — standard, advanced, and a single flagship tier — to a list of more than a dozen models sourced across several major model vendors, spanning general-purpose flagships, lightweight fast models, long-context models, and reasoning-enhanced models. On the surface this is just a wider set of options. In practice it is an architectural upgrade to the platform’s inference scheduling layer: models have moved from being hard-coded business parameters to being pluggable capability resources.
For developers, the list itself is not the interesting part. What matters is the engineering design that makes such a catalog possible. The rest of this article breaks that design down across five layers.
A Unified Model Gateway: Collapsing Heterogeneous Capabilities into One Contract
The first problem in multi-model integration is inconsistent naming and interfaces: vendors differ in authentication, request body structure, streaming protocols, error code semantics, and rate limiting. If business code has to face those differences directly, every new model means another round of business changes, and maintenance cost grows linearly — or worse — with the number of models.
The reasonable approach is to insert a unified gateway between the business layer and the models, exposing only one stable contract:
POST /v1/chat/completions{"model": "auto | fast | deep | long-context","messages": [{"role": "system", "content": "..."}],"temperature": 0.3,"max_tokens": 2048,"stream": true,"tools": [...]}
Inside the gateway, three responsibilities matter: protocol adaptation (translating the unified request into each backend’s private format), capability declaration (metadata describing each model’s context window, tool-calling support, multimodal support, and billing tier), and observability instrumentation (recording routing decisions, time to first token, total latency, token consumption, and failure reasons).
One point deserves emphasis: capability declarations must be calibrated against real probing and the official documentation, not filled in from guesswork. Routing a model that does not support tool calls into an agent workflow is one of the most common and hardest-to-diagnose failure sources in practice.
Task Routing: From Manual Selection to Intent-Driven Dispatch
In the three-tier era, the user carried the responsibility of choosing. With a dozen models, that responsibility has to move back to the system, because option overload directly damages the experience. Routing strategies typically come in three layers:
- Rule layer: hard mapping by task type. Summarization, rewriting, and format conversion go to the lightweight fast tier; code generation and structured extraction go to tiers with stronger instruction following; long-document question answering goes to the long-context tier.
- Classification layer: a lightweight classifier tags the request (complexity, domain, whether a reasoning chain is needed, expected output length), and a lookup table makes the decision.
- Feedback layer: weights are adjusted dynamically based on historical success rates and user adoption rates, closing the loop.
A minimal, runnable routing sketch:
def route(task):if task.tokens_in > 60_000:return "long-context"if task.kind in {"code", "schema_extract"}:return "deep"if task.complexity < 0.4 and not task.need_tools:return "fast"return "deep"
The key design principle is “explainable and overridable”: every routing decision must leave behind its rationale, while users or upper-layer policies remain able to force a specific model, so the automatic policy never becomes a black box.
Context and Prompt Governance: The Hidden Cost of Multiple Models
Models differ significantly in prompt sensitivity. The same prompt may perform well on model A and degrade noticeably on model B. A multi-model platform therefore needs layered management of prompt assets:
- System prompts stay semantically equivalent but allow model-specific tuning, with lightweight adaptation fragments maintained per model.
- Context budgets are managed centrally, allocating token quotas across “system instructions + retrieved fragments + conversation history + current input”, and trimming by priority when the limit is exceeded rather than simply cutting off the head.
- Output structure constraints should prefer supported constrained decoding or structured output capabilities; when falling back to prompt-level constraints, validation and retry are required.
An illustrative budget allocation:
BUDGET = 32_000alloc = {"system": 1_500, "tools": 3_000, "history": 8_000}alloc["retrieved"] = BUDGET - sum(alloc.values()) - len(current_input)
Evaluation and Canary Rollout: Without an Eval Set, Multiple Models Are Uncontrollable
Once multiple models are in play, the risk of quality regressions multiplies. A workable path is a three-tier evaluation setup:
- Offline eval sets: covering high-frequency office tasks (meeting notes, email polishing, table understanding, contract key-point extraction, long-document summarization), with no fewer than a few hundred cases per category, measured by accuracy, format compliance rate, and refusal rate.
- Online canary: a new model first takes a small share of traffic and is compared against the baseline model on the same prompts, tracking adoption rate and human rewrite distance.
- Circuit breaking: when a backend’s error rate or latency crosses a threshold, automatically fall back to a backup model and raise an alert.
Cost control also needs engineering attention: set token and concurrency quotas per tier, cache results for high-frequency repeated requests, and retrieve over long documents before inference instead of stuffing entire materials into the context.
Implementation Recommendations
To build similar capabilities in your own system, proceed in the order of gateway first, routing second, evaluation as the safety net: unify the contract and instrumentation first, then integrate capabilities from multiple vendors incrementally, and finally rely on eval sets and canary mechanisms to keep quality from regressing. If running in the cloud, a container platform can host the gateway, a message queue can smooth traffic spikes, object storage can hold evaluation corpora, and logging plus monitoring and alerting services can complete end-to-end observability — all general capability categories, not a pointer to any specific vendor’s offering.
The value of many models on one platform is not the count. It is turning “choosing a model” from a human burden into a system capability.
