Commit Graph
98 Commits
Author SHA1 Message Date
antirez 97ba327538 Read Qwen native BF16 n-grams directly from the GGUF
Keep the table outside model mappings and Metal residency. Use bounded explicit reads, reject failed lookups before GPU consumption, and remove the runtime sidecar option and paging controls. Preserve Qwen hash and speculative state handling; cover malformed files and exact recovery after prefill, decode, and MTP read failures.
2026-09-14 13:32:48 +02:00
Salvatore Sanfilippo efc27d6d86 Keep literal reasoning and tool tags inside Qwen arguments
Use the structural reasoning delimiter on the server and wait for the parameter delimiter while streaming in ds4-agent. Add server and bytewise agent regressions; both fail before the fixes and pass afterward on M5 Max.
2026-09-14 10:34:10 +02:00
ccea768827 Add Qwen3.8 Flash Next model support
Implement qwen4exp loading, tokenizer and chat formatting, PLE sidecars,
Metal text and vision graphs, built-in MTP, and recurrent KV persistence.
Integrate the CLI, agent, server, download targets, and conversion tools.

Preserve the native Q4_1 encoder, Q4_K accumulation guard, and shared
quantizer build target. Keep exact-MTP rewind and vision-cache row-width
fixes. Persist valid logits and recurrent state at completed prefill chunks,
and reuse Qwen text-answer history when tools clients omit reasoning.
Retain exact reasoning replay and test continued checkpoints, cancellation,
cache eviction, and restart reuse with and without reasoning_content. Include
reproducible charts and measurements comparing throughput before and after
the checkpoint fixes on M3 Ultra.

Add Qwen trunk steering and prompt activation capture, including GDN layers.
Keep the MTP predictor outside the 48-row bank and preserve prompt dumps
through one-token prefill tails and multi-row speculative verification.
Recover Chrome target creation and retain its last page target. Preserve
full agent transcripts in stripped-session format when KV no longer fits,
while retaining the newer automatic compaction and continuation logic.
Add steering/MTP/capture, Chrome CDP recovery, and full-session save/reload
regressions. Adapt the intended changes from fork PRs #13 and #7.

Reconcile with antirez main bd66c40, preserving DeepSeek v4.1 model IDs,
tool syntax, session state, and Metal kernel dispatch. Exclude superseded
engine code and prototypes.

Co-authored-by: Andreas Parusel <aparuael@7170c824-6152-4cf1-985e-9503832ce673.fritz.box>
Co-authored-by: david <contact@davidberard.fr>
Co-authored-by: Michael Kuebbeler <cropduster@users.noreply.github.com>
Co-authored-by: Ogilthorp3 <bertrand@nepveu.name>
Co-authored-by: anemll <realanemll@gmail.com>
2026-09-13 14:57:29 +02:00
Salvatore Sanfilippo bd66c40207 DeepSeek v4.1 Flash support for Metal 2026-09-12 11:47:54 +02:00
Salvatore Sanfilippo 6289c51627 Give agent hints a distinct terminal label
Render the existing hint marker with a white-on-teal badge and a slim left rule. Keep body text, redirected output and the model transcript unchanged.

Test every stream split, unfinished markers, quoted continuations, literal code and both tool syntaxes. Verify terminal colors and UTF-8 at multiple widths, including redraws between fragments.
2026-09-08 17:26:35 +02:00
Salvatore Sanfilippo e33a5b2538 Keep agent tasks running across context compaction
Reserve summary space, recover already-full conversations by summarizing a bounded prefix, and retain every unsummarized token. Reject oversized input without corrupting the current conversation.

Resume unfinished responses in the same assistant message while preserving thinking state and the output budget. Discard incomplete tool calls before compacting and retry without executing partial arguments.

Cover real-model compaction, generated-code correctness, budget accounting, and recovery in a PTY regression; add deterministic boundary tests.
2026-09-08 14:12:35 +02:00
6546ae5473 agent: add opt-in programming hints
Adapt teaching-mode PR #391 to /hints on|off. Append the full
instruction once per context and short state changes at safe
assistant boundaries. New and resumed sessions start off;
compaction reinstates the current policy.

Use ordinary Markdown asides and the existing renderer, without
a learner profile, new tool, or persistent preference.

Tested on M5 Max IT with DeepSeek Flash and GLM Flash coding sessions,
prefix reuse, queued changes, compaction, save/switch/new, frontend
and PTY tests, and agent ASAN/UBSAN checks.

Closes #391

Co-authored-by: Salvatore Sanfilippo <antirez@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-07 18:16:55 +02:00
Salvatore Sanfilippo b36e26ed13 Make agent file tools and background shell jobs reliable
Replace files atomically with metadata and concurrent-change checks. Stream bounded reads with exact continuation, report incomplete searches, preserve literal [upto] edits, and avoid silently truncating user text.

Drain shell output and enforce deadlines independently of model progress. Synchronize observations and cleanup, bound log tails, honor status refresh requests, and filter terminal commands from displayed shell output. Align tool prompts and schemas with actual behavior and vision availability.

Add file, job, schema and PTY regressions. Combined fixes passed frontend tests, ASan/UBSan, ThreadSanitizer and DeepSeek/GLM editing smoke tests on M5 Max IT. Linux-specific metadata preservation still needs native QA.
2026-09-06 22:50:54 +02:00
Salvatore Sanfilippo db1942148c Fix agent terminal redraws, Unicode input and Markdown rendering
Buffer complete terminal updates, repaint status without erasing live input, and retain pending redraws across throttling. Preserve fragmented UTF-8, navigation and paste input, and bound tab completion safely.

Use shared Unicode width handling for input, output and queued prompts. Preserve unmatched Markdown delimiters and publish code recoloring as one update. Add focused terminal regression tests.
2026-09-06 22:50:20 +02:00
Salvatore Sanfilippo 930ab73279 Keep valid opportunistic drafts across tool sampling boundaries 2026-09-06 01:27:29 +02:00
Salvatore Sanfilippo e1711c21d9 Report tool observation errors without compacting the conversation
Distinguish image/rendering failures from results that exceed the context budget. Preserve the transcript and return the original error. Add an invalid-image regression and run the agent suite under ASan and UBSan.
2026-09-06 01:18:40 +02:00
Salvatore Sanfilippo d108ae4e8d Preserve literal tool data across agent and server rendering
Do not HTML-unescape argument bodies. Share a narrow, reversible escape for each body closing delimiter, including its literal escaped spelling. Keep streaming fragments intact across those escapes. Preserve protocol-looking text inside GLM agent arguments until the actual argument terminator. Add round-trip, streaming and agent regressions.
2026-09-06 01:14:31 +02:00
Salvatore Sanfilippo 233eeb85a7 Fix session rollback, TP restore and GLM memory accounting
Restore GLM recurrent and pooled-indexer state after rejected speculation. Invalidate unsafe DeepSeek rewinds and rebuild retained agent prefixes with their images before decoding again.

Rebuild saved TP token prefixes on both ranks. Give GLM speculative cycles an explicit command and shared token limit, with protocol version 10 requiring peers to update together.

Account for live and planned Metal GLM sessions when reserving graph and streaming memory. Add model-free state and protocol tests plus a small GPU rollback regression.
2026-09-05 14:29:18 +02:00
Salvatore Sanfilippo b0a147a7fb Add conversation prefix conditioning 2026-09-03 01:25:25 +02:00
Salvatore Sanfilippo fc8bf3c39c Add DeepSeek V4 Flash vision support 2026-09-01 00:11:58 +02:00
antirez 87495f6cc9 Add live steering controls 2026-08-30 13:33:09 +02:00
antirez ab993cb2a7 Accept ROCm backend in ds4-agent 2026-08-29 13:06:04 +02:00
antirez 04478e0ff6 Fix streamed terminal output at wrap boundaries 2026-08-29 11:36:22 +02:00
antirez 747eafc2c2 Add GLM 5.3 vision quality gates 2026-08-29 02:54:01 +02:00
Salvatore Sanfilippo 47713296d5 Add GLM 5.3 Flash vision support 2026-08-28 23:26:29 +02:00
antirez 147109a3cc Add GLM 5.3 Flash inference
Implement GLM 5.3 Q2 and Q4 inference across Metal and CUDA, including tensor parallelism, RDMA, batching, MTP, snapshots, SSD streaming, and GLM 5.2 shared-path improvements.

Add quantization and validation tools, official quality fixtures, model downloads, regression coverage, release QA, and user documentation.
2026-08-28 23:26:29 +02:00
antirez abd4ed3885 cli: expose exact MTP sampling mode 2026-08-23 15:05:13 +02:00
antirez 8d683d6616 dspark: add opportunistic temperature sampling 2026-08-23 15:05:13 +02:00
antirez 769a8ba42d dspark: support exact stochastic speculative decoding 2026-08-23 15:05:13 +02:00
antirez b030961104 agent: disable upto by default for new DS4F
The new DS4F checkpoint struggles with anchored [upto] edits. Keep exact old/new replacement as the default and make [upto] prompting and automatic insertion an explicit --edit-upto opt-in.
2026-08-05 14:03:22 +02:00
Salvatore Sanfilippo 355da75342 Add focused regressions for critical parser fixes 2026-08-04 13:47:47 +02:00
Luigi Colluto 0fa15c6c67 Bound agent cache strings by the remaining file
Reject truncated cache records before allocating memory for their declared text or title lengths.

Closes #544
2026-08-04 13:25:03 +02:00
antirez e0824ddcaa Make release builds warning-free 2026-07-20 11:09:28 +02:00
antirez 66cbce5289 Unify distributed inference CLI and documentation 2026-07-18 18:50:24 +02:00
antirez 36ee8c1407 Add CUDA tensor parallelism and session batching 2026-07-18 18:50:03 +02:00
antirez 005afedcd9 Add GLM 5.2 inference and quality fixtures 2026-07-18 18:48:45 +02:00
antirez 7624c68795 Add ds4-agent edit regression tests
Add a small ds4-agent unit-test harness for anchored [upto] edits and include it in make test so regressions in old-text matching are caught by default.
2026-06-10 00:08:36 +02:00
Salvatore Sanfilippo 512d07cb08 Merge pull request #338 from kamranjon/kamranjon/agent-edit-tool-fix
[Agent Fix]: Old tail anchor not found after old head
2026-06-09 18:59:00 +02:00
antirez 9f6af8857e Polish agent raw mode restoration 2026-06-09 13:12:41 +02:00
fry69 61886b452e fix: restore terminal state correctly on quit and help
Three fixes for regressions introduced by the raw-mode restoration
commit (ce5b70b):

1. agent_prompt_yes_no_ex: handle non-blocking stdin
   editor_start sets O_NONBLOCK on stdin; fgets() returned NULL
   immediately (EAGAIN) causing the save prompt to exit without
   waiting for user input.  Temporarily switch to blocking mode
   around the fgets call.

2. /quit handler: stop editor before prompting
   editor_restore_terminal_layout resets the scroll region but does
   not disable raw mode or restore stdin flags.  Call editor_stop
   first so that raw mode is off and stdin is blocking when we
   prompt the user.  Handle AGENT_EXIT_CANCEL by restarting the
   editor instead of leaving it half-stopped.

3. linenoiseRestoreRawMode: do not corrupt orig_termios
   The function unconditionally overwrote orig_termios with the
   current terminal attributes via tcgetattr.  While the editor is
   active those are the raw-mode settings (OPOST cleared).  Later,
   disableRawMode restores this corrupted orig_termios, leaving the
   terminal in raw mode after editor_stop.  puts output then lacks
   carriage returns, causing garbled display (e.g. /help).
   Only update orig_termios when rawmode == 0 (child process
   changed terminal to cooked).
2026-06-09 05:02:32 +02:00
fry69 ce5b70be9c fix(agent): restore raw mode 2026-06-09 03:43:37 +02:00
antirez c463029c20 Style ds4-agent system status messages 2026-06-06 12:45:58 +02:00
antirez 42e59157ea Make ds4-agent interruption cooperative 2026-06-06 12:37:27 +02:00
antirez 7ac436a382 Show agent web tool status messages 2026-06-06 11:20:48 +02:00
antirez 56b25eb86a Show prefill speed in agent progress 2026-06-06 11:18:27 +02:00
antirez 02852fa3e4 Show greedy sampling in agent status 2026-06-06 11:12:08 +02:00
antirez a56519de98 Harden ds4-agent DSML parsing 2026-06-06 11:06:46 +02:00
Kamran Pakseresht a9f486b008 Fix agent: old tail anchor not found after old head 2026-06-04 21:04:54 -07:00
Salvatore Sanfilippo 9ba160ae82 Implement SSD streaming 2026-06-04 13:43:42 -07:00
antirez 592b93f1df help: improve command line help
Add shared help text across the CLI, server, agent, bench, and eval tools. Expand distributed-mode guidance, clean up endpoint naming, and use a TTY-only 256-color layout with clearer section titles, option arguments, separators, examples, and explanatory text.
2026-05-30 12:22:19 +02:00
antirez 5eaee25c74 agent: handle wrapped tool results in history 2026-05-30 10:45:52 +02:00
user fec25dafdf build: fix current compiler warnings
(cherry picked from commit 0b3efaf86f61421330e90629508adbd6228b4a8b)
2026-05-29 18:50:54 +02:00
Salvatore Sanfilippo 4844d55108 Add distributed KV checkpoint support 2026-05-29 17:53:57 +02:00
Salvatore Sanfilippo abdc807ced Add distributed inference
Add coordinator/worker distributed layer execution, pipelined prefill, worker routing, telemetry, activation transport width, and KV mismatch recovery for DeepSeek Flash/Pro.
2026-05-29 12:12:10 +02:00
antirez dc322b8c3f Merge branch 'pro' 2026-05-25 07:55:29 +02:00