Instructions to use mlx-community/LFM2-8B-A1B-6bit-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/LFM2-8B-A1B-6bit-MLX with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("mlx-community/LFM2-8B-A1B-6bit-MLX") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- LM Studio
- Pi new
How to use mlx-community/LFM2-8B-A1B-6bit-MLX with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "mlx-community/LFM2-8B-A1B-6bit-MLX"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "mlx-community/LFM2-8B-A1B-6bit-MLX" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use mlx-community/LFM2-8B-A1B-6bit-MLX with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "mlx-community/LFM2-8B-A1B-6bit-MLX"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default mlx-community/LFM2-8B-A1B-6bit-MLX
Run Hermes
hermes
- MLX LM
How to use mlx-community/LFM2-8B-A1B-6bit-MLX with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "mlx-community/LFM2-8B-A1B-6bit-MLX"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "mlx-community/LFM2-8B-A1B-6bit-MLX" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlx-community/LFM2-8B-A1B-6bit-MLX", "messages": [ {"role": "user", "content": "Hello"} ] }'
LFM2-8B-A1B — MLX 6-bit (Apple Silicon)
Maintainer / Publisher: Susant Achary
Upstream model: LiquidAI/LFM2-8B-A1B
This repo (MLX 6-bit): mlx-community/LFM2-8B-A1B-6bit-MLX
This repository provides an Apple-Silicon-optimized MLX build of LFM2-8B-A1B at 6-bit quantization.
Among quantized tiers, 6-bit is a strong fidelity sweet-spot for many Macs—noticeably smaller than FP16/8-bit while preserving answer quality for instruction following, summarization, and structured extraction.
🔎 What is LFM2-8B-A1B?
- Architecture: Mixture-of-Experts (MoE) Transformer.
- Size:
8B total parameters with ~1B active per token (A1B ≈ “1B active”). - Why MoE? At each token, a subset of experts is activated, reducing compute per token while keeping a larger parameter pool for expressivity.
Single-device memory reality: Even though only ~1B are active per token, all experts typically reside in memory during inference on one device. That means RAM planning should track total parameters, not just the active slice.
📦 What’s in this MLX build
config.json(MLX),mlx_model*.safetensors(6-bit shards)- Tokenizer files:
tokenizer.json,tokenizer_config.json - Model metadata (e.g.,
model_index.json)
Target: macOS on Apple Silicon (M-series) with Metal/MPS.
✅ Intended use
- General instruction following, chat, and summarization
- RAG and long-context assistants on device
- Schema-guided structured outputs (JSON)
⚠️ Limitations
- Quantization can cause small regressions vs FP16 on tricky math/code or tight formatting.
- For very long contexts and/or batching, the KV-cache can dominate memory—tune
max_tokensand batch size. - Add your own safety/guardrails for sensitive deployments.
🔢 RAM planning (6-bit, MoE, MLX)
You asked to assume and decide realistic ranges. The following are practical starting points for a single-device MLX run; validate on your hardware.
Rule-of-thumb components
- Weights (6-bit): ≈
total_params × 0.75 byte→ for 8B params ≈ ~6.0 GB
- Downloads last month
- 35
6-bit
Model tree for mlx-community/LFM2-8B-A1B-6bit-MLX
Base model
LiquidAI/LFM2-8B-A1B