litellm/tests/_support
yujonglee 56ff5cdb46
feat(gateway): resolve Redis and the database in their own crates and hand them to routes as axum state (#52222)
build_redis had one caller, and its result was bound to an unused variable, so no route could reach Redis. The gateway also had no database pool at all, and readiness always answered "Not connected".

The Redis merge (the REDIS_* layering and its secret snapshot, with their contract tests) moves from gateway/src/redis into redis-resolve, next to interpret. The new db-resolve crate reads the writer and the read replica from general_settings and the DATABASE_* variables into litellm_db::Endpoint. Each crate has one resolve call that takes the host's SecretResolver, so a setting can come from the environment, the secret manager or OIDC, and every name is asked for by name. The gateway only picks the surface and connects.

The Python host resolves its native pool endpoint through the same crate, with DatabaseEndpoint.resolve in python-bridge, so no endpoint rule is left in Python.

Resources is built first, once per config. It holds the environment with the config's environment_variables in front of the process, the SecretResolver over it, the HTTP client config and the inference CoreResources. Inference, Redis and the database each take what they need from it, so no part reaches into another for a pool or for secrets.

AppState holds inference, the Redis clients and the database pools. It is built once at boot and passed to the router with with_state, and a handler takes the part it needs with State<RedisClients> or State<Option<Pools>>. Readiness pings the writer and reports connected, disconnected or Not connected.

Forwarding mode still builds no state because it serves nothing natively on main. Token auth, PKCS#12 client certificates on the gateway and the proxy's 503 on a disconnected database are not ported, and the db-resolve AGENTS file lists every difference from the Python host.
2026-11-18 09:16:13 +09:00
..
__init__.py fix(params): stop stream_chunk_size reaching provider request bodies (#42664) 2026-09-23 10:27:47 -07:00
clock_loops.py fix(proxy)!: end a chat completions stream with an error event when a guardrail blocks mid-stream (#46953) 2026-10-17 18:00:12 -07:00
mcp_count_tool_upstream.py feat(mcp): add an opt-in per-server setting to skip MCP tool output validation (#49961) 2026-11-03 20:42:10 -08:00
native_database.py feat(gateway): resolve Redis and the database in their own crates and hand them to routes as axum state (#52222) 2026-11-18 09:16:13 +09:00
parallel_request_limiter_golden.py feat(callbacks-parallel-request-limiter): port parallel request limiter v3 to a rust callback (#51537) 2026-11-16 22:56:38 -08:00
rust_parallel_request_limiter.py feat(callbacks-parallel-request-limiter): port parallel request limiter v3 to a rust callback (#51537) 2026-11-16 22:56:38 -08:00
stream_chunk_size.py fix(params): validate stream_chunk_size once, before any provider call (#43222) 2026-09-26 23:01:20 +00:00