Update litellm/litellm_core_utils/get_model_cost_map.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
Cesar Garcia 2026-03-20 22:18:16 -03:00 committed by GitHub
parent 88ee7c507b
commit 4e4dd88e7e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -26,9 +26,9 @@ def _load_local_model_cost_map() -> dict:
# Try loading from package resources (production)
try:
import importlib.resources
with importlib.resources.open_text(
"litellm", "model_prices_and_context_window.json"
) as f:
with importlib.resources.files("litellm").joinpath(
"model_prices_and_context_window.json"
).open("r") as f:
return json.load(f)
except (FileNotFoundError, ModuleNotFoundError):
pass