mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-24 00:52:24 +00:00
Merge pull request #42071 from BerriAI/litellm_remove_dead_telemetry_flag
This commit is contained in:
commit
58065d46fd
18 changed files with 38 additions and 30 deletions
2
.github/template.yaml
vendored
2
.github/template.yaml
vendored
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -212,7 +212,6 @@ sandbox_tools:
|
|||
|
||||
litellm_settings:
|
||||
drop_params: True
|
||||
telemetry: False
|
||||
code_interpreter_interception_params:
|
||||
enabled: true
|
||||
sandbox_tool_name: e2b_sandbox
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -758,9 +756,11 @@ class ProxyInitializationHelpers:
|
|||
)
|
||||
@click.option(
|
||||
"--telemetry",
|
||||
default=True,
|
||||
default=None,
|
||||
type=bool,
|
||||
help="Helps us know if people are using this feature. Turn this off by doing `--telemetry False`",
|
||||
hidden=True,
|
||||
expose_value=False,
|
||||
help="Deprecated no-op kept so existing start commands still parse",
|
||||
)
|
||||
@click.option(
|
||||
"--log_config",
|
||||
|
|
@ -977,7 +977,6 @@ def run_server(
|
|||
add_function_to_prompt,
|
||||
config,
|
||||
max_budget,
|
||||
telemetry,
|
||||
test,
|
||||
local,
|
||||
num_workers,
|
||||
|
|
@ -1082,7 +1081,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,
|
||||
|
|
|
|||
|
|
@ -1230,12 +1230,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)
|
||||
|
||||
enforce_master_key_boot_verdict(
|
||||
await with_stored_secrets_counted(
|
||||
|
|
@ -2426,7 +2426,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
|
||||
|
|
@ -8621,6 +8620,14 @@ 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: 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(
|
||||
model=None,
|
||||
alias=None,
|
||||
|
|
@ -8632,7 +8639,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,
|
||||
|
|
@ -8648,7 +8654,6 @@ async def initialize(
|
|||
user_user_max_tokens, \
|
||||
user_request_timeout, \
|
||||
user_temperature, \
|
||||
user_telemetry, \
|
||||
user_headers, \
|
||||
experimental, \
|
||||
llm_model_list, \
|
||||
|
|
@ -8755,7 +8760,6 @@ async def initialize(
|
|||
dynamic_config["general"]["max_budget"] = litellm.max_budget
|
||||
if experimental:
|
||||
pass
|
||||
user_telemetry = telemetry
|
||||
|
||||
|
||||
# for streaming
|
||||
|
|
|
|||
|
|
@ -49,4 +49,3 @@ general_settings:
|
|||
|
||||
litellm_settings:
|
||||
drop_params: True
|
||||
telemetry: False
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -256,7 +256,6 @@ general_settings:
|
|||
master_key: {api_key}
|
||||
|
||||
litellm_settings:
|
||||
telemetry: false
|
||||
""",
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
|
|
|||
|
|
@ -228,7 +228,6 @@ general_settings:
|
|||
|
||||
litellm_settings:
|
||||
drop_params: true
|
||||
telemetry: false
|
||||
""",
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
],
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
@ -376,7 +377,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 +395,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 +502,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),
|
||||
|
|
@ -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
|
||||
# ---------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -617,6 +617,15 @@ class TestProxyInitializationHelpers:
|
|||
assert "Skipping server startup" in result.output
|
||||
mock_uvicorn_run.assert_not_called()
|
||||
|
||||
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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue