109 Commits
Author SHA1 Message Date
z 4fb855f819 docs(brand): add hero banner 2026-06-28 21:03:12 -07:00
z 6ef79beaae chore(brand): dynamic hero banner 2026-06-28 21:03:11 -07:00
633cb12e73 cleanup: refresh SKU links + strip upstream brands (#3)
Rewrite dead HF links to live successors, refresh stale Zen4 / old Zen-3 chat lineups to current Zen5 canonical + Zen3 specialty, and strip upstream brand mentions from user-facing prose (attribution and base_model chains preserved).

Co-authored-by: zooqueen <worringantje@gmail.com>
2026-05-29 22:24:59 -07:00
Hanzo DevandGitHub 05c9ebb3c4 Merge pull request #2 from zenlm/zen5-repo-rename-pro
download_model.sh: REPO -> zenlm/zen-5-pro-gguf
2026-05-29 18:57:44 -07:00
Antje WorringandClaude Opus 4.7 2118ce35ef download_model.sh: REPO -> zenlm/zen-5-pro-gguf
HF repo renamed to align with the canonical SKU ladder: the IQ2-imatrix
DS4-Flash weights are the zen5-pro tier (not zen5-flash, which is now
Qwen3-4B). Old zen-5-flash-gguf redirects to zen-5-pro-gguf on HF.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-29 18:53:12 -07:00
Hanzo DevandGitHub ef3b57252b Merge pull request #1 from zenlm/zen5/default-zenlm-weights
default download to zenlm/zen-5-flash-gguf
2026-05-29 18:21:51 -07:00
Antje WorringandClaude Opus 4.7 92ca7bb8fb default download to zenlm/zen-5-flash-gguf (antirez kept as upstream)
Switches the default REPO in download_model.sh from antirez/deepseek-v4-gguf
to zenlm/zen-5-flash-gguf so 'make + ./download_model.sh q2-imatrix' pulls
the Zen5-branded mirror. UPSTREAM_REPO=antirez/deepseek-v4-gguf is preserved
as a reference and as a manual fallback.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-29 18:21:45 -07:00
Antje WorringandClaude Opus 4.7 d5a723e0c4 zen5: rebrand antirez/ds4 fork for the Zen LLM family
Rebrand-only changes; upstream sources (ds4.c, ds4_metal.m, ds4_cuda.cu,
etc.) are unchanged so upstream pulls apply cleanly.

- README.md: zen5 product framing, full attribution to antirez/ds4
  and ggml-org/llama.cpp lineage.
- README-UPSTREAM.md: preserves the upstream README verbatim.
- NOTICE.md: explicit fork policy and upstream tracking instructions.
- LLM.md: repo-level navigation per ~/work/CLAUDE.md convention.
- CLAUDE.md: symlink to LLM.md.
- Makefile: adds zen5 / zen5-server / zen5-bench symlink aliases
  alongside the upstream ds4 names so both work.
- .gitignore: includes zen5-* binaries.

LICENSE is unchanged; ds4.c authors and ggml authors copyrights preserved.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-29 12:58:46 -07:00
antirez 2964a93257 Fix Anthropic tool replay parsing order
Parse Anthropic tool_use blocks by their own type field instead of relying on the enclosing message role being parsed first.

Some clients serialize messages as content-before-role, which made full-history tool_result replays look like unknown live-only continuations.

Fixes #127.
2026-05-14 22:46:04 +02:00
antirez 04b6fda2be cuda: use managed KV cache for huge contexts
Keep normal CUDA context buffers on device allocations, but route very large KV-cache tensors through managed memory so million-token contexts do not starve unified-memory systems during graph/session allocation.

The fallback is scoped to the long-lived KV/cache tensors and logs when it is used because it may reduce performance.

Tested on 0.180 with:
- make cpu
- make -B cuda-spark
- make cuda-regression
- ./ds4_test --server --metal-kernels
- ./ds4_test --logprob-vectors --tool-call-quality
- ds4-bench ctx-alloc 32768, 250000, and 1000000
- ds4-server --ctx 1000000 startup smoke

(cherry picked from commit 0b248a65c07d21f2fc8ff4815bd8b75af26719f9)
2026-05-14 17:03:51 +02:00
antirez 94c1f38314 Stream Anthropic tool calls live
Project sampled DSML tool calls to Anthropic SSE tool_use blocks while keeping raw DSML as the parser/cache source of truth.

Reuse streamed tool ids for final parsed calls so tool_result continuation still matches live state.
2026-05-14 16:45:44 +02:00
antirez 06105915b2 Recover Responses replays without hidden reasoning 2026-05-14 12:47:14 +02:00
antirez 008347536b Tag Responses API server logs 2026-05-14 12:38:24 +02:00
antirez 67e6146e40 Revert "metal: cover q4 expert tensors in model views"
This reverts commit 2a7a5f3ad4.

There was no ack from the user. Don't want to take a fix
that is astronautically produced from an unclear error
trace.
2026-05-14 12:30:28 +02:00
antirez 43535e1393 Add Anthropic live tool continuation 2026-05-14 12:29:59 +02:00
antirez 646798fd1c Clarify server progress logs 2026-05-14 11:18:29 +02:00
antirez 5453ad0a41 Use visible live checkpoints for toolless thinking 2026-05-14 10:57:24 +02:00
antirez e88a71eb2e Merge responses-api 2026-05-14 10:29:27 +02:00
antirez b4c5f7c200 Skip tool checkpoint canonicalization for exact DSML replay 2026-05-14 10:25:50 +02:00
antirez 2a7a5f3ad4 metal: cover q4 expert tensors in model views 2026-05-14 02:04:10 +02:00
antirez acb40bf597 Fix Responses API live continuation 2026-05-14 01:54:00 +02:00
antirez a01bf1de44 Fix Responses tool checkpoint cache reuse 2026-05-14 00:14:37 +02:00
antirez 639696696f Tighten Responses tool_search replay 2026-05-14 00:06:10 +02:00
antirez f7e07f87a4 Harden Responses API tool replay
Preserve Responses namespace metadata and tool_search calls while rendering DSML-safe internal tool names. Replay function_call, hosted tool, and tool_search_output items into the shared chat/tool path so Codex and Pi can round-trip tool calls without losing KV-cache prefix reuse. Document the /v1/responses endpoint and add server unit coverage for namespace, tool_search, and replay output shapes.
2026-05-13 21:09:48 +02:00
antirez 21746117d3 Merge branch 'pr-91-responses' into responses-api 2026-05-13 20:45:20 +02:00
antirez 0cba357ca1 Add long-context story recall regression
Replace the default long-context continuation check with a deterministic prose-story retrieval test. The fixture embeds spelled-out person-number assignments in a long rendered prompt, and ds4_test now validates the generated Name=number list instead of brittle sampled prose.
2026-05-13 19:11:16 +02:00
antirez d540955e5b gguf-tools: support CUDA quality scorer
Build score_official against the CUDA runtime on Linux and select the CUDA backend there, while keeping the existing Metal path on macOS.\n\nCorrectness: make -C gguf-tools quality-score; gguf-tools/quality-testing/score_official ds4flash.gguf /tmp/ds4_quality_smoke/manifest.tsv /tmp/ds4_quality_smoke/scores.tsv 16384.
2026-05-13 18:42:41 +02:00
antirez a46484060e cuda: reduce long-context prefill slope
Fold the successful CUDA selector/top-k/indexed-attention changes into one clean commit. This excludes rejected experiment commits and the local prefill-slope work log.\n\nMeasured on GB10 with speed-bench/promessi_sposi.txt, 2048-token append chunks: 32K prefill improved from 255.61 tok/s on origin/main to 346.49 tok/s. Full-curve average improved from 316.39 tok/s to 369.76 tok/s. 32K full prompt + 128-token generation prefill improved from 312.87 tok/s to 368.43 tok/s, while generation stayed neutral at 12.49 -> 12.48 tok/s.\n\nCorrectness: make cuda-regression; ./ds4_test --logprob-vectors --tool-call-quality; ./ds4_test --server --metal-kernels.
2026-05-13 18:42:41 +02:00
Frank Denisandantirez dbfdd94fe8 Improve imatrix calibration corpus
Broaden the DS4 imatrix prompt dataset with provider-neutral agent/tool traffic, multi-language programming prompts, algorithm recall, Bash scripting, and multilingual translation tasks.

Remove duplicate rendered prompts and avoid provider-specific client references in the generated calibration corpus. This improves calibration coverage without claiming to fix a distributed GGUF bug.
2026-05-13 17:51:22 +02:00
antirez c5ef7acdc8 README: separate motivations. 2026-05-13 12:48:29 +02:00
antirez b9325e43eb README reworked with rocm branch link. 2026-05-13 12:45:50 +02:00
Codexandantirez 023089100a cuda: remove block16 MoE down diagnostic path
The PR #110 direction is useful, but the old block16 routed-down subvariant should not remain as an env-gated alternate path. It had prior top-logit instability, and a README prompt spot check showed different greedy first-token behavior when forced.

Keep the faster default non-block16 tile16 path and remove DS4_CUDA_MOE_DOWN_BLOCK16 plus the unused block16 kernels.

Validation on GB10: make cuda-regression; ./ds4_test --logprob-vectors --tool-call-quality --metal-kernels. Speed after removal: promessi_sposi 2048 prefill 401.32 tok/s, gen 14.00 tok/s; 8192 prefill 375.17 tok/s, gen 13.66 tok/s; README 8247 prefill 361.13 tok/s.
2026-05-13 08:57:56 +02:00
Carlos Villelaandantirez e85c0518b5 cuda: make MoE down block16 path opt-in
Keep the tile16/row2048 MoE down path enabled for batched prefill, but only use the block16 subvariant when DS4_CUDA_MOE_DOWN_BLOCK16 is set. On GB10 the non-block16 variant was consistently faster while preserving the old path as an explicit diagnostic option.
2026-05-13 08:57:56 +02:00
Carlos Villelaandantirez ad8a926c0f cuda: use memset for compressor state zeroing
Zero compressor state_kv buffers with cudaMemsetAsync instead of launching the generic fill_f32 kernel. The default stream preserves ordering while avoiding a small fill kernel in prefill/replay state setup.
2026-05-13 08:57:56 +02:00
Carlos Villelaandantirez eb3c0b8b9e cuda: allocate graph tensors in device memory
CUDA graph/session tensors are only accessed through backend read/write/copy/fill APIs. Allocate them with cudaMalloc instead of managed memory and add a backend fill_f32 hook so CUDA can initialize tensors device-side while Metal preserves its existing host-visible behavior.
2026-05-13 08:57:56 +02:00
Codexandantirez 8aaf3d1f94 build: make CUDA target selection explicit
On Linux, plain make now prints the explicit build targets instead of silently choosing a CUDA build. Add cuda-spark for the GB10 path without an explicit nvcc -arch, cuda-generic for native CUDA builds, and keep make cuda CUDA_ARCH=... for explicit arch selection.

Measured on GB10 with make cuda-spark: README.md prompt, 8247 input tokens, 344.90 tok/s prefill. Test: make cuda-regression.
2026-05-13 08:57:56 +02:00
antirez d57ae3fd85 Add contributing regression guide 2026-05-13 08:30:35 +02:00
cghartandantirez f8b4ed635d cuda: restore q8 fp16 cache on large-memory devices
Use a smaller default Q8->F16 cache reserve on 112+ GiB CUDA devices so GB10 keeps the fast cached weight path by default. Measured on README.md with the DS4 Flash GGUF: prefill 316.85 t/s, generation 13.83 t/s after the cleanup.
2026-05-12 22:18:48 +02:00
cghartandantirez a5f4f761b7 cuda: keep live MTP correctness fixes
Retain the useful CUDA pieces from cghart's branch without the disabled decode experiments: add the fd-cache model-map guard for base+MTP loads, support the Q4_K routed expert decode path used by the MTP draft head, and use CUDA for non-Apple ds4_test runs.
2026-05-12 22:18:48 +02:00
Salvatore SanfilippoandGitHub 8809b90a1e Merge pull request #98 from Chida82/benchtypos
Fix file paths in README for benchmark prompt and SVG generation
2026-05-12 19:09:16 +02:00
Salvatore SanfilippoandGitHub 8c1920934b Merge pull request #101 from tao12345666333/fix-hardcode-errors
fix: use backend names in session errors
2026-05-12 18:40:53 +02:00
antirez 453a5faa89 Add DS4 imatrix and GGUF quantization tools
Add routed-MoE imatrix collection to the DS4 graph path, including dataset generation docs and the tracked calibration prompt corpus.

Add a standalone DeepSeek V4 Flash HF-to-GGUF quantizer that reuses GGUF template metadata, emits DS4 Q2/Q4 recipes, supports imatrix-aware routed expert quantization, and internalizes the required Q8_0, Q4_K, Q2_K, and IQ2_XXS quantizers instead of vendoring GGML.

Document quantizer provenance, output formats, and the DS4-specific imatrix mapping used by the generated GGUF files.
2026-05-12 18:34:08 +02:00
Chida82 382027bb33 Fix image path for M3 Max benchmark in README 2026-05-12 17:37:05 +02:00
Chida82 3aa85eea21 Update README to reflect new directory structure for benchmark files 2026-05-12 17:35:38 +02:00
Jintao Zhang 03a14e4cf1 Use backend names in session errors
Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
2026-05-12 23:02:32 +08:00
Chida82 67e450c0a5 Fix file paths in README for benchmark prompt and SVG generation 2026-05-12 15:52:25 +02:00
antirez a97e7a3989 Guard CUDA q8 fp16 cache memory use
The CUDA Q8->F16 expansion cache is only an acceleration path, but on memory-constrained cards it could consume enough VRAM to make later allocations or cuBLAS calls fail. Add a budget check before expanding weights, keeping a default reserve of max(4 GiB, 5% VRAM), and fall back to native Q8 kernels when the cache is capped or memory is tight.

Expose DS4_CUDA_Q8_F16_CACHE_MB to disable or cap the cache and DS4_CUDA_Q8_F16_CACHE_RESERVE_MB to override the reserve. If allocation, dequantization, or cuBLAS use of the cached path fails, release/disable the optional cache and continue through the Q8 kernel path instead of failing the request.

Fixes #78
2026-05-12 13:58:14 +02:00
Audrey TangandClaude Opus 4.7 bb697b3b5f feat(server): add /v1/responses (OpenAI Responses API) for Codex CLI
Implements the Responses API endpoint that Codex CLI (and other modern
OpenAI tooling) speaks instead of /v1/chat/completions. The wire format
is documented in OpenAI's Responses API; this implementation has been
iterated against the Codex CLI binary's SSE parser shape until no
remaining schema gaps were found.

Request parsing (parse_responses_request, parse_responses_input):
- Accepts the typed input array (message, function_call,
  function_call_output, reasoning, custom_tool_call(_output),
  local_shell_call(_output), web_search_call(_output),
  tool_search_call(_output), image_generation_call(_output),
  compaction, context_compaction).
- Maps hosted-tool history to function_call/function_call_output so
  prior actions survive across turns; rejects unknown item types and
  non-completed status with 400 to avoid silent context loss.
- Strict content-array parsing: only string|null|array of recognized
  text blocks (input_text/output_text/text/summary_text/
  reasoning_text); rejects non-text modalities (input_image/file/
  audio) instead of accepting an empty prompt.
- Merges adjacent function_call items into the preceding assistant
  message so text + tool-call turns render as a single assistant
  block.
- Honors reasoning.effort (incl. "minimal"/"none") and gates
  reasoning summary surface on reasoning.summary opt-in.
- Rejects previous_response_id, conversation, and forced tool_choice
  explicitly (constrained decoding / persisted state not supported).

Output (responses_sse_*, responses_final_response):
- Emits the full streaming lifecycle: response.created,
  output_item.added/.done, reasoning_summary_part.added/.done,
  reasoning_summary_text.delta/.done, content_part.added/.done,
  output_text.delta/.done, function_call_arguments.delta/.done,
  response.completed.
- Branches the terminal event by finish reason: response.failed for
  errors and response.incomplete with reason "max_tokens" for length.
- Every event carries sequence_number; every output_text part carries
  annotations:[]; function_call output_item.added ships with an empty
  arguments string (full args arrive via function_call_arguments.done
  and output_item.done), and item ids are stable across added/done.
- Tracks whether </think> was actually observed so a truncated stream
  marks the reasoning item incomplete instead of "completed".
- Recovers gracefully when the DSML tool parse fails after the model
  was suppressed at the tool marker: the suppressed tail is flushed
  as additional output_text deltas so the streamed message matches
  output_item.done.

Tested by 25 rounds of /codex:adversarial-review against the same
client this is meant to feed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 06:45:02 -04:00
Salvatore SanfilippoandGitHub 3630e64ea2 Merge pull request #88 from timtan/bench-m2-ultra
Add M2 Ultra (192 GB) benchmark
2026-05-12 12:19:56 +02:00
timtanandClaude Opus 4.7 d9e2317075 Add M2 Ultra (192 GB) benchmark.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 18:08:39 +08:00