mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-16 08:23:06 +00:00
Add the models of openrouter that are not in the json file with the pricings of the models yet
This commit is contained in:
committed by
Rajan Paneru
parent
5149a1de86
commit
771f06bd17
@@ -37,6 +37,17 @@ def update_local_data(local_data, remote_data):
|
||||
model_info["input_cost_per_token"] = model["pricing"]["prompt"]
|
||||
model_info["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:
|
||||
local_data[f"openrouter/{model_id}"] = {
|
||||
"max_tokens": model["context_length"],
|
||||
"input_cost_per_token": model["pricing"]["prompt"],
|
||||
"output_cost_per_token": model["pricing"]["completion"],
|
||||
"litellm_provider": "openrouter",
|
||||
"mode": "chat"
|
||||
}
|
||||
|
||||
def write_to_file(file_path, data):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user