A Practical Guide to Multi-Model Selection and Tiered Routing in Office Scenarios
Enterprise office tasks vary significantly in complexity, making a single-LLM approach inefficient for both cost and quality. This guide explores how to implement a multi-model architecture by dividing models into tiers, routing requests based on task complexity, and balancing cost, latency, and quality. It also covers best practices for fallback mechanisms, evaluation systems, and data security to ensure robust LLM deployment in enterprise environments.
1. Background: Why Office Scenarios Need Multiple Models
Enterprise office tasks vary significantly in complexity. Writing meeting minutes, polishing emails, and translating short texts are lightweight tasks that are sensitive to response speed and require less reasoning depth. In contrast, comparing contract clauses, analyzing financial data, and summarizing across multiple documents require strong reasoning capabilities and longer context windows. Relying on a single model either wastes costs on simple tasks or compromises quality on complex ones.
Therefore, multi-model coexistence has become a standard practice for enterprise LLM deployment. Teams need to address three core questions: how to define model tiers, how to route tasks to the appropriate tier, and how to verify if the routing is optimal.
2. Model Tiering: Defining Tiers by Task Complexity
It is recommended to divide available models into three to four tiers, with each tier corresponding to a set of typical tasks.
| Tier | Typical Tasks | Key Metrics |
|---|---|---|
| Flagship | Complex reasoning, long document synthesis, code review | Accuracy, reasoning stability |
| Balanced | Medium-length document summarization, structured extraction, multi-turn QA | Balance of quality and cost |
| Lightweight | Short text rewriting, title generation, format conversion | Time to first token, cost per call |
When defining tiers, do not rely solely on model parameter descriptions; instead, base your decisions on your team’s actual task samples. The same model may perform very differently across different tasks, so tier classification must be confirmed through evaluation. Tier names are merely internal conventions and do not need to correspond to any external product names.
3. Task Routing: Assigning Requests to the Right Tier
Routing strategies generally fall into three categories:
- Rule-based routing: Directly determines the tier based on fields such as task type, input length, and reasoning requirements. It is simple to implement, highly explainable, and suitable for scenarios where task types are clear.
- Classifier routing: Uses a lightweight model or traditional classification method to first determine request difficulty, then assigns the tier. Suitable for scenarios with diverse request types where rules are hard to enumerate, but it adds an extra inference overhead to each request.
- Manual specification: The user selects the tier from the UI. Suitable for professional users with clear expectations for the output, but has a higher barrier for general users.
In practice, rule-based routing is often used as the foundation, with manual specification retained as a fallback. Below is an example of rule-based routing:
from dataclasses import dataclass@dataclassclass ModelTier:name: strmax_context_tokens: intlatency_budget_ms: intTIERS = {"flagship": ModelTier("flagship", 128_000, 15_000),"balanced": ModelTier("balanced", 64_000, 5_000),"light": ModelTier("light", 16_000, 1_500),}HIGH_REASONING_TASKS = {"contract_review", "data_analysis", "code_review"}LONG_DOC_TASKS = {"document_summary", "multi_doc_qa"}def route(task_type: str, input_tokens: int, user_override: str | None = None) -> str:if user_override in TIERS:return user_overrideif task_type in HIGH_REASONING_TASKS:return "flagship"if task_type in LONG_DOC_TASKS or input_tokens > 16_000:return "balanced"return "light"
The context lengths and latency budgets in the example are illustrative. Actual values should be set based on the parameters of the selected models and business requirements. Rule tables should be managed in configuration files to allow adjustments without changing the codebase.
4. Trade-offs: Cost, Latency, and Quality
To evaluate the cost of a single API call, you can use the following approximation:
Cost per call = Input tokens × Input price + Output tokens × Output price
Most pricing models charge a higher unit price for output tokens, making output length control just as important as input length control. For example, prompting the model to return the conclusion first, followed by no more than three supporting facts, is usually more cost-effective than letting the model generate freely. It is also easier to render in the UI.
Latency must also be analyzed separately. In interactive applications, the perceived wait time primarily stems from the time to first token and subsequent generation speed. Batch tasks focus more on throughput and total elapsed time, tolerating longer individual latencies but requiring concurrency control to avoid rate limits.
The relationship between the three dimensions can be summarized as follows: the flagship tier offers the highest quality but also the highest unit cost and latency, while the lightweight tier is the opposite. A reasonable approach is to set an acceptable quality floor for each task type, then select the lowest-cost tier that meets this floor. This concept can be termed “minimum cost selection satisfying constraints.”
5. Fallback and Fault Tolerance
Any external service may experience timeouts, rate limiting, or temporary outages. Office systems should implement fallback mechanisms at the model invocation layer to prevent users from encountering raw errors. Common practices include:
- Timeout retries: Perform a limited number of retries on the same tier with an incremental backoff period.
- Tier degradation: If the flagship tier is unavailable, automatically fall back to the balanced tier, and display a UI prompt indicating that the result may slightly differ.
- Circuit breaking: If a tier fails consecutively up to a threshold, pause calls to it for a period to prevent the failure from cascading through the system.
Below is an example of a fallback chain:
import timeclass TierUnavailable(Exception):passdef call_with_fallback(prompt: str, chain: list[str], call_fn, retries: int = 1):last_error = Nonefor tier in chain:for attempt in range(retries + 1):try:return tier, call_fn(tier, prompt)except TimeoutError as exc:last_error = exctime.sleep(0.5 * (attempt + 1))except TierUnavailable as exc:last_error = excbreakraise RuntimeError(f"All tiers failed: {last_error}")
Because fallback mechanisms can alter output quality, the system should log the actual tier used for each request. These logs are useful for post-mortem analysis and for determining whether a specific tier’s availability needs improvement.
6. Evaluation System: Verifying Model Selection
Selection conclusions must be validated through evaluation. The recommended evaluation process is as follows:
- Extract samples from real business operations to cover all task types. Prepare at least dozens of cases for each task type.
- Define auto-checkable criteria for each case, such as whether required fields are present, whether the output is valid structured format, or whether numerical values match the expected answer.
- Execute batch runs against candidate tiers, tracking the pass rate and latency percentiles (e.g., median and 95th percentile).
- For open-ended tasks that cannot be auto-evaluated, introduce manual spot-checks and record inter-rater reliability.
Example evaluation code:
import timeimport statisticsdef evaluate_tier(tier: str, cases: list[dict], call_fn, checker) -> dict:passed = 0latencies_ms = []for case in cases:start = time.perf_counter()output = call_fn(tier, case["prompt"])latencies_ms.append((time.perf_counter() - start) * 1000)if checker(output, case["expected"]):passed += 1return {"tier": tier,"pass_rate": round(passed / len(cases), 3),"p50_ms": round(statistics.median(latencies_ms), 1),"p95_ms": round(sorted(latencies_ms)[int(len(latencies_ms) * 0.95) - 1], 1),}
Evaluation results should be re-run periodically. Model version updates, prompt adjustments, or shifts in business data can all change previous conclusions. It is recommended to version-control the evaluation set and run a full evaluation before modifying routing rules.
7. Data Security and Access Control
Office data often contains contracts, HR, and financial information. When integrating multiple models, pay special attention to the following:
- Data classification: Clearly define which data can be processed by external services and which must remain in the internal environment.
- Desensitization: Before sending requests, mask sensitive fields such as ID numbers, bank account numbers, and phone numbers. Restore the original values when processing the output.
- Least privilege: Store API keys in a key management service, grant permissions separately by application and runtime environment, and rotate them regularly.
- Log management: Record request metadata for auditing. Prompt and output content should be handled according to retention policies to avoid storing plaintext logs long-term.
