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.

2.3.1 is available on GitHub Releases with source, Python packages and an Apple-notarized native runtime; the six ANE bundles of 2.3.0 apply unchanged. Install from PyPI using the instructions below.

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.
  • The prebuilt installation below requires no local compilation. Building from source separately requires a compatible Xcode/CoreAI SDK and Metal compiler toolchain.
  • 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 and install the pinned release from PyPI:

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

python -m pip install justfit-llm==2.3.1
justfit verify
justfit doctor
justfit serve \
  --runtime-manifest https://github.com/YuhuaBillChen/justfit-llm/releases/download/v2.3.1/runtime-manifest.json \
  --runtime-sha256 <runtime-manifest.json SHA256 from the release SHA256SUMS> \
  --ane-manifest https://github.com/YuhuaBillChen/justfit-llm/releases/download/v2.3.0/ane-index.json \
  --ane-manifest-sha256 fd1b71cfa9d4e785741dc2e0ba4d43f2a4dd556a62c0a61f37838b7f9e3ec99d

First run with these options downloads and verifies the prebuilt runtime, matching ANE assets and pinned model, then serves on http://127.0.0.1:8000. ANE bundles require an exact chip and macOS build 26A434 match; on other builds, omit the two ANE options to use GPU vision. Later runs of justfit serve reuse installed components. Ctrl+C stops the foreground server.

A first run without runtime options or an installed runtime uses the source-build path and requires developer tools. Quickstart covers source builds, ports and models.

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 link always points to the current manuscript; an arXiv link will be added when public.

Full-set AIME 2026: on M5 Pro, the same four-bit target with TQ4 KV scores 86/90 (95.6%) with A8 off and 85/90 (94.4%) with A8 on, covering all 30 questions at three seeds. Each arm has three capped generations included in the denominator. This tests A8 within the quantized configuration.

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},
  url = {https://github.com/YuhuaBillChen/justfit-llm/blob/main/paper/JustFit-v2.pdf}
}

Machine-readable citation · JustFit v1 paper

Acknowledgments and license

JustFit's native runtime is derived from Splash 1.3.0. Splash already provides language ANE FFN, paged KV tiering and composite-state persistence; JustFit extends their integration, retention and resource coordination. 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.1

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.1
File Size Uploaded Provenance Actions
justfit_llm-2.3.1.tar.gz 2.4 MB With provenance Details for justfit_llm-2.3.1.tar.gz

Built distribution (wheel)

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

Total release size: 5.1 MB

Release files / justfit_llm-2.3.1.tar.gz

Download URL justfit_llm-2.3.1.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
46fc8e08460fb3c2046dfcfaa8bd54d60d1c745e1b12a345215e492abf59a36a
BLAKE2b-256 checksum
How to use checksums
e418cbd31f10b9c8ebe9ccabec207c08e911c77d7eb3e9d278cc071bee90ddb5
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 28, 2026.

Transparency log

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

Download URL justfit_llm-2.3.1-py3-none-any.whl
Size 2.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
81cbb2c4c0a155a8c3b00a1e7583ab8940415c4d4c1ff5e8e7d352e1b57b94cd
BLAKE2b-256 checksum
How to use checksums
228a0ff0b2aef3dfb5161906855bcde20b5d13826f6b750b9337ea50325d5066
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 28, 2026.

Transparency log

Security for justfit-llm 2.3.1

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.1.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 28, 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.1 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