diff --git a/pkg/inference/runtime_flags_allowlist.go b/pkg/inference/runtime_flags_allowlist.go index 7b3d7d3a8..6b2cd9649 100644 --- a/pkg/inference/runtime_flags_allowlist.go +++ b/pkg/inference/runtime_flags_allowlist.go @@ -170,11 +170,13 @@ var LlamaCppAllowedFlags = map[string]bool{ "--chat-template": true, "--chat-template-kwargs": true, "--jinja": true, "--no-jinja": true, - "--pooling": true, - "--reasoning-format": true, - "--reasoning-budget": true, - "--prefill-assistant": true, - "--no-prefill-assistant": true, + "--pooling": true, + "--reasoning-format": true, + "--reasoning-budget": true, + "--reasoning-preserve": true, + "--no-reasoning-preserve": true, + "--prefill-assistant": true, + "--no-prefill-assistant": true, // Web interface and API (safe flags only - no file paths) "--api-prefix": true, diff --git a/pkg/inference/runtime_flags_allowlist_test.go b/pkg/inference/runtime_flags_allowlist_test.go index a73ec3890..2f62f41f2 100644 --- a/pkg/inference/runtime_flags_allowlist_test.go +++ b/pkg/inference/runtime_flags_allowlist_test.go @@ -161,6 +161,10 @@ func TestLlamaCppAllowedFlags_Categories(t *testing.T) { "--embeddings", "--embedding", "--reranking", "--rerank", "--metrics", "--no-metrics", "--jinja", "--no-jinja", }, + "reasoning": { + "--reasoning-format", "--reasoning-budget", + "--reasoning-preserve", "--no-reasoning-preserve", + }, "speculative": { "--spec-draft-n-max", "--draft-n-max", "--draft-max", "--spec-draft-n-min", "--draft-n-min", "--draft-min", "--spec-draft-p-min", "--draft-p-min", diff --git a/pkg/inference/runtime_flags_test.go b/pkg/inference/runtime_flags_test.go index 78fb84a39..c2dd77e0a 100644 --- a/pkg/inference/runtime_flags_test.go +++ b/pkg/inference/runtime_flags_test.go @@ -91,6 +91,13 @@ func TestValidateRuntimeFlags(t *testing.T) { expectError: false, description: "Sampling flags should be allowed", }, + { + name: "llama.cpp: reasoning preservation flags allowed", + backend: "llama.cpp", + flags: []string{"--reasoning-preserve", "--no-reasoning-preserve"}, + expectError: false, + description: "Reasoning preservation flags should be allowed", + }, { name: "llama.cpp: real-world flags from issue 515", backend: "llama.cpp",