From baa64463482ff874959d629c73ce78138f6fc657 Mon Sep 17 00:00:00 2001 From: jesus Date: Fri, 11 Sep 2026 15:26:55 +0000 Subject: [PATCH 1/3] fix(cli): pin pi compat flags for gateway models Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/proxy/client/cli/commands/pi.py | 3 +++ tests/test_litellm/proxy/client/cli/test_pi.py | 1 + 2 files changed, 4 insertions(+) diff --git a/litellm/proxy/client/cli/commands/pi.py b/litellm/proxy/client/cli/commands/pi.py index 9810e81ae36..17b4a75488b 100644 --- a/litellm/proxy/client/cli/commands/pi.py +++ b/litellm/proxy/client/cli/commands/pi.py @@ -188,10 +188,13 @@ def provider_block( Real contextWindow/maxTokens matter: pi otherwise assumes 128k/16384, which breaks compaction thresholds and over-asks models with smaller output caps. + pi sniffs compat from the base URL, and one gateway URL fronts models with + different capabilities, so both flags are pinned off. """ return { # mutable-ok: JSON serialization requires a mutable object "baseUrl": base_url.rstrip("/") + "/v1", "api": "openai-completions", + "compat": {"supportsStore": False, "supportsLongCacheRetention": False}, "apiKey": f"${LITELLM_PROXY_API_KEY_ENV}", "models": [_model_entry(model_id, limits) for model_id in model_ids], # mutable-ok: JSON array } diff --git a/tests/test_litellm/proxy/client/cli/test_pi.py b/tests/test_litellm/proxy/client/cli/test_pi.py index 03e5d7dd197..3b91a35781c 100644 --- a/tests/test_litellm/proxy/client/cli/test_pi.py +++ b/tests/test_litellm/proxy/client/cli/test_pi.py @@ -188,6 +188,7 @@ class TestProviderBlock: assert block == { "baseUrl": "http://localhost:4000/v1", "api": "openai-completions", + "compat": {"supportsStore": False, "supportsLongCacheRetention": False}, "apiKey": "$LITELLM_PROXY_API_KEY", "models": [{"id": "m-1"}, {"id": "m-2"}], } From 0cb773c2d75f45617b08246a3dc7dbc2a1b95cca Mon Sep 17 00:00:00 2001 From: jesus Date: Fri, 11 Sep 2026 15:38:22 +0000 Subject: [PATCH 2/3] fix(cli): annotate pi compatibility field Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/proxy/client/cli/commands/pi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/proxy/client/cli/commands/pi.py b/litellm/proxy/client/cli/commands/pi.py index 17b4a75488b..7b02da1e9de 100644 --- a/litellm/proxy/client/cli/commands/pi.py +++ b/litellm/proxy/client/cli/commands/pi.py @@ -194,7 +194,7 @@ def provider_block( return { # mutable-ok: JSON serialization requires a mutable object "baseUrl": base_url.rstrip("/") + "/v1", "api": "openai-completions", - "compat": {"supportsStore": False, "supportsLongCacheRetention": False}, + "compat": {"supportsStore": False, "supportsLongCacheRetention": False}, # mutable-ok: JSON field "apiKey": f"${LITELLM_PROXY_API_KEY_ENV}", "models": [_model_entry(model_id, limits) for model_id in model_ids], # mutable-ok: JSON array } From 31fe5e4537556ab4a9ef8f934d06ab9251032dde Mon Sep 17 00:00:00 2001 From: jesus Date: Fri, 11 Sep 2026 15:50:52 +0000 Subject: [PATCH 3/3] fix(cli): clarify pi compatibility suppression Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/proxy/client/cli/commands/pi.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/client/cli/commands/pi.py b/litellm/proxy/client/cli/commands/pi.py index 7b02da1e9de..56e9a43af2c 100644 --- a/litellm/proxy/client/cli/commands/pi.py +++ b/litellm/proxy/client/cli/commands/pi.py @@ -194,7 +194,10 @@ def provider_block( return { # mutable-ok: JSON serialization requires a mutable object "baseUrl": base_url.rstrip("/") + "/v1", "api": "openai-completions", - "compat": {"supportsStore": False, "supportsLongCacheRetention": False}, # mutable-ok: JSON field + "compat": { # mutable-ok: JSON serialization requires a nested mutable object + "supportsStore": False, + "supportsLongCacheRetention": False, + }, "apiKey": f"${LITELLM_PROXY_API_KEY_ENV}", "models": [_model_entry(model_id, limits) for model_id in model_ids], # mutable-ok: JSON array }