From 6ee319ae08fbfa2f432d073d182a1ed4903c5010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Tue, 27 May 2025 22:05:38 +0200 Subject: [PATCH] fix: convert boolean string to boolean (#2284) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # What does this PR do? Handles the case where the vllm config `tls_verify` is set to `false` or `true`. Closes: https://github.com/meta-llama/llama-stack/issues/2283 Signed-off-by: Sébastien Han --- llama_stack/providers/remote/inference/vllm/config.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/llama_stack/providers/remote/inference/vllm/config.py b/llama_stack/providers/remote/inference/vllm/config.py index 8ecce6200..99abddf51 100644 --- a/llama_stack/providers/remote/inference/vllm/config.py +++ b/llama_stack/providers/remote/inference/vllm/config.py @@ -34,11 +34,16 @@ class VLLMInferenceAdapterConfig(BaseModel): @classmethod def validate_tls_verify(cls, v): if isinstance(v, str): - cert_path = Path(v) + # Check if it's a boolean string + if v.lower() in ("true", "false"): + return v.lower() == "true" + # Otherwise, treat it as a cert path + cert_path = Path(v).expanduser().resolve() if not cert_path.exists(): raise ValueError(f"TLS certificate file does not exist: {v}") if not cert_path.is_file(): raise ValueError(f"TLS certificate path is not a file: {v}") + return v return v @classmethod