Skip to content

The missing implementations for MLX. Research papers, native Swift, Apple Silicon optimized.

Notifications You must be signed in to change notification settings

mlx-community/.github

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 

Repository files navigation

mlx-community β€” Community MLX-Swift Implementations

Hey everyone! πŸ‘‹

I've been building MLX-Swift implementations of recent research papers and wanted to share them with the community. I've organized these under a new GitHub org: github.com/mlx-community

The goal is to be a community-driven complement to ml-explore β€” focusing on bleeding-edge techniques and native Swift implementations that aren't in the official repos yet.


Current Projects

Native MLX-Swift implementation of speculative decoding for faster LLM inference.

  • Draft-then-verify pipeline with any MLX-compatible models
  • 2-3x speedups on Apple Silicon
  • Streaming support, simple API
  • Works with models from mlx-community on HF
let output = try await SpeculativeDecoding.generate(
    prompt: "Explain quantum computing:",
    draftModelId: "mlx-community/Qwen2.5-0.5B-Instruct-4bit",
    targetModelId: "mlx-community/Qwen2.5-7B-Instruct-4bit"
)

Benchmarks (M2 Max, 24GB):

Method Tokens/sec Speedup
Standard 45.2 1.0x
Speculative (warm) 89.4 1.98x

FastRL + EAGLE adaptive drafter implementation. The drafter learns from target model rejections in real-time, improving acceptance rate during inference.

Based on:

Features:

  • Hardware-tiered configs (Entry/Pro/Elite for different Mac specs)
  • Background training with GPU-aware scheduling
  • Single-layer EAGLE head option for minimal overhead
  • Multi-Armed Bandit for adaptive SD configuration

Native Swift port of PaddleOCR-VL β€” a 0.9B vision-language model for document understanding.

  • OCR, table parsing, formula extraction, chart analysis
  • 109 language support
  • NaViT-style dynamic resolution
  • CLI + library interfaces
paddleocr-vl ocr document.png --task table

Roadmap

Working on next:

  • mamba-swift β€” Native Mamba/Mamba-2 SSM (no Swift implementation exists yet)
  • medusa-swift β€” Multi-head speculative decoding
  • lora-swift β€” LoRA training in native Swift

Why MLX-Swift?

Most MLX community work is Python. But there's a huge opportunity for native Swift:

  • Ship ML directly in iOS/macOS apps
  • No Python runtime overhead
  • Better integration with Apple ecosystem
  • SwiftUI + MLX = native AI apps

Happy to take suggestions on what to implement next. PRs welcome!

β€” @lulzx

About

The missing implementations for MLX. Research papers, native Swift, Apple Silicon optimized.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published