ai-agent

Mlx Lm

Run LLMs with MLX
6,904 stars1,025 forksPythonUpdated 9/6/2026100% free · open source
What it does

Runs open‑source LLMs locally on Apple silicon (or any GPU) using the MLX runtime, letting you generate text or expose an API without paying for cloud inference.

When to use it
  • You need cheap, on‑device inference for a prototype or internal tool.
  • Your team wants to experiment with open‑source models (e.g., Llama‑2, Mistral) without a cloud subscription.
  • You prefer a Python‑only stack and want to integrate generation into existing scripts or a lightweight HTTP API.
Ready-to-paste prompt
python -m mlx_lm.generate --model ./Mistral-7B-Instruct-v0.1 --prompt "You are a startup advisor. Give three quick tips for launching a SaaS product." --max-tokens 150
Heads up: The first model download can take many GB and requires at least 16 GB of RAM; ensure your Mac has enough free memory or run the model in `--device cpu` mode to avoid OOM errors.
Saves to your device
Use with Claude
New

Skip the builder — one click puts this in Claude, Cursor, Antigravity and more.

✅ Light setup

Installs with a command or two; your AI agent can do it for you.

Try it instantly — no install
Claude Code
mkdir -p ~/.claude/skills/mlx-lm && curl -fsSL https://workflowstacks.com/api/skills/mlx-lm/claude-skill -o ~/.claude/skills/mlx-lm/SKILL.md
Open in another AI app

Opens the app with this repo with the prompt ready to go — no copy-paste needed.

Connect the whole catalog (MCP)
claude mcp add --transport http workflowstacks https://workflowstacks.com/api/mcp

Adds a WorkflowStacks connector to Claude Code: search and load any skill here by chatting.

How Mlx Lm works
Codeflow
Free to inspect

Mlx Lm is a large Python project (~46k lines across 190 code files, plus 18 test files). Setup is light: installs like a normal app. Reading the code is optional. Last commit this month, MIT license, has a test suite.

Size
Large codebase
~46k lines · 190 code files · ~6 h to skim
Setup
One-command install
Installs like a normal app. Reading the code is optional.
Runs on
Python
No API keys detected
Python 100%
Where to start reading
  1. 1
    README.md
    Start here — what it does and how to install it
  2. 2
    AGENTS.md
    The instructions the AI actually follows
  3. 3
    mlx_lm/cli.py
    Where the program starts running
  4. 4
    mlx_lm/__init__.py
    Inside mlx_lm/ — the main logic begins here
What's in each folder
mlx_lm/Core code — the actual logic195 files
benchmarks/Evaluations & benchmarks1 files
tests/Tests — proof it works18 files
.github/CI / automation (GitHub Actions)9 files
READMEHas testsDocumentedCI checksMIT licenseUpdated this month
Quick Actions
Details
Creator
ml-explore
Language
Python
Category
ai-agent
Published
3/11/2025

Are you the creator of this tool? Claim your listing → and earn 85% of every sale.