Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/itsmostafa/llm-engineering-skillsnpx agentmods add skills/itsmostafa/llm-engineering-skills/mlxWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/itsmostafa/llm-engineering-skills/mlx)<a href="https://agentmods.dev/skills/itsmostafa/llm-engineering-skills/mlx"><img src="https://agentmods.dev/badge/skills/itsmostafa/llm-engineering-skills/mlx.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00057 | $0.02492 |
| Opus 5 | $0.00028 | $0.01246 |
| Sonnet 5 | $0.00011 | $0.00498 |
| Haiku 4.5 | $0.00006 | $0.00249 |
Grade A, and why
mlx scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
curl http://localhost:8080/v1/chat/completions \ How it starts
The opening of the file, as written. The whole thing — 338 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Using MLX for LLMs on Apple Silicon
MLX-LM is a Python package for running large language models on Apple Silicon, leveraging the MLX framework for optimized performance with unified memory architecture.
Table of Contents
- Core Concepts
- Installation
- Text Generation
- Interactive Chat
- Model Conversion
- Quantization
- Fine-tuning with LoRA
- Serving Models
- Best Practices
- References
Core Concepts
Why MLX
| Aspect | PyTorch on Mac | MLX |
|---|---|---|
| Memory | Separate CPU/GPU copies | Unified memory, no copies |
| Optimization | Generic Metal backend | Apple Silicon native |
| Model loading | Slower, more memory | Lazy loading, efficient |
| Quantization | Limited support | Built-in 4/8-bit |
MLX arrays live in shared memory, accessible by both CPU and GPU without data transfer overhead.
Supported Models
MLX-LM supports most popular architectures: Llama, Mistral, Qwen, Phi, Gemma, Cohere, and many more. Check the mlx-community on Hugging Face for pre-converted models.
Installation
pip install mlx-lm
Requires macOS 13.5+ and Apple Silicon (M1/M2/M3/M4).
Text Generation
Python API
from mlx_lm import load, generate
# Load model (from HF hub or local path)
model, tokenizer = load("mlx-community/Llama-3.2-3B-Instruct-4bit")
# Generate text
response = generate(
model,
tokenizer,
prompt="Explain quantum computing in simple terms:",
max_tokens=256,
temp=0.7,
)
print(response)
Streaming Generation
from mlx_lm import load, stream_generate
model, tokenizer = load("mlx-community/Mistral-7B-Instruct-v0.3-4bit")
prompt = "Write a haiku about programming:"
for response in stream_generate(model, tokenizer, prompt, max_tokens=100):
print(response.text, end="", flush=True)
print()
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 7d ago First seen · 338 lines · 57 tokens per session scan A 7f1cc9e64abb
mlx is a skill published in the GitHub repository itsmostafa/llm-engineering-skills (23 stars, last pushed 4mo ago), licensed MIT. It adds 57 tokens to every session and 2,492 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
better-prompt
A prompt editor that turns rough instructions for AI systems into clearer, more complete prompts. It follows published OpenAI and Anthropic guidance.
ai-engineer-expert
Expert-level AI implementation, deployment, LLM integration, and production AI systems. Use when the user mentions AI engineering, LLM, deployment, production AI, or integration, or when the task involves LLM Patterns, LLM Integration, or Production Systems.
bio-prefect-dask-nextflow
Design reproducible bioinformatics pipelines with Prefect plus Dask or Nextflow. Use when scaffolding local, distributed, or scheduler-backed workflows.
gauntlet
Empirically test whether a skill actually improves model output — before trusting it. Runs a controlled experiment: planted-flaw fixture, no-skill control arm, skill arm(s), optional cross-model arms via installed CLIs, blind judging with shuffled labels, and a pressure test for verdict stability. Produces…
image-prompt
Use when the user wants to turn a short idea into a rich, production-grade image-generation prompt — posters, landing-page or UI mockups, ads, editorial layouts, photoreal scenes, game screenshots, logos, or illustrations. Builds ONE structured, copy-paste-ready prompt optimized for gpt-image-2 by default, following…
toolshed
Toolshed — durable, model-agnostic working state for ONE coding task (feature, fix, investigation) as docs/work/SLUG/ under docs/, DELETED at close. NOT the Workbench product/MCP (Slack highlights app). Seeds STATE + decisions/questions/evidence with grades and reproduction commands. Use for "start a toolshed", "seed…