litellm: target *_backup.json — LiteLLM's local cost map, not the file name we guessed

This commit is contained in:
inference-admin committed 2026-11-17 08:36:53 +00:00
1 parent d35ee1760f
commit 0e8517b6be
1 file changed
+8 -3
+8 -3
View File
@@ -35,10 +35,15 @@ ENTRIES = {
def main() -> int:
files = glob.glob("/app/.venv/lib/python*/site-packages/litellm/"
"model_prices_and_context_window.json")
# LiteLLM ships the local map as *_backup.json; cost.json is the download
# cache. Patch whichever exists, preferring the loadable backup.
files = (glob.glob("/app/.venv/lib/python*/site-packages/litellm/"
"model_prices_and_context_window_backup.json")
or glob.glob("/app/.venv/lib/python*/site-packages/litellm/"
"model_prices_and_context_window.json")
or glob.glob("/app/.venv/lib/python*/site-packages/litellm/cost.json"))
if not files:
print("[coop-patch] FAIL model_prices_and_context_window.json not found")
print("[coop-patch] FAIL no local cost map found (backup / model_prices / cost.json)")
return 1
path = files[0]
with open(path, encoding="utf-8") as handle: