fix(utils.py): fix custom pricing when litellm model != response obj model name

This commit is contained in:
Krrish Dholakia 2024-05-13 15:24:56 -07:00
parent acb1f225ac
commit 8d94665842
4 changed files with 87 additions and 5 deletions

View file

@ -727,7 +727,6 @@ def completion(
### REGISTER CUSTOM MODEL PRICING -- IF GIVEN ###
if input_cost_per_token is not None and output_cost_per_token is not None:
print_verbose(f"Registering model={model} in model cost map")
litellm.register_model(
{
f"{custom_llm_provider}/{model}": {
@ -849,6 +848,10 @@ def completion(
proxy_server_request=proxy_server_request,
preset_cache_key=preset_cache_key,
no_log=no_log,
input_cost_per_second=input_cost_per_second,
input_cost_per_token=input_cost_per_token,
output_cost_per_second=output_cost_per_second,
output_cost_per_token=output_cost_per_token,
)
logging.update_environment_variables(
model=model,