๐ Production-ready MLX implementations of popular AI models, optimized for Apple Silicon (M1/M2/M3/M4)
World's first MLX-native OCR model
- ๐ Model on Hugging Face
- ๐ฆ Size: ~2GB
- โก Speed: 2-3s per image on M4 Max
- ๐ฏ Use case: Document digitization, receipt processing, academic paper OCR
- ๐ Web UI Available - Beautiful browser-based interface!
8-bit quantized multilingual translation model
- ๐ Model on Hugging Face
- ๐ฆ Size: 4.2GB (70% smaller than original)
- โก Speed: 25 tokens/s on M4 Max
- ๐ Languages: 200+
- ๐ฏ Use case: Document translation, real-time translation, multilingual chat
# Install MLX and dependencies
pip install mlx mlx-lm transformers pillow
# Clone this repo for examples
git clone https://github.com/biabia-55/mlx-models.git
cd mlx-modelsfrom transformers import AutoTokenizer
from PIL import Image
# Load model
tokenizer = AutoTokenizer.from_pretrained(
"biabia-55/PaddleOCR-VL-MLX",
trust_remote_code=True
)
# Process image
image = Image.open("document.jpg")
# See paddleocr-vl-mlx/examples/ for complete codefrom mlx_lm import load, generate
# Load model
model, tokenizer = load("biabia-55/Hunyuan-MT-Chimera-7B-MLX-Q8")
# Translate
prompt = "Translate to French: Hello, world!"
result = generate(model, tokenizer, prompt=prompt, max_tokens=256)
print(result)Tested on M4 Max (128GB RAM):
| Model | Task | Speed | Memory | vs PyTorch |
|---|---|---|---|---|
| PaddleOCR-VL-MLX | OCR | 2-3s/image | ~4GB | 2.5x faster |
| Hunyuan-MT-MLX-Q8 | Translation | 25 tok/s | ~8GB | 1.67x faster |
mlx-models/
โโโ paddleocr-vl-mlx/ # PaddleOCR-VL examples and tools
โ โโโ examples/ # Usage examples
โ โโโ conversion/ # PyTorch โ MLX conversion scripts
โ โโโ README.md
โโโ hunyuan-mt-mlx/ # Hunyuan-MT examples and tools
โ โโโ examples/ # Usage examples
โ โโโ quantization/ # Quantization scripts
โ โโโ README.md
โโโ docs/ # Documentation
โ โโโ performance_benchmarks.md
โ โโโ conversion_guide.md
โ โโโ faq.md
โโโ README.md # This file
# See paddleocr-vl-mlx/examples/document_pipeline.py
from paddleocr_mlx import OCRPipeline
pipeline = OCRPipeline()
result = pipeline.process("document.pdf")
# Preserves formatting, tables, and layout# See hunyuan-mt-mlx/examples/streaming_translation.py
from hunyuan_mlx import StreamingTranslator
translator = StreamingTranslator()
for chunk in translator.translate_stream("Long text..."):
print(chunk, end='', flush=True)# See examples for batch processing multiple files
# Optimized for throughput on Apple SiliconSee docs/conversion_guide.md for detailed instructions on converting PyTorch models to MLX.
python -m pytest tests/Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- PaddlePaddle Team for PaddleOCR-VL
- Tencent Hunyuan Team for Hunyuan-MT
- Apple ML Research for the MLX framework
- Hugging Face for model hosting
- GitHub: @biabia-55
- Hugging Face: @gamhtoi
- Email: wheiwalee@gmail.com
Note: Models are hosted on Hugging Face under
gamhtoi, while code and documentation are on GitHub underbiabia-55. Both accounts belong to the same author.
If you find this project useful, please consider giving it a star!
Made with โค๏ธ for the Apple Silicon community