Skip to main content

JustFit is a local inference system for serving a 27B language-and-vision model on memory-constrained Macs. It coordinates compressed context, a resident speculative draft, concurrent requests and CPU/GPU/ANE work under one unified-memory budget.

Stable version: 2.3.0. This source tree prepares the stable release. Package-index and release-asset publication are pending; use the reviewed wheel and native runtime supplied with this release candidate. The immutable RC24 preview remains available separately.

Why JustFit

  • Keep long histories alongside the draft. Warm-prefix tests reach a 320K aggregate page capacity across two live requests while retaining the speculative draft. This is a tested B2 bound, not a 320K single-request or cold-prefill guarantee.
  • Make concurrent work useful. Bound transient workspaces, share compressed pages and preserve committed state across scheduling and cold restarts.
  • Put idle accelerators to work. Use CPU-assisted prefill on M4 Pro, GPU A8 paths on M5 Pro/M6, and qualified ANE work when execution phase and memory allow it. Vision offload aims to leave GPU capacity for text; it does not guarantee lower image latency.
  • Serve through a familiar API. OpenAI-compatible chat, images, streaming, structured output and native-enforced thinking budgets.

Measured results

Four-system comparison on M4 Pro, M5 Pro and M6: tested retained context, 16K prefill and 16K decode rates

Capacity and speed are separate experiments. Solid bars show tested B1 bounds; hatching extends them to the B2 total. Both JustFit generations reach a 320K page capacity using their respective warm-prefix protocols; v2 retains its draft. Speed uses eight fixed SPEED-Bench 16K tasks with 512 forced output tokens. Weight formats, decoders and profiles differ. M4 Pro/M5 Pro have physical 24 GiB; M6 has physical 32 GiB, with 8 GiB locked only for the v1/v2 B2 capacity tests. M6 speed runs use physical 32 GiB.

At 16K, v2's median decode rate is 2.0–2.5× the v1 rate across these configurations. Relative to upstream Splash 1.3.0, median prefill improves 9–46%, while singleton decode declines 2–9%. These whole-system results are not isolated mechanism gains or a chip-generation ranking.

Protocols, exact rates and limitations →

Get started

Supported setup

  • Apple silicon and macOS 27.0+. Reference configurations: M4 Pro, M5 Pro and M6, with at least 24 GiB. Other chip variants are not individually qualified.
  • Python 3.12 recommended; the package declares support for Python 3.12–3.14.
  • Compatible Xcode/CoreAI SDK and Metal compiler toolchain for this source preview. justfit serve finds installed tools; it does not install Xcode or the SDK.
  • Internet access and storage for the pinned model pack: approximately 17.4 GB, plus dependencies, build outputs and caches. The model repository is publicly accessible without a Hugging Face token at the checked revision.

Installing the Python package on Linux does not enable native inference there. The standalone GPU engine's macOS 26.4 source target is separate from this complete macOS 27/CoreAI setup.

Install the reviewed release

Create a fresh environment. Install the reviewed wheel downloaded alongside this source tree:

python3.12 -m venv .venv
source .venv/bin/activate

python -m pip install --index-url https://pypi.org/simple/ -r requirements-runtime.txt
python -m pip install ./justfit_llm-2.3.0-py3-none-any.whl
justfit verify
justfit doctor
justfit serve

First run: create a versioned workspace, build the native runtime, download and verify the pinned model, choose the device preset, then serve on http://127.0.0.1:8000. Later runs reuse the build and model. Ctrl+C stops the foreground server. GPU vision works without a compiled ANE vision profile.

If the Metal compiler is missing, install the component with xcodebuild -downloadComponent MetalToolchain after installing compatible Xcode. Step-by-step setup and overrides cover custom ports, local models and prebuilt-runtime inputs. Use the matching 2.3.0 runtime and published SHA256 to skip local compilation; see the linked instructions.

Send a request

curl http://127.0.0.1:8000/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "incoai/Qwen3.8-27B-Splash",
    "messages": [{"role": "user", "content": "What is 17 multiplied by 19?"}],
    "max_tokens": 64,
    "reasoning_effort": "none"
  }'

The model ID retains the upstream runtime pack's name; the engine and CLI are JustFit. The default model is pinned to revision 9d27070b71f7142c6b6025f03ac011d70a73cb48.

How it works

Mechanism Responsibility
KVExec Consume compressed history with bounded reconstruction and rotated-domain attention.
PhaseSwap Control component and workspace lifetimes while the speculative draft stays resident.
StateTrans Preserve committed KV, recurrent and draft state across scheduling and persistence.
CrossFire Coordinate CPU, GPU and ANE work using phase ownership and memory admission.

ANE behavior

Reference preset Language prefill ANE vision eligibility
M4 Pro / m4 CPU-assisted GPU Text prefill or decode
M5 Pro / m5 GPU A8 Text prefill or decode
M6 / m6 GPU A8 + ANE FFN Decode with no active text prefill

Vision eligibility requires qualified 4K/8K assets, a matching chip and OS build, and memory admission. 4K/8K count image patches, not text tokens or screen pixels. Idle requests, unsupported inputs and unavailable resources use GPU. M6 reserves ANE for language prefill before admitting vision work. ANE setup and download interface.

Documentation

I want to… Start here
Install, build or choose a port/model Quickstart · Python installation
Understand the measurements Results and protocols · Preview validation
Change device settings Configuration · ANE policy
Prepare ANE assets or a prebuilt runtime ANE downloads · Offline provisioning · Runtime distribution
Deploy a managed service Deployment and rollback · Broker integration
Control reasoning output Thinking budget
Report a problem or contribute Issues · Contributing · Security

The default endpoint is local. Network deployment needs appropriate authentication and TLS; see security scope. Native runtime sources are in source/, ANE tooling in vision-tools/, and optional managed-service components in service/.

Paper and citation

JustFit v2: Long-Context Local LLM Serving with Just-in-Time State Management — Yuhua Chen, 2026. Read the preprint (PDF) · Paper and citation files. This dated version remains available as the manuscript evolves; an arXiv link will be added when public.

If JustFit supports your research, please cite:

@unpublished{chen2026justfitv2,
  author = {Chen, Yuhua},
  title = {{JustFit v2}: Long-Context Local LLM Serving with Just-in-Time State Management},
  year = {2026},
  month = oct,
  note = {Preprint, version 2026-10-23 revision 2},
  url = {https://github.com/YuhuaBillChen/justfit-llm/blob/paper-v2-2026-10-23-r2/paper/2026-10-23/JustFit-v2.pdf}
}

Machine-readable citation · JustFit v1 paper

Acknowledgments and license

JustFit's native runtime is derived from Splash 1.3.0. Upstream authors, licenses and implementation credits are preserved in NOTICE and third-party notices. Model weights and derived assets retain their own licenses.

Code is available under Apache 2.0. JustFit maintainers handle this project's support; please direct JustFit issues here rather than to upstream maintainers.

Metadata

Release files for justfit-llm 2.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for justfit-llm 2.3.0
File Size Uploaded Provenance Actions
justfit_llm-2.3.0.tar.gz 2.4 MB With provenance Details for justfit_llm-2.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for justfit-llm 2.3.0
File Interpreter ABI Platform Actions
justfit_llm-2.3.0-py3-none-any.whl Python 3 none any Details for justfit_llm-2.3.0-py3-none-any.whl

Total release size: 5.1 MB

Release files / justfit_llm-2.3.0.tar.gz

Download URL justfit_llm-2.3.0.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
b17f20aa332f35cdcc5827a2901af294f36b4bc55b697a0c1a08ae7da80a5285
BLAKE2b-256 checksum
How to use checksums
42b317f17f02acc6798eabf498b2d60ea2ddf3de0360f498632df8229a0f7762
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Release files / justfit_llm-2.3.0-py3-none-any.whl

Download URL justfit_llm-2.3.0-py3-none-any.whl
Size 2.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
aaa3f4f0ef7180bb0ceb09296ac3b2e6713c96b76afb96ff5cbef5f22f04ce8d
BLAKE2b-256 checksum
How to use checksums
f01b2ad86534f4a6d24b5f820a92ff54da430b6ab4290bbaac3b454c54b862b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Security for justfit-llm 2.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for justfit_llm-2.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.3.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page