mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
(perf sdk) - minor changes to cost calculator to run helpers only when necessary (#7704)
* use _get_model_info_helper * fix _get_potential_model_names
This commit is contained in:
parent
dab7bebaf2
commit
71e679246a
1 changed files with 4 additions and 2 deletions
|
@ -3890,9 +3890,11 @@ def _strip_model_name(model: str, custom_llm_provider: Optional[str]) -> str:
|
|||
elif custom_llm_provider and (custom_llm_provider == "databricks"):
|
||||
strip_version = _strip_stable_vertex_version(model_name=model)
|
||||
return strip_version
|
||||
else:
|
||||
elif "ft:" in model:
|
||||
strip_finetune = _strip_openai_finetune_model_name(model_name=model)
|
||||
return strip_finetune
|
||||
else:
|
||||
return model
|
||||
|
||||
|
||||
def _get_model_info_from_model_cost(key: str) -> dict:
|
||||
|
@ -3969,7 +3971,7 @@ def _get_potential_model_names(
|
|||
)
|
||||
combined_stripped_model_name = "{}/{}".format(
|
||||
custom_llm_provider,
|
||||
_strip_model_name(model=model, custom_llm_provider=custom_llm_provider),
|
||||
stripped_model_name,
|
||||
)
|
||||
|
||||
return PotentialModelNamesAndCustomLLMProvider(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue