litellm: target *_backup.json — LiteLLM's local cost map, not the file name we guessed
This commit is contained in:
1 parent
d35ee1760f
commit
0e8517b6be
1 file changed
+7
-2
@@ -35,10 +35,15 @@ ENTRIES = {
|
||||
|
||||
|
||||
def main() -> int:
|
||||
files = glob.glob("/app/.venv/lib/python*/site-packages/litellm/"
|
||||
# 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:
|
||||
|
||||
Reference in new issue
Block a user