Multi-Model Integration for an Office Platform: Architecture, Routing, and Evaluation

    This article explains how an office collaboration platform moved from offering three model options to managing a pool of ten, and what that shift requires architecturally. It covers a five-layer decoupled design, an internal capability matrix built from real load tests, a three-tier routing and fallback strategy with cost controls, structured output validation and citation tracing, observability and canary rollout, and a practical implementation checklist. The goal is to treat models as replaceable compute backends while making routing, validation, and evaluation the durable product assets.

    1. The Real Problem: From Picking One Model to Managing a Model Pool

    An office collaboration platform expanded its model options from three tiers to ten in a single release, spanning several major model providers and covering flagship, lightweight, and preview tiers. On the surface this is just more product choice. In practice the architectural question has shifted: the system is no longer optimized around a single model, but must decide how to dispatch work correctly across a heterogeneous pool.

    The specific model families and versions are abstracted here into four roles:

    • Flagship general-purpose tier: complex reasoning, long-form writing, cross-document synthesis;
    • Lightweight high-throughput tier: classification, extraction, rewriting, tagging, and other high-concurrency short tasks;
    • Long-context / multimodal tier: entire contracts, transcribed meeting recordings, table screenshots;
    • Preview tier: exploring capability ceilings, never on a production critical path.

    These four roles are the coordinate system for every engineering decision that follows.

    2. Target Architecture: Five Decoupled Layers

    Split capabilities into five layers so that swapping a model in any one layer leaves the others untouched:

    1. Access adapter layer: unified authentication, retries, timeouts, rate limiting, streaming passthrough;
    2. Capability abstraction layer: stable internal interfaces for inference, extraction, generation, and embedding;
    3. Routing decision layer: model selection based on task profile, cost budget, and latency target;
    4. Constraints and validation layer: structured output, citation tracing, sensitive-data redaction;
    5. Observability and evaluation layer: instrumentation, offline evaluation sets, online canary and rollback.

    The key principle: business code depends only on the capability abstraction layer, and no concrete model identifier string ever appears in it.

    1. # Illustrative: capability abstraction and route registration (pseudocode)
    2. class TaskProfile:
    3. task_type: str # summarize / extract / rewrite / chat
    4. max_input_tokens: int
    5. latency_budget_ms: int
    6. cost_ceiling: float # per-request cost ceiling
    7. need_citation: bool
    8. def route(p: TaskProfile, pool):
    9. cands = [m for m in pool if m.supports(p.task_type)
    10. and m.ctx >= p.max_input_tokens]
    11. cands.sort(key=lambda m: (m.p95_latency > p.latency_budget_ms,
    12. m.unit_cost, -m.quality_score))
    13. return cands[0]

    3. Capability Matrix: Do Not Trust Vendor Claims, Run Your Own Load Tests

    With ten models on the same stage, the biggest trap is assuming one prompt set fits all. Build an internal capability matrix with these dimensions: effective context length (note the gap between advertised length and effective recall length), structured output stability, factual consistency in long text, dialect and domain terminology handling, concurrency quota, time to first token and total latency, and cost per token.

    For methodology, assemble a golden set of 200–500 real business samples and run double-blind scoring in parallel with automated metrics. Re-run the regression every time a model or prompt changes. The recurring pattern: lightweight tiers are usually close to flagship tiers on extraction and classification, but clearly behind on multi-hop reasoning and long-form consistency, which is exactly where layered routing pays off.

    4. Routing Strategy: Three-Tier Fallback and Cost Control

    • Tier 1: rule-based routing. Task type maps directly to a model role, covering 80% of traffic;
    • Tier 2: quality routing. Low confidence (JSON parse failure, failed validation) automatically escalates to the flagship tier for one retry;
    • Tier 3: circuit-breaker fallback. When quota is exhausted or latency exceeds threshold, switch to a backup model and return a “partial result + pending computation” marker.

    Cost control essentials: prompt prefix caching, batching short tasks, hierarchical summarization (summarize, then summarize the summary), and retrieval-based trimming of long documents before they enter the model. Put “cost per thousand office requests” and “manual rework rate” on the same dashboard so that squeezing cost does not quietly cancel out the gains through rework.

    5. Structured Output and Trustworthiness

    Office scenarios are extremely sensitive to format. Use constrained decoding or strict output mode, then validate against a schema server-side with automatic repair and retry:

    1. {"action":"create_event","title":"Weekly Sync","attendees":["A","B"],"start":"2026-09-01T10:00:00+08:00"}

    Add citation tracing as well: every conclusion in generated content points back to a numbered source fragment so a human can verify it. For tables and numeric output, use a two-stage “extract first, then compute” flow and forbid the model from doing arithmetic in its head, which substantially reduces numeric hallucination.

    6. Observability and Canary Rollout

    Standard instrumentation fields: request ID, routing decision, fallback count, token usage, validation failure reason, user adoption rate. Roll out with shadow traffic and percentage-based canary: a new model first “runs but does not answer,” differences are compared, and only then does traffic increase. Keep the ability to roll back to the previous routing table with one action.

    7. Implementation Checklist

    1. Build the capability abstraction and adapter layers; remove hardcoded model identifiers;
    2. Build the golden evaluation set and regression pipeline;
    3. Ship three-tier routing with circuit-breaker fallback;
    4. Enforce structured output validation and citation tracing;
    5. Build a joint dashboard for cost, latency, and adoption rate;
    6. Isolate preview-tier models in a sandbox, out of the production path.

    8. Conclusion

    Going from three tiers to ten models does not increase engineering complexity linearly; the cost depends on whether the abstraction is in place. Treat models as replaceable compute backends and treat routing, validation, and evaluation as the real product assets, and you can capture quality, cost, and compliance at the same time in the multi-model era. If an organization already uses Baidu AI Cloud, the same layered approach can be carried over with general-purpose categories such as container platforms, message queues, logging services, and monitoring and alerting, without binding to any specific implementation.