Commit graph

53162 commits

Author SHA1 Message Date
mateo-berri
5d2cc109c8 test(decisions): clear every OpenAI base setting in the proxy OpenAI deployment test
Backport of #45214 to stable/1.104.x.
Cherry-picked from a2951b318d (litellm_openai_decisions_provider).
2026-10-07 20:01:16 -07:00
mateo-berri
c65d369958 fix(decisions): honor litellm OpenAI key and base settings for the openai provider
Backport of #45214 to stable/1.104.x.
Cherry-picked from e465919004 (litellm_openai_decisions_provider).
2026-10-07 19:49:50 -07:00
mateo-berri
7df9c0620f fix(decisions): load on Python 3.10 and 3.11 and bill cached tokens once under custom pricing
Backport of 39012f1c22 from #45214 to stable/1.104.x. The IR extra default now mirrors #45214 (shared _NO_EXTRA via default_factory).
2026-10-07 19:36:04 -07:00
mateo-berri
36894a1743 fix(decisions): give IR extra fields a default_factory so Python 3.11 imports litellm
Python 3.11 rejects an unhashable MappingProxyType as a dataclass default, so import litellm raised ValueError there. The same change needs to land on #45214.
2026-10-07 19:16:36 -07:00
mateo-berri
2976595063 fix(decisions): keep provider fields inside System One answers
Backport of #45214 to stable/1.104.x.
Cherry-picked from 1348de864f (litellm_openai_decisions_provider).

(cherry picked from commit 1348de864f)
2026-10-07 19:04:39 -07:00
mateo-berri
df8f46c4ea test(decisions): read _hidden_params in the OpenAI provider test on stable/1.104.x
The public hidden_params accessor comes from #44668, which is not on stable/1.104.x, so the backported test reads the private attribute like the rest of the file
2026-10-07 18:52:49 -07:00
mateo-berri
637cc3f5b1 feat(decisions): route both request formats through a shared decisions IR
System One and OpenAI-format bodies now convert to one internal representation, and each provider translates it to its own wire format. OpenAI deployments receive the caller's messages, images, names, typed choice values, level descriptions and safety_identifier unchanged. System One providers return a 400 for image input. Cached and cache-write tokens are priced on both response shapes, and provider response extras survive the round trip.

(cherry picked from commit 0dd207fde1)
2026-10-07 18:50:14 -07:00
mateo-berri
fbcc73b579 refactor(decisions): move the OpenAI wire translation into llms/openai
(cherry picked from commit d209a85076)
2026-10-07 18:49:42 -07:00
mateo-berri
138f901e09 feat(decisions): add OpenAI as a Decisions provider
System One requests to openai/ models are translated to OpenAI's Decisions shape on the way out and OpenAI's answers are translated back, so both /v1/systemone and /v1/decisions can route to gpt-6-luna.

(cherry picked from commit b94bbbc318)
2026-10-07 18:49:42 -07:00
mateo-berri
ef6cbbc6f5 bump: version 1.104.2 2026-10-07 16:27:46 -07:00
mateo-berri
d9afde2a63 fix(decisions): return 400 for bodies that are not JSON
Backport of the #45184 follow-up to stable/1.104.x.
Cherry-picked from b6bb885324 (litellm_systemone_endpoint).
2026-10-07 16:27:38 -07:00
mateo-berri
5f4588dec4 fix(decisions): cap OpenAI-format questions at the System One limit
Backport of the #45184 follow-up to stable/1.104.x.
Cherry-picked from 7ef132947a (litellm_systemone_endpoint).
2026-10-07 16:27:22 -07:00
mateo-berri
77d57c3948 fix(decisions): import assert_never from typing_extensions for Python 3.10
Backport of the #45184 follow-up to stable/1.104.x.
Cherry-picked from 29e715473c (litellm_systemone_endpoint).
2026-10-07 16:12:45 -07:00
mateo-berri
c24cbf6442 feat(decisions): serve System One format at /v1/systemone and OpenAI format at /v1/decisions
Backport of #45184 to stable/1.104.x.
Cherry-picked from 3339469e73 (litellm_systemone_endpoint, #45184 is not merged yet). The playground
System One tab and managed agent authorization are not on this line, so those hunks are dropped,
and the lazy-disabled precedence test is dropped as in the #44236 pick.
2026-10-07 16:06:21 -07:00
devin-ai-integration[bot]
bc4b7fd42c feat(decisions): add unified /v1/decisions endpoint for Jev-compatible providers (#44236)
Backport of #44236 to stable/1.104.x.
Cherry-picked from 8b1990b4bc (main). Adapted to this line: the lazy feature
helpers are ported by hand, managed agent authorization and the integration suites are not on
this line, and the lazy-disabled precedence test is dropped since attach_lazy_features takes no
feature list here.
2026-10-07 16:00:08 -07:00
yuneng-jiang
48963be81b
Merge pull request #45012 from BerriAI/litellm_pgb_bump_1104
chore(docker): bump pgbouncer to 1.26.0
2026-10-07 10:33:06 -07:00
yuneng
8dc23130b2 chore(docker): bump pgbouncer to 1.26.0 2026-10-07 06:53:41 +00:00
yuneng-jiang
31c72deaff
Merge pull request #44777 from BerriAI/litellm_chore_ca2bf5
Some checks failed
LiteLLM Rust / rust-lint (push) Has been cancelled
LiteLLM Rust / rust-test (push) Has been cancelled
LiteLLM Rust / rust-wheel (push) Has been cancelled
chore(release): refresh dependencies on stable/1.104.x and cut 1.104.1
2026-10-05 22:27:59 -07:00
Yuneng Jiang
76be798b83
chore: refresh uv.lock for 1.104.1 2026-10-05 18:54:47 -07:00
Yuneng Jiang
fe2d304792
bump: version 1.104.0 → 1.104.1 2026-10-05 18:54:28 -07:00
Yuneng Jiang
b349abe125
chore(deps): bump source-map-js in the vscode-extension lockfile 2026-10-05 18:52:54 -07:00
Yuneng Jiang
8fe56436e9
chore(deps): bump source-map-js and smol-toml in the dashboard lockfile 2026-10-05 18:52:53 -07:00
Yuneng Jiang
e79811bd85
chore(deps): bump next, moment and brace-expansion in the dashboard 2026-10-05 18:52:53 -07:00
Yuneng Jiang
a2630cd039
chore(deps): bump werkzeug to 3.1.9 2026-10-05 18:51:02 -07:00
Yuneng Jiang
0bbd5683f8
chore(deps): bump multidict to 6.9.1 2026-10-05 18:51:01 -07:00
Yuneng Jiang
b3a2bc4b1b
chore(deps): bump mako to 1.4.2 2026-10-05 18:51:00 -07:00
Yuneng Jiang
28892881cb
chore(deps): bump langgraph-sdk to 0.4.4 2026-10-05 18:51:00 -07:00
yuneng-jiang
79645770fe
Merge pull request #44397 from BerriAI/litellm_fix_d03a47
fix(proxy-extras): keep the post-migration sanity check from building the hand-built SpendLogs indexes
2026-10-03 11:41:40 -07:00
Yuneng Jiang
5bb3b88197
fix(proxy-extras): keep the post-migration sanity check from building the hand-built SpendLogs indexes
schema.prisma still declares the LiteLLM_SpendLogs (api_key, startTime) and (litellm_call_id) indexes while their migrations are now SELECT 1, so the v1 resolver's drift script recreated both with a blocking CREATE INDEX at boot. The drift script now drops those two statements before it is applied, matching filter_request_log_index_diff on main. The schema sync test exempts the two indexes

Ported to rc/1.104.0 from stable/1.103.x (#44286), which is not on main: main carries filter_request_log_index_diff from #43948 instead, and its backport here was reverted in #44212. The key metadata recovery hunk is dropped because this line's test file has no Postgres-backed index fixture

(cherry picked from commit 4d245e1d9c)
2026-10-03 10:42:20 -07:00
yuneng-jiang
5aa0cd00fb
chore(release): backport part of #43902 and #43983 to rc/1.104.0 (#44332)
* test(e2e): align completion, SAIL, and spend-log fixtures with supported contracts (#43902)

Partial backport to rc/1.104.0: only the text completion endpoint test moves off the deprecated gpt-3.5-turbo-instruct to openai/gpt-5.4-nano. The SAIL, spend-log and coverage registry repairs target tests or behavior this line does not need for the e2e suite

(cherry picked from commit e61733b170)

* test(ci): repair stale tests and flaky CI infrastructure (#43983)

Partial backport to rc/1.104.0: only the Together AI structured-output e2e case moves to the hybrid reasoning backend with reasoning off, since the reasoning-only model it picked returned no content. The CI infrastructure and other test repairs are not needed for this line's e2e suite

(cherry picked from commit 6ca90b927c)
2026-10-02 22:20:02 -07:00
yuneng-jiang
31d6c60e92
chore(release): backport #44283 and part of #44229 to rc/1.104.0 (#44312)
Some checks failed
LiteLLM Rust / rust-lint (push) Has been cancelled
LiteLLM Rust / rust-test (push) Has been cancelled
LiteLLM Rust / rust-wheel (push) Has been cancelled
* test: repair stale and polluting tests red on scheduled main CI (#44229)

Partial backport to rc/1.104.0: only the owned Redis port, Presidio stored-content check and event-loop lag logging fixes apply here. The other repairs target tests or behavior this line does not have

* test(proxy): stop the proxy_server app fixture leaking LITELLM_LOG

The session app fixture set LITELLM_LOG=ERROR with os.environ.setdefault and never removed it, so later tests on the same xdist worker inherited it. test_drop_params_env_var spawns a subprocess with os.environ and lost the warning it asserts on. Scope the variable to the import with a MonkeyPatch context

* test(secret-detection): give the hand-built redaction request an ASGI path

Since #43975 _read_request_body checks the route path via request.scope, and a scope without path raised KeyError that was swallowed into an empty body, so chat_completion failed with a missing messages parameter. Real ASGI scopes always carry path

* test(integration): isolate litellm callback lists per sdk test

usage-based-routing-v2 Routers register their selector in litellm.callbacks and nothing removes it, not even Router.reset(). The counter TTL and Redis service metrics tests left their selectors behind, and the next usage routing test ran their pre-call checks against its own rpm=1 deployments, raising "Deployment over defined rpm limit". An autouse fixture now gives each sdk test copies of the callback lists and restores the originals afterwards

* test(integration): keep the owner-lookup fault proxy off the shared read replica

The owned proxy points DATABASE_URL at a scratch database but inherited
DATABASE_URL_READ_REPLICA from the replica job, so auth read the shared
database and rejected the freshly created key with token_not_found_in_db.
Drop the replica variable like the other scratch-database owned proxies

* test(integration): request every seeded key in the team owner breakdown

The aggregated team activity endpoint now caps breakdown.api_keys at the top
100 keys by default (#43398), so the 300 seeded keys came back as 100 rows.
The test guarantees each key is reported with its own owner, so ask for an
api_key_limit that covers all seeded keys

* test(integration): give every owned Redis its own port in the redis-cache container

On CircleCI every owned Redis ran on the fixed port 16379 inside the shared
redis-cache container. When an earlier server still held that port, the new
one failed to bind, readiness pinged the old server, the pidfile read failed
and cleanup then reported "Owned Redis still serves after shutdown"

Reserve an ephemeral port for the docker-exec path the same way the local
binary path already does, and refuse to start when something already serves
the chosen port so the failure names the real cause

* test(e2e): skip the Vertex Mistral partner case the e2e project cannot reach

The e2e Vertex project gets a 404 publisher model not found for vertex_ai/mistral-small-2503, so the case can only fail

* test(e2e): skip the Vertex gpt-oss partner case the e2e project never serves

vertex_ai/openai/gpt-oss-120b-maas has hit a 60s read timeout with no response headers on every run in the e2e Vertex project since the case was ported, and no other Vertex partner chat model passes there to switch to

* test(e2e): check only stored message content for a leaked card number

The Presidio spend-log check ran the card-number pattern over the whole serialized response, so a Luhn-valid usage.cost float (0.0003466000000000001) failed the streaming /v1/messages case although the stored content was <CREDIT_CARD>. The check now reads the content and text strings of the stored response, which is where a raw card would land, and still requires the placeholder there

* test(e2e): assert the proxy decodes token-array embeddings for titan

The port in #44120 carried over a legacy SDK-direct test that expected Bedrock to reject token ids with a 400. Through the proxy, /embeddings decodes token arrays to text for providers that cannot embed tokens, so titan answers 200. The test now sends a token array and its decoded sentence and requires the two vectors to match, which fails if the proxy stops decoding or decodes with the wrong tokenizer

* test(e2e): run the Bedrock extended-thinking round trip on a model that honors enabled thinking

us.anthropic.claude-sonnet-5-5 is adaptive-only, so litellm sends thinking.type=enabled with a 1024 budget as adaptive with low effort, and Bedrock returned no reasoning blocks on 5 of 5 identical Converse calls (boto3 direct agreed). us.anthropic.claude-sonnet-4-6 accepts the legacy shape verbatim and returned reasoning on 5 of 5. The non-thinking Bedrock case stays on sonnet-5-5

* test(proxy): stop unit modules forcing DEBUG logging into the event-loop lag tests

Five tests/unit modules set verbose_proxy_logger to DEBUG at import, so every xdist worker that collected them logged the 2.4MB pass-through response from a worker thread, and secret redaction of that line held the GIL for ~0.8s+ inside the timed window. The lag tests now pin the LiteLLM loggers to WARNING and freeze gc while timing, and the module-level DEBUG overrides are removed

* test(e2e): cite the tokenizer and date behind the titan token-array fixture

* test(e2e): let migration seed replicas finish their request-log indexes before cloning

Since #43948 a serving proxy builds the two LiteLLM_SpendLogs indexes on a background thread after it reports ready. The seed fixtures stopped the replica at readiness, so every cloned legacy database lacked an index no real deployment would be missing, and the v2 baseline diff refused it. Seeds now wait until both indexes exist and are valid in the database's schema

* test(passthrough): give the pass-through MockRequest an httpx URL and ASGI scope

* test(integration): ignore foreign allow_all_keys MCP servers in the access matrix tool list

test_toolset_gateway_url_serves_a_team_granted_toolset_to_a_key_without_its_own_grant (#43908) registers an allow_all_keys server on the shared gateway, and allow_all_keys servers are listed to every key by design, so a matrix case running on another xdist worker at the same time saw its tools. The matrix now drops tools of allow_all_keys servers it did not create, read from LiteLLM_MCPServerTable before and after listing, and still compares everything else exactly

(cherry picked from commit 9b5562f89b)

* fix(proxy-extras): retry P3009 when a peer already recovered the named migration row (#44283)

* fix(proxy-extras): retry P3009 when a peer already recovered the named migration row

* fix(proxy-extras): pin P3009 recovery locals as Final and cover a recovered sibling row

* test(proxy-extras): stop the P3009 ledger fakes shadowing the partition detector cursor

* fix(proxy-extras): annotate the migration ledger reader locals as Final

---------

Co-authored-by: yuneng <yuneng@berri.ai>
(cherry picked from commit 8b11b682f4)

---------

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-02 19:15:58 -07:00
yuneng-jiang
656daa062d
chore(release): backport #44277 to rc/1.104.0 and bump oauthlib (#44304)
* fix(proxy): stop queued registry read-throughs spending the resync budget (#44277)

* fix(proxy): stop queued registry read-throughs spending the resync budget

RegistryReadThrough.attempt serializes misses behind one lock, but every
request that was queued behind the first one still spent a unit of the
20-per-5s resync budget and re-ran the DB resync, even though the first
request had already loaded the object. A burst of more than 20 requests
for a model created on another worker therefore exhausted the budget and
the rest got 400 "Invalid model name".

attempt now checks whether the key is already loaded once it holds the
lock and returns early without touching the budget. Models check the
router's model names and deployment ids, guardrails and agents reuse
their existing registry lookups.

* test(proxy): gate the queued read-through test on events and cover each registry's loaded check

The queued-requests test now holds the first resync on an asyncio.Event instead of
a timed sleep and records calls in a recorder with tuple and frozenset state. New
tests show the model, guardrail and agent read-throughs each answer an object that
is already loaded without reading the database, so rewiring any registry's loaded
check now fails a test

* test(proxy): keep the queued read-through recorder inside its test and type the agent registry fixture

(cherry picked from commit b877a38e5f)

* chore(deps): bump oauthlib to 4.0.0
2026-10-02 18:41:55 -07:00
yuneng-jiang
a1f27fcbe1
test: fix three order-dependent and timing-flaky tests (#44271) (#44280)
* test(integration): answer the model-info refresh GET in the mixed MCP responses wire peer

The proxy's periodic model-info refresh sends GET /v1/models to the deployment api_base, which tripped the peer's /responses-only assertion when a tick landed mid-test

* test(e2e): wait for the api-keys URL after clicking Virtual Keys in onboarding

/ui already renders the Virtual Keys heading, so the helper returned before navigation finished. The late route change moved focus and closed the account menu popover in hideLiteAdmin

* test(proxy): stop two unit modules leaking app.openapi_schema and a session-wide Router

test_custom_openapi cached a stripped schema on app.openapi_schema and never cleared it, breaking later openapi route tests. test_proxy_reject_logging built a module-level Router that stayed in the live router registry all session and re-added cost-map keys during a reload. Reset the schema via monkeypatch and make the Router a function-scoped fixture

(cherry picked from commit a292fd409f)
2026-10-02 16:35:44 -07:00
yuneng-jiang
6e747b059b
test(integration): opt the config pass-through spend-log case into auth (#44267)
The failure spend-log row from #42695 is written for pass-through routes that
run as LLM API routes, which a config route only does with auth: true. The
test omitted auth and passed only while config wins (#41779) registered config
entries through the typed model, where auth defaults to true. #43962 restored
the pre-config-wins registration, so the route lost that status and the row
was never written. Set auth: true on the route so the test covers the logging
it was written for without depending on that side effect

(cherry picked from commit 1d9cd9b09c)
2026-10-02 16:10:55 -07:00
yuneng-jiang
2e5981cdfe
Merge pull request #44224 from BerriAI/litellm_rc_1_104_0_extras_post1
chore: bump litellm-proxy-extras to 0.4.102.post1
2026-10-02 12:33:12 -07:00
yuneng
13d3ba8e98 chore: bump litellm-proxy-extras to 0.4.102.post1 2026-10-02 19:20:16 +00:00
yuneng-jiang
e0127558f2
Merge pull request #44206 from BerriAI/litellm_rc_1_104_0_enforce_migration_check_default
fix(proxy): enforce the migration check by default and stop building SpendLogs indexes in migrations (rc/1.104.0)
2026-10-02 12:15:01 -07:00
yuneng-jiang
fb90b661a2
chore(release): backport #44066 to rc/1.104.0 (#44216)
* feat(mcp)!: disable stdio MCP servers by default (#44066)

* feat(mcp)!: disable stdio MCP servers by default

stdio MCP servers now only run when the proxy is started with
LITELLM_ENABLE_MCP_STDIO=true. While it is off, existing stdio servers stay
registered but never start: tool listings skip them quietly, direct tool
calls and health checks return a 403 naming the env var, and creating or
updating a stdio server is rejected. The flag is read from the process
environment only, so DB-stored environment_variables cannot turn it on.

The UI reads mcp_stdio_enabled from /.well-known/litellm-ui-config to grey
out the stdio transport, show a banner on stdio forms, and badge stdio
server cards.

BREAKING CHANGE: stdio MCP servers are off by default. Set
LITELLM_ENABLE_MCP_STDIO=true in the proxy environment and restart to keep
using them.

* fix(mcp): ignore stdio flag from config file and read UI flag from the selected worker

LITELLM_ENABLE_MCP_STDIO set under environment_variables in config.yaml is now skipped like the DB-stored value, so only the process environment can enable stdio. The dashboard reads mcp_stdio_enabled from the proxy it is managing, so a control plane shows each worker's own setting.

* test(mcp): cover non-mapping payloads in the shared transport validator

* fix(mcp): skip blocked stdio servers quietly in every listing and keep the UI unchanged until the flag loads

Prompt, resource and resource-template listings now skip a blocked stdio server at debug level like tool listing does, instead of logging a warning per server on every call. The dashboard only treats stdio as disabled once the proxy explicitly reports mcp_stdio_enabled false, so a proxy with the flag on, or an older one without the field, renders exactly as before with no flicker while loading.

* fix(mcp): route blocked stdio tool calls to the flag error and warn once per server

A gateway tools/call naming a blocked stdio server's tool now returns the
LITELLM_ENABLE_MCP_STDIO message instead of "Tool not found".

The "will not start" warning moves out of build_mcp_server_from_table, which
DB reload re-runs on every cycle for rows with a NULL updated_at and which
drafts and test-connection also call. It now fires when a row first enters
the registry or changes transport.

* fix(ui): explain on the server detail page why a stdio server is inert

The Overview and MCP Tools tabs showed "No tools available" with no reason
while stdio is disabled. The detail page now shows the same warning banner
as the edit form, and hands off to the form's banner once editing starts.

* refactor(ui): name the stdio banner conditions on the server detail page

Keeps local/no-long-condition-chain within its budget

* fix(proxy): log the ignored DB-stored LITELLM_ENABLE_MCP_STDIO warning once

The DB config sync re-reads environment_variables on every cycle, so a stored
flag logged the warning on each sync per worker

(cherry picked from commit 2b85808011)

* chore(deps): bump pyjwt to 2.15.0

* chore(deps): bump pypdf to 6.19.0

* chore(deps): bump tornado to 6.5.9

* chore(deps): bump urllib3 to 2.8.0

* chore(deps): bump gitpython to 3.1.62

* chore: update Next.js build artifacts (2026-10-02 18:00 UTC, node v24.19.0)
2026-10-02 12:04:10 -07:00
yassin
84e85778ba fix(proxy): enforce the migration check by default and stop building SpendLogs indexes in migrations
ENFORCE_PRISMA_MIGRATION_CHECK now defaults to true in both the proxy CLI and the standalone migration entrypoint, with ENFORCE_PRISMA_MIGRATION_CHECK=false or --no-enforce_prisma_migration_check as the opt-out. The two LiteLLM_SpendLogs index migrations become SELECT 1 so operators build those indexes online by hand.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-02 17:34:32 +00:00
yuneng-jiang
5663d07a1a
revert: backport of #43948, #44109, #44124 to rc/1.104.0 (#44156) (#44212)
This reverts merge commit dea6fb9be6, reversing changes made to 61876f228e
2026-10-02 10:27:23 -07:00
yuneng-jiang
dea6fb9be6
Merge pull request #44156 from BerriAI/litellm_backport_rc1040_bp1001
chore(release): backport #43948, #44109, #44124 to rc/1.104.0
2026-10-02 00:21:06 -07:00
Yuneng Jiang
b82994aced chore(deps): bump gitpython to 3.1.62 2026-10-02 06:48:43 +00:00
Yuneng Jiang
d7a656665f chore(deps): bump urllib3 to 2.8.0 2026-10-02 06:48:43 +00:00
Yuneng Jiang
c0d1ff41b9 chore(deps): bump tornado to 6.5.9 2026-10-02 06:48:42 +00:00
Yuneng Jiang
99b8e5b413 chore(deps): bump pyjwt to 2.15.0 2026-10-02 06:48:42 +00:00
Yuneng Jiang
bd59176d88 chore: bump litellm-proxy-extras to 0.4.102.post1
The backported SpendLogs index build changes code inside litellm-proxy-extras, and litellm calls the new ProxyExtrasDBManager methods at boot. 0.4.102 is already published without them, so the pin moves to a post release built from this line
2026-10-02 06:48:42 +00:00
yassin
f46ddd24aa feat(proxy-extras): make the SpendLogs index build opt-in
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit 4d95818e34)
2026-10-02 06:48:42 +00:00
devin-ai-integration[bot]
7f81c8ea88 fix(proxy-extras): bound the lock waits of the partitioned SpendLogs index build (#44109)
Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit 123237c8a8)
2026-10-02 06:48:42 +00:00
devin-ai-integration[bot]
24e0d53fc2 fix(proxy-extras): build the SpendLogs indexes in the migration job instead of in migrations (#43948)
The two SpendLogs index migrations shipped in v1.103.0 each break one table shape: the plain CREATE INDEX holds a SHARE lock on a large unpartitioned table and the CONCURRENTLY one fails with 0A000 on a partitioned parent. Both files are now inert and the indexes are built by a table-driven, shape-aware step after migrate deploy: CONCURRENTLY on a plain table, ON ONLY the parent plus per-partition CONCURRENTLY and ATTACH PARTITION on a partitioned one. The migration job builds them synchronously and exits non-zero on failure; a serving proxy that ran migrate deploy itself builds them in the background off the readiness path. A valid index of the same definition under another name is renamed and reused, an invalid one is rebuilt, and extra copies are reported with their DROP INDEX statement instead of being dropped. The migration checker rejects any CREATE INDEX on LiteLLM_SpendLogs or LiteLLM_ErrorLogs in future migrations

Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit c66c8288c3)
2026-10-02 06:48:42 +00:00
yuneng-jiang
61876f228e
fix(proxy): restore pre-config-wins handling of pass-through endpoints (#43962) (#44054)
* fix(proxy): restore pre-config-wins handling of pass-through endpoints

Config-wins (#41779) made general_settings.pass_through_endpoints a config-owned key. The DB reader then got the config list back as if it were DB rows, re-registered each entry without forward_headers on every DB sync, and the stripped copy won the route lookup, so a config pass-through with forward_headers: true stopped forwarding Authorization. UI create, update and delete of pass-throughs were also rejected while the config declared any.

This puts pass-throughs back on their pre-#41779 path: the settings store no longer lets the config own the key, the config list is captured env-resolved at load_config, each DB sync merges DB entries with config entries on paths the DB does not declare, and /config/field/info reads the stored rows only. A UI pass-through write re-applies that merge immediately so the config entries stay served until the next sync.

* fix(proxy): keep config pass-throughs in every reload of the merged list

get_config now returns DB pass-throughs plus config ones on other paths,
each DB sync republishes that merged list, and /config/field/info reads
pass_through_endpoints from the DB row so a UI write never drops stored
entries when models are not stored in the DB

* fix(proxy): keep serving pass-throughs while the config file reloads

load_yaml cleared the runtime pass-through list, so auth: false routes
answered 401 while get_config awaited the database

* fix(proxy): read stored pass-throughs from the writer before a UI write

A lagging read replica could return an older list, and the UI create and
edit flows write the whole field back

* fix(proxy): apply config file pass-through auth changes on reload

The kept runtime list was merged as if it were DB entries, so an edited
config entry on the same path was dropped. Merge the stored DB row with
the fresh config instead, and give the field-info test mock a writer

* fix(proxy): keep pass-throughs served while a DB sync reads the database

get_config resets the stored DB rows before reading them again, which
cleared the served pass-through list and made auth: false routes answer
401 for the length of the read

* refactor(proxy): move the settings store reload out of the loop

basedpyright rejects a Final variable assigned inside a loop

(cherry picked from commit 2eb2bf130b)
2026-10-01 11:40:00 -07:00