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

Function _estimated_total_cost_for

uncommon_route/proxy.py:4590–4594  ·  view source on GitHub ↗
(model_name: str)

Source from the content-addressed store, hash-verified

4588 primary_key = _primary_api_key
4589
4590 def _estimated_total_cost_for(model_name: str) -> tuple[float, float]:
4591 token_input = input_tokens_after if input_tokens_after > 0 else input_tokens_before
4592 main_cost = _estimate_cost(model_name, token_input, effective_output_tokens)
4593 total_cost = main_cost + (sidechannel_estimated_cost if is_virtual else 0.0)
4594 return main_cost, total_cost
4595
4596 def _prepare_attempt(model_name: str) -> dict[str, Any]:
4597 attempt_provider_entry = _providers.get_for_model(model_name)

Callers 2

_apply_attemptFunction · 0.85
_spend_error_for_modelFunction · 0.85

Calls 1

_estimate_costFunction · 0.85

Tested by

no test coverage detected