Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Studio llama-server args: a value-less ngram-mod flag keeps the next flag (#15728)
Daniel Han31377a64488a
diff --git a/studio/backend/core/inference/llama_server_args.py b/studio/backend/core/inference/llama_server_args.pyindex bb58c605e6b..7e4f51fab8c 100644--- a/studio/backend/core/inference/llama_server_args.py+++ b/studio/backend/core/inference/llama_server_args.py@@ -1907,7 +1907,10 @@ def translate_ngram_mod_args(while i < len(args):_flag, eq, value = args[i].partition("=")legacy = _NGRAM_MOD_LEGACY_FLAGS.get(_flag_name(args[i]) or "")- if legacy is None or (not eq and i + 1 >= len(args)):+ # A following flag is not this flag's value; consuming it would orphan that flag's own value.+ if legacy is None or (+ not eq and (i + 1 >= len(args) or _flag_name(args[i + 1]) is not None)+ ):out.append(args[i])i += 1continuediff --git a/studio/backend/tests/test_llama_server_args.py b/studio/backend/tests/test_llama_server_args.pyindex 9d40d8e42e8..c5ed950257b 100644--- a/studio/backend/tests/test_llama_server_args.py+++ b/studio/backend/tests/test_llama_server_args.py@@ -1533,3 +1533,16 @@ def test_owner_only_path_flags_names_each_file_option_once():assert _lsa.owner_only_path_flags(["--ctx-size", "4096", "-ngl", "99"]) == []assert _lsa.owner_only_path_flags(None) == []assert validate_extra_args(args) == args++[email protected]("chain_with_mtp", [False, True])+def test_translate_ngram_mod_does_not_consume_a_following_flag(chain_with_mtp):+ # Under MTP the swallowed pair is dropped, leaving the next flag's value as a bare positional.+ from core.inference.llama_server_args import translate_ngram_mod_args, validate_extra_args++ args = validate_extra_args(+ ["--spec-type", "draft-mtp", "--spec-ngram-mod-n-min", "--top-k", "/restricted/model.gguf"]+ )+ out = translate_ngram_mod_args(args, "legacy", chain_with_mtp = chain_with_mtp)+ assert out[-2:] == ["--top-k", "/restricted/model.gguf"]+ validate_extra_args(out)