Optimize AI model routing portfolio

Choose one evidenced AI-model route per workload on a value/CVaR Pareto frontier under hard privacy, residency, retention, quality, latency, endpoint-capacity, route-availability, provider-diversity, concentration, budget and dependency constraints.

What it's for

Chooses which model handles which workload against quality, latency, residency, capacity and budget limits at once, instead of defaulting everything to the largest model.

Gives CTOs and investors a finance-aware multi-model routing policy that balances quality and latency with data sovereignty, capacity, common-provider failure and concentration tail risk.

What you give it

Inputs split into evidence read from your connected systems, calibration your team owns, and numerical controls that affect precision but never the result's meaning.

Field Type Role Required
beam_width integer ≥ 1, ≤ 10000 Numerical control Optional
exact_enumeration_limit integer ≥ 1, ≤ 1000000 Your calibration Optional
implementation_budget number ≥ 0 Your calibration Yes
max_detail_rows integer ≥ 1, ≤ 500 Numerical control Optional
maximum_cvar_total_loss any Your calibration Optional
maximum_endpoint_overload_probability number ≥ 0, ≤ 1 Your calibration Optional
maximum_expected_operating_cost any Your calibration Optional
maximum_expected_total_loss any Your calibration Optional
maximum_latency_breach_probability number ≥ 0, ≤ 1 Your calibration Optional
maximum_provider_concentration_fraction number ≥ 0, ≤ 1 Your calibration Optional
maximum_quality_breach_probability number ≥ 0, ≤ 1 Your calibration Optional
maximum_route_unavailability_probability number ≥ 0, ≤ 1 Your calibration Optional
minimum_distinct_providers_for_high_impact integer ≥ 1, ≤ 100 Your calibration Optional
model_endpoints array of objects (6 fields) Evidence Yes
risk_aversion number ≥ 0 Your calibration Optional
routing_options array of objects (15 fields) Evidence Yes
scenarios array of objects (4 fields) Evidence Yes
tail_probability number ≥ 0.001, ≤ 0.5 Your calibration Optional
workload_classes array of objects (9 fields) Evidence Yes

Each routing_options record

Field Type Required
available_scenario_ids array of string Yes
dependency_option_ids array of string Yes
endpoint_ids array of string (≥ 1 item) Yes
evidence_verified boolean Yes
exclusion_option_ids array of string Yes
gross_value_scenarios array of number (≥ 2 items) Yes
id string (non-empty) Yes
implementation_cost number (≥ 0) Yes
is_current_state boolean Yes
operating_cost_scenarios array of number (≥ 2 items) Yes
p95_latency_ms_scenarios array of number (≥ 2 items) Yes
quality_loss_scenarios array of number (≥ 2 items) Yes
quality_score_scenarios array of number (≥ 2 items) Yes
traffic_fractions array of number (≥ 1 item) Yes
workload_class_id string (non-empty) Yes
Example input
{
  "implementation_budget": 5,
  "maximum_provider_concentration_fraction": 0.6,
  "model_endpoints": [
    {
      "capacity_scenarios": [
        200,
        200
      ],
      "data_retention_compliant": true,
      "evidence_verified": true,
      "id": "model-a",
      "provider_id": "provider-a",
      "serving_region": "eu"
    },
    {
      "capacity_scenarios": [
        200,
        200
      ],
      "data_retention_compliant": true,
      "evidence_verified": true,
      "id": "model-b",
      "provider_id": "provider-b",
      "serving_region": "eu"
    }
  ],
  "routing_options": [
    {
      "available_scenario_ids": [
        "base",
        "provider-a-outage"
      ],
      "dependency_option_ids": [],
      "endpoint_ids": [
        "model-a"
      ],
      "evidence_verified": true,
      "exclusion_option_ids": [],
      "gross_value_scenarios": [
        100,
        100
      ],
      "id": "route-a",

Truncated for display — the full payload is 144 lines.

What you get back

This is the actual output of running the example above — computed by the same function the platform calls, not an illustration.

Example output
{
  "assumptions": [
    "Every workload selects one prospectively evidenced route whose endpoint shares sum to one. Request volume, value, operating and quality loss, latency, endpoint capacity and provider-failure scenarios share one horizon.",
    "Residency, retention, quality, latency, high-impact provider diversity and endpoint capacity are hard feasibility conditions. Provider concentration uses value-weighted traffic exposure, not endpoint counts or vendor labels.",
    "A provider failure removes every endpoint share on that provider in the same scenario; route unavailability removes the whole route. Gross value and quality loss scale to surviving traffic, while direct workload value at risk is lost only once. Gross opportunity, quality loss, operating cost and direct failure loss must be finance-owned, non-overlapping definitions.",
    "Exactness covers only the submitted finite model and beam output is heuristic. Selection is not a vendor SLA, procurement approval, data-transfer authorization, guaranteed quality/cost or judgment about a provider, team or person."
  ],
  "baseline_current_state": {
    "conditional_value_at_risk": 110,
    "expected_net_value": 30,
    "expected_total_loss": 40,
    "feasible": false,
    "provider_concentration_fraction": 1,
    "routing_option_ids": [
      "route-a"
    ]
  },
  "constraints": {
    "implementation_budget": 5,
    "maximum_cvar_total_loss": null,
    "maximum_endpoint_overload_probability": 0,
    "maximum_expected_operating_cost": null,
    "maximum_expected_total_loss": null,
    "maximum_latency_breach_probability": 0,
    "maximum_provider_concentration_fraction": 0.6,
    "maximum_quality_breach_probability": 0,
    "maximum_route_unavailability_probability": 0,
    "minimum_distinct_providers_for_high_impact": 2,
    "risk_aversion": 0,
    "tail_probability": 0.1
  },
  "decision": "ai_model_routing_portfolio_supported",
  "endpoint_diagnostics": [
    {
      "endpoint_id": "model-a",
      "maximum_selected_load": 50,
      "minimum_capacity": 200,
      "provider_economic_exposure_fraction": 0.5,
      "provider_id": "provider-a"
    },
    {
      "endpoint_id": "model-b",
      "maximum_selected_load": 50,
      "minimum_capacity": 200,

Truncated for display — the full payload is 130 lines.

How it works

Constrained optimization — Pick the best feasible option under real limits — budget, headcount, dependencies, capacity — rather than ranking a list and hoping it fits.

  1. 1 Freeze workload value and requirements, versioned endpoint capacity and provider identity, coherent scenarios and executable route alternatives with prospective economics and current-state labels.
  2. 2 Aggregate traffic from all selected workloads upward into endpoint capacity; remove all shares on failed providers; scale gross value and quality loss to surviving traffic; union breach scenarios and value-weight provider concentration.
  3. 3 Enumerate the multiple-choice portfolio exactly when tractable or disclose deterministic beam search, apply hard governance and tail-loss constraints, compare with current state, and return the non-dominated value/CVaR/concentration frontier.

Before you trust it

Every tool in the catalog ships with the conditions under which its answer is meaningful — and the conditions under which it should abstain instead of guessing.

Assumptions & guardrails

  • Objectives use commensurable locally governed value units, constraints reflect real feasibility, and uncertainty covers plausible adverse inputs.
  • All routes are executable and prospectively evaluated at one scenario horizon; traffic shares are positive and exhaustive; provider IDs represent common-mode failure; direct value at risk, gross opportunity, quality loss and cost are non-overlapping.
  • The recommendation is optimal only for its stated objective, feasible set, evidence, and solver guarantee; it is not a universal management optimum.
  • Exactness applies only to the submitted finite alternatives and beam output is heuristic; selection grants no procurement, deployment, data-transfer or legal approval and is not a judgment about vendors, teams or people.

Minimum evidence

  • workload_classes: required and organization-defined
  • model_endpoints: required and organization-defined
  • scenarios: required and organization-defined
  • routing_options: required and organization-defined
  • implementation_budget: required and organization-defined

How to validate it

Backtest the chosen action against simple feasible baselines on held-out scenarios, sweep costs/constraints/risk tolerance, and require constraint feasibility under adverse inputs.

Calibrating it to your org

Same for everyone

The mathematical kernel, validation rules, method version, and JSON output semantics are organization-independent; no tenant-trained coefficients or company benchmark is embedded in the function.

Specific to you

  • versioned option-set projection that joins workload, endpoint and scenario epochs, aggregates every selected workload's traffic to shared endpoint capacity and preserves current-state and dependency identity
  • prospective route evidence, workload value and non-overlapping economic perimeter, provider common-mode identity, privacy/residency/retention, quality/latency, endpoint capacity, availability, concentration, budget, expected/tail loss, dependencies, solver boundary and accountable product/platform/privacy/security/finance/risk approval

Calibration workflow

  1. 1 Define the management decision, target outcome, aggregate unit, privacy boundary, cadence, and prediction/intervention horizon for this organization.
  2. 2 Build a tenant-scoped historical cohort using only information available before each prediction or decision; preserve zero periods, censoring, assignment probabilities, and unresolved outcomes when the method requires them.
  3. 3 Estimate statistical parameters on training history, but obtain costs, utilities, risk tolerance, practical-effect thresholds, capacity, and policy constraints from accountable decision owners.
  4. 4 Validate on later time windows or held-out aggregate units at the deployment grain, against a simple baseline and the function-specific validation strategy.
  5. 5 Deploy only if the returned decision clears evidence, overlap, calibration, robustness, and guardrail checks; warning, unsupported, schema-gap, and fallback decisions are abstentions.
  6. 6 Monitor realized outcomes, data drift, coverage, and decision regret; recalibrate at a governed cadence or after a detected regime/definition change, never merely because a stakeholder dislikes the result.

Call it from your AI

You don't wire up 388 tools in your MCP client. The GitRevio MCP server exposes 18 tools, three of which let an agent search the catalog, read a tool's schema, and run it — so the assistant finds this one on its own.

gitrevio_capabilities_search
  { "q": "choose one evidenced aimodel route per" }
  → finds "optimize_ai_model_routing_portfolio"

gitrevio_capability_describe
  { "capability_id": "optimize_ai_model_routing_portfolio" }
  → returns the input schema and agent guidance shown on this page

gitrevio_capability_run
  { "capability_id": "optimize_ai_model_routing_portfolio", "arguments": { ... } }
  → returns the result shown above

Works in Claude Desktop, Claude Code, Cursor, Cline, Continue.dev, Goose and Aider. See the MCP server.

Related tools

Audit AI model routing evidence integrity

Audit every live AI-model route against current version-matched local evaluation, uncontaminated temporal holdout, pricing freshness, residency, retention, reliability and genuinely independent provider fallback evidence, counting each workload's value at risk once.

Forecasting & survival

Forecast AI inference economics

Forecast full AI-inference cost, retry demand, terminal-failure loss, gross value and economic-loss VaR/CVaR with tenant-local Gamma-Poisson, Beta-Binomial and partially pooled lognormal models plus shared provider-outage scenarios.

Forecasting & survival

Audit AI capability fallback integrity

Prove that every aggregate capability required when AI is unavailable has a current approved runbook and a sufficiently large, timely, successful, independently observed exercise conducted with AI actually disabled.

Statistical audit & measurement

Audit AI code change evidence integrity

Prove that aggregate AI-assisted coding evidence comes from prospectively registered, nonoverlapping treatment/control studies with immutable assignment, configuration, trace and mature-outcome denominators before anyone estimates an effect.

Causal inference & experiment design

Audit AI inference cost allocation integrity

Reconcile provider AI invoices bottom-up to workload and route usage, price terms, cached requests, retries, fixed charges and credits without combining currencies or silently allocating unexplained spend.

Statistical audit & measurement

Audit AI knowledge grounding integrity

Audit the complete AI knowledge supply chain from immutable source versions through indexed chunks and effective access policy to retrieved evidence, claim-level citations and honestly mature grounding outcomes, without treating unresolved answers as failures.

Constrained optimization

See every tool in AI cost, routing & return →

Ready to See Your Engineering work clearly?

Request a free demo