Multi-Model Architecture for an Office Platform: Design and Practice
This article explains how to build an office platform that integrates multiple large language models. It covers a unified model abstraction layer, capability-based routing strategies, tier design, an evaluation system, cost and capacity governance, and an engineering implementation checklist. The goal is to treat models as replaceable, schedulable resources so the platform can balance quality, latency, and cost while staying stable as models evolve rapidly.
1. Background: Why Office Platforms Are Moving to Multiple Models
In office applications, user needs are highly fragmented: writing emails, editing copy, summarizing, extracting table fields, generating meeting notes, and reviewing contract clauses all demand very different model capabilities. Early platforms typically offered only three options—“Standard,” “Advanced,” and “Flagship”—and relied on a single model family to cover every task. As models began iterating faster, this single-tier approach exposed three problems:
- Capability mismatch: Lightweight tasks running on heavy models inflate latency and cost; difficult tasks running on light models produce unstable output quality.
- Supply risk: When a single model hits rate limits, rolls back a version, or changes policy, the business has no smooth degradation path.
- One-dimensional experience: Different users prefer different trade-offs between “fast” and “accurate,” and there is no explainable space for choice.
As a result, integrating multiple models at once and forming a “model shelf” turns models from a fixed dependency into a schedulable resource. This is not simply expanding a dropdown menu—it is an architectural upgrade.
2. Core Design: A Unified Model Abstraction Layer
The first principle of multi-model integration is that business code should not be aware of specific models. The recommended approach is to build a unified abstraction layer on the server side and confine differences within adapters.
from dataclasses import dataclassfrom typing import Protocol@dataclassclass ModelRequest:messages: list[dict]temperature: float = 0.3max_tokens: int = 1024stream: bool = Falseclass ModelAdapter(Protocol):name: strcapabilities: set[str] # {"chat","long_context","json","vision"}def invoke(self, req: ModelRequest) -> str: ...class Registry:def __init__(self):self._adapters: dict[str, ModelAdapter] = {}def register(self, adapter: ModelAdapter):self._adapters[adapter.name] = adapterdef get(self, name: str) -> ModelAdapter:return self._adapters[name]
The abstraction layer should explicitly declare capability tags rather than only model names—for example, whether a model supports long context, structured output, streaming responses, or multimodal input. This way, routing decisions are based on capabilities rather than marketing tiers.
3. Routing Strategy: From “User Selects” to “System Recommends”
If a multi-model shelf is left entirely to users, it significantly raises decision costs. A more mature approach is three-layer routing:
- L1 rule-based routing: Hard-match by task type. Summarization and extraction go to tiers with long context and high stability; creative rewriting goes to low-latency tiers; code and tables go to tiers with strong structured-output capabilities.
- L2 quality routing: For the same task, request two candidate models in parallel and use lightweight checks (format validity, field completeness rate, length constraints) to pick the better result.
- L3 fallback routing: When the primary model times out or hits rate limits, automatically degrade to a backup model and mark the degradation in the response for later auditing.
Illustrative logic:
def route(task: str, registry: Registry, req: ModelRequest):plan = {"summarize": ["long_ctx_a", "fast_b"],"extract": ["json_a", "json_b"],"rewrite": ["fast_b", "fast_c"],}[task]last_err = Nonefor name in plan:try:return registry.get(name).invoke(req)except Exception as e:last_err = eraise RuntimeError(f"all models failed: {last_err}")
4. Task Classification and Tier Design
Keeping the concept of “tiers” is user-friendly, but tiers should be defined by capability combinations rather than bound to a single model:
| Tier | Goal | Typical Configuration |
|---|---|---|
| Ultra-fast | Prioritize time to first token | Lightweight model + short context |
| Standard | Balance quality and cost | Mid-tier model + structured constraints |
| Deep | Prioritize complex reasoning | Strong reasoning model + long context + multi-candidate validation |
The key point is that multiple replaceable implementations can sit behind the same tier. The tier stays stable externally while allowing canary switching internally.
5. Evaluation System: No Evaluation, No Multi-Model
The biggest risk of a multi-model platform is “switching by gut feeling.” You must build a dual closed loop of offline evaluation sets and online metrics:
- Offline set: Stratified sampling by office scenario, covering summarization, extraction, rewriting, Q&A, and table understanding, with reference answers and hard constraints annotated.
- Automated metrics: Format compliance rate, field accuracy rate, citation coverage rate, length-out-of-bounds rate, and refusal rate.
- Human spot checks: Keep a human review channel for high-risk scenarios (contracts, finance, external-facing copy).
- Online metrics: Time to first token, end-to-end latency, failure rate, degradation rate, and user rewrite rate.
Evaluation results should flow back into routing configuration, forming a loop of “evaluate—tune—canary—re-evaluate.”
6. Cost and Capacity Governance
Running multiple models in parallel amplifies costs, requiring three governance measures:
- Budget quotas: Set token budgets and concurrency limits per tenant/scenario, automatically degrading to a lightweight tier when exceeded.
- Cache reuse: Apply semantic caching to high-frequency identical requests and return on cache hits to reduce repeated inference.
- Batching and asynchrony: Route non-real-time tasks (batch summarization, nightly reports) through an asynchronous queue to smooth out peaks and fill valleys.
It is also recommended to log the following for each call: task type, model identifier, token consumption, latency, and whether degradation occurred. This log supports later cost attribution, and logging and monitoring can rely on general-purpose logging services and monitoring/alerting capabilities.
7. Engineering Implementation Checklist
- Establish a model registry and capability-tag specification; prohibit hardcoding model names in the business layer.
- Implement a unified adapter for each model to isolate protocol differences and error semantics.
- Manage the routing table in a configuration center, supporting canary rollout by scenario and one-click rollback.
- Enforce end-to-end timeouts and retry budgets to avoid cascading timeouts.
- Build a structured-output validation middleware to uniformly handle JSON parsing failures and missing fields.
- Establish degradation marking and user-notification conventions to avoid “silent degradation” that damages trust.
- Security and compliance: input masking, output auditing, and mandatory human review for sensitive scenarios.
8. Conclusion
Behind the product move of “launching multiple models at once,” what is truly tested is the platform’s layered abstraction, routing and scheduling, evaluation loop, and cost governance. By designing models as replaceable resources, office applications can continuously balance quality, latency, and cost, and keep the architecture stable as models iterate rapidly.
