diff --git a/studio/backend/core/inference/llama_cpp.py b/studio/backend/core/inference/llama_cpp.py index 6995df4f41..f9e66d4945 100644 --- a/studio/backend/core/inference/llama_cpp.py +++ b/studio/backend/core/inference/llama_cpp.py @@ -134,6 +134,7 @@ def _has_answer_artifact(text: str) -> bool: return _PLAN_LIST_FRAMING.search(text) is None return False + # Without max_tokens, llama-server defaults to n_predict = n_ctx (up to # 262144 for Qwen3.5), producing many-minute zombie decodes when cancel # fails. t_max_predict_ms is a wall-clock backstop applied unconditionally, diff --git a/studio/backend/tests/test_llama_cpp_reprompt_guard.py b/studio/backend/tests/test_llama_cpp_reprompt_guard.py index 49954918f0..f750023a40 100644 --- a/studio/backend/tests/test_llama_cpp_reprompt_guard.py +++ b/studio/backend/tests/test_llama_cpp_reprompt_guard.py @@ -103,8 +103,8 @@ def test_artifact_regex_detects_non_alpha_info_strings(): samples = [ "First, let me write it.\n```python3\nprint('hi')\n```", "First, let me write it.\n```c++\nint main() { return 0; }\n```", - "First, let me write it.\n```c#\nConsole.WriteLine(\"hi\");\n```", - "First, let me write it.\n```objective-c\nNSLog(@\"hi\");\n```", + 'First, let me write it.\n```c#\nConsole.WriteLine("hi");\n```', + 'First, let me write it.\n```objective-c\nNSLog(@"hi");\n```', "First, let me write it.\n```ts-node\nconsole.log('hi')\n```", "First, let me script it.\n```bash-session\n$ echo hi\n```", "First, let me show it.\n```python linenums=\"1\"\nprint('hi')\n```",