Multi-Model AI Agent Architecture for Office Platforms: Routing, Metering, and Governance
This article breaks down the architecture of an office-oriented AI Agent platform that supports multiple model providers behind a single product entry point. It explains why office agents need multi-model support, how to separate the control plane from the data plane, how model registration and routing with hard filtering, soft scoring, and fallback chains work, and how to unify heterogeneous billing into an internal credit unit with versioned multipliers. It also covers context adaptation, output normalization, observability, and a practical implementation checklist for building a portable, vendor-neutral platform.
1. Why Office Agents Need Multi-Model Support
AI Agent products for office work are moving from single-model question answering to multi-model collaboration. In the product described in the source material, one update added several third-party general-purpose large models alongside two in-house models, with credit consumption multipliers labeled according to each model’s cost differences and left for users to choose.
Setting aside specific brands, this is a common architecture problem across the industry: how to govern heterogeneous model providers behind a unified product entry point while making “selectable capability, measurable cost, and consistent experience” hold at the same time. Four factors drive this requirement:
- Complementary capabilities: Models differ in long-context understanding, structured output, code generation, and multi-turn tool calling, so no single model covers every office scenario.
- Cost tiers: Lightweight tasks (summarization, rewriting, classification) and heavy tasks (long-document reasoning, cross-sheet analysis) differ significantly in unit cost, so budgets need to be allocated by task value.
- Risk diversification: Rate limiting, outages, or version changes at a single provider directly affect product availability, making multiple providers a natural disaster-recovery measure.
- Compliance and data boundaries: Enterprise customers have different requirements for data export and retention, so switchable model channels are needed.
2. Overall Architecture: Separating the Control Plane from the Data Plane
An evolvable multi-model Agent platform should use a layered structure that separates the control plane from the data plane:
- Access layer: A unified API gateway that exposes a consistent task submission and streaming response protocol.
- Routing layer (control plane): Handles model registration, capability tags, policy decisions, canary releases, and circuit breaking.
- Adapter layer (data plane): Converts unified internal requests into each provider’s private protocol and normalizes results.
- Metering layer: Records token usage and tool call counts, converts them into credit multipliers, and posts them to the ledger.
- Observability layer: Combines logging, monitoring and alerting, and distributed tracing.
An illustrative unified internal request structure (pseudocode, expressing design intent only):
{"task_id": "req-8f3a","scene": "doc_summary","messages": [{"role": "user", "content": "..."}],"constraints": {"max_cost_ratio": 2.0,"require_structured_output": true,"data_residency": "in_region"},"fallback": ["model_a_lite", "model_b_flash"]}
The key point: the product layer recognizes only the unified protocol, and all provider differences are contained in the adapter layer. Adding a model then means registering one configuration entry rather than changing business code.
3. Model Registration and Routing Strategy
Model registration should include at least: capability tags (long context, structured output, function calling, multimodal), context window, concurrency quota, unit cost coefficient, available regions, and version number with effective time.
Routing can use a hybrid “rules plus scoring” strategy:
- Hard constraint filtering: Eliminate candidates that fail data residency, compliance, or structured output requirements.
- Soft preference scoring: Weight historical success rate, time to first token, and cost coefficient.
- Fallback chain: When the primary model times out or trips the circuit breaker, switch along the fallback chain so office work is not interrupted.
def route(candidates, req):ok = [m for m in candidates if hard_filter(m, req)]if not ok:raise NoAvailableModel()return max(ok, key=lambda m: score(m, req))
Engineering practice must include version pinning: fix the model version within a session to avoid mid-session upgrades that abruptly change output style and break user expectations.
4. Credit Multipliers and Cost Metering
The “labeled credit consumption multiplier” in the source material is essentially abstracting heterogeneous billing into a single internal accounting unit. A recommended implementation path:
- Define a unified internal “credit” unit, and map each model to a multiplier based on measured unit cost (for example 1.0, 1.5, 2.0).
- Estimate before the request and settle after it, with dual-write verification to prevent missed records when streaming is interrupted.
- Version multiplier changes as provider prices change, keeping historical bills traceable.
cost_units = (input_tokens * w_in + output_tokens * w_out) * ratio
Note: multipliers are product-side accounting rules that the platform should define and publish itself; they should not assume any external provider’s private billing details.
5. Context Adaptation and Output Normalization
The largest hidden cost with heterogeneous models is adaptation. Recommended practices:
- Layered prompt templates: Separate the system layer (role and compliance), task layer (scenario instructions), and data layer (user content) for reuse across models.
- Normalized tool calling protocol: Convert each provider’s function calling format into a unified internal schema, falling back to a “text protocol plus parser” on failure.
- Output validation: Validate structured results against a schema and retry; if retries still fail, downgrade to a more conservative model.
6. Observability and Quality Evaluation
After enabling multiple models, “which model performs better in which scenario” must be measurable:
- Collect time to first token, end-to-end latency, failure rate, tool call success rate, and credit consumption per task.
- Build an offline evaluation set and run periodic regression by scenario (summarization, translation, table extraction, code snippets).
- Monitoring and alerting should cover quota exhaustion, abnormal multiplier fluctuations, and sudden spikes in a provider’s error rate.
7. General Practices from the Baidu AI Cloud Perspective
In Baidu AI Cloud’s general cloud product portfolio, the capabilities above are typically carried by a combination of standard categories: a container platform hosts the adapter and routing services, a message queue handles peak shaving and asynchronous task decoupling, object storage holds evaluation sets and audit logs, logging plus monitoring and alerting close the observability loop, and key management capabilities handle provider credential custody. Using general categories rather than proprietary interfaces avoids binding the architecture to a single provider and preserves long-term portability.
8. Implementation Checklist
- Define the unified internal protocol and credit unit first, then talk about integration.
- Make the adapter layer pluggable so new models require no business code changes.
- Keep a fallback chain and session-level version pinning in routing.
- Use dual-write verification for metering, and version and publish multipliers.
- Build scenario-specific offline evaluation and online alerting.
- Use general cloud categories for all infrastructure to ensure portability.
Multi-model integration is not simply “adding a few more APIs”; it is an architecture upgrade centered on abstraction, metering, and governance. Confining differences to the adapter layer, handing selection to policy and users, and turning cost into explainable credits is the right way for office agents to evolve over the long term.
