Redact --api-key value from llama-server startup log
When UNSLOTH_DIRECT_STREAM=1, the generated bearer token was logged verbatim in the startup command. Replace the secret with <redacted> before logging.
This commit is contained in:
parent
24f92fac86
commit
2507d26970
1 changed files with 6 additions and 1 deletions
|
|
@ -950,7 +950,12 @@ class LlamaCppBackend:
|
|||
else:
|
||||
self._api_key = None
|
||||
|
||||
logger.info(f"Starting llama-server: {' '.join(cmd)}")
|
||||
_log_cmd = list(cmd)
|
||||
if "--api-key" in _log_cmd:
|
||||
_ki = _log_cmd.index("--api-key") + 1
|
||||
if _ki < len(_log_cmd):
|
||||
_log_cmd[_ki] = "<redacted>"
|
||||
logger.info(f"Starting llama-server: {' '.join(_log_cmd)}")
|
||||
|
||||
# Set library paths so llama-server can find its shared libs and CUDA DLLs
|
||||
import os
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue