Skip to main content

Memory-intelligent local LLM orchestration for 16GB Apple Silicon Macs

Project description

MacSmart LLM

PyPI version Python 3.11+ License: MIT

Memory-intelligent local LLM orchestration for 16GB Apple Silicon Macs.

Unlike LM Studio or Ollama which treat all Macs the same, MacSmart actively monitors available memory, thermal state, and battery level to recommend and manage the best model + quantization for your current system state.

MacSmart Demo

Why?

  • 16GB is the most common MacBook config but completely ignored by benchmarking research
  • Existing tools let users download models that crash or swap-thrash on 16GB
  • No tool auto-selects the best model/quantization based on actual available memory
  • Apple Silicon Neural Accelerators (via MLX) are untapped on 16GB configs

Features

  • System Profiler — Detect chip (M1–M5), GPU cores, memory bandwidth, thermal state, battery
  • Model Recommender — Auto-select the best model + quantization for your available memory
  • Benchmark Runner — Measure TTFT, tokens/sec, peak memory, swap usage, energy
  • Batch & Compare — Run multiple models head-to-head with side-by-side results
  • Energy Comparison — Compare energy efficiency across prompt lengths
  • Memory Watchdog — Real-time memory pressure monitoring with live Rich UI
  • Download Manager — Download, list, and manage models from HuggingFace Hub
  • Dashboard — Interactive web UI for exploring benchmark results

Installation

# Install from PyPI
pip install macsmart

# Or install from source (for development)
git clone https://github.com/awneesht/m5-llm-benchmark.git
cd m5-llm-benchmark
pip install -e ".[dev]"

Usage

# Show system profile (chip, memory, thermal, battery)
macsmart profile

# Get model recommendations for your current memory
macsmart recommend

# Recommend for a specific task with custom memory budget
macsmart recommend --task coding --memory 10

# Run inference on a model
macsmart run mlx-community/Qwen2.5-7B-Instruct-4bit --prompt "Hello, world!"

# Download a model
macsmart download mlx-community/Qwen2.5-7B-Instruct-4bit

# List cached models
macsmart models

# Benchmark a model
macsmart benchmark mlx-community/Qwen2.5-7B-Instruct-4bit

# Batch benchmark multiple models
macsmart batch model1 model2 model3

# Compare models side-by-side
macsmart compare model1 model2

# Compare energy efficiency across prompt lengths
macsmart energy-compare model1 model2

# Launch the results dashboard
macsmart dashboard

# Watch memory pressure in real-time
macsmart watch

# Delete a cached model
macsmart delete mlx-community/Qwen2.5-7B-Instruct-4bit

# All commands support --json-output for scripting
macsmart profile --json-output
macsmart recommend --json-output

16GB Memory Budget

Component Memory
macOS + system ~3–4 GB
Typical user apps ~1–2 GB
Available for LLM ~10–12 GB
Safe model size (no swap) ~8–9 GB
Max model size (some swap OK) ~12–14 GB

Requirements

  • macOS with Apple Silicon (M1/M2/M3/M4/M5)
  • Python 3.11+
  • 16GB RAM (optimized for this config, works on others too)

Development

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run with coverage
pytest --cov=macsmart

# Run a single test file
pytest tests/test_benchmark.py -v

License

MIT

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

macsmart-0.2.1.tar.gz (59.7 kB view details)

Uploaded Source

Built Distribution

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

macsmart-0.2.1-py3-none-any.whl (48.6 kB view details)

Uploaded Python 3

File details

Details for the file macsmart-0.2.1.tar.gz.

File metadata

  • Download URL: macsmart-0.2.1.tar.gz
  • Upload date:
  • Size: 59.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for macsmart-0.2.1.tar.gz
Algorithm Hash digest
SHA256 89813963537b62b27559d3330de01e8407325668518a853d081bd967554e9012
MD5 09c815409df1594ecce22411f026790b
BLAKE2b-256 731835b2d71035c10738d15b454243a9d9e1a07c6ca37f95652ac77f008cd2b2

See more details on using hashes here.

File details

Details for the file macsmart-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: macsmart-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 48.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for macsmart-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b94947dc7d60a598a146c699de87feddafd38c9d63105c4c9759d8cea9e0b466
MD5 a2690ce04f12eb53dfdcd98e203036a1
BLAKE2b-256 376f05e1334f2137562efb982a890e61d8462e546521aa6229387d0df6bc5691

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