MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / _baseline_cost

Function _baseline_cost

uncommon_route/stats.py:228–240  ·  view source on GitHub ↗
(r: RouteRecord)

Source from the content-addressed store, hash-verified

226
227
228def _baseline_cost(r: RouteRecord) -> float:
229 if r.baseline_cost > 0:
230 return r.baseline_cost
231 main_estimated = max(0.0, r.estimated_cost - r.sidechannel_estimated_cost)
232 if main_estimated <= 0:
233 return 0.0
234 if 0.0 <= r.savings < 0.999999:
235 denominator = 1.0 - r.savings
236 if denominator > 0:
237 return main_estimated / denominator
238 if r.savings == 0.0:
239 return main_estimated
240 return 0.0
241
242
243def _get_stats_pricing() -> dict[str, ModelPricing]:

Callers 1

summaryMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected