Skip to main content

Transparent unified-memory fit estimates for local AI models

Project description

๐Ÿฉบ Mac AI Doctor

A transparent first opinion on whether a local AI model fits your Apple Silicon Mac.

Mac AI Doctor (maid) reads small metadata filesโ€”never model weightsโ€”and estimates weight, KV-cache, runtime, and safety-margin memory. It reports a range rather than fake precision.

              demo/llama-8b
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Weights        โ”‚      4.77 GB โ”‚
โ”‚ KV cache       โ”‚      0.54 GB โ”‚
โ”‚ Runtime        โ”‚      1.25 GB โ”‚
โ”‚ Peak range     โ”‚ 7.21โ€“8.20 GB โ”‚
โ”‚ Available      โ”‚     16.0 GB  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ COMFORTABLE ยท high confidence โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ Good fit. Keep normal apps modest.             โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Install

This project uses uv. Install it first, then use either a packaged release or a checkout.

# Package install (once published)
uv tool install mac-ai-doctor
# Development checkout
git clone https://github.com/barvhaim/mac-ai-doctor.git
cd mac-ai-doctor
uv sync --group dev

Use

uv run maid system
uv run maid check meta-llama/Llama-3.1-8B-Instruct
uv run maid check ~/Models/model-q4.gguf --memory-gb 16 --context 8192
uv run maid compare org/model-a org/model-b --memory-gb 32 --concurrency 2
uv run maid recommend --memory-gb 16 --task coding
uv run maid check MODEL --json

On Linux or when detection fails, pass --memory-gb. --kv-dtype accepts fp32, fp16, bf16, int8, or q8. For deterministic offline demos/tests, check and compare include a hidden --fixture FILE option using the documented fixture shape in tests/fixtures/.

What it reads (and what it does not)

For Hugging Face and MLX repositories, the tool requests config.json, an optional model.safetensors.index.json, and the model API's file-size listing. It never downloads weight contents. For local GGUF files it reads only the 24-byte fixed header and uses file size. Local directories/config files are also supported. Dense and MoE architecture fields are parsed; MoE active parameters are informational because all expert weights still need memory.

No credentials are collected. Normal Hugging Face HTTP requests reveal the same network metadata as any web request (IP and user-agent) to Hugging Face.

Formula and policy

Decimal GB are used. When metadata permits:

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
low..high = subtotal ร— 1.10 .. subtotal ร— 1.25

COMFORTABLE means the high estimate is at most 80% of unified memory; TIGHT fits but leaves less than 20%; UNLIKELY exceeds memory; UNKNOWN means weight size is unavailable. Confidence reflects metadata completenessโ€”not prediction accuracy. Unified memory is shared by macOS, apps, GPU, and model runtime. Implementations differ, memory mapping can help, and multimodal image encoders may add memory not exposed in text config metadata. Treat this as screening, then verify with your actual runtime. The tool intentionally makes no tokens/second prediction.

JSON

--json emits schema version 1.0, model metadata, inputs, component estimates, range, headroom, verdict, confidence, and assumptions. Fields that cannot be supported are null, never invented.

Troubleshooting

  • Cannot detect memory: pass --memory-gb N; automatic detection requires macOS.
  • 401/403 or gated model: authenticate/access the model or use a downloaded config.json.
  • No weight size: use a repository with safetensors index/API sizes or a local GGUF.
  • GGUF rejected: versions 2 and 3 are supported; verify the file is complete.
  • Very long context looks large: KV memory grows linearly with context and concurrency.

Development

uv sync --group dev
uv run ruff check . && uv run mypy src && uv run pytest
uv build

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.1.1.tar.gz (48.4 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.1.1-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mac_ai_doctor-0.1.1.tar.gz
  • Upload date:
  • Size: 48.4 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.1.1.tar.gz
Algorithm Hash digest
SHA256 9d4a84c19e2d67b091ac4ddbf3107e026cf5277d6da092e78bd52e6e1ffe2221
MD5 b8d3be9ec0cd876f797d90b6f5c225ca
BLAKE2b-256 d1fa3656ca9e27f520ec13220b40956fda5666cbcf36f8938af5693a807917e6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mac_ai_doctor-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.5 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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e92ad5dae725ec153b840bc3e8b862764ec20f3781c8d892cd5f9ea5dcd1a82f
MD5 7af410616c3573a8baf95d7c8bac0c3e
BLAKE2b-256 9b1f7fbadc10e3491ed311a61a8e31f2c696de48e6256e63d550255baaa5277e

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