Cost-Optimal Foundation Model Deployment Portfolio for Transportation Management


Abstract

Foundation models, including large language models (LLMs) and vision-language models (VLMs), are increasingly used for transportation management center (TMC) tasks such as anomaly detection, incident reporting, and traveler information. Deploying multiple such models across TMC functions raises a portfolio question: which model should serve each function, in which deployment mode, and under what shared hardware budget? We formulate this as the Foundation Model Deployment Portfolio (FMDP) problem, a mixed-integer program minimizing total cost of ownership (TCO) subject to per-function quality, latency, and safety constraints over shared GPU capacity. We prove the problem NP-hard by reduction from the 0-1 knapsack problem and propose a polynomial-time greedy heuristic. In an illustrative case study with five TMC functions and 19 candidate (model, mode) pairs, FMDP identifies a mixed portfolio costing $34/mo (97% below the cheapest feasible all-closed-API baseline) by routing four functions to open-source APIs and the one function whose quality floor no open-source model meets to a closed API. Break-even analysis shows that on-premise GPU investment becomes reasonable only above approximately 309 vision queries/hour or if API prices double.

foundation model deployment, large language models, mixed-integer programming, total cost of ownership, transportation management centers

1 Introduction↩︎

Transportation management centers (TMCs) operate continuously, monitoring hundreds of CCTV feeds, detecting and verifying incidents, coordinating response with police and fire agencies, adjusting signal timing and ramp metering, and pushing traveler information to dynamic message signs and 511 traveler information services [1]. A recent Federal Highway Administration (FHWA) briefing on next-generation Traffic Management Systems recommends that agencies “assess the balance between on-premises and cloud-enabled capabilities”, weighing AI/ML computing needs against the cost of GPUs [2]. To date, we are aware of no formal framework for this assessment.

Many TMC functions already rely on AI models. Classical detectors like YOLO [3] handle vehicle counting and basic anomaly detections, but foundation models (FMs) can support broader TMC tasks: VLMs interpret camera scenes for rare-event detection [4], LLMs predict traffic states from heterogeneous sensor data [5], draft incident reports [6], and advise on signal timing [7]. Several recent surveys document these applications [8][10].

As capable models become widely available, a practical planning question emerges: which model should serve each function, and how should it be deployed? Agencies can now choose closed-source cloud APIs (e.g., GPT-4o at $2.50/M tokens [11], Gemini Flash at $0.075/M [12]), open-source models on hosted inference platforms (e.g., Llama-3.1-8B [13] at $0.18/M via Together.ai [14]), or on-premise (self-hosted) GPU. These options differ substantially in cost, latency, quality, and data sovereignty. Moreover, the decisions are coupled: when multiple functions share a limited on-premise GPU budget, loading a large vision model for detection can consume available memory to force the report generator onto a more expensive cloud API.

Existing work on LLM cost optimization operates at the per-query level. FrugalGPT [15] cascades models within a single task; RouteLLM [16] and ThriftLLM [17] route individual queries to cheaper alternatives; and INFaaS [18] automates model-variant selection at runtime. None of these methods address the multi-function setting in which functions compete for shared infrastructure, and none guarantee the operational requirements a TMC imposes. A low-cost model is not useful if it misreads a sensor or produces an incoherent incident report, so deployment must respect a minimum quality. It must also meet latency targets; FHWA, for instance, names rapid incident detection a primary Traffic Incident Management performance goal [2]. And for safety-critical functions such as wrong-way-driver detection, a safety bound must hold the false-negative rate (FNR) below an agency-specified threshold. To our knowledge, FM deployment for TMC operations has not been formulated as a portfolio optimization problem under constraints of the quality, latency, safety, and costs. Our contributions are threefold.

  1. We formulate the Foundation Model Deployment Portfolio (FMDP) problem as a constrained mixed-integer program that minimizes monthly total cost of ownership (TCO) across functions sharing GPU capacity, subject to quality, latency, and safety constraints.

  2. We prove the FMDP is NP-hard via reduction from the 0-1 knapsack problem and propose a greedy heuristic.

  3. We present an illustrative TMC case study showing 97% cost reduction over the cheapest feasible all-closed-API baseline and derive per-function API vs.on-premise break-even formulas.

2 Related Work↩︎

Foundation models in transportation. Several surveys discuss FM applications in intelligent transportation: Wandelt et al. [8] review LLMs across ITS tasks; Zhang et al. [9] focus on LLMs for mobility forecasting; Fan et al. [10] address multimodal perception and decision-making on complex roads. VLMs have been applied to video anomaly detection [4], [19], LLMs to traffic state prediction [5] and signal control [7], and LLM-based agents to incident analysis [6].

Cost-efficient model selection and routing. FrugalGPT [15] pioneered LLM cascading, reporting up to 98% cost reduction by querying models from cheapest to most expensive until a quality bar is met. ThriftLLM [17] formulates ensemble selection with approximation guarantees; RouteLLM [16] trains preference-based routers; Hybrid LLM [20] routes between cloud and on-device models; Dekoninck et al. [21] derive provably optimal routing; and FORC [22] applies integer programming to per-task assignment. All target a single function and do not model shared GPU capacity.

Deployment economics and security. Zhang et al. [23] analyze cloud vs on-premise deployment as a pricing game between LLM providers, finding that privacy concerns shape equilibrium strategies. Huang et al. [24] propose SOLID, a semi-open on-premise framework securing selected model layers against distillation while preserving fine-tuning flexibility. Both study a single model’s deployment choice.

Resource allocation and model serving. From an operations research point of view, FMDP combines a multiple-choice assignment structure with knapsack-type GPU-capacity constraints and a fixed-charge model-sharing structure, which relate FMDP to the Generalized Assignment Problem [25], [26]. INFaaS [18] automates the selection of models in heterogeneous hardware, and Mélange [27] formulates the composition of the GPU fleet as a bin packing. These systems operate at per-query or serving-system granularity, whereas FMDP addresses deployment planning across functions.

3 Problem Formulation↩︎

3.1 Preliminaries↩︎

Consider a TMC operating \(F\) functions \(\mathcal{F} = \{1, \ldots, F\}\) over a planning horizon of \(H\) hours (e.g., \(H = 720\) for one month). Each function \(f\) processes queries at rate \(\lambda_f\) (queries/hour) and must satisfy: (i) a minimum quality score \(q_f^{\min} \in [0,1]\); (ii) a maximum per-query latency \(L_f\) (seconds); and (iii) for safety-critical functions \(f \in \mathcal{F}_s \subseteq \mathcal{F}\), a domain-specific safety constraint \(s_{fm} \le S_f^{\max}\). What \(s_{fm}\) measures depends on the task. For video anomaly detection, a natural choice is FNR [4]; for text generation, it could be a hallucination rate [28]. The formulation can use any task-specific safety metric that is measured at the model level and constrained by an upper bound. Table ¿tbl:tab:notation? summarizes the notations.

@ll@ Notation & Description (units)

\(f \in \mathcal{F}\) & Function index
\(m \in \mathcal{M}\) & Model index
\(d \in \mathcal{D}\) & Deployment mode
\(\mathcal{A}_f \subseteq \mathcal{M} \times \mathcal{D}\) & Feasible (model, mode) pairs for function \(f\)

\(x_{fmd} \in \{0,1\}\) & 1 if function \(f\) is assigned to \((m,d)\)
\(y_{md} \in \{0,1\}\) & 1 if model \(m\) is loaded in GPU mode \(d\)

\(H\) & Planning horizon (hours)
\(\lambda_f\) & Query arrival rate (queries/hour)
\(\tau_f^{\textsf{in}},\; \tau_f^{\textsf{out}}\) & Average input/output tokens per query
\(q_{fm},\; q_f^{\min}\) & Quality score / minimum required
\(\ell_{fmd},\; L_f\) & Per-query latency / maximum allowed (s)
\(s_{fm},\; S_f^{\max}\) & Safety metric / maximum tolerated
\(\mathrm{mem}_m\) & Model memory footprint (GB)
\(\mathrm{cap}_d\) & GPU memory capacity per device (GB)
\(n_{md}\) & GPUs needed: \(\lceil \mathrm{mem}_m / \mathrm{cap}_d \rceil\)
\(G_d\) & Available GPU count in mode \(d\)

\(p_m^{\textsf{in}},\; p_m^{\textsf{out}}\) & API price per token ($/token)
\(R_d\) & GPU rental rate ($/hr per device)
\(P_d\) & GPU purchase price ($/device)
\(T_d\) & Amortization period (months)
\(\text{TDP}_d\) & Thermal design power (kW per device)
\(p_e\) & Electricity price ($/kWh)
\(\mu_{fmd}\) & GPU utilization factor \(\in[0,1]\)

Let \(\mathcal{M}\) be the set of candidate models and \(\mathcal{D}\) the set of deployment modes. We distinguish four modes by how inference is accessed and where it runs (Table ¿tbl:tab:modes?). Pricing varies enormously [29][33]: among closed-source APIs alone, GPT-4o charges $2.50/M input tokens while Gemini-2.5-Flash charges $0.075/M, a 33\(\times\) gap. Open-source hosted APIs are cheaper and allow fine-tuning. Cloud GPU rental charges by the hour regardless of utilization; the agency can load any open-weight model using an inference engine ( e.g., vLLM [34] or SGLang [35]). On-premise GPUs incur amortized purchase and energy costs but provide full data control.

3pt

@llrl@ Mode & Model / Platform & Pricing & Trade-off
& GPT-4o [11] & $2.50/$10.00 & Highest quality
& Claude Haiku 4.5 [36] & $1.00/$5.00 & Mid-tier quality
& GPT-4o-mini [11] & $0.15/$0.60 & Budget tier
& Gemini-2.5-Flash [12] & $0.075/$0.30 & Lowest closed
& Llama-3.1-8B [13] & $0.18/$0.18 & Fine-tunable
& Qwen2.5-VL-7B [37] & $0.20/$0.20 & Vision
& RTX 4090 [38] & $0.35/hr & Full control
& A100 80GB [38] & $1.29/hr & Full control
& RTX 4090 [39] & $44/mo+energy & Sovereignty
& A100 80GB [40] & $417/mo+energy & Sovereignty

To compute the cost model, we reduce the four modes into two cost families: per-query variable cost (both API types) and fixed infrastructure plus variable energy (cloud rental and on-premise). We write \(\mathcal{D} = \{\textsf{closed api}, \textsf{open api}, \textsf{gpu-rent}, \textsf{gpu-own}\}\). Let \(\mathcal{A}_f \subseteq \mathcal{M} \times \mathcal{D}\) denote the feasible candidate set for function \(f\). Each pair \((m,d)\) is characterized by quality \(q_{fm}\), safety metric \(s_{fm}\), latency \(\ell_{fmd}\) (for \(f \in \mathcal{F}_s\)), and memory \(\mathrm{mem}_m\). For GPU modes, the required device count is \(n_{md}=\lceil \mathrm{mem}_m/\mathrm{cap}_d\rceil\).

3.2 Cost Model↩︎

Monthly cost consists of three components: variable API charges, fixed hardware costs, and, for owned hardware, variable energy cost.

API cost (\(d = \textsf{(closed/open) api}\)). Monthly cost is proportional to query volume and token length: \[C^{\text{api}}_{fm} = \lambda_f \cdot H \cdot \bigl(\tau^{\textsf{in}}_f \cdot p^{\textsf{in}}_m + \tau^{\textsf{out}}_f \cdot p^{\textsf{out}}_m\bigr) \label{eq:api95cost}\tag{1}\] where \(\tau^{\textsf{in}}_f, \tau^{\textsf{out}}_f\) are average input/output tokens per query and \(p^{\textsf{in}}_m, p^{\textsf{out}}_m\) are the model provider’s per-token prices.

GPU hardware cost (shared). For \(d \in \{\textsf{gpu-rent}, \textsf{gpu-own}\}\), hosting model \(m\) requires \(n_{md}\) devices. Monthly infrastructure cost reads: \[C^{\text{hw}}_{md} = \begin{cases} R_d \cdot n_{md} \cdot H & d = \textsf{gpu-rent} \\[4pt] P_d \cdot n_{md} \,/\, T_d & d = \textsf{gpu-own} \end{cases} \label{eq:hw95cost}\tag{2}\] Importantly, \(C^{\text{hw}}_{md}\) is charged once per model loaded.

Energy cost (\(d = \textsf{gpu-own}\) only). Operational energy per function is given by: \[C^{\text{energy}}_{fmd} = \text{TDP}_d \cdot n_{md} \cdot \mu_{fmd} \cdot H \cdot p_e \label{eq:energy95cost}\tag{3}\] where \(\mu_{fmd}=\min(\lambda_f \ell_{fmd}/3600,1)\) is the fraction of time the GPU actively processes queries for function \(f\), assuming sequential inference.

3.3 FMDP Formulation↩︎

We formulate FMDP as a mixed-integer program. Binary variable \(x_{fmd}\) assigns function \(f\) to model–deployment pair \((m,d)\), and \(y_{md}\) indicates whether model \(m\) is loaded on GPU infrastructure \(d\).

\[\begin{align} \min_{x, y} \;\; & \underbrace{ \sum_{f} \sum_{\substack{(m,d) \in \mathcal{A}_f \\ d = \textsf{(closed/open) api}}} \!\!\! C^{\text{api}}_{fm}\, x_{fmd} }_{\text{API token cost}} \;+\; \underbrace{ \sum_{m} \sum_{d \neq \textsf{api}} \!\!\! C^{\text{hw}}_{md}\, y_{md} }_{\text{fixed hardware cost}} \notag \\ & \;+\; \underbrace{ \sum_{f} \sum_{\substack{(m,d) \in \mathcal{A}_f \\ d = \textsf{gpu-own}}} \!\!\! C^{\text{energy}}_{fmd}\, x_{fmd} }_{\text{variable energy cost}} \tag{4} \\[4pt] \text{s.t.} \;\; & \textstyle\sum_{(m,d) \in \mathcal{A}_f} x_{fmd} = 1 \quad \forall\, f \tag{5} \\ & \textstyle\sum_{(m,d) \in \mathcal{A}_f} q_{fm} \cdot x_{fmd} \geq q_f^{\min} \quad \forall\, f \tag{6} \\ & \textstyle\sum_{(m,d) \in \mathcal{A}_f} s_{fm} \cdot x_{fmd} \leq S_f^{\max} \quad \forall\, f \!\in\! \mathcal{F}_s \tag{7} \\ & \textstyle\sum_{(m,d) \in \mathcal{A}_f} \ell_{fmd} \cdot x_{fmd} \leq L_f \quad \forall\, f \tag{8} \\ & y_{md} \geq x_{fmd} \quad \forall\, f,\; (m,d),\; d \!\neq\! \textsf{api} \tag{9} \\ & \textstyle\sum_{m} n_{md} \cdot y_{md} \leq G_d \quad \forall\, d \!\neq\! \textsf{api} \tag{10} \\ & x_{fmd},\; y_{md} \in \{0,1\} \tag{11} \end{align}\]

Constraint 5 assigns exactly one model–mode pair per function. Constraints 68 enforce quality floors, safety bounds and latency ceilings. Since exactly one \(x_{fmd}=1\) per function, these reduce to checking whether the selected pair meets each threshold; infeasible pairs can be pre-filtered from \(\mathcal{A}_f\). We keep the linear-sum form because it produces tighter LP relaxation bounds (Section 4). Constraint 9 links the two variable families: using model \(m\) on a GPU for any function forces \(y_{md}=1\). Constraint 10 ensures that GPU usage in each mode does not exceed \(G_d\).

4 Complexity and Solution Methods↩︎

4.1 NP-Hardness↩︎

Proposition 1. The FMDP is NP-hard.

Proof. We reduce from the 0–1 Knapsack Problem (KP) [41], in which items \(j = 1, \ldots, J\) with weights \(w_j\), values \(v_j\), and a capacity \(B\) are given. Construct an FMDP instance with one function \(f_j\) per item and budget \(G_{\textsf{gpu-own}} = B\); the mode set \(\mathcal{D}\) is unchanged, and modes other than \(\textsf{gpu-own}\) and \(\textsf{open api}\) simply have no feasible candidates. Set the electricity price \(p_e = 0\). Each function \(f_j\) has two feasible candidates. The first is a distinct local model \(m_j\) with \(\mathrm{mem}_{m_j} = w_j \cdot \mathrm{cap}_{\textsf{gpu-own}}\), so that \(n_{m_j,\textsf{gpu-own}} = w_j\) and, by Eq. 2 , its hardware cost is \(\kappa w_j\) with \(\kappa = P_{\textsf{gpu-own}} / T_{\textsf{gpu-own}}\). The second is a dedicated API model \(a_j\) whose per-token price is chosen through Eq. 1 so that its monthly cost equals \(\kappa w_j + v_j\). All quality, latency, and safety constraints are set non-binding. Because each \(m_j\) serves only \(f_j\), an assignment is feasible iff the GPU-assigned subset \(S\) satisfies \(\sum_{j \in S} w_j \leq B\), and its total cost is \(\kappa \sum_{j} w_j + \sum_{j \notin S} v_j\). Minimizing cost is therefore equivalent to maximizing \(\sum_{j \in S} v_j\) subject to the knapsack constraint, so solving FMDP optimally solves KP. ◻

4.2 LP Relaxation Bound↩︎

Relaxing the binary variables to \([0,1]\) gives a polynomial-time LP lower bound. Without the GPU-capacity constraint 10 and the linking constraints 9 , the problem decomposes into independent per-function selections whose LP relaxation is integral. With shared GPU capacity and fixed-charge loading variables, tightness is no longer guaranteed; we therefore use the LP optimum as a lower bound to certify heuristic solution quality.

4.3 Greedy Heuristic↩︎

Algorithm 1 is a two-phase greedy heuristic cheap enough to re-run whenever prices change. Phase 1 scans the functions in arbitrary order and assigns each to its cheapest feasible (model, mode) pair given the models already loaded; a model loaded once serves later functions at no extra hardware cost, matching the fixed-charge structure of 4 . Phase 2 runs only if the GPU budget \(G_d\) is exceeded. It first computes the cheapest feasible API fallback cost for each GPU-assigned function \(\hat{c}_f\), then repeatedly switches the function with the smallest repair ratio \(r_f = \Delta_f / g_f\) to its fallback, where \(\Delta_f = \hat{c}_f - \mathrm{cost}_{fmd}\) is the resulting cost increase and \(g_f\) is the number of GPU devices released. A function sharing its model with others frees no devices, so we set \(g_f = 0\) and \(r_f = +\infty\) rather than divide by zero. If all \(r_f=+\infty\), the heuristic switches the function with the smallest \(\Delta_f\), reducing the number of users of at least one loaded model and eventually releasing capacity. The loop ends once the budget is met. The Worst-case complexity is \(O(F \cdot |\mathcal{A}|_{\max} + F^2)\): candidate lists are scanned once in Phase 1 and once for \(\hat{c}_f\), and Phase 2 performs repair iterations of at most \(F\), up to \(F\) functions.

Figure 1: Two-Phase Greedy Heuristic for FMDP

5 Illustrative Case Study↩︎

We use an illustrative TMC case study to demonstrate the FMDP. Scenario details are demonstrated as follows. In practice, agencies would replace the illustrative entries in Table ¿tbl:tab:catalog? with measurements from their own models and workloads.

5.1 Scenario Design↩︎

We consider a TMC with \(\mathcal{F}{=}5\) functions and illustrative requirements (Table 1), reflecting the operational scope described in the NextGen TMS briefing [2]: video anomaly detection (f1), traffic state estimation (f2), incident report generation (f3), signal timing advisory (f4), and traveler information (f5). Function f1 is safety-critical: it monitors CCTV feeds for wrong-way drivers, pedestrians on freeways, and road safety, and we assume a FNR bound of \(s_{f1} \leq 0.10\). Query rates range widely, from 200 queries/hour for f1 (one frame every 18 s) down to just 3 incidents/hour for f3.

Table 1: Illustrative TMC Functions
ID Function \(\lambda_f\) \(L_f\) \(q_f^{\min}\) Safety
(q/hr) (s)
f1 Video anomaly detection 200 5 0.70 FNR\(\,{\leq}\,\)0.10
f2 Traffic state estimation 120 10 0.75
f3 Incident report generation 3 30 0.80
f4 Signal timing advisory 60 5 0.70
f5 Traveler information 10 15 0.75

3pt

We assemble a set of candidates per function from the deployment modes in Table ¿tbl:tab:modes?; Table ¿tbl:tab:catalog? lists the full catalog. Quality and FNR scores are illustrative but align with published performance tiers: frontier closed-source VLMs outperform open-source VLMs, which in turn outperform classical detectors [3], [4], [19], [42]; text-function quality (f2–f5) follows the same ordering, consistent with LLM-as-judge evaluations [43] and public leaderboards (e.g., [44]). We assume that the relative performance of these models on TMC tasks mirrors their ranking on public benchmarks.

API costs are computed from Eq. 1 . Because providers use different tokenizers, the same prompt results in different token counts and different per-query costs \(c_q\). For vision queries, GPT-4o encodes a 720p CCTV frame as \({\sim}\)​1,105 image tokens [11]; Qwen2.5-VL tiles the same frame into \({\sim}\)​1,000 tokens [37]. On-premise costs follow Eqs. 23 . We assume two agency-owned RTX 4090 GPUs ($1,600 MSRP [39], 36-month amortization, 450 W TDP, $0.12/kWh), a workstation-class configuration without data-center infrastructure, for 48 GB total on-premise VRAM.

3pt

@clllcr@ & Model & Deployment & \(q\) & FNR & $/month
& GPT-4o (vision) & Closed API & .85 & .04 & 1,102
& Qwen2.5-VL-7B (vision) & Open API & .78 & .08 & 29
& InternVL2-8B (vision) & On-Premise (16G) & .78 & .08 & 46
& YOLOv8-L (vision) & On-Premise (\(\!<\!\)1G) & .72 & .11 & \(<\)1
& GPT-4o-mini & Closed API & .82 & – & 9
& Gemini-2.5-Flash & Closed API & .79 & – & 3
& Llama-3.1-8B & Open API & .77 & – & 2
& Qwen2.5-7B & On-Premise (15G) & .77 & – & 45
& GPT-4o & Closed API & .90 & – & 9
& Claude Haiku 4.5 & Closed API & .84 & – & 4
& GPT-4o-mini & Closed API & .82 & – & 1
& Llama-3.1-8B & Open API & .78 & – & \(<\)1
& Rule-based & – & .60 & – & 0
& GPT-4o-mini & Closed API & .80 & – & 6
& Gemini-2.5-Flash & Closed API & .77 & – & 2
& Qwen2.5-7B & Open API & .75 & – & 1
& GPT-4o & Closed API & .88 & – & 40
& GPT-4o-mini & Closed API & .80 & – & 2
& Llama-3.1-8B & Open API & .76 & – & 1

5.2 Results and Analysis↩︎

We implement Algorithm 1 in Python on an Apple MacBook Pro (M4, 24 GB RAM). Experiment 1 presents the FMDP portfolio, while Experiment 2 studies API on-premise break-even points.

Experiment 1: Optimal portfolio vs.baselines. We evaluate five single-tier baselines (Table ¿tbl:tab:results?), each forcing every function into one deployment mode: All-Closed-Frontier picks the highest-quality closed model per function; All-Closed-Budget picks the cheapest feasible closed model; All-Open-Source-API uses hosted open-source models throughout; All-On-Premise runs everything locally; and Classical-Only relies on rule-based or classical-ML methods.

FMDP assigns f1, f2, f4, and f5 to hosted open-source APIs and routes only f3 to GPT-4o-mini, because no open-source option meets its quality floor. The resulting portfolio costs $34/mo with zero GPU usage. At current open-source API prices ($0.20/M tokens for vision), f1’s 144,000 monthly queries cost even less via API than on-premise hardware ($29 vs.$46/mo).

Three baselines are infeasible. All-On-Premise requires 63 GB of GPU memory, exceeding the 48 GB budget. Classical-Only and All-Open-Source-API fail the quality threshold for f3 (\(q{=}.60\) and \(.78\) vs.\(q^{\min}{=}.80\)). Thus, the all-open-source portfolio nearly matches FMDP in cost but does not satisfy all constraints. FMDP is feasible by assigning f3 to GPT-4o-mini at a marginal cost of $1/mo, while keeping the other functions on open-source APIs. The two feasible baselines are closed-source and exceed $1,100/mo, driven by f1’s sustained vision queries via GPT-4o. FMDP’s $34/mo portfolio is thus, 97% below the cheapest feasible baseline.

3pt

@lrrrc@ Strategy & TCO & \(\bar{Q}\) & GPU & Feasible?
& ($/mo) & & (GB) &
All-Closed-Frontier & 1,166 & .85 & 0 & ✔
All-Closed-Budget & 1,110 & .81 & 0 & ✔
All-Open-Source-API & 34 & .77 & 0 & \(\times\)
All-On-Premise & 226 & .77 & 63 & \(\times\)
Classical-Only & \(<\)1 & .63 & 0 & \(\times\)
FMDP Optimal & 34 & .78 & 0 & ✔

Experiment 2: API vs.on-premise break-even points. On-premise deployment becomes cheaper than a cloud API once the query rate exceeds \[\lambda^* \;=\; \frac{C^{\text{hw}}_{md}}{H \cdot c_q} \label{eq:tipping}\tag{12}\] where \(c_q\) is the per-query API cost and \(C^{\text{hw}}_{md}\) is the monthly hardware amortization. Table ¿tbl:tab:tipping? evaluates this for a single RTX 4090 at $44/mo.

At $0.20/M tokens, the open-source vision API (Qwen2.5-VL) breaks even at 309 q/h, above f1’s 200 q/h, so FMDP keeps f1 on the API. Adding cameras or raising the frame rate beyond one frame every 12 s would cross this threshold and shift f1 on-premise. GPT-4o, on the contrary, breaks even at only 8 q/h due to its higher per-query cost ($0.0077): for any sustained vision workload beyond that rate, owning a GPU beats paying closed-API vision prices. Text workloads are far below their break-even points, 617 q/h for GPT-4o-mini and 2,684 q/h for Llama-3.1-8B. Therefore, no text function in this scenario justifies local hardware. These thresholds move with API pricing, which changes frequently: doubling the vision price to $0.40/M halves \(\lambda^*\) to 154 q/h, below f1’s rate, and the optimal assignment shifts on-premise.

3pt

@llrl@ Cloud API & \(c_q\) ($/q) & \(\lambda^*\) (q/h) & Implication
GPT-4o (vision) & 0.0077 & 8 & on-prem
Qwen2.5-VL (vision) & 0.00020 & 308.6 & use API
GPT-4o-mini (text) & 0.00010 & 617.3 & use API
Llama-3.1-8B (text) & 0.000023 & 2,683.8 & use API

6 Discussion↩︎

Although the case study is small, it illustrates why FM deployment for TMCs should be treated as a portfolio problem rather than a set of independent model choices. No single deployment tier can be both feasible and cost-minimal. The all-open-source API strategy nearly matches FMDP’s monthly cost but fails the quality requirement for incident report generation, while the cheapest feasible all-closed-source strategy exceeds $1,100/mo because sustained vision API calls dominate cost. FMDP identifies the narrow point where closed-source capability is needed and keeps the remaining functions on lower-cost hosted open-source APIs. Break-even analysis shows that deployment decisions are sensitive to query volume and per-query price. At January 2026 prices, the open-source vision API remains cheaper than local deployment at 200 q/h, but this would reverse if camera sampling rates, the number of streams, or API prices increase. Text functions have much higher break-even rates, thus on-premise GPU deployment is not cost effective for the small volume reporting and advisory workloads in our case study.

7 Conclusion↩︎

This paper introduced FMDP, a mixed-integer programming framework to jointly select foundation models and deployment modes across TMC functions subject to the constraints of quality, latency, safety, and shared GPU-capacity. We proved FMDP is NP-hard and proposed a two-phase greedy heuristic. In an illustrative five-function case study, FMDP achieves a $34/mo portfolio, 97% below the cheapest feasible all-closed-source baseline, by using hosted open-source APIs where possible and a closed-source API only where needed. The break-even analysis further identifies when on-premise GPU deployment becomes cost-effective.

Limitations and future work. The case study demonstrates the planning methodology rather than realistic operational performance: its quality, latency, and safety parameters are illustrative and should be replaced with agency-specific measurements prior to operational use. The current formulation assigns one model to each function and does not consider model cascading, price and demand uncertainty, or inter-function dependencies. Future work will extend FMDP to model cascading, multi-period planning, and validation with operational TMC data.

References↩︎

[1]
Federal Highway Administration, “Next generation of traffic management systems and centers: A primer,” U.S. Department of Transportation; https://highways.dot.gov/media/49321, 2024.
[2]
ITS Joint Program Office, Updated January 2026“Next generation transportation management centers and transportation management systems: Executive briefing,” U.S. Department of Transportation; https://www.itskrs.its.dot.gov/briefings/executive-briefing/next-generation-transportation-management-centers-and-transportation, 2025.
[3]
G. Jocher, A. Chaurasia, and J. Qiu, Ultralytics YOLOv8.” https://github.com/ultralytics/ultralytics, 2023.
[4]
L. Zanella, W. Menapace, M. Mancini, Y. Wang, and E. Ricci, “Harnessing large language models for training-free video anomaly detection,” in Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 2024, pp. 18527–18536.
[5]
X. Guo, Q. Zhang, J. Jiang, M. Peng, M. Zhu, and H. F. Yang, “Towards explainable traffic flow prediction with large language models,” Communications in Transportation Research, vol. 4, p. 100150, 2024.
[6]
L. Da et al., “Open-ti: Open traffic intelligence with augmented language model,” International Journal of Machine Learning and Cybernetics, vol. 15, no. 10, pp. 4761–4786, 2024.
[7]
S. Lai, Z. Xu, W. Zhang, H. Liu, and H. Xiong, “LLMLight: Large language models as traffic signal control agents,” in Proceedings of the 31st ACM SIGKDD conference on knowledge discovery and data mining v. 1, 2025, pp. 2335–2346.
[8]
S. Wandelt, C. Zheng, S. Wang, Y. Liu, and X. Sun, “Large language models for intelligent transportation: A review of the state of the art and challenges,” Applied Sciences, vol. 14, no. 17, p. 7455, 2024.
[9]
Z. Zhang et al., “Large language models for mobility analysis in transportation systems: A survey on forecasting tasks,” Transportation Research Record, vol. 2680, no. 2, pp. 756–774, 2026.
[10]
L. Fan et al., “Multimodal perception and decision-making systems for complex roads based on foundation models,” IEEE Transactions on Systems, Man, and Cybernetics: Systems, vol. 54, no. 11, pp. 6561–6569, 2024.
[11]
OpenAI, Accessed: Jan. 2026API pricing.” https://openai.com/api/pricing, 2025.
[12]
Google, Accessed: Jan. 2026“Gemini API pricing.” https://ai.google.dev/pricing, 2025.
[13]
A. Grattafiori et al., “The llama 3 herd of models,” arXiv preprint arXiv:2407.21783, 2024.
[14]
Together AI, Accessed: Jan. 2026“Inference pricing.” https://www.together.ai/pricing, 2025.
[15]
L. Chen, M. Zaharia, and J. Zou, “Frugalgpt: How to use large language models while reducing cost and improving performance,” arXiv preprint arXiv:2305.05176, 2023.
[16]
I. Ong et al., “RouteLLM: Learning to route LLMs from preference data,” in The thirteenth international conference on learning representations, 2025.
[17]
K. Huang et al., “ThriftLLM: On cost-effective selection of large language models for classification queries,” Proceedings of the VLDB Endowment, vol. 18, no. 11, pp. 4410–4423, 2025.
[18]
F. Romero, Q. Li, N. J. Yadwadkar, and C. Kozyrakis, \(\{\)INFaaS\(\}\): Automated model-less inference serving,” in 2021 USENIX annual technical conference (USENIX ATC 21), 2021, pp. 397–411.
[19]
Y. Yao et al., “DoTA: Unsupervised detection of traffic anomaly in driving videos,” IEEE transactions on pattern analysis and machine intelligence, vol. 45, no. 1, pp. 444–459, 2022.
[20]
D. Ding et al., “Hybrid LLM: Cost-efficient and quality-aware query routing,” in The twelfth international conference on learning representations, 2024.
[21]
J. Dekoninck, M. Baader, and M. Vechev, “A unified approach to routing and cascading for LLMs,” in ICML 2025, 2025.
[22]
M. Šakota, M. Peyrard, and R. West, “Fly-swat or cannon? Cost-effective language model choice via meta-modeling,” in Proceedings of the 17th ACM international conference on web search and data mining, 2024, pp. 606–615.
[23]
Z. J. Zhang, J. Shi, and S. Tang, “Cloud or on-premise? A strategic view of large language model deployment,” A Strategic View of Large Language Model Deployment (June 16, 2025), 2025.
[24]
H. Huang et al., “A middle path for on-premises LLM deployment: Preserving privacy without sacrificing model confidentiality,” in Proceedings of the 2025 conference on empirical methods in natural language processing, 2025, pp. 8332–8370.
[25]
M. L. Fisher, R. Jaikumar, and L. N. Van Wassenhove, “A multiplier adjustment method for the generalized assignment problem,” Management science, vol. 32, no. 9, pp. 1095–1103, 1986.
[26]
D. W. Pentico, “Assignment problems: A golden anniversary survey,” European Journal of Operational Research, vol. 176, no. 2, pp. 774–793, 2007.
[27]
T. Griggs et al., “M\(\backslash\)’elange: Cost efficient large language model serving by exploiting gpu heterogeneity,” arXiv preprint arXiv:2404.14527, 2024.
[28]
L. Huang et al., “A survey on hallucination in large language models: Principles, taxonomy, challenges, and open questions,” ACM Transactions on Information Systems, vol. 43, no. 2, pp. 1–55, 2025.
[29]
G. Pan, V. Chodnekar, A. Roy, and H. Wang, “A cost-benefit analysis of on-premise large language model deployment: Breaking even with commercial LLM services,” arXiv preprint arXiv:2509.18101, 2025.
[30]
O. Gubanova, Accessed: Jan. 2026LLM total cost of ownership 2025: Build vs. Buy math.” Ptolemay Blog, 2025, [Online]. Available: https://www.ptolemay.com/post/llm-total-cost-of-ownership.
[31]
S. Ivanovici, Accessed: Jan. 2026“Cost of serving LLMs.” Fin.ai Research Blog, 2025, [Online]. Available: https://fin.ai/research/cost-of-serving-llms/.
[32]
DetectX, Accessed: Jan. 2026“Cost comparison: API vs self-hosting for open-weight LLMs.” DetectX Blog, 2025, [Online]. Available: https://www.detectx.com.au/cost-comparison-api-vs-self-hosting-for-open-weight-llms/.
[33]
T. Sharma, Accessed: Jan. 2026“The complete AI strategy guide: Cloud APIs vs self-hosted models.” Medium, 2025, [Online]. Available: https://medium.com/@tuhinsharma121/the-complete-ai-strategy-guide-cloud-apis-vs-self-hosted-models-a68b9bb69778.
[34]
W. Kwon et al., “Efficient memory management for large language model serving with pagedattention,” in Proceedings of the 29th symposium on operating systems principles, 2023, pp. 611–626.
[35]
L. Zheng et al., “Sglang: Efficient execution of structured language model programs,” Advances in neural information processing systems, vol. 37, pp. 62557–62583, 2024.
[36]
Anthropic, Accessed: Jan. 2026API pricing.” https://claude.com/pricing#api, 2025.
[37]
S. Bai et al., “Qwen2.5-VL technical report.” 2025, [Online]. Available: https://arxiv.org/abs/2502.13923.
[38]
RunPod, Accessed: Jan. 2026GPU cloud pricing.” https://www.runpod.io/pricing, 2025.
[39]
NVIDIA, MSRP $1,599 at launch (Oct. 2022)GeForce RTX 4090.” https://www.nvidia.com/en-us/geforce/graphics-cards/40-series/rtx-4090/, 2022.
[40]
NVIDIA, 80 GB PCIe; market price approximately $15,000 (2025)NVIDIA A100 tensor core GPU.” https://www.nvidia.com/en-us/data-center/a100/, 2020.
[41]
R. M. Karp, “Reducibility among combinatorial problems,” in 50 years of integer programming 1958-2008: From the early years to the state-of-the-art, Springer, 2009, pp. 219–241.
[42]
Z. Chen et al., “Internvl: Scaling up vision foundation models and aligning for generic visual-linguistic tasks,” in Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 2024, pp. 24185–24198.
[43]
L. Zheng, W.-L. Chiang, Y. Sheng, et al., “Judging LLM-as-a-judge with MT-Bench and Chatbot Arena,” in NeurIPS, 2023.
[44]
Artificial Analysis, Accessed: Jan. 2026“LLM leaderboard.” https://artificialanalysis.ai/leaderboards/models, 2025.

  1. \(^{*}\)Equal contribution. Contact: xc557@cornell.edu.↩︎

  2. \(^{1}\)Cornell University, Ithaca, NY, USA.↩︎

  3. \(^{2}\)University of California, Berkeley, CA, USA.↩︎

  4. \(^{3}\)The Hong Kong Polytechnic University, Hong Kong SAR.↩︎

  5. \(^{4}\)University of Illinois Chicago, Chicago, IL, USA.↩︎