Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

MLX LM

$ mlx_lm Official Low Risk
Apple MLX · AI & Media · MIT · macos

MLX LM (mlx_lm) is Apple's official toolkit for running, quantizing (mlx_lm convert -q), LoRA fine-tuning, and serving (mlx_lm server) LLMs on Apple Silicon unified memory. It supports deterministic generation flags (--temp 0.0, --seed, --max-tokens) and Hugging Face model pulls.

FCRS-1.0 Score
77 /100
Good
Medium Confidence
Zero-Friction Install
pip install mlx-lm
CLI vs MCP Decision CLI Only

mlx_lm compiles and runs Apple Metal GPU kernels locally on unified memory; it is strictly a host-local compute CLI.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 16 / 25

Clean non-interactive mlx_lm.generate and mlx_lm.convert flags with --seed and --max-tokens, though outputs are plain text without a --json flag.

  • mlx_lm.generate supports --prompt, --max-tokens, --temp, and --seed
  • No native --json CLI output flag
Trust & Safety 22 / 25

Local Apple Silicon execution; --upload-repo on convert is strictly opt-in.

  • Local unified-memory execution with opt-in Hugging Face uploads
Setup & Portability 8 / 15

Strictly limited to macOS on Apple Silicon (arm64); unavailable on Linux, Windows, or Intel Macs.

  • Requires Apple Silicon macOS hardware
Utility & Efficiency 14 / 15

Fastest native inference, 4-bit quantization, and LoRA fine-tuning workflow on Apple Silicon Macs.

  • Native Metal acceleration for inference, quantization, and LoRA tuning
Maintenance & Lineage 9 / 10

Official Apple MLX repository (ml-explore/mlx-lm) under MIT license.

  • Official ml-explore/mlx-lm repo (MIT)
Docs & Verifiability 8 / 10

Well-maintained README and subcommand --help pages.

  • Clear CLI documentation in repository README and --help

Security, Auth & Guardrails

Auth Modes
No Auth Env API Key
Credential Storage

No auth needed for public models; gated Hugging Face repos read HF_TOKEN or ~/.cache/huggingface/token.

Side Effects
Read-Only Local Write Remote Write
Cost & Quotas

MIT open-source Python package from Apple MLX; requires an Apple Silicon Mac (M1/M2/M3/M4+).

Copyable Guardrail for CLAUDE.md / AGENTS.md
# MLX LM Agent Rules
- Always pass `--max-tokens` on `mlx_lm.generate` and avoid `mlx_lm.chat` or `mlx_lm.server` in synchronous calls.
- Omit `--upload-repo` on `mlx_lm.convert` unless explicitly asked to publish weights to Hugging Face.

Agent-Ready Command Recipes

Safe Read-Only Queries

Inspect generation CLI flags
mlx_lm.generate --help

Prints supported model, sampling, seed, and token-limit flags without downloading weights.

Run deterministic single-shot Apple Silicon inference
mlx_lm.generate --model mlx-community/Llama-3.2-3B-Instruct-4bit --prompt "List 3 HTTP status codes." --max-tokens 64 --temp 0.0

Generates a bounded greedy-decoded completion locally on Apple Silicon.

Controlled Writes & Previews

Convert and 4-bit quantize a model locally
mlx_lm.convert --hf-path Qwen/Qwen2.5-1.5B-Instruct -q --q-bits 4 -o ./mlx_model

Downloads and quantizes Hugging Face weights into a local ./mlx_model directory without uploading.

Strengths for Agents

  • + First-party Apple Silicon Metal acceleration for local inference, quantization, and LoRA fine-tuning.
  • + Supports reproducible --temp 0.0 and --seed flags in mlx_lm.generate.

Caveats & Pitfalls

  • ! Restricted exclusively to Apple Silicon macOS machines.
  • ! Lacks a native --json output mode on CLI commands.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI