mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-24 22:09:56 +00:00
Forwarding mode forwarded everything to Python with no native app behind it, and standalone mode built its own, so the two modes could not share a layer. The gateway now builds one native app in main.rs and serves it in both modes. Standalone serves it on its own listener. In front of Python, gateway-forward takes it as any tower Service together with `admit`, never as an axum Router, and composes the two itself, so no request Python answers passes through a native layer. `admit` is the only thing that decides who answers, and x-litellm-gateway names who did. `admit` is a value built from the config and called per request. It judges a request by its route, POST /v1/messages, and its caller, the master key. One that passes is answered by the native app, and Python never sees it. This is the happy path only. The config's settings and the request's headers and body are not judged yet, so a setting or parameter only Python honors is served natively until a later change adds those judges. A gateway that loaded no config refuses every request with reason configuration. x-litellm-gateway now names which check refused, as configuration, route or credential. In front of Python the native app is built from the config file Python runs with. The supervisor resolves the local YAML file by Python's own precedence, which is CONFIG_FILE_PATH, else --config, and none when LITELLM_CONFIG_BUCKET_NAME moves the config to a bucket. It passes the path as LITELLM_FORWARD_CONFIG, and the gateway loads it the way standalone mode does. With no local file the config is empty. A file the gateway cannot load, or a config the native app cannot be built from, is logged as an error and also leaves the config empty with every request refused, because the gateway exiting would stop Python with it. Config stored in the database is not read yet. Forwarding mode now builds the same AppState and verifies the same license as standalone. The new process module reads the environment once and picks the mode, replacing settings.rs. NON_LLM_CONNECTION_TIMEOUT is read the way Python's get_env_int reads it, so a blank or unparsable value no longer stops the gateway, and Python with it, in forwarding mode. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| test_audio_transcription_model_resolution.py | ||
| test_basic_proxy_startup.py | ||
| test_callback_delete.py | ||
| test_callback_leak_contracts.py | ||
| test_callback_settings_boot.py | ||
| test_claude_settings_real_io.py | ||
| test_codex_catalog_boot.py | ||
| test_config_declared_model_behaviours.py | ||
| test_effective_settings.py | ||
| test_fips_mode_boot.py | ||
| test_json_logs_startup.py | ||
| test_lazy_routes_flag.py | ||
| test_main_real_io.py | ||
| test_multi_worker_reload.py | ||
| test_multi_worker_slow_import_boot.py | ||
| test_openapi_docs_route.py | ||
| test_reload_worker_pool.py | ||
| test_runtime_real_io.py | ||
| test_rust_forward.py | ||
| test_rust_forward_lifecycle.py | ||
| test_rust_forward_traffic.py | ||
| test_search_embedding_model_settings.py | ||
| test_startup_output.py | ||
| test_unit_conftest_isolation.py | ||