Skip to content

Upgrade the AI Gateway to LiteLLM 1.105.6 and refuse decision models outside the Decisions API - #344

Merged
Zhupku merged 2 commits into
mainfrom
fix/ai-gateway-standalone-guard
Oct 28, 2026
Merged

Zhupku merged 2 commits into
mainfrom
fix/ai-gateway-standalone-guard

Conversation

@Zhupku

@Zhupku Zhupku commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Two fixes found in an end-to-end test of the AI Gateway deployed on its own (without the CetiRun operator). Both also affect the CetiRun platform, in narrower cases.

1. Upgrade to LiteLLM 1.105.6 (stale capability data in the bundled price table). The price table bundled with LiteLLM 1.105.1 marks Azure's gpt-6-astra and gpt-6.1-sol as taking reasoning_effort: none. Azure refuses it: measured directly against Azure OpenAI, gpt-6-astra (2026-09-03) answers 400 for none on Chat Completions and on the Responses API, while gpt-6-sol, gpt-5.6-terra and gpt-5.4-nano take it. The guard removes none for Azure models the table marks as refusing it, which is how Hermes' side tasks keep working, and LiteLLM's own parameter check reads the same table. So with priceTable: bundled, or with the default remote when downloading the current table fails at pod start, a request with reasoning_effort: none to gpt-6-astra got Azure's 400. LiteLLM corrected the data upstream (BerriAI/litellm#43935), and 1.105.6, a patch release of the same 1.105 line, ships it and also checks the Responses API's reasoning.effort against the table.

requirements.txt is regenerated as its header says: the package set of the upstream v1.105.6 image, minus litellm-enterprise, with the two Python 3.12 backports kept. The set was read from the image's installed package metadata (docker cp of site-packages; the image was not run). Besides litellm, it moves aiohttp, boto3, botocore, s3transfer, grpcio and the OpenTelemetry packages to the upstream image's versions, adds two OpenTelemetry exporter packages, and drops Deprecated, which the upstream image no longer installs. litellm-proxy-extras stays at 0.4.105, so there is no new database migration.

2. Decision models refused through any API but the Decisions API, for every key. A decision model, such as Microsoft-Decision-1 configured with model_info.mode: evaluation, answers only LiteLLM's Decisions API (/v1/systemone, /v1/decisions). Measured on the standalone Gateway: a chat request for it from a key created in the console got the provider's 404, LiteLLM cooled the deployment down, and for about four seconds every auto router classifying with it (classifier_type: jev) used its default classifier, for every caller. The guard already refused this for the keys the operator issues (403); the master key and console keys were not covered, and LiteLLM 1.105.6 and main have no such check. The guard now refuses a request for a decision model through any other API (chat completions, Responses, Anthropic Messages, embeddings, text completions) from every caller with a 400, "The model is a decision model: call it through /v1/systemone or /v1/decisions.", before any deployment is called: no retry, fallback or cooldown. It reads the API from the call type of the request's logging object, which the proxy sets from the route that received the request. The Decisions API and a router's own classifier calls are unchanged; operator keys keep their 403.

The README describes the guard's new rule, notes that the price table also decides which parameters a model takes (so the image's copy can be wrong where the downloaded one has been corrected), and says which LiteLLM version its measurements were made on.

Related issue

Found in a standalone AI Gateway end-to-end test; no separate issue.

Validation

Offline (Linux container: Python 3.11, Helm 3.22.0):
  python3 -B -m unittest scripts/tests/test_ai_gateway_guard.py scripts/tests/test_ai_gateway_entrypoint.py
    scripts/tests/test_ai_gateway_request_log.py: 106 tests OK (7 new guard tests for the decision-model rule)
  python3 -B -m unittest discover -s scripts/tests: 726 OK, 26 skipped
  bash scripts/cetirun-ai-gateway-helm-test.sh: pass
  python3 -B scripts/ci/validate.py chart-check: pass
  Mutation checks of the decision-model rule: 10 of 10 caught
  scripts/license_headers.py: OK; git diff --check: clean; no file mode changes
Image (ACR build of this branch):
  pip install --no-deps of the regenerated set, then pip check: "No broken requirements found";
  the Dockerfile's enterprise-package and import checks passed
  The litellm 1.105.6 wheel (manylinux x86_64): sha256 matches PyPI; every .py file identical to the v1.105.6 git
  tag by blob SHA; no .pth, sitecustomize or other files outside the package (the payload of the malicious
  1.107.0 release was such files); installed files in the built image equal the wheel's RECORD
  OSV for the new set: ddtrace 4.11.0, dnspython 2.8.0 and filelock 3.32.7 have advisories published in late
  October; main's set has the same three (left for a separate change). The opentelemetry-api advisory on
  main's 1.33.1 is gone with the upgrade.
Live, AKS test cluster (Kubernetes 1.37), Azure OpenAI and Microsoft-Decision-1 in Foundry:
  Standalone Gateway (this branch's chart, operatorIntegration off, own namespace, removed afterwards):
    remote price table: 32/32 general checks (models, Responses API, streaming, Anthropic Messages, guard,
      encrypted reasoning, both routers, failover, deployment affinity, budget 402, RPM, TPM, health checks,
      spend log, metrics) and 21/21 checks of both fixes
    upgraded with --reuse-values to priceTable: bundled and a PodMonitor: 32/32 and 21/21 (before this change,
      with LiteLLM 1.105.1, the bundled run failed the gpt-6-astra reasoning_effort none check: 31/32)
    decision-1 through chat, Responses, Anthropic Messages, embeddings and text completions, from the master key
      and from a console key: 400 with the new message; the next three auto-decision requests were still
      classified by Decision-1 (cause jev_classifier); /v1/systemone (both keys) and /v1/decisions: 200
    reasoning.effort none to gpt-6-astra on the Responses API: LiteLLM 1.105.6 answers 400 itself, without
      calling Azure
    Container Insights received the request log lines
  CetiRun platform (deployed from main of 2026-10-23), Gateway image then Copilot proxy image changed to this build:
    Gateway image: the platform's 61 API checks (listings, policy grants, operator key isolation, limits,
      Copilot isolation) pass; decision-1 chat from the master key 400, from four Agent keys still 403;
      auto-decision with two Agent keys classified by Decision-1; reasoning_effort none to gpt-6-astra 200;
      no Agent restarted
    Copilot proxy image (the same image): the Agents' proxies were replaced, the Agents were not restarted;
      through each Agent's own proxy: Claude, GPT (Responses-only models through the proxy's chat-to-Responses
      bridge), Gemini and Grok chat, streaming, tool calls (GPT and Claude), Responses API: 13/13;
      the 61 API checks again: 61/61
Not run: envtest; the Hugo build (CI runs the docs checks). The README's measurements that name LiteLLM 1.105.1
were not repeated on 1.105.6.

Compatibility and operational impact

  • Dependency upgrade: LiteLLM 1.105.1 to 1.105.6 with the package versions above. Same Python base image; litellm-proxy-extras unchanged, so no database migration. Gateway pods and Copilot proxy pods roll once with the new image; on the test cluster the Agents themselves were not restarted.
  • A request for a decision model through an API other than the Decisions API now gets 400 from the Gateway, for every key, instead of the provider's 404 and a cooldown that affected every router classifying with that model. Keys the operator issues are unchanged (403).
  • LiteLLM 1.105.6 refuses a Responses API request with a reasoning.effort the price table marks as unsupported with its own 400 (the chart sets no drop_params); before, the request went to the provider, which refused it.

Checklist

  • The change is focused and preserves unrelated work.
  • Tests cover the changed behavior, or I explained why no new test is needed.
  • Documentation and examples match any public behavior changes.
  • Generated artifacts were updated from source, or none are affected. (requirements.txt regenerated from the upstream v1.105.6 image, as its header says.)
  • Dependency changes include lockfiles, source attribution, and license information, or none are affected. (The header names the upstream image digest and commit; the two new packages are Apache-2.0 OpenTelemetry exporters.)
  • I checked the diff and attachments for secrets, private endpoints or identifiers, customer data, agent conversations, and internal information.
  • I followed the applicable CLA instructions, or asked a maintainer about an unclear check.
  • I identified checks that need credentials or a live environment and did not run them without authorization.

The price table bundled with LiteLLM 1.105.1 marks Azure's gpt-6-astra and
gpt-6.1-sol as taking reasoning_effort none, which Azure refuses. The guard
and LiteLLM's own parameter check go by that table, so with priceTable:
bundled, or when downloading the current table fails at pod start, a request
with reasoning_effort none to gpt-6-astra got Azure's 400 instead of losing
the parameter. 1.105.6, a patch release of the same line, ships the corrected
table and also checks the Responses API's reasoning.effort against it.

requirements.txt is regenerated from the upstream v1.105.6 image, minus
litellm-enterprise, read from the image's installed package metadata without
running it; the Python 3.12 backports stay. The set moves aiohttp, boto3,
botocore, s3transfer, grpcio and the OpenTelemetry packages to the upstream
image's versions, adds two OpenTelemetry exporter packages, and drops
Deprecated, which the upstream image no longer installs. The advisories
published in late October for ddtrace, dnspython and filelock, which main's
set has too, are left for a separate change.

The README notes that the price table also decides which parameters a model
takes, and which LiteLLM version the measurements were made on.
…ry key

A decision model, such as Microsoft-Decision-1 configured with
model_info.mode evaluation, answers only LiteLLM's Decisions API
(/v1/systemone and /v1/decisions). Asked for through chat completions, the
provider answered 404 and LiteLLM cooled the deployment down, so for about
four seconds every auto router classifying with it used its default
classifier, for every caller: measured on a Gateway without the operator,
with a key created in the console. The guard refused such requests only for
the keys the CetiRun operator issues.

The guard now refuses a request for a decision model through any other API
(chat completions, Responses, Anthropic Messages, embeddings) from every
caller, with a 400 that points to the Decisions API, before any deployment is
called: no retry, fallback or cooldown. It reads the API from the call type
of the request's logging object, which the proxy sets from the route that
received the request. The Decisions API and a router's own classifier calls
reach the model as before, and keys the operator issues keep their 403.
@Zhupku Zhupku self-assigned this Oct 28, 2026

@feiskyer Pengfei Ni (feiskyer) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Zhupku
Zhupku merged commit fa3d77e into main Oct 28, 2026
34 checks passed
@Zhupku
Zhupku deleted the fix/ai-gateway-standalone-guard branch October 28, 2026 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants