From 0e8517b6be60ea37e6a4a2cc5ff483e92896f902 Mon Sep 17 00:00:00 2001 From: Inferencebot Date: Tue, 17 Nov 2026 08:36:53 +0000 Subject: [PATCH] =?UTF-8?q?litellm:=20target=20*=5Fbackup.json=20=E2=80=94?= =?UTF-8?q?=20LiteLLM's=20local=20cost=20map,=20not=20the=20file=20name=20?= =?UTF-8?q?we=20guessed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- patch_audio_cost_map.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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: