fix(proxy): bind --debug to LITELLM_DEBUG instead of the generic DEBUG

DEBUG is one of the most reused environment variable names there is, so an
unrelated value left in a shell turned on proxy debug logging, which can put
request and response payloads into logs.

Measured with click's CliRunner before and after:

  DEBUG=1        before debug=True   after debug=False
  DEBUG=true     before debug=True   after debug=False
  DEBUG=release  before startup error, after debug=False
  DEBUG=0        before debug=False  after debug=False

Anyone setting DEBUG on purpose now sets LITELLM_DEBUG. --detailed_debug still
reads DETAILED_DEBUG, which is specific enough not to collide.
This commit is contained in:
ayaangazali 2026-08-29 15:47:33 -07:00
parent 36ea28b092
commit d5ce02a670

View file

@ -698,7 +698,7 @@ class ProxyInitializationHelpers:
is_flag=True,
type=bool,
help="To debug the input",
envvar="DEBUG",
envvar="LITELLM_DEBUG",
)
@click.option(
"--detailed_debug",