Skip to main content

Transparent unified-memory fit estimates for local AI models

Project description

๐Ÿฉบ Mac AI Doctor

Will this AI model fit in your Apple Silicon Mac's unified memory?

maid reads small metadata filesโ€”never model weightsโ€”and estimates weight, KV-cache, and runtime memory as a range, then gives a plain verdict.

$ maid check ibm-granite/granite-switch-4.1-3b-preview --memory-gb 16

     ibm-granite/granite-switch-4.1-3b-preview
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Weights    โ”‚        8.80 GB โ”‚
โ”‚ KV cache   โ”‚        0.34 GB โ”‚
โ”‚ Runtime    โ”‚        1.31 GB โ”‚
โ”‚ Peak range โ”‚ 11.49โ€“13.06 GB โ”‚
โ”‚ Available  โ”‚        16.0 GB โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ TIGHT ยท high confidence โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ May fit, but close memory-heavy apps or reduce context/concurrency. โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Install

Requires uv.

uv tool install mac-ai-doctor          # CLI only
uv tool install 'mac-ai-doctor[web]'    # also enables `maid web`

Use

maid web                                                 # interactive web UI (needs the 'web' extra)
maid system                                              # your chip and memory
maid check meta-llama/Llama-3.1-8B-Instruct              # a Hugging Face model
maid check ~/Models/model-q4.gguf --context 8192         # a local GGUF
maid compare org/model-a org/model-b --concurrency 2     # side by side
maid recommend --memory-gb 16 --task coding              # a starting point
maid check MODEL --json                                  # machine-readable

Accepts a Hugging Face ID, a local .gguf file, or a local/MLX directory with config.json.

Options: --memory-gb N (required off macOS), --context, --concurrency, --kv-dtype (fp32/fp16/bf16/int8/q8), --json. Tasks: coding, chat, vision.

Verdicts

Verdict Meaning
COMFORTABLE High estimate โ‰ค 80% of memory.
TIGHT Fits, but leaves < 20% headroom.
UNLIKELY Exceeds memory.
UNKNOWN Weight size unavailable.

Confidence reflects metadata completeness, not prediction accuracy.

What it reads

Only bounded metadata: config.json, the safetensors index, and the model API's file-size listingโ€”or the 24-byte header of a local GGUF. Weight contents are never downloaded. No credentials are collected.

How it estimates

Decimal GB. This is screening, not a benchmarkโ€”verify with your actual runtime. No tokens/second prediction is made.

weights = stored_weight_bytes ร— 1.06
KV      = 2 ร— layers ร— KV_heads ร— head_dim ร— context ร— concurrency ร— dtype_bytes
runtime = max(1 GB, weights ร— 12%) + 0.25 GB ร— concurrency
range   = subtotal ร— 1.10 .. subtotal ร— 1.25

Unified memory is shared with macOS, apps, and the GPU. Memory mapping can help; multimodal image encoders may add memory not shown in text config metadata.

Troubleshooting

  • Can't detect memory โ€” pass --memory-gb N (auto-detection needs macOS).
  • 401/403 or gated โ€” authenticate, or point at a downloaded config.json.
  • No weight size โ€” use a repo with a safetensors index/API sizes, or a local GGUF (v2/v3).

Develop

git clone https://github.com/barvhaim/mac-ai-doctor.git && cd mac-ai-doctor
uv sync --group dev
uv run ruff check . && uv run mypy src && uv run pytest

See CONTRIBUTING.md. MIT licensed.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mac_ai_doctor-0.2.0.tar.gz (124.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mac_ai_doctor-0.2.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file mac_ai_doctor-0.2.0.tar.gz.

File metadata

  • Download URL: mac_ai_doctor-0.2.0.tar.gz
  • Upload date:
  • Size: 124.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mac_ai_doctor-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c0b8cec2639ae338794ac488d8ff295b564a1795593eaa6fc4936d7bd86ef578
MD5 9a920f1abdde44f38988e285e6454e68
BLAKE2b-256 d029071ed36df31e4570a99f155403a285d3096e62f46fb0964cbbe0958893d1

See more details on using hashes here.

File details

Details for the file mac_ai_doctor-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: mac_ai_doctor-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mac_ai_doctor-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3a82823be998948e66a7de77ac10fa7615843243648b4e1c8987dc28e0517f59
MD5 918c424f2ac33fc79f38c73c64c46019
BLAKE2b-256 c47bf55e24b457470946e25f015cd176c0b81acd02867e64d8267638e9926bd7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page