Skip to content

feat: Decision 3.0 (d3-lite/nano/mini) Core ML runtime - #37

Merged
Alex-Wengg merged 1 commit into
mainfrom
feat/d3-coreml
Oct 11, 2026
Merged

Alex-Wengg merged 1 commit into
mainfrom
feat/d3-coreml

Conversation

@Alex-Wengg

Copy link
Copy Markdown
Member

Adds D3Manager, which runs vLLM Semantic Router's Decision 3.0 models (d3-lite 0.85B, d3-nano 2.2B, d3-mini 4.5B) on the GPU through Core ML. A request takes text or JSON state, optional images and any number of choice, yes/no or score questions, and gets a probability for every option.

  • D3ModelStore downloads pinned, checksummed snapshots from the lite/, nano/ and mini/ folders of FluidInference/d3-coreml, pinned to revision 31d0a53b.
  • D3Check example lite|nano|mini downloads a model and answers a sample request. D3Check parity compares the Swift host with the Python Core ML host.
  • D3PromptTests covers prompt building.
  • The README gets a Decision 3.0 section.
text (100 q) images per text question (M5 Pro)
d3-lite 2 flips 1 / 24 ~46 ms
d3-nano 0 flips 0 / 24 ~65 ms
d3-mini 1 flip 0 / 48 ~160 ms

Flips are answers that differ from upstream PyTorch (bf16 on MPS).

Verified locally:

  • swift build -c release passes.
  • swift-format lint is clean on the new files.
  • All 69 pinned checksums match the HF repo.
  • D3Check example lite re-downloaded files from the new repo and answered (route=returns 0.979, 142 ms).

Tests were not run locally because XCTest isn't installed here, so CI will be the first run.

🤖 Generated with Claude Code

D3Manager runs vLLM Semantic Router's Decision 3.0 models on the GPU through
Core ML: text graph per length bucket (E256/E640/E1536, fp16 compute, int8
weights), fp32 vision tower per patch bucket (P320/P1536/P3072), host-side
embeddings, M-RoPE positions and the 255-way FP32 readout, one row per question.

D3ModelStore downloads pinned, checksummed snapshots from the lite/, nano/ and
mini/ folders of FluidInference/d3-coreml (revision 31d0a53b; all 69 pinned
checksums verified against the repo). D3Check: 'example lite|nano|mini' and
'parity' against the Python Core ML host (0 token mismatches, 0 flips).

Answers vs upstream PyTorch (bf16, MPS): text 2/0/1 flips of 100, images
1/24, 0/24, 0/48; ~46/65/160 ms per text question on an M5 Pro.
@Alex-Wengg
Alex-Wengg merged commit 9384e70 into main Oct 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant