completed context
30,720 baseline positions → the complete 262,144-position native window on the same 24 GiB laptop.
240K input + 16K output · 1× cold + 2× warm-prefix extension · peaks 20,357–20,450 MiBApple M4 Pro · 24 GiB unified memory · Qwen3.8-27B MXFP4
JustFit fits Qwen3.8-27B's full 256K-token context — and shares it across concurrent requests — inside 24 GiB of unified memory. No cloud, no truncation, no losing where you were.
Held all at once, this workload needs two of this machine.
JustFit runs it on one.
A begins alone and owns six equal-capacity page groups.
git clone --branch justfit-repro-v4 https://github.com/YuhuaBillChen/mlx-vlm
cd mlx-vlm && examples/justfit/run_server.sh
git checkout justfit-repro-v4
hf download mlx-community/Qwen3.8-27B-mxfp4 --local-dir ./justfit-models/qwen38-mxfp4
hf download billchen42/JustFit-Qwen3.8-27B-components --local-dir ./justfit-components
python examples/justfit/prepare_components.py --model ./justfit-models/qwen38-mxfp4 --output ./justfit-extracted --language-only
The green segment is measured. The red segments are each term's own arithmetic from the paper's live-set equation Mlive = W + K + S + X + H, shown at long-context scale — not the measured peak of an alternative run, since the terms overlap in time.
Proof
Each row below is a fresh-process, full-output run with postflight and page-reuse checks. The measured JSON is public.
30,720 baseline positions → the complete 262,144-position native window on the same 24 GiB laptop.
240K input + 16K output · 1× cold + 2× warm-prefix extension · peaks 20,357–20,450 MiBA 160K-input lane and a 128K-input lane each generate 16K tokens from ordered warm-prefix restores.
9.735 aggregate tok/s median · distinct from the 294,912-position fully cold B2 resultA 128K+12K agent stream begins first; three 8K+12K streams then join it and all four complete from one shared pool.
22.570 common-active tok/s · 12.147 wall-output tok/s · 18,915 MiB · no implicit 8K prompt gatePaged TQ4 generates 696,834 reasoning tokens at 15.04 token-weighted tok/s.
Integrated runtime check · not 256K-context comprehensionDevelopment continues at justfit-mlx. These links deliberately resolve against the immutable justfit-repro-v4 tag in the research fork instead — that is the tree the paper cites, so it stays fixed while the code moves on.
Use it today
Run a secured OpenAI-compatible endpoint locally, then connect a browser UI, a terminal client, or Hermes Agent. No provider account, no per-token bill.
Add http://host.docker.internal:8080/v1 as an OpenAI-compatible connection, supply the local API key, and select justfit-qwen38.
Use the dependency-free examples/justfit/chat_cli.py client for a direct multi-turn Chat Completions session.
Configure the custom endpoint with context length 73728 — 65,536 input positions plus an 8,192-token output ceiling.
How it fits
Quantizing the KV cache is only the first step — usable context is set by every allocation that overlaps it: weights, resident pages, attention operands, prefill workspace, speculative state, component lifetimes. JustFit treats their overlap as the actual problem.
Page-addressed 4-bit KV, page-native decode, and direct-inverse reconstruction of only the current layer's floating-point attention operands — never a second full-precision copy.
The output head, vision tower, and speculative drafter attach only when a request actually needs them, and detach at scheduler-selected safe boundaries — not when you remember to free them.
A request can move speculative → batched → speculative decoding without migrating its surviving KV. Completed and cancelled rows return their pages for immediate reuse.
What JustFit doesn't claim
The headline numbers are real, and they are also the ceiling — not what you should run every day. Stated up front so you don't have to find out the hard way.