diff --git a/patch_audio_cost_map.py b/patch_audio_cost_map.py index dfa4fe4..55fedcb 100644 --- a/patch_audio_cost_map.py +++ b/patch_audio_cost_map.py @@ -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: