mlx-bun 0.3.0 → 0.5.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.
- package/README.md +57 -32
- package/docs/README.md +58 -42
- package/docs/archive/investigations/benchmark-ledger-through-v0.4.0.md +3617 -0
- package/docs/archive/investigations/openjarvis-fit.md +198 -0
- package/docs/archive/investigations/qwen38-27b-campaign-log.md +1092 -0
- package/docs/archive/planning/release-notes-v0.4.0.md +45 -0
- package/docs/archive/planning/release-notes-v0.5.0.md +37 -0
- package/docs/design/batching.md +1535 -50
- package/docs/design/decode-speed-program.md +394 -1171
- package/docs/design/generic-model-support.md +195 -3
- package/docs/design/kv-cache.md +538 -225
- package/docs/design/speculative-decoding.md +552 -50
- package/docs/design/turboquant.md +140 -17
- package/docs/design/unified-engine-frontier-plan.md +259 -150
- package/docs/planning/PRODUCT_ROADMAP.md +21 -6
- package/docs/planning/public-readiness-handoff.md +244 -0
- package/docs/planning/public-readiness.md +149 -0
- package/docs/reference/benchmarks.md +3537 -1112
- package/docs/reference/cli.md +102 -2
- package/docs/reference/distribution.md +45 -13
- package/docs/reference/environment.md +159 -13
- package/docs/reference/library-api.md +18 -4
- package/docs/reference/memory.md +1 -1
- package/docs/reference/models.md +28 -7
- package/docs/reference/server-api.md +257 -33
- package/docs/reference/server-config.md +372 -151
- package/docs/reference/troubleshooting.md +13 -21
- package/package.json +2 -2
- package/src/audio/audiotoolbox.ts +112 -0
- package/src/audio/conformer.ts +8 -0
- package/src/audio/mic-capture.ts +98 -0
- package/src/audio/silero-vad.ts +379 -0
- package/src/audio/whisper-decode.ts +774 -0
- package/src/audio/whisper-fast.ts +732 -0
- package/src/audio/whisper-format.ts +73 -0
- package/src/audio/whisper-mel.ts +185 -0
- package/src/audio/whisper-timing.ts +274 -0
- package/src/audio/whisper-tokenizer.ts +239 -0
- package/src/audio/whisper-transcribe.ts +410 -0
- package/src/backends/mlx/assistant-target.ts +46 -0
- package/src/backends/mlx/autoregressive-draft-rows.ts +120 -0
- package/src/backends/mlx/autoregressive.ts +22 -1
- package/src/backends/mlx/batch-group.ts +464 -236
- package/src/backends/mlx/cache-attachment.ts +67 -0
- package/src/backends/mlx/cache-layout.ts +31 -0
- package/src/backends/mlx/checkpoint-state.ts +53 -0
- package/src/backends/mlx/continuation-persistence.ts +107 -0
- package/src/backends/mlx/continuation-request.ts +43 -0
- package/src/backends/mlx/continuation.ts +77 -0
- package/src/backends/mlx/draft-target.ts +7 -22
- package/src/backends/mlx/encoder-cache.ts +25 -0
- package/src/backends/mlx/fill-append.ts +21 -8
- package/src/backends/mlx/fill-group.ts +497 -0
- package/src/backends/mlx/full-kv-row-append.ts +32 -0
- package/src/backends/mlx/full-kv-row-donor.ts +54 -0
- package/src/backends/mlx/full-transitioning-kv-rows.ts +65 -0
- package/src/backends/mlx/gateway-binding.ts +122 -19
- package/src/backends/mlx/kv-codec.ts +9 -0
- package/src/backends/mlx/kv-maintenance.ts +161 -0
- package/src/backends/mlx/kv-tensor-rows.ts +212 -0
- package/src/backends/mlx/mixed-iteration.ts +62 -0
- package/src/backends/mlx/model-prompt.ts +46 -32
- package/src/backends/mlx/model-serving.ts +5 -4
- package/src/backends/mlx/paged-cache-codec.ts +27 -0
- package/src/backends/mlx/prefill-cohort.ts +100 -0
- package/src/backends/mlx/prefill-policy.ts +26 -0
- package/src/backends/mlx/prefill-rows.ts +244 -0
- package/src/backends/mlx/prefill.ts +1 -1
- package/src/backends/mlx/projected-context-rows.ts +72 -0
- package/src/backends/mlx/prompt-input.ts +29 -0
- package/src/backends/mlx/qwen-prompt-input.ts +40 -0
- package/src/backends/mlx/request-state-policy.ts +54 -0
- package/src/backends/mlx/rollback.ts +45 -4
- package/src/backends/mlx/row-sampling.ts +49 -0
- package/src/backends/mlx/serial-executor.ts +51 -73
- package/src/backends/mlx/speculative-group.ts +438 -0
- package/src/backends/mlx/speculative-round.ts +161 -0
- package/src/backends/mlx/speculative.ts +24 -7
- package/src/backends/mlx/state-rows.ts +104 -0
- package/src/backends/mlx/state-views.ts +21 -1
- package/src/backends/mlx/target-layout-capability.ts +35 -0
- package/src/backends/mlx/transitioning-kv-rows.ts +173 -0
- package/src/cli.ts +333 -36
- package/src/contracts/execution.ts +21 -0
- package/src/contracts/object-cache.ts +8 -0
- package/src/contracts/pi-provider.ts +1 -1
- package/src/contracts/pi.ts +3 -1
- package/src/contracts/prefix-cache.ts +33 -0
- package/src/contracts/resources.ts +7 -0
- package/src/contracts/sampling.ts +23 -0
- package/src/contracts/scheduling.ts +27 -0
- package/src/engine/execution-plan.ts +38 -25
- package/src/engine/execution-tasks.ts +44 -0
- package/src/engine/namespaced-cache.ts +13 -0
- package/src/engine/resources.ts +12 -1
- package/src/engine/scheduler.ts +32 -7
- package/src/fill/fill-session.ts +14 -3
- package/src/fit.ts +29 -15
- package/src/generate.ts +105 -195
- package/src/grammar.ts +13 -0
- package/src/inference/draft-acceptance.ts +41 -0
- package/src/inference/draft-output.ts +49 -0
- package/src/inference/prefill.ts +6 -0
- package/src/inference/rollback.ts +2 -2
- package/src/kv-scheme.ts +92 -12
- package/src/kv-store.ts +183 -93
- package/src/lab/README.md +5 -1
- package/src/lab/paged-kv/paged-attention.ts +117 -0
- package/src/lab/paged-kv/paged-kv-rows.ts +111 -0
- package/src/lab/paged-kv/paged-kv.ts +126 -46
- package/src/md-modules.d.ts +5 -0
- package/src/mlx/array.ts +39 -1
- package/src/mlx/ffi.ts +19 -0
- package/src/mlx/normalized-argmax.ts +116 -0
- package/src/mlx/ops.ts +97 -10
- package/src/model/artifact-identity.ts +73 -0
- package/src/model/batched-kv.ts +235 -0
- package/src/model/batched-mask.ts +12 -4
- package/src/model/batched-quant.ts +8 -2
- package/src/model/batched-quantized-kv.ts +144 -0
- package/src/model/batched-rotating-quant.ts +76 -15
- package/src/model/batched-rotating-state.ts +76 -0
- package/src/model/batched-rotating.ts +64 -22
- package/src/model/batched-row-storage.ts +52 -0
- package/src/model/batched-ssm.ts +52 -0
- package/src/model/batched-turboquant-kv.ts +94 -0
- package/src/model/compiled-decode.ts +7 -1
- package/src/model/decoded-kv-donor.ts +12 -0
- package/src/model/delayed-quantized-kv.ts +72 -0
- package/src/model/delayed-rotating-quantized-kv.ts +93 -0
- package/src/model/delayed-turboquant-kv.ts +57 -0
- package/src/model/factory.ts +26 -0
- package/src/model/fingerprint.ts +12 -0
- package/src/model/full-prefill-padding.ts +56 -0
- package/src/model/full-prefill-row.ts +105 -0
- package/src/model/gemma4-base.ts +183 -82
- package/src/model/gemma4.ts +116 -28
- package/src/model/generated/gemma4-12b.ts +4 -1
- package/src/model/generated/gemma4-26b.ts +4 -1
- package/src/model/generated/gemma4-e4b.ts +4 -1
- package/src/model/glm52-cache.ts +80 -4
- package/src/model/glm52-mla.ts +12 -6
- package/src/model/glm52.ts +19 -40
- package/src/model/kv-attention-view.ts +70 -0
- package/src/model/minicpm5.ts +11 -7
- package/src/model/profile.ts +29 -4
- package/src/model/quantized-append-attention.ts +31 -0
- package/src/model/qwen3-delta-state.ts +74 -0
- package/src/model/qwen3-delta.ts +59 -36
- package/src/model/qwen3-mrope.ts +7 -9
- package/src/model/qwen3_5.ts +177 -75
- package/src/model/rotating-kv-donor.ts +35 -0
- package/src/model/rotating-kv-layout.ts +262 -0
- package/src/model/rotating-row-transaction.ts +35 -0
- package/src/model/speculative-rotating-kv.ts +101 -0
- package/src/model/ssm-prefill-padding.ts +39 -0
- package/src/model/support.ts +8 -0
- package/src/model/token-groups.ts +66 -0
- package/src/model/trellis-linear.ts +4 -4
- package/src/model/turboquant-codec.ts +89 -0
- package/src/model/universal/dense.ts +14 -13
- package/src/model/whisper.ts +435 -0
- package/src/native/mic_capture.swift +92 -0
- package/src/native-pack.ts +6 -5
- package/src/pi-web.ts +9 -1
- package/src/preflight.ts +31 -15
- package/src/prompt-cache.ts +306 -86
- package/src/runtime-config.ts +1 -5
- package/src/safetensors.ts +9 -2
- package/src/sampler.ts +37 -25
- package/src/serve/audio-routes.ts +323 -0
- package/src/serve/chat-request.ts +2 -0
- package/src/serve/chat-stage.ts +19 -14
- package/src/serve/completion-executor.ts +9 -1
- package/src/serve/discovery-routes.ts +17 -1
- package/src/serve/generated-token-history.ts +57 -0
- package/src/serve/generation-gateway.ts +88 -38
- package/src/serve/model-binding.ts +7 -1
- package/src/serve/model-host.ts +3 -4
- package/src/serve/preparation.ts +3 -3
- package/src/serve/prompt-response-trace.ts +14 -0
- package/src/serve/request-plan.ts +6 -3
- package/src/serve/request-prep.ts +40 -25
- package/src/serve/text-completion-stage.ts +2 -2
- package/src/serve/transcription-server.ts +64 -0
- package/src/serve/transcription-service.ts +502 -0
- package/src/server.ts +185 -261
- package/src/spec/assistant-rows.ts +93 -0
- package/src/spec/assistant-source.ts +28 -18
- package/src/spec/cache-identity.ts +22 -0
- package/src/spec/deepspec-rows.ts +29 -0
- package/src/spec/deepspec-source.ts +12 -10
- package/src/spec/dflash-source.ts +28 -4
- package/src/spec/drafter.ts +153 -142
- package/src/spec/dspark/deepspec-module.ts +95 -120
- package/src/spec/dspark/module-dflash.ts +126 -170
- package/src/spec/glm52-mtp-graph.ts +29 -0
- package/src/spec/glm52-mtp-rows.ts +132 -0
- package/src/spec/glm52-mtp-source.ts +54 -136
- package/src/spec/glm52-mtp-state.ts +33 -0
- package/src/spec/ngram-source.ts +115 -21
- package/src/spec/projected-draft-rows.ts +73 -0
- package/src/spec/qwen-mtp-module.ts +171 -0
- package/src/spec/qwen-mtp-rows.ts +230 -0
- package/src/spec/qwen-mtp-source.ts +84 -226
- package/src/spec/qwen-mtp-state.ts +30 -0
- package/src/spec/serve-loop.ts +73 -69
- package/src/spec/source.ts +93 -15
- package/src/spec/two-model-rows.ts +62 -0
- package/src/spec/two-model.ts +45 -103
- package/src/ssd-cache.ts +107 -36
- package/src/ssd-durability.ts +29 -27
- package/src/storage/host-buffer.ts +24 -0
- package/src/storage/kv-writer.ts +83 -0
- package/src/storage/kv-writer.worker.js +264 -0
- package/src/storage/retention-policy.ts +37 -0
- package/src/tiered-prompt-cache.ts +45 -0
- package/src/vision/embedder.ts +8 -0
- package/src/vision/prompt.ts +101 -65
- package/src/vision/qwen3vl-prompt.ts +101 -64
- package/src/vision/qwen3vl-tower.ts +11 -0
- package/src/vision/siglip.ts +8 -0
- package/src/web/app.html +12 -0
- package/src/web/app.js +217 -57
- package/src/web/src/chat.ts +4 -1
- package/src/web/src/composer.ts +3 -0
- package/src/web/src/voice.ts +141 -0
- package/src/web/sw.js +1 -1
- package/src/backends/mlx/memory-guard.ts +0 -40
- package/src/spec/prefix-state.ts +0 -45
- /package/docs/{planning → archive/planning}/release-notes-v0.3.0.md +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# mlx-bun v0.4.0
|
|
2
|
+
|
|
3
|
+
This release brings shared batched decode, generated-history cache reuse and
|
|
4
|
+
resumable generation together through separate scheduling, inference, sampling
|
|
5
|
+
and persistence interfaces.
|
|
6
|
+
|
|
7
|
+
- Shared ordinary and speculative execution supports Qwen MTP, prompt lookup,
|
|
8
|
+
standalone, assistant, DeepSpec and DSpark/DFlash providers on qualified
|
|
9
|
+
model/request combinations. Single requests run at B=1 through the scheduler.
|
|
10
|
+
- Full and rotating affine/TurboQuant cache layouts compose with delayed and
|
|
11
|
+
per-layer precision, speculative rollback and generated target/draft state.
|
|
12
|
+
- Completed decode populates the shared RAM/SSD cache so later turns can reuse
|
|
13
|
+
generated history. SSD persistence is queued and runs during idle ownership.
|
|
14
|
+
- Ordinary interrupted-generation resume now works through shared execution,
|
|
15
|
+
including compatible adapters and quantized caches. Restored sampler history,
|
|
16
|
+
pending tokens and usage accounting preserve the continuation contract.
|
|
17
|
+
- Ordinary paged storage and adapter-qualified prompt lookup use the same state
|
|
18
|
+
and execution interfaces. GLM native MTP gains shared cache transactions and
|
|
19
|
+
row state; final real-artifact testing remains deferred.
|
|
20
|
+
- Measured Trellis v13 is selected by default, and eligible Qwen KV4 speculation
|
|
21
|
+
is enabled. Workload-dependent lookup and other experimental settings remain
|
|
22
|
+
opt-in. Memory fit estimates are advisory unless users choose explicit limits.
|
|
23
|
+
- Benchmark reporting retains request/source identities, paired comparisons,
|
|
24
|
+
failures and configuration differences. CI and the release build use Bun 1.4.2.
|
|
25
|
+
|
|
26
|
+
Serving keeps its existing `--batch 8` default. A lone eligible request starts
|
|
27
|
+
immediately at B=1; the cap does not wait for eight requests. `--batch 1` retains
|
|
28
|
+
the serial executor, and unsupported compositions can still use it. Removing
|
|
29
|
+
serial and completing every feature combination are follow-up work.
|
|
30
|
+
|
|
31
|
+
Checkpoint capture is eventually persistent: queued snapshots can remain in RAM
|
|
32
|
+
during uninterrupted traffic. A successful explicit flush is the durability
|
|
33
|
+
boundary. Media, fill/grammar-jump and direct paged-attention work remain tracked.
|
|
34
|
+
No DSpark/DFlash checkpoint has been trained for this campaign; execution fixtures
|
|
35
|
+
do not establish trained-drafter performance.
|
|
36
|
+
|
|
37
|
+
Measured performance and its workload limits are in the
|
|
38
|
+
[benchmark record](https://github.com/joshuarossi/mlx-bun/blob/v0.4.0/docs/reference/benchmarks.md).
|
|
39
|
+
This release does not claim a matched full-task Kanban speedup or completion of
|
|
40
|
+
the entire optimization program. Supported settings are documented in the
|
|
41
|
+
[server configuration reference](https://github.com/joshuarossi/mlx-bun/blob/v0.4.0/docs/reference/server-config.md).
|
|
42
|
+
|
|
43
|
+
Requires Apple Silicon and macOS 14 or later. npm installs require Bun 1.4.0 or
|
|
44
|
+
later; Bun 1.4.2 is the tested version. The existing native runtime pack 0.4.0
|
|
45
|
+
provides MLX 0.32.2 and its matching C API.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# mlx-bun v0.5.0
|
|
2
|
+
|
|
3
|
+
Whisper speech-to-text: transcription, dictation and voice input, bit-exact
|
|
4
|
+
against mlx-whisper and faster than both mlx-whisper and whisper.cpp on the
|
|
5
|
+
same clips.
|
|
6
|
+
|
|
7
|
+
- `mlx-community/whisper-large-v3-turbo` (any fp16 `mlx-community/whisper-*`)
|
|
8
|
+
loads as a new encoder-decoder family. The oracle-parity graph matches
|
|
9
|
+
mlx-whisper 0.4.3 bit-exactly on the mel spectrogram, the encoder output and
|
|
10
|
+
every decoder logit; the default fast path (fused attention, fused cross-K/V,
|
|
11
|
+
a compiled decoder step with device-side logit filters, pipelined greedy,
|
|
12
|
+
in-graph beam top-k) is held to at most two differing tokens per clip. M1 Max,
|
|
13
|
+
11 s clip: 340 ms greedy (mlx-whisper 371), 424 ms beam-5 (whisper.cpp 499).
|
|
14
|
+
- Decoding: greedy, sampling with the temperature fallback ladder, beam search
|
|
15
|
+
(mlx-whisper has none; matches whisper.cpp's beam-5 transcripts), prompts and
|
|
16
|
+
vocabulary hints fitted to the 223-token budget, language detection,
|
|
17
|
+
translation, >30 s seek loop, word-level timestamps.
|
|
18
|
+
- `POST /v1/audio/transcriptions` and `/v1/audio/translations` (OpenAI shape,
|
|
19
|
+
multipart or JSON, json/verbose_json/text/srt/vtt, SSE streaming) on every
|
|
20
|
+
server, with Whisper loaded per take beside the chat model and released right
|
|
21
|
+
after it; `mlx-bun serve <whisper model>` runs a transcription-only server.
|
|
22
|
+
- Streaming sessions (`/v1/audio/sessions`): audio uploaded while recording,
|
|
23
|
+
every finished 30 s window transcribed during capture — a 62 s take returns
|
|
24
|
+
327 ms after its last chunk.
|
|
25
|
+
- Silero VAD v6.2 gate (ported from the reference graph, verified against the
|
|
26
|
+
pip package): silence returns an empty transcript without running Whisper;
|
|
27
|
+
runs on the stream inside sessions.
|
|
28
|
+
- In-process audio decoding through AudioToolbox (3.7 ms for an 11 s mp3 vs
|
|
29
|
+
72 ms via afconvert); any CoreAudio-readable container.
|
|
30
|
+
- `mlx-bun transcribe <file>` and `mlx-bun dictate` (push-to-talk from the
|
|
31
|
+
microphone, print / clipboard / typed keystrokes; new `mlx-bun-mic-capture`
|
|
32
|
+
sidecar), and a hold-to-talk mic in the web composer for any chat model.
|
|
33
|
+
- Measured and shelved: a Core ML encoder on the Neural Engine (3.3× slower
|
|
34
|
+
than the GPU on the M1 Max); whisper.cpp-style encoder context truncation
|
|
35
|
+
ships as an off-by-default Lab option.
|
|
36
|
+
|
|
37
|
+
Native pack `native-v0.5.0` adds the `mlx-bun-mic-capture` helper.
|