MLX LM is an open-source Python package designed for running and fine-tuning large language models on Apple silicon using Apple's MLX framework. It enables developers to generate text, interact with conversational models, and customize LLMs locally on Mac computers. The package integrates with Hugging Face Hub, providing access to thousands of compatible models through simple commands. It supports model conversion, quantization, and uploading optimized models to Hugging Face. Users can perform low-rank and full-model fine-tuning, including training quantized models. Its Python API and command-line tools support streaming generation, configurable sampling, and interactive chat. Additional capabilities include distributed inference, prompt caching, and memory-efficient processing of long contexts.
Features
- Apple Silicon-Optimized LLM Inference
- Hugging Face Hub Model Integration
- Low-Rank and Full-Model Fine-Tuning
- Model Conversion and Quantization
- Streaming Text Generation and Interactive Chat
- Distributed Inference and Prompt Caching