Views
No views yet
[MASK] tokens and fills them in in parallel,
committing the most-confident positions each step until the answer resolves. A different decoding
paradigm, running on-device on Apple Silicon.GSAI-ML/LLaDA-8B-Instruct (LLaMA-dense 8B, bidirectional, no causal mask)d3LLM/d3LLM_LLaDA (hao-ai-lab / NVIDIA) — pseudo-trajectory distillation that cuts the number of denoising steps hard (≈8 tokens committed per forward here)coreai-core), GPU1git clone https://github.com/john-rocky/coreai-kit
2open coreai-kit/Examples/DiffuseChat/DiffuseChat.xcodeproj
3# → Run, then pick "LLaDA-8B (diffusion)" in the model picker
4
5# agents / headless (macOS):
6cd coreai-kit/Examples/DiffuseChat
7swift run diffuse-cli --model llada-8b --prompt "What is the capital of France?"1import CoreAIKit
2
3let dlm = try await KitDiffusionLM(catalog: "llada-8b")
4let reply = try await dlm.reply(to: prompt)
5// reply: the denoised answer — pass onStep: to watch the canvas fill in per forward
6// (still-masked positions as ░), in parallel, not left-to-rightExamples/DiffuseChat/Sources/QuickStart.swift
— this exact code as one typed function, no UI; the CLI is an argument shell over it, and
the GUI renders the same live canvas.
The canvas is fixed (S=256 ≈ 210 generated tokens) and the whole history must fit — no
KV cache. reply(messages:) takes role/content turns and drops the oldest first.
Pass onStep: nil if you only want the final text.https://github.com/john-rocky/coreai-kit → product CoreAIKitdownloadProgress callback)48 + ░4 =░7░ clips░░░ → 48 + 24 = 72 clips altogether.macos/ bundle. The host drives the
denoising loop over a single static, bidirectional forward (main(input_ids[1,S]) → logits[1,S,vocab],
no KV cache).macos/ — Core AI .aimodel (GPU) + tokenizer/ + metadata.jsonmetadata.json exposes the diffusion knobs (no recompile to retune):
seq — canvas length (256 ⇒ answers up to ~210 tokens). No KV cache ⇒ the whole prompt+answer
lives in S; per-step cost is ~linear in S (a larger canvas = fuller answers but slower steps).block_size 32, threshold 1.0 — the entropy threshold trades steps for speed; lower = more gradual, higher = fewer forwards (faster), too high degrades quality| metric | value |
|---|---|
| throughput | ≈40 tok/s (threshold 1.0, S=256) |
| TTFT | ~0.3 s |
| forwards (NFE) | ~22 for a full 210-token answer |
| size | 4.9 GB (int4 + int8 head) |
generate_multi_block_kv_cache lever) for higher throughput