mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-04 02:31:27 +00:00
Lazy evaluate debug log in pass-through endpoint (#30177)
* Pass through debug lazy logging * fix(proxy): convert remaining eager pass-through debug logs to lazy formatting
This commit is contained in:
parent
8dd7ab7f3f
commit
1406905905
1 changed files with 6 additions and 7 deletions
|
|
@ -174,9 +174,7 @@ async def chat_completion_pass_through_endpoint( # noqa: PLR0915
|
|||
|
||||
data["adapter_id"] = adapter_id
|
||||
|
||||
verbose_proxy_logger.debug(
|
||||
"Request received by LiteLLM:\n{}".format(json.dumps(data, indent=4)),
|
||||
)
|
||||
verbose_proxy_logger.debug("Request received by LiteLLM:\n%s", data)
|
||||
data["model"] = (
|
||||
general_settings.get("completion_model", None) # server default
|
||||
or user_model # model name passed via cli args
|
||||
|
|
@ -298,7 +296,7 @@ async def chat_completion_pass_through_endpoint( # noqa: PLR0915
|
|||
)
|
||||
)
|
||||
|
||||
verbose_proxy_logger.debug("\nResponse from Litellm:\n{}".format(response))
|
||||
verbose_proxy_logger.debug("\nResponse from Litellm:\n%s", response)
|
||||
return response
|
||||
except Exception as e:
|
||||
await proxy_logging_obj.post_call_failure_hook(
|
||||
|
|
@ -811,9 +809,10 @@ async def pass_through_request( # noqa: PLR0915
|
|||
else:
|
||||
_parsed_body = await _read_request_body(request)
|
||||
verbose_proxy_logger.debug(
|
||||
"Pass through endpoint sending request to \nURL {}\nheaders: {}\nbody: {}\n".format(
|
||||
url, headers, _parsed_body
|
||||
)
|
||||
"Pass through endpoint sending request to \nURL %s\nheaders: %s\nbody: %s\n",
|
||||
url,
|
||||
headers,
|
||||
_parsed_body,
|
||||
)
|
||||
|
||||
### COLLECT GUARDRAILS FOR PASSTHROUGH ENDPOINT ###
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue