Text Generation
MLX
Safetensors
English
emo
Mixture of Experts
mixture-of-experts
modularity
conversational
custom_code
4-bit precision
Instructions to use georgesZam/emo-1b14b-1t-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use georgesZam/emo-1b14b-1t-4bit 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("georgesZam/emo-1b14b-1t-4bit") 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 Settings
- LM Studio
- MLX LM
How to use georgesZam/emo-1b14b-1t-4bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "georgesZam/emo-1b14b-1t-4bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "georgesZam/emo-1b14b-1t-4bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8080/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "georgesZam/emo-1b14b-1t-4bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Atomic Chat
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -14,21 +14,23 @@ base_model: allenai/Emo_1b14b_1T
|
|
| 14 |
base_model_relation: quantized
|
| 15 |
---
|
| 16 |
|
| 17 |
-
# Emo-1B-14B-1T β MLX
|
| 18 |
|
| 19 |
-
MLX-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
## Credits
|
| 22 |
|
| 23 |
-
**All credit for the model,
|
| 24 |
|
| 25 |
- **Paper:** [EMO: Pretraining Mixture of Experts for Emergent Modularity](https://arxiv.org/abs/2605.06663) β Wang, Bhagia, Min et al., Ai2, 2026.
|
| 26 |
- **Base model:** [`allenai/Emo_1b14b_1T`](https://huggingface.co/allenai/Emo_1b14b_1T)
|
| 27 |
- **Training data:** [`allenai/OLMoE-mix-0924`](https://huggingface.co/datasets/allenai/OLMoE-mix-0924)
|
| 28 |
- **Visualization:** [emovisualization.netlify.app](https://emovisualization.netlify.app)
|
| 29 |
|
| 30 |
-
If you use this model in your work, please cite the original EMO paper:
|
| 31 |
-
|
| 32 |
```bibtex
|
| 33 |
@article{wang2026emo,
|
| 34 |
title = {EMO: Pretraining Mixture of Experts for Emergent Modularity},
|
|
@@ -38,57 +40,52 @@ If you use this model in your work, please cite the original EMO paper:
|
|
| 38 |
}
|
| 39 |
```
|
| 40 |
|
| 41 |
-
This repository only contributes the MLX port and
|
| 42 |
-
|
| 43 |
-
## Variants
|
| 44 |
|
| 45 |
-
|
| 46 |
-
|---|---|---|---|
|
| 47 |
-
| `4bit-g64/` | 4 | 64 | ~7.5 GB |
|
| 48 |
-
| `4bit-g32/` | 4 | 32 | ~8.0 GB |
|
| 49 |
|
| 50 |
-
`
|
| 51 |
|
| 52 |
-
|
|
|
|
|
|
|
| 53 |
|
| 54 |
-
|
| 55 |
|
| 56 |
```bash
|
| 57 |
-
git clone https://github.com/
|
| 58 |
cd mlx-lm
|
|
|
|
| 59 |
pip install -e .
|
| 60 |
```
|
| 61 |
|
| 62 |
-
|
| 63 |
|
| 64 |
## Usage
|
| 65 |
|
| 66 |
```python
|
| 67 |
from mlx_lm import load, generate
|
| 68 |
|
| 69 |
-
model, tokenizer = load("georgesZam/emo-1b14b-1t-4bit
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
prompt = "The capital of France is"
|
| 73 |
-
out = generate(model, tokenizer, prompt=prompt, max_tokens=80, verbose=True)
|
| 74 |
```
|
| 75 |
|
| 76 |
-
|
| 77 |
|
| 78 |
```bash
|
| 79 |
-
|
| 80 |
```
|
| 81 |
|
| 82 |
## Architecture notes (port)
|
| 83 |
|
| 84 |
-
EMO at inference time is OLMoE-shaped with
|
| 85 |
|
| 86 |
-
1. **Shared experts.** The last `num_shared_experts` columns of the gate
|
| 87 |
-
2. **Layernorm naming.** EMO uses `pre_attention_layernorm` / `pre_feedforward_layernorm`
|
| 88 |
-
3. **No q/k norm**
|
| 89 |
|
| 90 |
-
|
| 91 |
|
| 92 |
## License
|
| 93 |
|
| 94 |
-
Inherits from the base model. See `allenai/Emo_1b14b_1T` for terms.
|
|
|
|
| 14 |
base_model_relation: quantized
|
| 15 |
---
|
| 16 |
|
| 17 |
+
# Emo-1B-14B-1T β MLX (4-bit, group_size=32)
|
| 18 |
|
| 19 |
+
MLX 4-bit quantization of [`allenai/Emo_1b14b_1T`](https://huggingface.co/allenai/Emo_1b14b_1T) β Ai2's EMO (Emergent Modularity) MoE LM (1B active / 14B total, top-8 of 128 experts, 1 shared expert, midtrained on 1T tokens of OLMoE-mix-0924).
|
| 20 |
+
|
| 21 |
+
Quantization: **4-bit, group_size=32** (chosen over `g64` to keep the MoE router precision tighter β group_size=32 limits the quantization error on the gate projection, which matters more for MoE than for dense models).
|
| 22 |
+
|
| 23 |
+
Size on disk: ~9.5 GB. Runs comfortably on Apple Silicon with β₯16 GB unified memory.
|
| 24 |
|
| 25 |
## Credits
|
| 26 |
|
| 27 |
+
**All credit for the model, training, data, and the EMO architecture goes to the original authors at Allen Institute for AI (Ai2):**
|
| 28 |
|
| 29 |
- **Paper:** [EMO: Pretraining Mixture of Experts for Emergent Modularity](https://arxiv.org/abs/2605.06663) β Wang, Bhagia, Min et al., Ai2, 2026.
|
| 30 |
- **Base model:** [`allenai/Emo_1b14b_1T`](https://huggingface.co/allenai/Emo_1b14b_1T)
|
| 31 |
- **Training data:** [`allenai/OLMoE-mix-0924`](https://huggingface.co/datasets/allenai/OLMoE-mix-0924)
|
| 32 |
- **Visualization:** [emovisualization.netlify.app](https://emovisualization.netlify.app)
|
| 33 |
|
|
|
|
|
|
|
| 34 |
```bibtex
|
| 35 |
@article{wang2026emo,
|
| 36 |
title = {EMO: Pretraining Mixture of Experts for Emergent Modularity},
|
|
|
|
| 40 |
}
|
| 41 |
```
|
| 42 |
|
| 43 |
+
This repository only contributes the MLX port and 4-bit quantization β no training, no data, no architectural research.
|
|
|
|
|
|
|
| 44 |
|
| 45 |
+
## β οΈ Requires a fork of `mlx-lm`
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
+
The `emo` model type is **not yet upstream** in [`ml-explore/mlx-lm`](https://github.com/ml-explore/mlx-lm). Loading this model with stock `pip install mlx-lm` will fail with:
|
| 48 |
|
| 49 |
+
```
|
| 50 |
+
ValueError: Model type emo not supported.
|
| 51 |
+
```
|
| 52 |
|
| 53 |
+
Until the PR lands upstream, install the fork that ships `mlx_lm/models/emo.py`:
|
| 54 |
|
| 55 |
```bash
|
| 56 |
+
git clone https://github.com/ml-explore/mlx-lm.git
|
| 57 |
cd mlx-lm
|
| 58 |
+
# Add the emo.py model file (see "Architecture notes" below for the exact code)
|
| 59 |
pip install -e .
|
| 60 |
```
|
| 61 |
|
| 62 |
+
Or, if a public fork already exists, replace the URL above with it. The `emo.py` file used to produce this repo is shipped alongside this README for reference.
|
| 63 |
|
| 64 |
## Usage
|
| 65 |
|
| 66 |
```python
|
| 67 |
from mlx_lm import load, generate
|
| 68 |
|
| 69 |
+
model, tokenizer = load("georgesZam/emo-1b14b-1t-4bit")
|
| 70 |
+
out = generate(model, tokenizer, prompt="The capital of France is", max_tokens=80, verbose=True)
|
|
|
|
|
|
|
|
|
|
| 71 |
```
|
| 72 |
|
| 73 |
+
CLI:
|
| 74 |
|
| 75 |
```bash
|
| 76 |
+
python -m mlx_lm generate --model georgesZam/emo-1b14b-1t-4bit --prompt "Hello"
|
| 77 |
```
|
| 78 |
|
| 79 |
## Architecture notes (port)
|
| 80 |
|
| 81 |
+
EMO at inference time is OLMoE-shaped with three tweaks the MLX port handles:
|
| 82 |
|
| 83 |
+
1. **Shared experts.** The last `num_shared_experts` columns of the gate route through a *separate* softmax + top-k (here top-1 over 1 shared expert) and are concatenated to the standard top-k. Shared indices are offset by `num_experts - num_shared_experts`. This matches the original `EmoSparseMoeBlock` legacy path in `modeling_emo.py`.
|
| 84 |
+
2. **Layernorm naming.** EMO uses `pre_attention_layernorm` / `pre_feedforward_layernorm`. The MLX module mirrors these names so weights map 1-to-1 without a remap.
|
| 85 |
+
3. **No q/k norm.** Unlike OLMoE, EMO's attention has no q_norm / k_norm.
|
| 86 |
|
| 87 |
+
"Emergent Modularity" itself is a *pretraining* contribution β at inference it's a vanilla MoE forward pass. Expert subsetting (the paper's headline benefit) is not exposed in this checkpoint; doing it cleanly requires an offline analysis of expert activations on your target domain and dropping unused expert rows from each layer's stacked `switch_mlp` tensors.
|
| 88 |
|
| 89 |
## License
|
| 90 |
|
| 91 |
+
Inherits from the base model. See [`allenai/Emo_1b14b_1T`](https://huggingface.co/allenai/Emo_1b14b_1T) for terms.
|