Multi-Model Selection and AI Asset Quota Governance for Enterprise Office Workloads

    When an enterprise adopts large language models, three problems typically emerge: unreliable output for complex tasks, high per-call costs for routine tasks, and no clear boundaries between departments over model usage. This article walks through a three-step approach: classify tasks by complexity to choose models, govern AI assets with roles, quotas, and data classification, and connect the two through a routing gateway. Model names, quota numbers, and alert thresholds in this article are examples only—before production use, re-measure them against vendor terms, real traffic, and actual billing.

    1. Classify Tasks First, Then Choose Models

    Model selection should be driven by the task itself, not by a model’s parameter count. To decide which tier a task belongs to, evaluate four dimensions: input length, degree of output structure, latency requirements, and the cost of a single failure. The table below compares the two tiers.

    Dimension Deep Reasoning Tier Lightweight Daily Tier
    Typical tasks Rule analysis, plan review, 3D display data generation Copywriting, information extraction, content summarization
    Input length Tens of thousands of tokens; requires reading the full document Typically hundreds to a few thousand tokens
    Output requirements Structured results that must pass validation Free-form text or simple fields
    Latency target Seconds to tens of seconds is acceptable First-token response within hundreds of milliseconds
    Cost per call Higher Lower
    Failure cost High—an incorrect conclusion may flow into business processes Low—can be retried or fixed manually
    Fallback strategy Retry with an alternate model in the same tier; escalate to a manual queue if it still fails Retry with an alternate model in the same tier; return a failure status and enqueue if it still fails

    3D display data generation falls into the deep reasoning tier and needs dedicated constraints. A model’s spatial coordinates or data structures can only be used directly for rendering if three prerequisites are met: the output format is a fixed, explicit schema with a version number; an automated validation program is in place; and manual spot checks are performed before rendering—for example, a 10% sampling rate per batch. When validation fails, the system retries once, then routes the task to manual handling. The person responsible for reviewing key conclusions is designated by the project lead. Models can reduce some manual validation work, but they cannot replace this review step.

    The core metric for the lightweight daily tier is time to first token (TTFT). It depends directly on the model, region, concurrency level, and input length, so always state the test conditions when reporting it. Use P95 as the statistical measure—for example, “under load testing with model X, region Y, concurrency of 50, and input of roughly 500 tokens, P95 was below 500 ms.” Unit cost only drops when request distribution is stable, cache hit rates are high, and batching is effective. Base any cost reduction claims on load tests and actual bills; never promise numbers in advance.

    2. Govern AI Assets with Roles, Quotas, and Data Classification

    Once multiple models are in play, the question shifts from “which model to choose” to “who can use which model.” Without boundaries, compute resources are easily abused, and sensitive data may be sent to non-compliant models. Use role-based access control (RBAC) to bind roles, model categories, token quotas, approval workflows, and revocation conditions together. The table below shows an example configuration.

    Role or Scope Allowed Model Categories Daily Token Quota (Example) Provisioning Revocation
    R&D engineers Deep reasoning, lightweight daily 2,000,000 Approved by department head Auto-revoked on transfer or departure
    Administrative staff Lightweight daily 200,000 Approved by department head Auto-revoked on transfer
    3D visualization task force Deep reasoning (multimodal API) 3,000,000 Requested by project lead, valid for 90 days Auto-revoked on expiry; renewable via the standard process
    Senior experts Deep reasoning, lightweight daily 5,000,000, with an alert at 80% usage Approved by administrator Revoked on role change

    A common mistake is granting unlimited quotas to executives or experts. Once an unlimited account’s key leaks, the loss is unbounded. Even top-privilege roles need quotas and alerts.

    Beyond the quota table, add the following rules (examples):

    • Daily quotas reset at midnight (UTC+8); monthly quotas reset on the first day of each calendar month.
    • Set a concurrency limit per department; queue requests that exceed it instead of letting them through.
    • Reject new requests when quotas are exhausted. Do not automatically downgrade deep reasoning tasks to lightweight models, since downgrading changes output reliability.
    • Alert department heads when usage reaches 80%. Also trigger an alert when a single account makes calls across departments, for administrator review.

    Data classification is the third boundary. For tasks involving customer information or unpublished financial data, determine the data’s classification level under your enterprise’s rules first, then decide which models it may be routed to. The example mapping below should be finalized by your data governance team.

    Data Level Allowed Model Categories (Example)
    Public Deep reasoning, lightweight daily
    Internal Deep reasoning, lightweight daily
    Confidential Lightweight daily only

    Audit logging is equally essential. Record the requester, department, model, token count, timestamp, and status for every call, with retention following your enterprise audit policy. Do not log raw prompts, to keep sensitive content out of logging systems.

    3. Routing Gateway Skeleton Code

    The gateway sits between business logic and model vendors. Each request passes, in order, through department permission checks, data classification checks, quota pre-checks, cost-based model selection, retries with failed models excluded, quota deduction, and audit log writing.

    The code below is a skeleton. It runs locally after copying and demonstrates the flow, but it is not production-ready. call_model is a placeholder—replace it with a vendor SDK call in production. Quota storage is an in-memory dict, which will over-spend under concurrency; use atomic operations in Redis or a database in production. estimate_tokens is only a rough approximation—use the vendor’s tokenizer in production.

    1. import json
    2. import logging
    3. import time
    4. import uuid
    5. from typing import Dict, Optional, Set, Tuple
    6. logging.basicConfig(level=logging.INFO, format="%(message)s")
    7. logger = logging.getLogger("model_gateway")
    8. # Model names are examples, not real products. Fill in versions, timeouts, and
    9. # cost weights according to vendor documentation and actual bills.
    10. MODEL_CATALOG = {
    11. "flagship_model_v3_pro": {"category": "complex_reasoning", "timeout_s": 60, "cost_weight": 5, "available": True},
    12. "deep_think_model_v4": {"category": "complex_reasoning", "timeout_s": 90, "cost_weight": 6, "available": True},
    13. "flash_model_v3": {"category": "lightweight_daily", "timeout_s": 5, "cost_weight": 1, "available": True},
    14. "lite_model_v4_1": {"category": "lightweight_daily", "timeout_s": 5, "cost_weight": 1, "available": True},
    15. }
    16. SCENARIO_ROUTING = {
    17. "rule_analysis": "complex_reasoning",
    18. "schema_check": "complex_reasoning",
    19. "3d_generation": "complex_reasoning",
    20. "copywriting": "lightweight_daily",
    21. "info_extraction": "lightweight_daily",
    22. "content_summary": "lightweight_daily",
    23. }
    24. # Allowed model categories per department (example)
    25. USER_PERMISSIONS = {
    26. "dept_research": {"complex_reasoning", "lightweight_daily"},
    27. "dept_admin": {"lightweight_daily"},
    28. }
    29. # Mapping from data level to allowed model categories
    30. # (example; determined by the data governance team). Unlisted levels are always rejected.
    31. DATA_CLASS_POLICY = {
    32. "public": {"complex_reasoning", "lightweight_daily"},
    33. "internal": {"complex_reasoning", "lightweight_daily"},
    34. "confidential": {"lightweight_daily"},
    35. }
    36. # Daily token quotas per department (example)
    37. DAILY_TOKEN_QUOTA = {"dept_research": 2_000_000, "dept_admin": 200_000}
    38. ALERT_RATIO = 0.8
    39. MAX_RETRIES = 2
    40. # Current-day usage. In production, store this in Redis or a database and use
    41. # atomic increments/decrements, otherwise concurrency will cause over-spending.
    42. USAGE_TODAY: Dict[str, int] = {}
    43. class GatewayError(Exception):
    44. """Expected rejection, e.g. insufficient permissions, disallowed data level, or quota exhaustion."""
    45. def call_model(model: str, prompt: str, timeout_s: int) -> Tuple[str, int]:
    46. """Placeholder implementation; returns (result text, actual tokens consumed).
    47. Replace with a vendor SDK call in production and pass timeout_s to the client.
    48. Map vendor timeout, rate-limit, and auth errors to TimeoutError or ConnectionError before raising."""
    49. if not MODEL_CATALOG[model]["available"]:
    50. raise ConnectionError(f"{model} unavailable")
    51. tokens = len(prompt) // 2 + 50
    52. return f"[{model}] processed", tokens
    53. def estimate_tokens(prompt: str) -> int:
    54. """Rough estimate, used only for quota pre-checks. Use the vendor's tokenizer in production."""
    55. return max(1, len(prompt) // 2)
    56. def pick_model(category: str, excluded: Set[str]) -> Optional[str]:
    57. """Select by cost weight in ascending order, skipping models that already failed for this request."""
    58. candidates = [
    59. (name, meta) for name, meta in MODEL_CATALOG.items()
    60. if meta["category"] == category and meta["available"] and name not in excluded
    61. ]
    62. if not candidates:
    63. return None
    64. return min(candidates, key=lambda item: item[1]["cost_weight"])[0]
    65. def audit(record: Dict) -> None:
    66. # Log metadata only; never log raw prompts
    67. logger.info(json.dumps(record, ensure_ascii=False))
    68. def record_usage(dept: str, tokens: int) -> None:
    69. USAGE_TODAY[dept] = USAGE_TODAY.get(dept, 0) + tokens
    70. quota = DAILY_TOKEN_QUOTA.get(dept, 0)
    71. if quota and USAGE_TODAY[dept] >= quota * ALERT_RATIO:
    72. logger.warning(json.dumps(
    73. {"event": "quota_alert", "dept": dept, "used": USAGE_TODAY[dept], "quota": quota},
    74. ensure_ascii=False,
    75. ))
    76. def route_model_request(user_dept: str, task_type: str, data_class: str, prompt: str) -> Dict:
    77. request_id = str(uuid.uuid4())
    78. started = time.monotonic()
    79. record = {
    80. "request_id": request_id, "dept": user_dept, "task_type": task_type,
    81. "data_class": data_class, "model": None, "attempts": 0, "tokens": 0,
    82. "status": "started",
    83. }
    84. try:
    85. # 1. Department permission check
    86. category = SCENARIO_ROUTING.get(task_type)
    87. if category is None or category not in USER_PERMISSIONS.get(user_dept, set()):
    88. raise GatewayError("PERMISSION_DENIED")
    89. # 2. Data classification check
    90. if category not in DATA_CLASS_POLICY.get(data_class, set()):
    91. raise GatewayError("DATA_POLICY_DENIED")
    92. # 3. Quota pre-check
    93. used = USAGE_TODAY.get(user_dept, 0)
    94. quota = DAILY_TOKEN_QUOTA.get(user_dept, 0)
    95. if used + estimate_tokens(prompt) > quota:
    96. raise GatewayError("QUOTA_EXCEEDED")
    97. # 4. Pick a model; on failure, exclude tried models and retry
    98. excluded: Set[str] = set()
    99. for attempt in range(1, MAX_RETRIES + 2):
    100. model = pick_model(category, excluded)
    101. if model is None:
    102. break
    103. record["attempts"] = attempt
    104. try:
    105. text, tokens = call_model(model, prompt, MODEL_CATALOG[model]["timeout_s"])
    106. except (TimeoutError, ConnectionError):
    107. excluded.add(model)
    108. continue
    109. # 5. Deduct quota only for successful calls
    110. record_usage(user_dept, tokens)
    111. record.update(model=model, tokens=tokens, status="ok")
    112. return {"request_id": request_id, "status": "ok", "model": model, "result": text}
    113. record["status"] = "failed"
    114. return {"request_id": request_id, "status": "failed", "reason": "All models failed; escalate to manual handling"}
    115. except GatewayError as exc:
    116. record["status"] = str(exc)
    117. return {"request_id": request_id, "status": "rejected", "reason": str(exc)}
    118. finally:
    119. record["latency_ms"] = round((time.monotonic() - started) * 1000)
    120. audit(record)
    121. if __name__ == "__main__":
    122. print(route_model_request("dept_admin", "copywriting", "internal", "Write a weekly meeting notice"))
    123. print(route_model_request("dept_admin", "rule_analysis", "internal", "Summarize reimbursement rules"))
    124. print(route_model_request("dept_research", "rule_analysis", "confidential", "Analyze customer contract terms"))

    A few implementation notes. The timeout parameter timeout_s only takes effect when configured through the vendor SDK’s client settings—passing it as a function argument does nothing. Failed requests are not charged against the quota in this code, but if the vendor still bills for failed calls, treat the bill as the source of truth.