From f8204724880405680649eaa75c937529abfc649b Mon Sep 17 00:00:00 2001 From: mateo Date: Sun, 20 Sep 2026 01:44:10 +0000 Subject: [PATCH 1/5] chore: remove the dead telemetry flag from the SDK, proxy CLI and configs Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- cookbook/livekit_agent_sdk/config.example.yaml | 1 - litellm/__init__.py | 1 - litellm/proxy/dev_config.yaml | 1 - litellm/proxy/example_config_yaml/oai_misc_config.yaml | 1 - litellm/proxy/proxy_cli.py | 10 ---------- litellm/proxy/proxy_server.py | 4 ---- litellm/proxy/wildcard_config.yaml | 1 - proxy_server_config.yaml | 1 - scripts/benchmark_anthropic_messages_perf.py | 1 - scripts/benchmark_chat_completions_perf.py | 1 - tests/integration/_support/process.py | 2 -- .../test_bedrock_knowledgebase_hook.py | 1 - tests/proxy_unit_tests/test_proxy_utils.py | 1 - .../llms/wandb/test_wandb_chat_transformation.py | 1 - .../test_litellm/proxy/proxy_server/test_lifecycle.py | 6 +++--- 15 files changed, 3 insertions(+), 30 deletions(-) diff --git a/cookbook/livekit_agent_sdk/config.example.yaml b/cookbook/livekit_agent_sdk/config.example.yaml index 1361f36af34..072625018a7 100644 --- a/cookbook/livekit_agent_sdk/config.example.yaml +++ b/cookbook/livekit_agent_sdk/config.example.yaml @@ -15,7 +15,6 @@ model_list: litellm_settings: drop_params: True - telemetry: False general_settings: master_key: sk-1234 # Change this to a secure key diff --git a/litellm/__init__.py b/litellm/__init__.py index e17ab613dac..738dd0cac76 100644 --- a/litellm/__init__.py +++ b/litellm/__init__.py @@ -240,7 +240,6 @@ email: Optional[str] = ( token: Optional[str] = ( None # Not used anymore, will be removed in next MAJOR release - https://github.com/BerriAI/litellm/discussions/648 ) -telemetry = True max_tokens: int = DEFAULT_MAX_TOKENS # OpenAI Defaults drop_params = drop_params_env_flag(os.environ, verbose_logger) modify_params = bool(os.getenv("LITELLM_MODIFY_PARAMS", False)) diff --git a/litellm/proxy/dev_config.yaml b/litellm/proxy/dev_config.yaml index f78431f694b..2eb503144e1 100644 --- a/litellm/proxy/dev_config.yaml +++ b/litellm/proxy/dev_config.yaml @@ -212,7 +212,6 @@ sandbox_tools: litellm_settings: drop_params: True - telemetry: False code_interpreter_interception_params: enabled: true sandbox_tool_name: e2b_sandbox diff --git a/litellm/proxy/example_config_yaml/oai_misc_config.yaml b/litellm/proxy/example_config_yaml/oai_misc_config.yaml index 16cc69c19a5..b6b2d0f71f5 100644 --- a/litellm/proxy/example_config_yaml/oai_misc_config.yaml +++ b/litellm/proxy/example_config_yaml/oai_misc_config.yaml @@ -38,7 +38,6 @@ litellm_settings: # budget_duration: 30d num_retries: 5 request_timeout: 600 - telemetry: False context_window_fallbacks: [{"gpt-5-mini": ["gpt-5.5"]}] default_team_settings: - team_id: team-1 diff --git a/litellm/proxy/proxy_cli.py b/litellm/proxy/proxy_cli.py index 0477b6c62e9..ddb02508c1f 100644 --- a/litellm/proxy/proxy_cli.py +++ b/litellm/proxy/proxy_cli.py @@ -56,8 +56,6 @@ if litellm_mode == "DEV": load_dotenv() from enum import Enum -telemetry: Final = None - class LiteLLMDatabaseConnectionPool(Enum): database_connection_pool_limit = 10 @@ -756,12 +754,6 @@ class ProxyInitializationHelpers: type=float, help="Set max budget for API calls - works for hosted models like OpenAI, TogetherAI, Anthropic, etc.`", ) -@click.option( - "--telemetry", - default=True, - type=bool, - help="Helps us know if people are using this feature. Turn this off by doing `--telemetry False`", -) @click.option( "--log_config", default=None, @@ -977,7 +969,6 @@ def run_server( add_function_to_prompt, config, max_budget, - telemetry, test, local, num_workers, @@ -1082,7 +1073,6 @@ def run_server( max_tokens=max_tokens, request_timeout=request_timeout, max_budget=max_budget, - telemetry=telemetry, drop_params=drop_params, add_function_to_prompt=add_function_to_prompt, headers=headers, diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index af25d418a63..df326615764 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -2374,7 +2374,6 @@ user_debug = False user_max_tokens = None user_request_timeout = None user_temperature = None -user_telemetry = True user_config: Final = None user_headers = None user_config_file_path: str | None = None @@ -8580,7 +8579,6 @@ async def initialize( max_tokens=None, request_timeout=600, max_budget=None, - telemetry=False, drop_params=True, add_function_to_prompt=True, headers=None, @@ -8596,7 +8594,6 @@ async def initialize( user_user_max_tokens, \ user_request_timeout, \ user_temperature, \ - user_telemetry, \ user_headers, \ experimental, \ llm_model_list, \ @@ -8703,7 +8700,6 @@ async def initialize( dynamic_config["general"]["max_budget"] = litellm.max_budget if experimental: pass - user_telemetry = telemetry # for streaming diff --git a/litellm/proxy/wildcard_config.yaml b/litellm/proxy/wildcard_config.yaml index 7c178690836..e1bae7abe65 100644 --- a/litellm/proxy/wildcard_config.yaml +++ b/litellm/proxy/wildcard_config.yaml @@ -49,4 +49,3 @@ general_settings: litellm_settings: drop_params: True - telemetry: False diff --git a/proxy_server_config.yaml b/proxy_server_config.yaml index 703d56bc0cd..05df5e31e49 100644 --- a/proxy_server_config.yaml +++ b/proxy_server_config.yaml @@ -173,7 +173,6 @@ litellm_settings: # budget_duration: 30d num_retries: 5 request_timeout: 600 - telemetry: False context_window_fallbacks: [{"gpt-3.5-turbo": ["gpt-3.5-turbo-large"]}] default_team_settings: - team_id: team-1 diff --git a/scripts/benchmark_anthropic_messages_perf.py b/scripts/benchmark_anthropic_messages_perf.py index 3c8a22f0cc2..3e4b4b25b6a 100644 --- a/scripts/benchmark_anthropic_messages_perf.py +++ b/scripts/benchmark_anthropic_messages_perf.py @@ -256,7 +256,6 @@ general_settings: master_key: {api_key} litellm_settings: - telemetry: false """, encoding="utf-8", ) diff --git a/scripts/benchmark_chat_completions_perf.py b/scripts/benchmark_chat_completions_perf.py index 2c211f674fe..c9f025a145f 100644 --- a/scripts/benchmark_chat_completions_perf.py +++ b/scripts/benchmark_chat_completions_perf.py @@ -228,7 +228,6 @@ general_settings: litellm_settings: drop_params: true - telemetry: false """, encoding="utf-8", ) diff --git a/tests/integration/_support/process.py b/tests/integration/_support/process.py index 84ee2ad1b79..e0923c9d055 100644 --- a/tests/integration/_support/process.py +++ b/tests/integration/_support/process.py @@ -74,8 +74,6 @@ def owned_proxy(gateway: Gateway, directory: Path, overrides: Mapping[str, str], str(port), "--num_workers", "1", - "--telemetry", - "False", "--use_prisma_db_push", "--enforce_prisma_migration_check", ], diff --git a/tests/logging_callback_tests/test_bedrock_knowledgebase_hook.py b/tests/logging_callback_tests/test_bedrock_knowledgebase_hook.py index 9faaaf492e8..5571c15beff 100644 --- a/tests/logging_callback_tests/test_bedrock_knowledgebase_hook.py +++ b/tests/logging_callback_tests/test_bedrock_knowledgebase_hook.py @@ -883,7 +883,6 @@ async def test_provider_specific_fields_in_proxy_http_response( max_tokens=None, request_timeout=600, max_budget=None, - telemetry=False, drop_params=True, add_function_to_prompt=False, headers=None, diff --git a/tests/proxy_unit_tests/test_proxy_utils.py b/tests/proxy_unit_tests/test_proxy_utils.py index 160753e3442..7cdd7365209 100644 --- a/tests/proxy_unit_tests/test_proxy_utils.py +++ b/tests/proxy_unit_tests/test_proxy_utils.py @@ -1112,7 +1112,6 @@ def test_settings_store_preserves_yaml_team_configuration_when_db_value_is_null( }, "param_name": "litellm_settings", "db_param_value": { - "telemetry": False, "drop_params": True, "num_retries": 5, "request_timeout": 600, diff --git a/tests/test_litellm/llms/wandb/test_wandb_chat_transformation.py b/tests/test_litellm/llms/wandb/test_wandb_chat_transformation.py index dd0d1bdbb9d..a25ed585ecc 100644 --- a/tests/test_litellm/llms/wandb/test_wandb_chat_transformation.py +++ b/tests/test_litellm/llms/wandb/test_wandb_chat_transformation.py @@ -47,7 +47,6 @@ WANDB_REASONING_MODELS: Final = ( @pytest.fixture def wandb_test_config(local_model_cost_map, monkeypatch: pytest.MonkeyPatch) -> None: monkeypatch.setattr(litellm, "disable_aiohttp_transport", True) - monkeypatch.setattr(litellm, "telemetry", False) monkeypatch.setattr(litellm, "drop_params", False) diff --git a/tests/test_litellm/proxy/proxy_server/test_lifecycle.py b/tests/test_litellm/proxy/proxy_server/test_lifecycle.py index 6121608b658..ba560cebd52 100644 --- a/tests/test_litellm/proxy/proxy_server/test_lifecycle.py +++ b/tests/test_litellm/proxy/proxy_server/test_lifecycle.py @@ -376,7 +376,7 @@ def _lit4152_worker_config_dict(): "master_key": _LIT4152_SECRETS[0], "database_url": _LIT4152_SECRETS[3], "api_key": _LIT4152_SECRETS[2], - "telemetry": True, + "drop_params": True, } @@ -394,7 +394,7 @@ def test__redact_worker_config_for_logging_dict_masks_all_secret_shapes(): assert secret not in rendered, f"leak: {secret} in {rendered!r}" assert isinstance(redacted, dict) assert redacted["model"] == "openai/gpt-4o-mini" - assert redacted["telemetry"] is True + assert redacted["drop_params"] is True def test__redact_worker_config_for_logging_json_string_round_trips_masked(): @@ -501,7 +501,7 @@ def test__redact_worker_config_for_logging_masks_nested_secret_fields(): def test_initialize_signature_is_async_with_expected_params(): sig = inspect.signature(initialize) # Hard-coded so a signature change (param added/removed) trips the gate. - expected_param_count = 17 + expected_param_count = 16 observed = { "is_async": inspect.iscoroutinefunction(initialize), "param_count": len(sig.parameters), From 8e530cf819443540192c393957956032ffbe19ea Mon Sep 17 00:00:00 2001 From: mateo Date: Sun, 20 Sep 2026 02:36:59 +0000 Subject: [PATCH 2/5] fix: keep --telemetry as a hidden no-op so existing start commands still parse Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/proxy/proxy_cli.py | 8 ++++++++ tests/test_litellm/proxy/test_proxy_cli.py | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/litellm/proxy/proxy_cli.py b/litellm/proxy/proxy_cli.py index ddb02508c1f..464d1141f8d 100644 --- a/litellm/proxy/proxy_cli.py +++ b/litellm/proxy/proxy_cli.py @@ -754,6 +754,14 @@ class ProxyInitializationHelpers: type=float, help="Set max budget for API calls - works for hosted models like OpenAI, TogetherAI, Anthropic, etc.`", ) +@click.option( + "--telemetry", + default=None, + type=bool, + hidden=True, + expose_value=False, + help="Deprecated no-op kept so existing start commands still parse", +) @click.option( "--log_config", default=None, diff --git a/tests/test_litellm/proxy/test_proxy_cli.py b/tests/test_litellm/proxy/test_proxy_cli.py index c806725d594..8095930bbef 100644 --- a/tests/test_litellm/proxy/test_proxy_cli.py +++ b/tests/test_litellm/proxy/test_proxy_cli.py @@ -617,6 +617,16 @@ class TestProxyInitializationHelpers: assert "Skipping server startup" in result.output mock_uvicorn_run.assert_not_called() + # --- legacy --telemetry flag is accepted, ignored and hidden --- + result = runner.invoke( + run_server, ["--local", "--skip_server_startup", "--telemetry", "False"] + ) + assert ( + result.exit_code == 0 + ), f"exit_code={result.exit_code}, output={result.output}" + assert "Skipping server startup" in result.output + assert "telemetry" not in runner.invoke(run_server, ["--help"]).output + # --- normal startup --- mock_uvicorn_run.reset_mock() From fdd91a347aa9ece3778c6a8e62ffc65e38afc6df Mon Sep 17 00:00:00 2001 From: mateo Date: Sun, 20 Sep 2026 02:44:52 +0000 Subject: [PATCH 3/5] test: drop narration comment from telemetry flag test Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- tests/test_litellm/proxy/test_proxy_cli.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_litellm/proxy/test_proxy_cli.py b/tests/test_litellm/proxy/test_proxy_cli.py index 8095930bbef..8cbae859b5c 100644 --- a/tests/test_litellm/proxy/test_proxy_cli.py +++ b/tests/test_litellm/proxy/test_proxy_cli.py @@ -617,7 +617,6 @@ class TestProxyInitializationHelpers: assert "Skipping server startup" in result.output mock_uvicorn_run.assert_not_called() - # --- legacy --telemetry flag is accepted, ignored and hidden --- result = runner.invoke( run_server, ["--local", "--skip_server_startup", "--telemetry", "False"] ) From b2e123da4332344677fba1b819dc423864cee89c Mon Sep 17 00:00:00 2001 From: mateo Date: Sun, 20 Sep 2026 03:14:11 +0000 Subject: [PATCH 4/5] fix(proxy): drop legacy telemetry key from persisted WORKER_CONFIG before initialize Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .github/template.yaml | 2 +- cookbook/misc/config.yaml | 1 - litellm/proxy/proxy_server.py | 11 +++++++++-- .../test_litellm/proxy/proxy_server/test_lifecycle.py | 11 +++++++++++ 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/template.yaml b/.github/template.yaml index d4db2c2ac1f..c77e578e53c 100644 --- a/.github/template.yaml +++ b/.github/template.yaml @@ -21,7 +21,7 @@ Parameters: WorkerConfigParameter: Type: String Description: Sample environment variable - Default: '{"model": null, "alias": null, "api_base": null, "api_version": "2023-07-01-preview", "debug": false, "temperature": null, "max_tokens": null, "request_timeout": 600, "max_budget": null, "telemetry": true, "drop_params": false, "add_function_to_prompt": false, "headers": null, "save": false, "config": null, "use_queue": false}' + Default: '{"model": null, "alias": null, "api_base": null, "api_version": "2023-07-01-preview", "debug": false, "temperature": null, "max_tokens": null, "request_timeout": 600, "max_budget": null, "drop_params": false, "add_function_to_prompt": false, "headers": null, "save": false, "config": null, "use_queue": false}' Resources: MyUrlFunctionPermissions: diff --git a/cookbook/misc/config.yaml b/cookbook/misc/config.yaml index d1d06eb5842..27a6332a882 100644 --- a/cookbook/misc/config.yaml +++ b/cookbook/misc/config.yaml @@ -55,7 +55,6 @@ litellm_settings: # budget_duration: 30d num_retries: 5 request_timeout: 600 - telemetry: False context_window_fallbacks: [{"gpt-3.5-turbo": ["gpt-3.5-turbo-large"]}] general_settings: diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index df326615764..9c4ea7e8599 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -1208,12 +1208,12 @@ async def proxy_startup_event(app: FastAPI) -> AsyncGenerator[None, None]: general_settings, ) = await proxy_config.load_config(router=llm_router, config_file_path=worker_config) elif isinstance(worker_config, dict): - await initialize(**worker_config) + await initialize_from_worker_config(worker_config) else: # if not, assume it's a json string worker_config = json.loads(worker_config) if isinstance(worker_config, dict): - await initialize(**worker_config) + await initialize_from_worker_config(worker_config) # check if DATABASE_URL in environment - load from there if prisma_client is None: @@ -8568,6 +8568,13 @@ def save_worker_config(**data): os.environ["WORKER_CONFIG"] = json.dumps(data) +LEGACY_WORKER_CONFIG_KEYS: Final = frozenset({"telemetry"}) + + +async def initialize_from_worker_config(worker_config: dict[str, object]) -> None: + await initialize(**{k: v for k, v in worker_config.items() if k not in LEGACY_WORKER_CONFIG_KEYS}) + + async def initialize( model=None, alias=None, diff --git a/tests/test_litellm/proxy/proxy_server/test_lifecycle.py b/tests/test_litellm/proxy/proxy_server/test_lifecycle.py index ba560cebd52..e9695685ca5 100644 --- a/tests/test_litellm/proxy/proxy_server/test_lifecycle.py +++ b/tests/test_litellm/proxy/proxy_server/test_lifecycle.py @@ -43,6 +43,7 @@ from litellm.proxy.proxy_server import ( cost_tracking, get_litellm_model_info, initialize, + initialize_from_worker_config, load_from_azure_key_vault, proxy_shutdown_event, proxy_startup_event, @@ -522,6 +523,16 @@ async def test_initialize_invalid_unexpected_kwarg_raises_type_error(): await initialize(this_is_not_a_real_kwarg=True) +@pytest.mark.asyncio +async def test_initialize_from_worker_config_drops_legacy_telemetry_key(): + with pytest.raises(TypeError): + await initialize(telemetry=True) + await initialize_from_worker_config({"telemetry": True, "request_timeout": 77}) + assert ps.user_request_timeout == 77 + with pytest.raises(TypeError): + await initialize_from_worker_config({"this_is_not_a_real_kwarg": True}) + + # --------------------------------------------------------------------------- # load_from_azure_key_vault # --------------------------------------------------------------------------- From f7756d01cf038097b35fbcbb79246971761b1ed2 Mon Sep 17 00:00:00 2001 From: mateo Date: Sun, 20 Sep 2026 03:21:01 +0000 Subject: [PATCH 5/5] refactor(proxy): freeze the filtered worker config before initialize Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/proxy/proxy_server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 9c4ea7e8599..72bfb2b53a9 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -8571,8 +8571,9 @@ def save_worker_config(**data): LEGACY_WORKER_CONFIG_KEYS: Final = frozenset({"telemetry"}) -async def initialize_from_worker_config(worker_config: dict[str, object]) -> None: - await initialize(**{k: v for k, v in worker_config.items() if k not in LEGACY_WORKER_CONFIG_KEYS}) +async def initialize_from_worker_config(worker_config: Mapping[str, object]) -> None: + supported: Final = MappingProxyType({k: v for k, v in worker_config.items() if k not in LEGACY_WORKER_CONFIG_KEYS}) + await initialize(**supported) async def initialize(