Skip to main content

MLX Foundry

PyPI version Python 3.10+ License: MIT Apple Silicon

A professional CLI pipeline for converting, benchmarking, and publishing HuggingFace models to Apple MLX format with publication-grade model cards.


Features

  • Multi-Quantization in One Run: Convert any HuggingFace model to 4-bit, 8-bit, and 16-bit MLX format.
  • 📊 Automated Benchmarking: Profile tokens/second, time to first token (TTFT), and peak memory usage on Apple Silicon unified memory.
  • 📝 Professional Model Cards: Generate publication-ready HuggingFace model cards featuring reproducible commands, benchmark tables, and hardware guides.
  • 🤗 One-Command Hub Publishing: Create repositories, assign appropriate tags (mlx, safetensors, conversational, etc.), and upload with automatic cleanup.
  • 📣 Social Post Generation: Instantly create ready-to-share summaries formatted for X/Twitter and Reddit (r/LocalLLaMA).

Requirements

  • macOS with Apple Silicon (M1/M2/M3/M4)
  • Python >= 3.10
  • mlx-lm and HuggingFace credentials (hf auth login)

Installation

pip install mlx-foundry

Or install from source for development:

git clone https://github.com/SirSahOl/mlx-foundry.git
cd mlx-foundry
pip install -e ".[dev]"

Quick Start

Run the end-to-end pipeline to convert, benchmark, generate model cards, and publish:

mlx-foundry pipeline \
    --model Qwen/Qwen3-0.6B \
    --author SirSahOl \
    --quants 4,8,16

Dry Run (Local only, skip publishing)

mlx-foundry pipeline \
    --model Qwen/Qwen3-0.6B \
    --author SirSahOl \
    --quants 4,8 \
    --skip-publish \
    --no-cleanup

Commands Reference

1. pipeline

Runs the complete workflow: conversion, benchmark, card generation, publish, and social posts.

mlx-foundry pipeline --model <HF_MODEL_ID> [OPTIONS]

Options:

  • -m, --model: HuggingFace model ID (required).
  • -a, --author: HuggingFace username/org (default: SirSahOl).
  • -q, --quants: Comma-separated quantizations (default: 4,8,16).
  • -o, --output: Base output directory (default: ./output).
  • --skip-benchmark: Skip performance benchmarking.
  • --skip-publish: Skip HuggingFace upload.
  • --skip-social: Skip social post generation.
  • --no-cleanup: Keep local converted weights after upload.
  • --private: Mark HuggingFace repository as private.
  • -f, --force: Overwrite existing output directories.

2. convert

Convert models to specified quantization levels.

mlx-foundry convert --model Qwen/Qwen3-0.6B --quants 4,8,16 --output ./output

3. benchmark

Measure throughput (tokens/sec), first-token latency, and memory footprint.

mlx-foundry benchmark --model ./output/Qwen3-0.6B-mlx-4bit --runs 5

4. card

Generate a rich README.md model card using Jinja2 templates.

mlx-foundry card \
    --model ./output/Qwen3-0.6B-mlx-4bit \
    --source Qwen/Qwen3-0.6B \
    --repo SirSahOl/Qwen3-0.6B-chat-mlx-4bit

5. publish

Upload a converted model folder to HuggingFace Hub with complete tags and metadata.

mlx-foundry publish \
    --model ./output/Qwen3-0.6B-mlx-4bit \
    --repo SirSahOl/Qwen3-0.6B-chat-mlx-4bit \
    --source Qwen/Qwen3-0.6B \
    --quant 4

6. social

Generate formatted announcements for Twitter and Reddit.

mlx-foundry social \
    --model-name Qwen3-0.6B \
    --repo SirSahOl/Qwen3-0.6B-chat-mlx-4bit \
    --source Qwen/Qwen3-0.6B \
    --quant 4

Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.


License

Distributed under the MIT License. See LICENSE for more information.

Release files for mlx-foundry 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mlx-foundry 0.1.0
File Size Uploaded
mlx_foundry-0.1.0.tar.gz 37.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mlx-foundry 0.1.0
File Interpreter ABI Platform
mlx_foundry-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 78.4 kB

Release files / mlx_foundry-0.1.0.tar.gz

Download URL mlx_foundry-0.1.0.tar.gz
Size 37.8 kB
Tags Source
SHA-256 checksum
How to use checksums
82d038f3387c1b51d528c2936e971629cd649134807bfb5b76f7b90a89d9e1fe
BLAKE2b-256 checksum
How to use checksums
2762a8b8ebead3625b6490f8e566b94c6aa799c287732bcc76790935a96bb51d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mlx_foundry-0.1.0-py3-none-any.whl

Download URL mlx_foundry-0.1.0-py3-none-any.whl
Size 40.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d9548d74f177142e5bcfdb7c5191d7e2c45cf0a29b2a04490a48e155cdbb1b0
BLAKE2b-256 checksum
How to use checksums
ecd4f21d4e9f7867ee3e629acfc638c7710ceac2fa59cd3bad6b49ce7a72e399
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page