mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
Bug fix: The prior code removed values like "supports_function_calling" or "supports_vision". This is fixed now.
Nothing is being removed. Only the pricings and the maximum tokens are being edited and new models in openrouter are being added.
This commit is contained in:
parent
771f06bd17
commit
514477b1e7
1 changed files with 7 additions and 4 deletions
|
|
@ -33,14 +33,17 @@ def update_local_data(local_data, remote_data):
|
|||
model_suffix = model_name[len("openrouter/"):]
|
||||
for model in remote_data["data"]:
|
||||
if model["id"] == model_suffix:
|
||||
model_info["max_tokens"] = model["context_length"]
|
||||
model_info["input_cost_per_token"] = model["pricing"]["prompt"]
|
||||
model_info["output_cost_per_token"] = model["pricing"]["completion"]
|
||||
# Update only the values that need to be updated
|
||||
model_info.update({
|
||||
"max_tokens": model["context_length"],
|
||||
"input_cost_per_token": model["pricing"]["prompt"],
|
||||
"output_cost_per_token": model["pricing"]["completion"]
|
||||
})
|
||||
break
|
||||
# Add models not in local data yet
|
||||
for model in remote_data["data"]:
|
||||
model_id = model["id"]
|
||||
if model_id not in local_data:
|
||||
if f"openrouter/{model_id}" not in local_data:
|
||||
local_data[f"openrouter/{model_id}"] = {
|
||||
"max_tokens": model["context_length"],
|
||||
"input_cost_per_token": model["pricing"]["prompt"],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue