From 2507d269704326407bedd4bb43ea4509490b221e Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Fri, 27 Mar 2026 08:26:10 +0000 Subject: [PATCH] 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 before logging. --- studio/backend/core/inference/llama_cpp.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/studio/backend/core/inference/llama_cpp.py b/studio/backend/core/inference/llama_cpp.py index fdd5420851..62fbdeb1c6 100644 --- a/studio/backend/core/inference/llama_cpp.py +++ b/studio/backend/core/inference/llama_cpp.py @@ -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] = "" + 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