@miller-tech/uap 1.215.2 → 1.217.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -124,7 +124,7 @@ LLAMA_LOG_FILE=/home/cogtek/llama.cpp/llama-server.log
124
124
  LLAMA_N_PREDICT=16384
125
125
 
126
126
  # Gemma 4 speaks its own <|turn>/<|tool_call> DSL, NOT ChatML. Use the
127
- # model's embedded template — the qwen3.5-enhanced.jinja used by the Qwen
127
+ # model's embedded template — the qwen-sharp.jinja used by the Qwen
128
128
  # profile emits a format Gemma was never trained on and silently destroys
129
129
  # tool calling.
130
130
  LLAMA_CHAT_TEMPLATE_FILE=embedded
@@ -57,9 +57,58 @@ LLAMA_SLOT_SAVE_PATH=/home/cogtek/.cache/inference/kv-slots
57
57
  LLAMA_LOG_FILE=/home/cogtek/llama.cpp/llama-server.log
58
58
  LLAMA_N_PREDICT=16384
59
59
 
60
- # Qwen3.6 is ChatML with the qwen3_coder tool-call format; the proxy's parsers
61
- # are built around exactly this template. Do NOT switch it to "embedded".
62
- LLAMA_CHAT_TEMPLATE_FILE=/home/cogtek/dev/miller-tech/universal-agent-protocol/tools/agents/config/qwen3.5-enhanced.jinja
60
+ # CHAT TEMPLATE (2026-08-20): switched from qwen3.5-enhanced.jinja to
61
+ # qwen-sharp.jinja -- peculiar-ragdoll/Qwen-Sharp-Chat-Templates
62
+ # (template_version qwen3.8-froggeric-v22.1), vendored verbatim at
63
+ # tools/agents/config/qwen-sharp.jinja. It targets Qwen 3.5/3.6/3.8 and is the
64
+ # template for ALL qwen models here. Pinned artifact -- both are asserted in
65
+ # test/chat-template-system-message.test.ts so a silent re-vendor fails CI:
66
+ # upstream revision 3dc34df52c63dd22ada21f96435e069deaa8d7da (2026-08-18)
67
+ # file sha256 d1f22a89eac3609dcfaa7b471b1f7d23bee2f084d275d26f4f8231d1d7908f4e
68
+ #
69
+ # WHAT IT FIXES: qwen3.5-enhanced.jinja hard-raised
70
+ # 'No user query found in messages.' -- a server-side failure for the whole
71
+ # request -- whenever no user turn survived its backwards scan, i.e. when every
72
+ # user turn was a <tool_response> or when the transcript was system+assistant
73
+ # only. Both shapes occur in normal agent loops. qwen-sharp renders them.
74
+ #
75
+ # WHAT STAYS COMPATIBLE (rendered and compared, not assumed):
76
+ # * the tool-call contract the model is told to EMIT is unchanged:
77
+ # <tool_call><function=NAME><parameter=K>V</parameter></function></tool_call>.
78
+ # anthropic_proxy.py's _HERMES_FUNCTION_RE / _TOOL_CALL_XML_RE parse it
79
+ # unchanged. The default is selected at render time by `_tool_format`, so
80
+ # the test asserts on RENDERED output -- the file contains a JSON emitter
81
+ # too, and a grep cannot tell which one is live.
82
+ # * the generation prompt matches the old template in BOTH enable_thinking
83
+ # states, so --reasoning auto --reasoning-format deepseek is unaffected.
84
+ # * a mid-conversation system message renders inline in both templates.
85
+ #
86
+ # WHAT ACTUALLY DIFFERS -- known and accepted:
87
+ # * HISTORY rendering of prior tool calls differs in whitespace only: with
88
+ # string-form `arguments` (the proxy's path -- it json.dumps them) the old
89
+ # template emitted "}\n</function>", the new one "}</function>"; and the
90
+ # separator between two tool calls in one assistant turn went "\n" ->
91
+ # "\n\n". Neither changes what the parsers accept.
92
+ # * the injected tool-calling instruction block was rewritten upstream: it now
93
+ # requires a <think> block before each tool call and forbids prose before
94
+ # the call. Behavioural, deliberate, not a wire change.
95
+ # * a system message containing an IMAGE now raises. Unreachable via the
96
+ # proxy, which flattens system to a text string before dispatch
97
+ # (anthropic_proxy.py ~4709). Direct-to-:8080 OpenAI clients can hit it.
98
+ # * unknown message roles no longer raise; they render as "[role]: content".
99
+ # * prior <think> blocks are retained across turns. Upstream sells this as a
100
+ # prompt-cache win; on the PROXY path it is a no-op, because the proxy
101
+ # already strips <think> from prior assistant turns on purpose
102
+ # (anthropic_proxy.py ~4725: "Stripping breaks the copy cycle"). On the
103
+ # direct path it re-introduces exactly that cycle -- pass
104
+ # chat_template_kwargs.preserve_thinking=false there if it shows up.
105
+ #
106
+ # chat_template_kwargs.reasoning_effort accepts
107
+ # none|minimal|low|medium|high|xhigh|max. NOTE: 'none' forces thinking OFF,
108
+ # overriding enable_thinking=true.
109
+ # Do NOT switch this to "embedded" -- the model's own baked-in template still
110
+ # carries the 'System message must be at the beginning.' raise.
111
+ LLAMA_CHAT_TEMPLATE_FILE=/home/cogtek/dev/miller-tech/universal-agent-protocol/tools/agents/config/qwen-sharp.jinja
63
112
 
64
113
  # --cache-ram sizing — measured, not guessed
65
114
  # The host-RAM prompt cache holds KV prefixes so a follow-up turn re-uses its
@@ -0,0 +1,155 @@
1
+ # =====================================================================
2
+ # Qwen 3.8 27B (dense, UD-IQ4_XS) @ 131072 ctx/slot / 2 slots, native MTP spec
3
+ # decoding on llama.cpp master (f466cfa38, 2026-08-20) — 2026-08-20
4
+ # Service: uap-llama-server.service -> scripts/run-llama-server-continuity.sh
5
+ # Install: cp to ~/.config/uap/llama-server.env
6
+ #
7
+ # WHY THIS BUILD: previous profile (qwen36-35b-a3b.env, kept alongside this
8
+ # file) ran a stale mtp-port worktree binary ~5 months behind upstream, with
9
+ # spec decoding off. Investigated wiring in the operator's local "dflash"
10
+ # tree-kernel / DDTree branches for tree-mode speculative verification on
11
+ # hybrid SSM+attention models; found upstream (commit 4e732e0a6, "llama:
12
+ # allow partial seq_rm for GDN models for speculative decoding") already
13
+ # merged the same core mechanism natively, and the remaining DDTree/tree-
14
+ # topology piece has no upstream equivalent and would need fresh kernel R&D,
15
+ # not a port -- deferred rather than shipped half-verified. This profile is
16
+ # instead plain upstream master + native `draft-mtp`, which measured 60-91%
17
+ # draft acceptance and no corruption/crashes across single, 5x-consecutive,
18
+ # multi-turn, and -np 2 concurrent validation queries.
19
+ #
20
+ # WHY MTP WORKS HERE (unlike the old profile's note below): Qwen3.8-27B-
21
+ # UD-IQ4_XS.gguf is a DENSE qwen35-arch model with a native MTP head baked
22
+ # into the checkpoint (blk.64.nextn.* tensors) -- confirmed via `gguf`
23
+ # tensor dump. The old profile's "MTP is a no-op" finding was specifically
24
+ # about a MoE (A3B) model; it does not apply here. No -md draft model file
25
+ # is used or needed -- draft-mtp reads the head from LLAMA_MODEL itself.
26
+ #
27
+ # CONTEXT BUDGET: --ctx-size is the TOTAL across slots, /props reports the
28
+ # PER-SLOT figure. 262144 / 2 slots = 131072 tokens/slot (2026-08-20: raised
29
+ # from 65536/slot per operator request). See
30
+ # docs/guides/QWEN36_LLAMACPP.md#measured-qwen38-27b-dense--native-draft-mtp-rtx-3090-24-gb
31
+ # for measured VRAM headroom at both tiers on this card (24 GiB) -- at
32
+ # 131072/slot only ~0.95 GiB is free, verified stable but thin; drop back to
33
+ # 65536/slot first if instability appears under real concurrent load. Keep
34
+ # PROXY_CONCURRENCY_LIMIT == slot count and PROXY_CONTEXT_WINDOW == per-slot
35
+ # context (anthropic-proxy.env; re-derive from /props if this changes).
36
+ # =====================================================================
37
+ LLAMA_BIN=/home/cogtek/llama.cpp/.worktrees/dflash-mtp-upgrade/build-cuda/bin/llama-server
38
+ LLAMA_MODEL=/home/cogtek/Downloads/Qwen3.8-27B-UD-IQ4_XS.gguf
39
+ # CONFIRMED INCOMPATIBLE 2026-08-20: mmproj-BF16.gguf crashed the server on
40
+ # load -- "mismatch between text model (n_embd = 5120) and mmproj
41
+ # (n_embd = 2048)". It was built for a different, smaller model's vision
42
+ # tower, not Qwen3.8-27B (n_embd 5120). Same applies to mmproj-F16.gguf
43
+ # (same family of file, unverified for this model). Do not re-enable either
44
+ # without a projector confirmed to report n_embd=5120 for its text side.
45
+ # "none" is a real opt-out (added to the continuity script 2026-08-20); an
46
+ # empty value is NOT equivalent -- it still falls through to auto-detect,
47
+ # which is how this got picked up in the first place.
48
+ LLAMA_MMPROJ=none
49
+
50
+ LLAMA_HOST=0.0.0.0
51
+ LLAMA_PORT=8080
52
+ LLAMA_CTX_SIZE=262144
53
+ LLAMA_PARALLEL=2
54
+ LLAMA_THREADS=16
55
+ LLAMA_GPU_LAYERS=99
56
+
57
+ LLAMA_CACHE_TYPE_K=q4_0
58
+ LLAMA_CACHE_TYPE_V=q4_0
59
+
60
+ LLAMA_BATCH_SIZE=512
61
+ LLAMA_UBATCH_SIZE=512
62
+
63
+ # Native MTP speculative decoding (self-contained, no draft model file).
64
+ # Measured 2026-08-20: 60-91% draft acceptance, stable under -np 2
65
+ # concurrency and 5x-consecutive/multi-turn stress, no crashes/corruption.
66
+ LLAMA_ENABLE_SPEC_DECODING=true
67
+ LLAMA_SPEC_TYPE=draft-mtp
68
+ LLAMA_DRAFT_MAX=2
69
+ LLAMA_DRAFT_MIN=1
70
+ LLAMA_DRAFT_P_MIN=0.75
71
+
72
+ # Sampling requested for this profile (llama-server defaults are top-p 0.95,
73
+ # top-k 40, temp 0.8 when unset -- see scripts/run-llama-server-continuity.sh).
74
+ LLAMA_TEMP=0.7
75
+ LLAMA_TOP_P=0.8
76
+ LLAMA_TOP_K=20
77
+
78
+ LLAMA_REPEAT_PENALTY=1.0
79
+ # LLAMA_CACHE_REUSE stays unset here (carried over from the previous Qwen3.6
80
+ # profile, where it never took effect). --cache-reuse (in-slot prompt PREFIX
81
+ # reuse) is disabled at load time in server-context.cpp whenever
82
+ # llama_kv_cache::get_can_shift() is false, which holds on three architectural
83
+ # conditions, none of them a flag: arch==STEP35; n_pos_per_embd()>1 (M-RoPE);
84
+ # or any layer with k_idx ("shifting would leave k_idx stale" -- the GDN
85
+ # linear-attention layers). qwen35-arch models (3.6, 3.8) trip the latter.
86
+ # The host-side prompt cache (--cache-ram) and --ctx-checkpoints are the
87
+ # mechanisms that DO run here.
88
+ LLAMA_SLOT_SAVE_PATH=/home/cogtek/.cache/inference/kv-slots
89
+ LLAMA_LOG_FILE=/home/cogtek/llama.cpp/llama-server.log
90
+ LLAMA_N_PREDICT=32768
91
+
92
+ # CHAT TEMPLATE (2026-08-20): switched from qwen3.5-enhanced.jinja to
93
+ # qwen-sharp.jinja -- peculiar-ragdoll/Qwen-Sharp-Chat-Templates
94
+ # (template_version qwen3.8-froggeric-v22.1), vendored verbatim at
95
+ # tools/agents/config/qwen-sharp.jinja. It targets Qwen 3.5/3.6/3.8 and is the
96
+ # template for ALL qwen models here. Pinned artifact -- both are asserted in
97
+ # test/chat-template-system-message.test.ts so a silent re-vendor fails CI:
98
+ # upstream revision 3dc34df52c63dd22ada21f96435e069deaa8d7da (2026-08-18)
99
+ # file sha256 d1f22a89eac3609dcfaa7b471b1f7d23bee2f084d275d26f4f8231d1d7908f4e
100
+ #
101
+ # WHAT IT FIXES: qwen3.5-enhanced.jinja hard-raised
102
+ # 'No user query found in messages.' -- a server-side failure for the whole
103
+ # request -- whenever no user turn survived its backwards scan, i.e. when every
104
+ # user turn was a <tool_response> or when the transcript was system+assistant
105
+ # only. Both shapes occur in normal agent loops. qwen-sharp renders them.
106
+ #
107
+ # WHAT STAYS COMPATIBLE (rendered and compared, not assumed):
108
+ # * the tool-call contract the model is told to EMIT is unchanged:
109
+ # <tool_call><function=NAME><parameter=K>V</parameter></function></tool_call>.
110
+ # anthropic_proxy.py's _HERMES_FUNCTION_RE / _TOOL_CALL_XML_RE parse it
111
+ # unchanged. The default is selected at render time by `_tool_format`, so
112
+ # the test asserts on RENDERED output -- the file contains a JSON emitter
113
+ # too, and a grep cannot tell which one is live.
114
+ # * the generation prompt matches the old template in BOTH enable_thinking
115
+ # states, so --reasoning auto --reasoning-format deepseek is unaffected.
116
+ # * a mid-conversation system message renders inline in both templates.
117
+ #
118
+ # WHAT ACTUALLY DIFFERS -- known and accepted:
119
+ # * HISTORY rendering of prior tool calls differs in whitespace only: with
120
+ # string-form `arguments` (the proxy's path -- it json.dumps them) the old
121
+ # template emitted "}\n</function>", the new one "}</function>"; and the
122
+ # separator between two tool calls in one assistant turn went "\n" ->
123
+ # "\n\n". Neither changes what the parsers accept.
124
+ # * the injected tool-calling instruction block was rewritten upstream: it now
125
+ # requires a <think> block before each tool call and forbids prose before
126
+ # the call. Behavioural, deliberate, not a wire change.
127
+ # * a system message containing an IMAGE now raises. Unreachable via the
128
+ # proxy, which flattens system to a text string before dispatch
129
+ # (anthropic_proxy.py ~4709). Direct-to-:8080 OpenAI clients can hit it.
130
+ # * unknown message roles no longer raise; they render as "[role]: content".
131
+ # * prior <think> blocks are retained across turns. Upstream sells this as a
132
+ # prompt-cache win; on the PROXY path it is a no-op, because the proxy
133
+ # already strips <think> from prior assistant turns on purpose
134
+ # (anthropic_proxy.py ~4725: "Stripping breaks the copy cycle"). On the
135
+ # direct path it re-introduces exactly that cycle -- pass
136
+ # chat_template_kwargs.preserve_thinking=false there if it shows up.
137
+ #
138
+ # chat_template_kwargs.reasoning_effort accepts
139
+ # none|minimal|low|medium|high|xhigh|max. NOTE: 'none' forces thinking OFF,
140
+ # overriding enable_thinking=true.
141
+ # Do NOT switch this to "embedded" -- the model's own baked-in template still
142
+ # carries the 'System message must be at the beginning.' raise.
143
+ LLAMA_CHAT_TEMPLATE_FILE=/home/cogtek/dev/miller-tech/universal-agent-protocol/tools/agents/config/qwen-sharp.jinja
144
+
145
+ # --cache-ram sizing inherited unchanged from the previous profile (measured
146
+ # working set was for a different model, but the host-RAM cache mechanism
147
+ # and its OOM history apply regardless of which model is loaded on the GPU
148
+ # side). Re-measure with the eviction grep in qwen36-35b-a3b.env's history
149
+ # if this model's prefill/eviction pattern differs materially.
150
+ #
151
+ # FLAG DRIFT: upstream renamed --checkpoint-every-n-tokens (old b8780
152
+ # spelling) to --checkpoint-min-step. An unknown flag makes llama-server
153
+ # exit 1, and systemd then burns its restart budget looping on it. Re-check
154
+ # every flag here against `llama-server --help` whenever LLAMA_BIN moves.
155
+ LLAMA_EXTRA_ARGS=--metrics --jinja --prio 2 --reasoning auto --reasoning-format deepseek --reasoning-budget 8000 --ctx-checkpoints 64 --checkpoint-min-step 2048 --cache-ram 16384
@@ -82,10 +82,10 @@
82
82
 
83
83
  "llm_server": {
84
84
  "description": "Instance 1: Main LLM (Qwen3.5 35B A3B) — port 8080",
85
- "command": "llama-server --model /path/to/Qwen3.5-35B-A3B-UD-IQ4_XS.gguf --chat-template-file chat_template.jinja --port 8080 --host 0.0.0.0 --ctx-size 131072 --gpu-layers 99 --cache-type-k q8_0 --cache-type-v q4_0 -fa on --threads 8 --batch-size 512 --ubatch-size 256 --mlock --metrics --n-predict 16384 --temp 0.3 --top-p 0.9 --top-k 20 --min-p 0.05",
85
+ "command": "llama-server --model /path/to/Qwen3.5-35B-A3B-UD-IQ4_XS.gguf --chat-template-file tools/agents/config/qwen-sharp.jinja --port 8080 --host 0.0.0.0 --ctx-size 131072 --gpu-layers 99 --cache-type-k q8_0 --cache-type-v q4_0 -fa on --threads 8 --batch-size 512 --ubatch-size 256 --mlock --metrics --n-predict 16384 --temp 0.3 --top-p 0.9 --top-k 20 --min-p 0.05",
86
86
  "flags": [
87
87
  "--model /path/to/Qwen3.5-35B-A3B-UD-IQ4_XS.gguf",
88
- "--chat-template-file chat_template.jinja",
88
+ "--chat-template-file tools/agents/config/qwen-sharp.jinja",
89
89
  "--n-predict 16384",
90
90
  "--temp 0.3",
91
91
  "--top-p 0.9",
@@ -79,7 +79,7 @@
79
79
  "description": "Instance 1: Main LLM (Qwen3.6 35B A3B) — port 8080, fronted by the proxy on :4000",
80
80
  "flags": [
81
81
  "--model /path/to/Qwen3.6-35B-A3B-UD-IQ4_XS.gguf",
82
- "--chat-template-file chat_template.jinja",
82
+ "--chat-template-file tools/agents/config/qwen-sharp.jinja",
83
83
  "--n-predict 16384",
84
84
  "--temp 0.3",
85
85
  "--top-p 0.9",