swift-mlx-lm

Run local LLM and VLM inference on Apple Silicon using MLX in Swift.

24|Updated Feb 1, 2026
One-click install
npx skills add https://github.com/PicoMLX/mlx-swift-lm-skill --skill swift-mlx-lm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swift-mlx-lm
Source: https://github.com/PicoMLX/mlx-swift-lm-skill/tree/main/mlx-swift-lm
Command: npx skills add https://github.com/PicoMLX/mlx-swift-lm-skill --skill swift-mlx-lm

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enables users to run powerful Large Language Models (LLMs) and Vision-Language Models (VLMs) directly on their Apple Silicon Macs, making advanced AI capabilities accessible without relying on cloud services.

Core Features & Use Cases

  • Local Inference: Run LLMs and VLMs efficiently on your Apple Silicon device.
  • Streaming Generation: Get responses in real-time as the model generates text.
  • Tool Calling: Integrate LLM capabilities with external tools and functions.
  • Fine-tuning: Adapt models using LoRA for specific tasks.
  • Use Case: Develop a Swift application that uses a local LLM to summarize user-provided text, answer questions about local documents, or even generate creative content, all processed on the user's machine.

Quick Start

Use the swift-mlx-lm skill to explain how to load a Qwen3-4B-4bit model for chat.

Frequently Asked Questions about swift-mlx-lm

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run LLMs locally on Apple Silicon using Swift?

You can run LLMs locally on Apple Silicon using Swift by leveraging the MLX framework, which enables efficient on-device inference for text generation and processing without relying on cloud services.

Can I integrate tool calling with a local LLM in my macOS app?

Yes, local LLM inference using the MLX framework in Swift supports tool calling, allowing you to integrate model capabilities directly with external tools and functions within your application.

Does the MLX framework support streaming generation for text models?

Yes, the MLX framework supports streaming generation, allowing your Swift applications to receive and display text responses in real-time as the local model generates them.

How do I fine-tune an LLM with LoRA on Apple Silicon devices?

You can fine-tune LLMs on Apple Silicon devices using LoRA within the Swift MLX framework, enabling you to adapt model weights for specific tasks directly on your local hardware.

Can I use Vision-Language Models for local inference on iOS?

Yes, the MLX framework facilitates local VLM inference on both macOS and iOS devices, allowing your Swift applications to process vision and language tasks on-device for enhanced privacy.

What is the best way to implement RAG patterns with a local LLM in Swift?

To implement RAG patterns in Swift, use the MLX framework to generate local embeddings and run LLM inference, enabling your application to answer questions based on local documents.