Repository navigation
decide/knowline: KnowLine-4B on macOS (MLX bf16) with a measured baseline - #133
Merged
Merged
Conversation
jayleaton
force-pushed
the
feat/mac-knowline
branch
from
October 30, 2026 13:28
0340adc to
3491ea5
Compare
jayleaton
force-pushed
the
feat/mac-knowline
branch
from
October 30, 2026 15:55
3491ea5 to
71d6f24
Compare
serve_mlx.py runs KnowLine's pinned knowline_server.py/knowline_layout.py with an mlx-lm Qwen3.5 backend: last-position logits through the tied head, float32 log-softmax, RMSNorm gains kept in float32 as transformers applies them. Skips HTTPServer's reverse lookup of 127.0.0.1 (35 s through mDNS on macOS) and builds the Metal kernels at load. Tests: lifecycle, refusals, cancellation, failures, and footprint on the longest prompt. Co-Authored-By: Claude Opus 5.5 <[email protected]>
50 fixed requests (54 questions), a bench that records probabilities, latency and footprint and compares runs, and the README's macOS baseline: MLX bf16 against the authors' unmodified transformers backend in bf16 and float32, and the 5-bit MLX quant (same answers, 20x the probability error: not adopted). Co-Authored-By: Claude Opus 5.5 <[email protected]>
The decide model of mac-apple-silicon.json (fetch.sh: weights against SHA256SUMS, the MLX venv) and the decision tool's config, booked at the measured peak plus 256 MiB. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
jayleaton
force-pushed
the
feat/mac-knowline
branch
from
October 31, 2026 02:27
71d6f24 to
919a2aa
Compare
jayleaton
marked this pull request as ready for review
October 31, 2026 02:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #134 (
feat/mac-foundation).KnowLine-4B Gen5.5 (
decisiontool,/v1/systemone, MCPdecide) on Apple silicon. It uses the sameopenai_serverwiring as the Spark, with a macOS launcher in place ofserve.py. Mac-only files; nothing the Spark runs changes.Three Mac-specific fixes in the launcher:
1 + wRMSNorm gains into bf16, a step of 1/128. That doubled the probability error against float32, so the gains stay in float32 and the norm's output is cast back, as transformers does.HTTPServer.server_bindcallsgetfqdn("127.0.0.1"), which goes to mDNS on macOS and took 35 of the 37 s the load first measured. The launcher skips that lookup.Evidence
M5 Ultra 96 GiB, macOS 27.2, real weights, each run under the shared gpulock.
Before: KnowLine had no Mac path.
serve.pyhardcodes CUDA, and the TensorFold Metal qwen35 loader only admits the 2B geometry.After: decisions are served on Metal. The reference is the authors' unmodified
knowline_server.py --backend hfon torch 2.13 MPS. No Spark output for this corpus is committed.test_serve_mlx.py: 7/7 OK (KNOWLINE_WEIGHTSset: includes the real-model memory test).fetch.shwas run end to end (SHA256SUMS OK, venv check OK).Through the daemon.
localrouter servewas built on this Mac fromfeat/mac-foundation, withmacos/config.example.json.The request named the model
jev-latest, the System One alias, and it reachedknowline-4b. The profile now lists KnowLine asdecideindeploy/profiles/mac-apple-silicon.json.Installer (rebased on foundation 64bcb59):
tools/install/bootstrap.sh --profile mac-apple-silicon --dry-run --models decideexits 0 on macOS. All prereqs are ok, and the plan ishost/builddone anddecide/fetchtodo (download 8.7 GiB, disk 9.3 GiB, up to 10.0 GiB on demand). After the rebase,zig build -Doptimize=ReleaseSafesucceeds, andtest_serve_mlx.pypasses 6 OK with 1 skipped (the real-model memory test is skipped because no weights were loaded this round; it passed earlier on the real weights).Merge Danger
Door: two-way. These are new files under
tools/decide/knowline/macos/plus a README section; reverting removes them, and there is no persisted state.Blast Radius: component. Only a Mac profile that names
serve_mlx.pyuses this; Spark/Linux configs andserve.pyare untouched.🤖 Generated with Claude Code