Revert "changes"

This reverts commit fa88bc9632.
This commit is contained in:
Utkash Dubey 2025-03-10 14:46:21 -07:00
parent 1f17daf52c
commit c7a04140e9
19 changed files with 141 additions and 191 deletions

View file

@ -8,29 +8,24 @@ export LITELLM_LOCAL_MODEL_COST_MAP=True
```
"""
from functools import cache
import os
import httpx
@cache
def get_locally_cached_model_cost_map():
import importlib.resources
import json
with importlib.resources.open_text(
"litellm", "model_prices_and_context_window_backup.json"
) as f:
content = json.load(f)
return content
def get_model_cost_map(url: str):
if (
os.getenv("LITELLM_LOCAL_MODEL_COST_MAP", False)
or os.getenv("LITELLM_LOCAL_MODEL_COST_MAP", False) == "True"
):
return get_locally_cached_model_cost_map()
import importlib.resources
import json
with importlib.resources.open_text(
"litellm", "model_prices_and_context_window_backup.json"
) as f:
content = json.load(f)
return content
try:
response = httpx.get(