Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
7495b0a
DeepSeek-V4.1-Flash on Metal: the EXL3 2.9bpw lane — trellis-decoded …
EugeneClaw Nov 6, 2026
3219a00
zig fmt the branch (21 files; the formatter gate must be clean before…
EugeneClaw Nov 6, 2026
04197e7
Merge branch 'upstream-main-0d7152' into contribution/dsv41-exl3
EugeneClaw Nov 6, 2026
2741976
CI: the dev-tools and Windows graphs compile again
EugeneClaw Nov 6, 2026
e5e0182
Hygiene: the review-out files leave, the glue set loses its temp name
EugeneClaw Nov 6, 2026
b3822a7
Hygiene: the reference MLX gather leaves (headers, kernel, test, bench)
EugeneClaw Nov 6, 2026
f56343b
Hygiene: the round history leaves the comments; core keeps no DSV4.1 …
EugeneClaw Nov 6, 2026
c4da0a7
Hygiene: seven over-600 files split by concern
EugeneClaw Nov 6, 2026
f8f904d
Attention: the trunk drops the comparator q-RMS arms; comments cite t…
EugeneClaw Nov 6, 2026
54a3170
Oracle: the teacher comparison reports KL beside NRMS and greedy agre…
EugeneClaw Nov 6, 2026
3ed1d16
Hygiene: the shared affine_mm and gemm_nax carry no diff; the gate GE…
EugeneClaw Nov 6, 2026
e5b35d1
Draft: the MTP round re-expresses from the release's forward_spec
EugeneClaw Nov 6, 2026
b87aa9e
EXL3: the prefill and decode provenance is the lane's own; the histor…
EugeneClaw Nov 6, 2026
9ca89a1
Hygiene: the rewrite-set comments lose the round history and the meas…
EugeneClaw Nov 6, 2026
67e8331
Copy rule: the HC boundary cites the release; the port claim and the …
EugeneClaw Nov 6, 2026
775c879
EXL3: the prompt tile and the scalar prefill own their job and window…
EugeneClaw Nov 6, 2026
f8143b3
EXL3 decode: the register-only single and pair bodies own their job a…
EugeneClaw Nov 6, 2026
a71f6ef
EXL3 decode: the funnel, wide and multi-row bodies own their job and …
EugeneClaw Nov 6, 2026
16635f5
Hygiene: the lane comments read as prose again
EugeneClaw Nov 6, 2026
a948274
Hygiene: the lane comments lose the last round labels and measured fi…
EugeneClaw Nov 6, 2026
6183707
Copy rule: the partial files state the earlier provenance instead of …
EugeneClaw Nov 6, 2026
a9102c5
Copy rule: the HC boundary is written from the release; the two-launc…
EugeneClaw Nov 6, 2026
7155a68
Attention: the pass runs in the release's own stages
EugeneClaw Nov 6, 2026
4793790
Draft: the drafter's attention runs in the release's DSparkAttention …
EugeneClaw Nov 6, 2026
2114798
Draft: proposeTokens runs the release forward_spec stages
EugeneClaw Nov 6, 2026
271ca4e
Draft: the stage methods are members of the round context
EugeneClaw Nov 6, 2026
dcd7811
EXL3: the host names its own body plan; the unused paired decode leaves
EugeneClaw Nov 6, 2026
a08d6da
EXL3: the dead prefill experiments and the variant bench leave; the h…
EugeneClaw Nov 6, 2026
b1fc015
EXL3: restore the shared prompt templates the broad prune overran; th…
EugeneClaw Nov 7, 2026
4dbba61
EXL3: the partly covered prompt files state their provenance
EugeneClaw Nov 7, 2026
d93c8f2
Backend: the /tmp snapshot toggle leaves the lane
EugeneClaw Nov 7, 2026
4dd66e8
EXL3: the named non-default prefill variants leave; the prompt files …
EugeneClaw Nov 7, 2026
288a66f
EXL3: the dead prefill arms leave; the multi-row pick requires its pi…
EugeneClaw Nov 7, 2026
671b680
EXL3: the GPU qualification tests split by decode and prefill
EugeneClaw Nov 7, 2026
b1e1e42
Reference: the stage diff separates its capture from its runner
EugeneClaw Nov 7, 2026
99fe143
Reference: the EXL3 projection checks split by arithmetic path
EugeneClaw Nov 7, 2026
64d45fc
EXL3: the projection kernel sources split at their top-level entries
EugeneClaw Nov 7, 2026
1a36bee
EXL3: the projection host separates its views, plan and encode entries
EugeneClaw Nov 7, 2026
ceb9a28
Attention: the pass separates its stage state, window and encode entries
EugeneClaw Nov 7, 2026
9883c41
Draft: the model separates its options, hash and pipeline support
EugeneClaw Nov 7, 2026
ccd53fa
Draft: the routed-expert block lives in its own module
EugeneClaw Nov 7, 2026
b8034f7
Draft: the forward pass lives in its own module
EugeneClaw Nov 7, 2026
d2a632f
Draft: the drafter block attention lives in its own module
EugeneClaw Nov 7, 2026
5597287
Draft: the proposition round and its stage context leave the model file
EugeneClaw Nov 7, 2026
51f5637
Draft: the model lifecycle and snapshot methods move out
EugeneClaw Nov 7, 2026
6ca6b4a
Draft: the model hash, stage and drafter helpers move out
EugeneClaw Nov 7, 2026
5763240
Draft: the forward module keeps only the aliases it uses
EugeneClaw Nov 7, 2026
afca95b
Core: the projection knobs live in the family; the core carries no V4…
EugeneClaw Nov 7, 2026
620cadf
Lanes: the served DeepSeek config opts into the plain shared round
EugeneClaw Nov 7, 2026
7711666
Contract: the dsv41 gate GEMMs compile their own source; the fp32 twi…
EugeneClaw Nov 7, 2026
240b6ce
Hygiene: the gate, scan and repack benches leave; no engine test read…
EugeneClaw Nov 7, 2026
33dba27
DSpark: the release form is the default; the earlier placement is the…
EugeneClaw Nov 7, 2026
ef1be39
Hygiene: dead sources, helpers, dumps, labels and the unreachable rou…
EugeneClaw Nov 7, 2026
1957f0b
EXL3: the projection keeps only the bodies its default path selects
EugeneClaw Nov 7, 2026
e8abbf1
Comments: the one-line rewrite clears the lean gate
EugeneClaw Nov 7, 2026
08303b7
Tests: the fused one-row QKV and the few-keys identity are pinned
EugeneClaw Nov 7, 2026
61cd514
Tests: the identity equivalence keeps its own file under the lean limit
EugeneClaw Nov 7, 2026
6624e3e
Comments: the reviewed one-line rewrite restores the lost conditions
EugeneClaw Nov 7, 2026
4e8072a
Review: the adversarial pass finds four blockers and they leave
EugeneClaw Nov 7, 2026
9385089
Review: the four spaced module-doc markers become real //! headers
EugeneClaw Nov 7, 2026
92d79fb
Review: the residual should-fix assertions land
EugeneClaw Nov 7, 2026
59aed6d
Reference: the trunk attention follows the release (no per-head q RMS)
EugeneClaw Nov 7, 2026
b9b1fb3
Oracle: the whole-model FP64 clause is the floor-relative band
EugeneClaw Nov 7, 2026
b152954
Oracle: the FP64 receipt carries the contract capture's own figures
EugeneClaw Nov 7, 2026
fd19bf4
Oracle: the floor binds the checkpoint metadata identity, and the rel…
EugeneClaw Nov 7, 2026
a9f6758
Tests: the trimmed-directory identity fixture builds its payload as b…
EugeneClaw Nov 7, 2026
0c58036
Review: the floor binds the token map and the streamed source, and th…
EugeneClaw Nov 7, 2026
923edb5
Docs: the full release-quality window reads 1.647x, so the 16-token c…
EugeneClaw Nov 7, 2026
76b819b
Docs: state the full-window band result as measured and keep the 16-t…
EugeneClaw Nov 7, 2026
1ba7fe0
Docs: a cold 16-token rerun also fails the zero-read residency clause
EugeneClaw Nov 7, 2026
245d135
Docs: the band floor is not rounding-level at the first token
EugeneClaw Nov 7, 2026
06518d5
Receipt: the oracle window starts after the operator self-check
EugeneClaw Nov 7, 2026
39fc808
Docs: the resident window starts after the operator self-check
EugeneClaw Nov 7, 2026
5bff047
Docs: the cold 16-token run still fails the residency clause
EugeneClaw Nov 7, 2026
a757035
Receipt: the residency receipt names the Engram stream's own reads
EugeneClaw Nov 7, 2026
f874f4f
Docs: the cold 16-token read is the stream at page granularity
EugeneClaw Nov 7, 2026
95d8e11
Review: the lane comments are one line so the lean CI counts none new
EugeneClaw Nov 7, 2026
3b93783
Merge upstream main 964f98b0ba64 into contribution/dsv41-exl3
EugeneClaw Nov 7, 2026
1223407
Lean: the re-blended shared files stay under 600 lines
EugeneClaw Nov 7, 2026
8cc69ac
Merge fix: the LFM3 encoder passes the recorder metadata word
EugeneClaw Nov 7, 2026
08c638e
Comments: the reference window and glue reference lose their last sta…
EugeneClaw Nov 7, 2026
ad325ab
Merge upstream main f4af83077 into contribution/dsv41-exl3
EugeneClaw Nov 7, 2026
dfbb025
Lean: the re-merged shared files stay under 600 lines
EugeneClaw Nov 7, 2026
a944501
Docs: the kernel count and standing rates are the final head's own nu…
EugeneClaw Nov 7, 2026
577d89b
Docs: the standing rates are rounded run-to-run figures; the kernel s…
EugeneClaw Nov 7, 2026
2972ae7
Lean: engine_api leaves two lines of headroom under 600
EugeneClaw Nov 7, 2026
1303e91
Comments: the last local-workaround note and three round-history asid…
EugeneClaw Nov 7, 2026
f2e28e9
Merge upstream main 5874551fa: lanes.zig keeps the lane's shared_plai…
EugeneClaw Nov 8, 2026
acfb1d4
EXL3: the routed prompt tile keeps its 64-column default (nax59), rec…
EugeneClaw Nov 8, 2026
a342024
Build: restore the family-neutral kv_state and drop the draft debug
EugeneClaw Nov 8, 2026
6d47441
Merge upstream main 5cfbc8880 into contribution/dsv41-exl3
EugeneClaw Nov 8, 2026
bec140d
Lean: the lane's existing switches and projection-knob parser are listed
EugeneClaw Nov 8, 2026
ae949d3
fabric: a hybrid model's prompt state in one order both backends read…
ThinkOffApp Nov 9, 2026
8ca90bd
core: a prompt prefix another machine filled reaches its stream like …
ThinkOffApp Nov 9, 2026
5041594
native: the GB10 exports Qwen3.8-27B states in place, and the Mac pul…
ThinkOffApp Nov 9, 2026
c12ba74
serve: --prefill-from and --mcdma-link on the Mac, --mcdma-produce on…
ThinkOffApp Nov 9, 2026
ed7296e
tests: tf-qwen27-import and tf-qwen35-cuda export, the two halves' ch…
ThinkOffApp Nov 9, 2026
f4e4336
changelog: #2648 under Unreleased
ThinkOffApp Nov 10, 2026
2f6d5d5
tests: a hand-off repeat whose keep at the cut is refused leaks no bo…
ThinkOffApp Nov 10, 2026
d12ea37
qwen27: a hand-off turn leaves slot 0 resumable, so its follow-up res…
ThinkOffApp Nov 11, 2026
f0cd32d
tests: the hand-off resume is pinned through the lane host and attach
ThinkOffApp Nov 11, 2026
db68372
lanes: a request waits for no cut below where its leader's pass began
ThinkOffApp Nov 11, 2026
376577d
build: the rounds tool's census build imports hybrid_state, as the CU…
ThinkOffApp Nov 11, 2026
ef2b14b
qwen27: which resumed plan takes its rows' origin is inherit's own rule
ThinkOffApp Nov 11, 2026
e0010c4
tests: the hand-off resume tests assert what the code sets, not the f…
ThinkOffApp Nov 11, 2026
04c2fa8
rebase: retain current reply priority and keep CUDA admission lean
ThinkOffApp Nov 13, 2026
5e39931
fmt: align environment rows after rebase
ThinkOffApp Nov 13, 2026
4df318c
deepseek_v41 handoff: CUDA record codecs, FP4 packers and the part plan
BlivionIaG Nov 16, 2026
0b01d9d
CHANGELOG: DeepSeek-V4.1 hand-off record library (#3563)
BlivionIaG Nov 16, 2026
52069d6
deepseek_v41 handoff: Metal packers, importer, protocol 2 adapter and…
BlivionIaG Nov 16, 2026
b3329e8
CHANGELOG: DeepSeek-V4.1 hand-off Metal side (#3564)
BlivionIaG Nov 16, 2026
ea274f5
deepseek_v41 on CUDA: --mcdma-produce exports a hand-off request's pr…
BlivionIaG Nov 16, 2026
0bce224
CHANGELOG: DeepSeek-V4.1 CUDA hand-off export (#3565)
BlivionIaG Nov 16, 2026
618517b
deepseek_v41 export: replay-mode and piece-wise prefill are exported …
BlivionIaG Nov 16, 2026
e36b502
CHANGELOG: DeepSeek-V4.1 hand-off export in replay and piece-wise pre…
BlivionIaG Nov 16, 2026
fb2c54b
deepseek_v41 CUDA: a split KV pool is exported by shard, each rank ex…
BlivionIaG Nov 16, 2026
9b2b616
CHANGELOG: DeepSeek-V4.1 split KV pool exported by shard (#3567)
BlivionIaG Nov 16, 2026
7fa5f1b
Merge #2373 (EXL3 2.9 bpw Metal lane) into the hand-off library and C…
BlivionIaG Nov 16, 2026
f771514
DeepSeek V4.1 on Metal: --prefill-from pulls a prompt's prefix state …
BlivionIaG Nov 16, 2026
dcc92d0
CHANGELOG: DeepSeek V4.1 --prefill-from pull and land (#3594)
BlivionIaG Nov 16, 2026
891d439
Remote prefill: weigh each prompt against the pair's load and the pre…
BlivionIaG Nov 16, 2026
76c9bb1
CHANGELOG: DeepSeek V4.1 per-prompt route (#3595)
BlivionIaG Nov 16, 2026
df3795f
DeepSeek V4.1 lane host: add the keepalive scratch only when a pull i…
BlivionIaG Nov 16, 2026
e5a9991
Merge pr/dsv41-pull-prefill-from into pr/dsv41-pull-route
BlivionIaG Nov 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ zig-out/

# Versioned GUI build resources, generated app engines stay ignored in app/.gitignore.
!app/build/
# mHC fp64 qualification receipts.
/receipts/

# The full E4B per-layer input oracle outputs (tools/zig/gemma4_e4b_layer_input_oracle.py --full); the committed fixture is the .json of SHA-256 prints.
tools/zig/fixtures/e4b_layer_input_mlx.bin
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ Each release's page on GitHub has its notes and measurements. See [the 1.0.0 rel

## Unreleased

- DeepSeek V4.1 remote prefill: with `--prefill-from`, each prompt is weighed against the pair's load and the predicted pull and Mac prefill times (`TF_PREFILL_ROUTE`, default `auto`; `always` queues every prompt behind the pull as before) (#3595).

- DeepSeek V4.1 on Metal: `--prefill-from URL` with `--mcdma-link` pulls a prompt's prefix state from a producer over the hand-off and lands it in the served lane; off unless the flag is given (#3594).

- DeepSeek-V4.1 on CUDA: a split KV pool (`TF_DSV41_KV_SPLIT`) is exported by shard on a `--mcdma-produce` server, each rank on its own link (`TF_DSV41_PRODUCE_LINK` on the followers) (#3567).

- DeepSeek-V4.1 on CUDA: a `--mcdma-produce` server also exports a hand-off request's state under `TF_DSV41_PREFILL=replay` and `TF_DSV41_PREFILL_PIECES`, and converts the snapshot to the protocol's parts off the engine thread (#3566).

- DeepSeek-V4.1 on CUDA: `--mcdma-produce LINK` (or `http`) exports a hand-off request's prompt state at its cut, and `GET /v1/handoff/<id>` serves it over the server's own port; a request cancelled by its cut leaves no held export. Nothing is exported unless the flag is given (#3565).

- DeepSeek-V4.1 prefill hand-off: the host-only Metal side (packers into the release and served lanes' caches, the importer, the protocol 2 adapter and the landing sink); no server calls it yet (#3564).

- DeepSeek-V4.1 prefill hand-off: the host-only library that turns a CUDA prompt state into the neutral bf16/f32 parts of the hand-off and back (record codecs, FP4 packers, the part plan); nothing calls it yet (#3563).

- Qwen3.8-27B: a GB10 can work through the long start of a prompt and hand the state to a Mac over ConnectX; the Mac finishes the prompt and writes the reply. Off unless the Mac is started with `--prefill-from` and `--mcdma-link` and the GB10 with `--mcdma-produce`. On a 120,832-token first message the first token came after 136 s instead of 385 s on an M5 Max; a GB10 serving the chat alone was quicker still. Replies can differ from the Mac's own where the top two choices are close (#2648, step 2b of #1594).

- HIP: the TCP fabric Kind gains its device side for two hosts over a network link: staged copies through mapped host memory, a stream that waits on a peer's counter, a 30 s limit on each proxy copy, and every rank refusing a bad part size together. Nothing selects the Kind yet (#2961). Thanks to @Shoestring-dev.

- GLM-5.3-Flash on CUDA: a decode window's DSA select spreads each row over many blocks (`TF_GLM_DSEL`, default on; `TF_GLM_DSEL=0` keeps one block a row) and picks `tf_glm_select_rows`' pools. At TP=4 on four GB10s, the decode round after a 1,040,384-token prompt is 5.05%, 9.36% and 11.36% shorter at 1, 4 and 8 streams, with every reply unchanged (#2722). Ported from patch 0067 of Mia's AI Lab's GLM-5.3-Flash stack. Thanks to Mia's AI Lab (@MiaAI-Lab).
Expand Down
9 changes: 8 additions & 1 deletion THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ MIT License, Copyright © 2025 Turboderp. TensorFold's decoders and kernels are
checked bit for bit against ExLlamaV3's dequantization.

The native `zig/src/core/exl3_format.zig` reference decoder, the `zig/src/core/exl3_projection*.zig` decoder and
`zig/kernels/metal/core/exl3_projection.metal` separately implement the same format and codebooks
`zig/kernels/metal/core/exl3_projection_core.metal` and `_wide.metal` separately implement the same format and codebooks
under the Turboderp attribution above. So do the native checkpoint scan (`zig/src/core/exl3_load.zig`,
`exl3_metal_load.zig`), the CUDA kernels (`zig/kernels/cuda/exl3_*.cu`, `exl3_decode.cuh`, `exl3_candidate.cuh`) and
their Zig side (`zig/src/cuda/exl3*.zig`), and GLM's reader of its EXL3 experts (`zig/src/families/glm/cuda_exl3.zig`).
Expand Down Expand Up @@ -294,6 +294,13 @@ Bolt's GGML checkpoints (`zig/kernels/cuda/ggml.cu`, `zig/src/cuda/ggml.zig`) ar
TensorFold ships no model weights. The `z-lab/Qwen3.8-27B-DFlash2` model card states Apache-2.0.
The optional `incoai/GLM-5.3-Flash-DFlash2` model card states Apache-2.0 too. Each checkpoint keeps its own license.

The native `zig/src/families/deepseek_v41/` implementation and `zig/tests/deepseek_v41_reference/`
follow [DeepSeek-V4.1-Flash's official inference](https://huggingface.co/deepseek-ai/DeepSeek-V4.1-Flash/tree/2cba9e42aa026125f3ed06c6d98c1db82f7ca027/inference),
MIT License, Copyright (c) 2023 DeepSeek: the reference's equations, the Engram normalization,
PCG64 multipliers and prime bucket layout, and the pinned chat template come from that revision.
The EXL3 checkpoint reads through the ExLlamaV3 format covered above; no captured CUDA/Triton
kernel assets, full model shards or binary traces are bundled.

## Structured output: libtfgrammar

`lib/libtfgrammar` in the release archives is `zig/src/grammar/tf_grammar.cc` compiled with the C++ sources of
Expand Down
7 changes: 4 additions & 3 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ pub fn build(b: *std.Build) void {
@import("zig/build/dsv41_shared.zig").steps(b);
@import("zig/build/dsv41_cuda.zig").steps(b);
@import("zig/build/dsv41_state.zig").steps(b);
@import("zig/build/dsv41_handoff.zig").steps(b);
@import("zig/build/dsv41_draft.zig").steps(b);
@import("zig/build/dsv41_assets.zig").steps(b);
const target = b.standardTargetOptions(.{});
Expand Down Expand Up @@ -108,7 +109,7 @@ pub fn build(b: *std.Build) void {
@import("zig/build/quant_geometry_host.zig").steps(b, test_step);
@import("zig/build/stage.zig").steps(b, test_step);
if (b.graph.host.result.os.tag == .macos) {
const step5_mods = metalEngineModules(b, b.graph.host, .Debug, draft_ids);
const step5_mods = metalEngineModules(b, b.graph.host, .Debug, draft_ids, b.createModule(.{ .root_source_file = b.path("zig/src/core/tokenizer/tokenizer.zig"), .target = b.graph.host, .optimize = .Debug, .link_libc = true }));
const empty = b.addWriteFiles().add("step5-compile-only.metallib", "");
step5_mods.sources.addImport("nemotron_packed_metallib", embedded(b, empty, "nemotron_packed.metallib"));
@import("zig/build/step5_host.zig").steps(b, step5_mods.metal, step5_mods.engine, step5_mods.lanes);
Expand All @@ -121,7 +122,7 @@ pub fn build(b: *std.Build) void {
@import("zig/build/flashnext_batch_host.zig").tests(b, test_step);
@import("zig/build/lfm3_host.zig").steps(b, test_step);
if (b.graph.host.result.os.tag == .macos) {
const budget_mods = metalEngineModules(b, b.graph.host, .Debug, draft_ids);
const budget_mods = metalEngineModules(b, b.graph.host, .Debug, draft_ids, b.createModule(.{ .root_source_file = b.path("zig/src/core/tokenizer/tokenizer.zig"), .target = b.graph.host, .optimize = .Debug, .link_libc = true }));
const budget_empty = b.addWriteFiles().add("budget-compile-only.metallib", "");
budget_mods.sources.addImport("nemotron_packed_metallib", embedded(b, budget_empty, "nemotron_packed.metallib"));
@import("zig/build/metal_prompt_sources.zig").steps(b, budget_mods.metal, budget_mods.engine, test_step);
Expand Down Expand Up @@ -186,7 +187,7 @@ pub fn build(b: *std.Build) void {
const gemma4_contract_host = @import("zig/build/gemma4_host.zig").tests(b, gemma4_host_sources);
gemma4_contract_host.dependOn(@import("zig/build/glm_rows_contract.zig").host(b, gemma4_host_sources));
if (b.graph.host.result.os.tag == .macos) {
const gemma4_host_mods = metalEngineModules(b, b.graph.host, .Debug, draft_ids);
const gemma4_host_mods = metalEngineModules(b, b.graph.host, .Debug, draft_ids, b.createModule(.{ .root_source_file = b.path("zig/src/core/tokenizer/tokenizer.zig"), .target = b.graph.host, .optimize = .Debug, .link_libc = true }));
gemma4_host_mods.sources.addImport("nemotron_packed_metallib", embedded(b, b.addWriteFiles().add("gemma4-compile-empty.metallib", ""), "nemotron_packed.metallib"));
@import("zig/build/gemma4_host.zig").compileHost(b, gemma4_host_mods.metal, gemma4_host_mods.engine, gemma4_host_mods.lanes, gemma4_host_mods.sources);
@import("zig/build/qwen27_host.zig").compileHost(b, gemma4_host_mods.metal, gemma4_host_mods.engine, gemma4_host_mods.lanes);
Expand Down
22 changes: 17 additions & 5 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ different scopes, or scopes a key the flags or environment already give, is refu

| Scope | Routes |
| --- | --- |
| `inference` | POST `/v1/chat/completions`, `/v1/completions`, `/v1/responses`, `/v1/messages`, `/v1/messages/count_tokens`, `/v1/tokenize`, `/v1/detokenize`, `/v1/audio/speech`, `/v1/images/generations`, `/v1/embeddings`, `/v1/decisions`, `/v1/systemone`, `/v1/rerank` (also by PUT), `/v1/ocr`, and the same paths without `/v1` where the server has them; GET `/v1/models`, `/models`, `/v1/voices`; a WebSocket upgrade on GET `/v1/responses` or `/responses` |
| `inference` | POST `/v1/chat/completions`, `/v1/completions`, `/v1/responses`, `/v1/messages`, `/v1/messages/count_tokens`, `/v1/tokenize`, `/v1/detokenize`, `/v1/audio/speech`, `/v1/images/generations`, `/v1/embeddings`, `/v1/decisions`, `/v1/systemone`, `/v1/rerank` (also by PUT), `/v1/ocr`, and the same paths without `/v1` where the server has them; GET `/v1/models`, `/models`, `/v1/voices`; GET and DELETE `/v1/handoff/<32 hex digits>`; a WebSocket upgrade on GET `/v1/responses` or `/responses` |
| `read` | GET `/metrics`, `/v1/metrics`, `/v1/load`, `/memory`, `/v1/memory`, `/stats`, `/dashboard`, `/v1/benchmark/manifest`, `/v1/models`, `/models`, `/v1/voices` |

A scoped key reaches nothing else: not the stored Responses (GET or DELETE `/v1/responses/ID`), Recall, Sliding Weights,
Expand Down Expand Up @@ -428,6 +428,15 @@ and on GLM-5.3-Flash's CUDA engine.
`logprob`, `rank` and `decoded_token`. The prompt token's `rank` counts every vocabulary token at or above it,
itself included, as vLLM does, and the best tokens are ranked by place. Such a request never resumes from the prompt
cache, so its whole prompt is prefilled. Chat, streamed requests and other engines return HTTP 400 with it.
Every native server reads MCDMA's `kv_transfer_params.mcdma_handoff` (`id`, 32 hex digits, and `export_from`, 0)
on `/v1/completions` and `/v1/chat/completions`. A server started with `--mcdma-produce` exports that prompt's state;
any other server, a malformed object, or a nonzero `export_from` gets HTTP 400 naming the field.
A DeepSeek-V4.1 CUDA server started with `--mcdma-produce http` also serves the exports it holds: `GET /v1/handoff/<id>` streams
the hand-off (HTTP 200, `application/octet-stream`, `Content-Length`; [DeepSeek-V4.1 hand-off](deepseek-v41-handoff.md#over-plain-http)),
`DELETE /v1/handoff/<id>` releases it (HTTP 200, or 404 when none is held). An id is exactly 32 hex digits (else HTTP 400); an
id with no export, a released or an expired one, and a server that serves no exports answer HTTP 404, and an export that failed
answers 409 with the reason. The key gate runs first: with keys, a request without a valid key gets 401, and a restricted key needs
the `inference` scope.
`ignore_eos: true` keeps user-supplied `stop` strings active, including when a stop string spans streamed chunks.
Both backends reject a non-boolean `ignore_eos` or a malformed `stop` with HTTP 400 before a stream opens.
Both backends reject malformed `temperature`, `top_p`, `top_k` and `seed` values with HTTP 400, whether or not
Expand Down Expand Up @@ -932,10 +941,13 @@ add `gpu_seconds` to the block: the GPU-busy time of the target model's forward
pass included. A round shared with other streams counts whole in each of their replies, and the drafter's passes
are not included. Without `TF_Q27_PROFILE` the field is absent and replies are unchanged.

Beside the block, native replies carry top-level `exact_mode`, always `"exact"`, and `stop_sequence`, the matched
stop string, when a stop string ended the reply. A server started with `--cortheon` adds a top-level `cortheon`
object summarizing the turn for requests Cortheon runs ([Cortheon](cortheon.md)). These ride on the whole reply and
the streamed finish event alike.
Beside the block, native replies carry top-level `exact_mode` and `stop_sequence`, the matched stop string, when a
stop string ended the reply. `exact_mode` is `"exact"`, or `"remote_prefix"` when a server started with
`--prefill-from` built any of the reply's prompt prefix on another machine; that reply can differ from one built here
alone. Its block then adds `remote_prefix`, the restored prefix's length, `pulled_prefix` when it came over the link
for this reply, and `kept_remote_cache_tokens` when it was a kept copy. A server started with `--cortheon` adds a
top-level `cortheon` object summarizing the turn for requests Cortheon runs ([Cortheon](cortheon.md)). These ride on
the whole reply and the streamed finish event alike.

The native server's finish log names the client reply ID. Completed requests report `prompt`, `cached`,
`thinking`, `effort`, `tokens`, `sha`, `finish`, `rounds`, and draft acceptance; a refused request reports
Expand Down
Loading