Skip to content

docs(local): add Apple Silicon 8/16/32 GB turbo-fieldfare guide, repack lessons, and Apache-2.0 NOTICE - #109

Merged
ghchinoy merged 3 commits into
GoogleCloudPlatform:mainfrom
ghchinoy:docs/apple-silicon-turbo-fieldfare
Dec 3, 2026
Merged

ghchinoy merged 3 commits into
GoogleCloudPlatform:mainfrom
ghchinoy:docs/apple-silicon-turbo-fieldfare

Conversation

@ghchinoy

@ghchinoy ghchinoy commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Addresses #108 (follow-up documentation and third-party attribution for #106 and #107):

  • NOTICE: Adds top-level Apache-2.0 attribution for drumih/turbo-fieldfare, mmastrac/diffgemma, and the upstream vLLM structured_server reference, noting that model weights are not redistributed and remain governed by upstream terms.
  • docs/deploy/laptop.md: Updates Option A (Apple Silicon Metal) with side-by-side quickstarts for LOCAL_ENGINE=diffgemma (default, 32 GB+ Macs) and LOCAL_ENGINE=turbo-fieldfare (8 / 16 / 32 GB Macs).
  • docs/reference/metal-engine.md: Adds the 8 / 16 / 32 GB memory-tier comparison table and Section 2a covering:
    • Prerequisites (macOS 26+, Apple Silicon Metal 4, Swift 6.2+, Python tokenizer runtime)
    • HF_HUB_DISABLE_XET=1 for >5 GB Hugging Face downloads on macOS
    • Official BF16 shard-by-shard MLX 4-bit/8-bit g64 -> .gturbo repack (~5 GB peak RAM, ~75 s, zero double-quantization)
    • TurboFieldfareRepack --verify-install 37-file SHA-256 verification
    • Bimodal cache-slot guidance (16 for 8/16 GB Macs, 128 for 24–32 GB Macs; avoid 32/64) and --prefill-chunk-tokens 256
    • Bundled <model>/tokenizer auto-detection and port :8080 conflict handling
  • docs/deploy/hardware.md: Adds a concise local Apple Silicon tiers section clearly separated from cloud NVIDIA serving recommendations.
  • Syncs all three pages to docs-site/.

Surface & Documentation Checklist

  • docs/ and docs-site/ are synced (make docs-sync-check and python3 scripts/docs_link_check.py).
  • No real project IDs, endpoint URLs, keys, or build outputs (studio/dist/*) are included.

Verification

  • make docs-sync-check (37/37 pages match)
  • python3 scripts/docs_link_check.py (0 broken relative links or anchors across 40 files)
  • pnpm --dir docs-site run build (38 pages built cleanly)

@jigyasujuneja jigyasujuneja left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs_sync_check.py (37/37 pages) and docs_link_check.py (0 broken links across 40 files) both pass, and all new flags match the scripts. A few accuracy and reproducibility issues should be fixed before merge:

  • The launch snippet fails at step 3 and skips verification at step 2 (docs/reference/metal-engine.md:80-95 and docs-site/ mirror):
    • Step 1 sets TURBO_FIELDFARE_SRC=/path/to/turbo-fieldfare-dgem, and scripts/setup_turbo_fieldfare.sh:50 builds only TurboFieldfareDiffusionProbe (not TurboFieldfareRepack).
    • Both scripts/download_turbo_fieldfare.sh:24-29 and scripts/serve_turbo_fieldfare.sh:31-38 ignore TURBO_FIELDFARE_SRC and only check PATH or hardcoded ../turbo-fieldfare-dgem.
    • Because TURBO_FIELDFARE_BIN is never exported, step 3 (make local-up) fails with TurboFieldfareDiffusionProbe binary not found whenever the checkout lives anywhere else. And step 2 (make download) exits 0 with only a tip when TurboFieldfareRepack is missing (an empty manifest.json passes unverified).
      Export TURBO_FIELDFARE_BIN in the snippet (and note that make download skips SHA-256 verification unless TurboFieldfareRepack is built), or update both scripts to read TURBO_FIELDFARE_SRC.
  • Unreproducible setup and --verify-install flag mismatch (docs/reference/metal-engine.md:49, 63-68, 81, docs/deploy/laptop.md:31-33): upstream drumih/turbo-fieldfare Package.swift has no TurboFieldfareDiffusionProbe product, and the guide has no URL/commit for the turbo-fieldfare-dgem fork and no BF16-to-.gturbo conversion command. MLX is missing from prerequisites (:51-55), and the ~50 GB temporary BF16 download is understated as "plus temporary space" (:55). Also, upstream TurboFieldfareRepack (Sources/TurboFieldfareRepack/Command/main.swift:8) requires --verify-install --input-gturbo <model.gturbo>, rejecting the positional path on line 66 (unless the fork changed it). Link the fork + exact conversion command, or mark Section 2a experimental / pending public fork.
  • Overstated engine parity (docs/deploy/laptop.md:37-38, docs/reference/metal-engine.md:97): laptop.md says both engines expose the same :8080/v1 contract and work identically across the CLI and gateway (including Studio and MCP), and puts LOCAL_ENGINE=turbo-fieldfare make setup/download/local-up next to diffgemma without noting it is not self-installing. turbo-fieldfare rejects dgem ask plain chat (HTTP 400), rejects think > 0, defaults to 4,096 context (vs. 32,768), ignores steps > 1, defaults seed_token to fixed, and exposes a custom /v1/systemone body ({"schema", "state"}) that silently ignores images/audio/video instead of returning 4xx (contradicting metal-engine.md:97).
  • NOTICE accuracy and release bundling (NOTICE:1-39, .github/workflows/release.yml:83, 86):
    • NOTICE:24 says "See upstream repository license terms" for mmastrac/diffgemma; upstream Cargo.toml declares license = "MIT" (no LICENSE file in the upstream tree).
    • NOTICE:30-35 omits the upstream copyright line from deploy/cloudrun/server/structured_server.upstream.py:2 (Copyright contributors to the vLLM project), the one third-party file redistributed there. Clarify scope vs. third_party/{banking77,bbox_real,clinc_oos} and embedded Studio/Go deps too.
    • NOTICE:14, 25 bake in "optional" and "default" labels that conflict with #110 (and :26-27 omits scripts/stop_server.sh).
    • .github/workflows/release.yml:83, 86 packs dgem LICENSE README.md templates without NOTICE. Under Apache-2.0 Section 4(d), include NOTICE in the release tarballs (or keep non-redistributed tool acknowledgements in docs/ instead of NOTICE).
  • Tier B RAM tier and footprint drift (docs/deploy/hardware.md:87-88, docs/reference/metal-engine.md:31-32, 71-73): the table lists Minimum Mac RAM: 16-24 GB for slots=128, contradicting recommended for 24 GB and 32 GB Macs (:72) and scripts/turbo_fieldfare_server.py:89 (gib >= 22.0, so 16 GB and 18 GB Macs get slots=16, picked by Python instead of serve_turbo_fieldfare.sh). Change the table minimum to 24 GB, and align the 1.96 GiB / 11.00 GiB probe footprints with the ~2.08 GiB / ~9.57 GiB (turbo_fieldfare_server.py:79) and ~2.1 GiB / ~9.6 GiB (:97, serve_turbo_fieldfare.sh:78) warnings printed by the code.
  • Measurement provenance and conflicting numbers (docs/reference/metal-engine.md:3, 14, 29-33, docs/deploy/hardware.md:85-89, docs/practitioners-guide.md:156): replacing "tested on Apple M5 with 32 GB unified memory" with "(8 GB, 16 GB, and 32 GB Macs)" drops the test host RAM, macOS version, sample count, and command. If slots=16 was measured on a 32 GB M5 (where the 13.31 GiB pack sits in OS page cache), mark the 8 GB row as projected. Also note the difference against the earlier ~880 ms (metal-engine.md:14) and ~250-600 ms (practitioners-guide.md:156) lines, and coordinate prefix KV reuse notes (hardware.md:89, metal-engine.md:33) with #111.
  • DGEM_LOCAL_URL scope and section heading (docs/reference/metal-engine.md:75, 101): -u configures dgem decide (cmd/root.go:80), while DGEM_LOCAL_URL configures dgem serve (cmd/serve.go:113, 1488), not dgem decide. Also title ## 3. Prerequisites (:101) for diffgemma so it does not clash with Section 2a.

…ck lessons, and Apache-2.0 NOTICE

Addresses GoogleCloudPlatform#108:
- NOTICE: add Apache-2.0 third-party attribution for drumih/turbo-fieldfare,
  mmastrac/diffgemma, and upstream vLLM structured_server reference.
- docs/deploy/laptop.md: document LOCAL_ENGINE=diffgemma (32 GB+ Macs) vs
  LOCAL_ENGINE=turbo-fieldfare (8/16/32 GB SSD-streaming Metal 4 Macs).
- docs/reference/metal-engine.md: add Apple Silicon 8/16/32 GB comparison
  table, prerequisites (macOS 26+, Metal 4, Swift 6.2+), HF_HUB_DISABLE_XET=1
  download guidance, official BF16 shard-by-shard .gturbo repack workflow,
  TurboFieldfareRepack --verify-install, bimodal slots (16/128, avoid 32/64),
  --prefill-chunk-tokens 256, and port-8080 conflict checks.
- docs/deploy/hardware.md: add Local Apple Silicon tiers table (explicitly
  separated from cloud NVIDIA serving).
- Sync all updated docs pages to docs-site/.
…mbined probe + adapter measurements

Updates docs/deploy/laptop.md, docs/reference/metal-engine.md, and
docs/deploy/hardware.md (and synced docs-site/) from probe-only spike
estimates to measured combined probe + HTTP adapter phys_footprint and
latency:
- Tier A (slots=16): ~2.46 GiB combined (1.96 GiB probe + 0.50 GiB adapter,
  0 swaps), ~3.07 s warm / 4.22 s cold p50.
- Tier B (slots=128): ~11.46 GiB combined (11.00 GiB probe + 0.46 GiB
  adapter), ~2.20 s warm / 2.43 s diverse p50.
…rk link, --verify-install, NOTICE, RAM tiers, and provenance

Addresses PR GoogleCloudPlatform#109 review items (rebased cleanly onto merged GoogleCloudPlatform#113):
- Link public ghchinoy/turbo-fieldfare (feat/diffusiongemma-probe) fork,
  build TurboFieldfareRepack in launch steps, and fix --verify-install
  syntax to '--verify-install --input-gturbo <path>' in both docs and
  scripts/download_turbo_fieldfare.sh.
- Add mlx/mlx-lm and ~50 GB temp BF16 download space to prerequisites.
- Clearly state turbo-fieldfare capability boundaries vs diffgemma
  (structured text decisions only; no dgem ask plain chat, think>0,
  steps>1, or images; 4,096 default context; fixed seed_token default).
- Update NOTICE with MIT license for mmastrac/diffgemma, upstream vLLM
  copyright line, scope notes, neutral wording (no default/optional drift),
  and bundle NOTICE in .github/workflows/release.yml archives.
- Align Tier B minimum RAM to 24 GB (>= 22 GiB auto-select), align script
  warnings with combined probe+adapter footprints, state Apple M5 32 GB
  macOS 26.7.3 provenance (marking 8 GB row projected), clarify -u vs
  DGEM_LOCAL_URL, and title Section 3 Prerequisites (diffgemma).
@ghchinoy

ghchinoy commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks @jigyasujuneja — rebased onto main (picking up #113's TURBO_FIELDFARE_SRC discovery and canonical /v1/systemone parity) and addressed all 7 review items:

  1. Reproducible launch & --verify-install syntax: Linked the public fork (https://github.com/ghchinoy/turbo-fieldfare, branch feat/diffusiongemma-probe), added swift build ... --product TurboFieldfareRepack to the launch snippet, and updated both docs/reference/metal-engine.md and scripts/download_turbo_fieldfare.sh to use --verify-install --input-gturbo <model.gturbo> (matching Sources/TurboFieldfareRepack/Command/main.swift:8).
  2. Prerequisites & disk space: Added mlx/mlx-lm (for optional local BF16 conversion) and explicitly noted ~50 GB temporary disk space for the BF16 download.
  3. Engine capability boundaries: Clarified in laptop.md and metal-engine.md that turbo-fieldfare is experimental, requires building from the fork, and is structured-text-only (no dgem ask plain chat, think > 0, steps > 1, or images; 4,096 default context vs. 32,768).
  4. NOTICE & release bundling: Added License: MIT for mmastrac/diffgemma (+ scripts/stop_server.sh), included Copyright contributors to the vLLM project for redistributed structured_server.upstream.py, clarified scope vs. third_party/ and module dependencies, removed default/optional status labels so NOTICE won't drift with feat(local): default LOCAL_ENGINE=auto to turbo-fieldfare on macOS 26+ with macOS 15 diffgemma fallback #110, and bundled NOTICE in .github/workflows/release.yml release archives.
  5. Tier B RAM minimum & footprint alignment: Changed Tier B (slots=128) minimum RAM to 24 GB (>= 22 GiB auto-select in turbo_fieldfare_server.py) and aligned warning messages in serve_turbo_fieldfare.sh / turbo_fieldfare_server.py with combined probe + adapter footprints.
  6. Measurement provenance: Restored explicit test-host provenance (Apple M5, 32 GB unified memory, macOS 26.7.3), marked the 8 GB row as projected from 32 GB M5 slots=16 (noting OS page cache), and reconciled the ~880 ms warm-prefix note vs. cold ~265-token reads.
  7. DGEM_LOCAL_URL scope & heading: Clarified -u is for dgem decide while DGEM_LOCAL_URL is for dgem serve, and retitled Section 3 to Prerequisites (diffgemma).

Verified: make docs-sync-check, python3 scripts/docs_link_check.py, pnpm --dir docs-site run build, bash -n scripts/*turbo_fieldfare*.sh, and python3 -m unittest scripts/test_turbo_fieldfare_server.py (20/20 OK).

@ghchinoy
ghchinoy force-pushed the docs/apple-silicon-turbo-fieldfare branch from 7ef2521 to 3abd380 Compare December 2, 2026 16:00

@jigyasujuneja jigyasujuneja left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All seven items from the previous pass are addressed cleanly: the public ghchinoy/turbo-fieldfare fork (feat/diffusiongemma-probe, verified live) is linked, TurboFieldfareRepack build and --verify-install --input-gturbo <path> flags match across the guide and scripts/download_turbo_fieldfare.sh, mlx/mlx-lm and the ~50 GB temp disk requirement are listed, experimental and structured-text-only boundaries are clear, NOTICE covers vLLM copyright and diffgemma MIT terms and is bundled in .github/workflows/release.yml, Tier B minimum RAM (24 GB) and combined footprint warnings match the scripts, M5 32 GB provenance is restored with 8/16 GB marked projected, and -u vs. DGEM_LOCAL_URL plus the Section 3 heading are fixed.

Two non-blocking nits for a quick follow-up:

  • In docs/reference/metal-engine.md (and its docs-site/ mirror), the intro bullet reads ~2.2-3.1 s on a cold ~265-token prompt, while the table below reports ~2.20 s and ~3.07 s as warm p50 (4.22 s cold for slots=16). Changing cold to warm keeps both lines aligned.
  • Once #110 lands, LOCAL_ENGINE defaults to auto (still resolving to diffgemma on fresh installs), so laptop.md, hardware.md, and metal-engine.md can note auto when convenient. Note that #109 and #111 edit disjoint hunks in scripts/turbo_fieldfare_server.py (lines 192-215 vs. 33 and 721-825).

CI checks are green (11 passed, 1 skipped). Approved.

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.

2 participants