Multi-Model Integration in an Office Platform: A Technical Practice
This article explains how to build an office automation platform that routes tasks across multiple LLM models. It covers a control plane and data plane architecture, model registration with capability tags, three-tier model classification, routing strategies based on rules, scoring, and canary releases, unified adaptation of context and tool calls, and evaluation, cost, and observability practices. Readers will find practical configuration examples and implementation recommendations.
1. Background: Why Office Scenarios Need Multiple Models on One Platform
Office automation involves highly diverse task types. Some tasks are short-text rewriting, formatting, and information extraction, where response latency matters most. Others are long-document understanding, cross-document comparison, and complex reasoning, where logical consistency is critical. Still others involve site structure generation, table processing, and multi-step execution, where tool orchestration and state management are essential. A single model can rarely be optimal across all these dimensions, so selecting models on demand within the same working environment becomes a natural engineering choice.
From a system perspective, the core change is that a model is no longer a single global dependency but a pluggable pool of capabilities. The platform must solve four problems: how models are registered and versioned, how requests are routed, how context and tools are adapted to different models, and how cost and quality are measured.
2. Overall Architecture: Separating the Control Plane from the Data Plane
It is recommended to split the system into a control plane and a data plane. The control plane handles model registration, capability tags, quotas, and policies. The data plane handles request parsing, routing, invocation, post-processing, and logging.
Client -> Gateway (auth/rate limit) -> Routing Layer -> Adapter Layer -> Model Capability Pool|-> Evaluation & Sampling -> Metrics/Logs/Alerts
- Model registration: describe models with capability tags (low latency, strong reasoning, long context, multi-step execution) rather than hard-coding model names.
- Routing layer: make decisions based on task tags, historical success rate, latency budget, and quotas.
- Adapter layer: unify message structures, tool-calling protocols, and error codes to hide differences between models.
3. Model Tiers and Task Mapping
Dividing models into three tiers makes governance easier: a lightweight tier (extraction, classification, rewriting), a main tier (summarization, writing, general Q&A), and a reasoning tier (complex analysis, code, and multi-step planning). Mapping rules should be configurable, for example maintained in a configuration center:
routes:- task: summarizetier: lightmax_latency_ms: 1200- task: analyzetier: reasoningmin_context: 32k- task: site_buildertier: reasoningtools: [file, browser, shell_sandbox]
The key point is that task tags are produced by an entry classifier rather than requiring users to select a model manually. Advanced users can override the policy, but automatic routing is the default.
4. Routing Strategy: Rules, Scoring, and Canary Releases
Routing can combine three layers of strategy: hard constraints (context length, tool-calling support), scoring (quality score × weight − latency penalty − cost penalty), and canary releases (small-traffic validation of a new version). Example code:
def choose(cands, task):cands = [c for c in cands if c.satisfy(task.hard)]cands.sort(key=lambda c: -(c.quality*0.6 - c.latency*0.2 - c.cost*0.2))return canary(cands, task)
During the canary stage, a fixed evaluation set and regression thresholds should be used to avoid hidden quality regressions caused by version upgrades.
5. Unified Adaptation of Context and Tool Calls
Models differ in long-context handling, adherence to system prompts, and tool-calling formats. The adapter layer should do three things: unify message and role conventions; split and summarize overly long inputs; and convert tool calls into a unified intermediate representation before serializing them into formats each model accepts. For multi-step tasks, introduce a state machine and checkpoints so that failures can roll back to the last stable state.
6. Evaluation, Cost, and Observability
Establish dual tracks of an offline evaluation set (high-frequency office tasks) and online sampling. Metrics include task success rate, latency percentiles, cost per task, and tool-call success rate. Logs should record routing reasons and versions for traceability. For cost governance, set tenant-level quotas and fallback policies: under high load, automatically switch to the lightweight tier and notify the user.
7. Implementation Recommendations
Launch first with automatic routing plus three-tier classification, then gradually introduce the reasoning tier and tool orchestration. Make evaluation and canary releases prerequisites for deployment. Add manual confirmation for high-risk actions (sending, deleting, external sharing). Baidu AI Cloud can provide foundational capabilities such as container platforms, message queues, log services, and monitoring and alerting on general cloud services to carry the control plane and data plane described above, but specific choices should be evaluated based on business scale and compliance requirements.
