Run this model with HF Jobs
Run Xylolabs/flung-8b-MLX-3bit on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Xylolabs/flung-8b-MLX-3bit. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Xylolabs/flung-8b-MLX-3bit on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/Xylolabs/flung-8b-MLX-3bit. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Instructions to use Xylolabs/flung-8b-MLX-3bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Xylolabs/flung-8b-MLX-3bit 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("Xylolabs/flung-8b-MLX-3bit") 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
- Pi
How to use Xylolabs/flung-8b-MLX-3bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Xylolabs/flung-8b-MLX-3bit"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Xylolabs/flung-8b-MLX-3bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use Xylolabs/flung-8b-MLX-3bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "Xylolabs/flung-8b-MLX-3bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "Xylolabs/flung-8b-MLX-3bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8080/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Xylolabs/flung-8b-MLX-3bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use Xylolabs/flung-8b-MLX-3bit 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 "Xylolabs/flung-8b-MLX-3bit"
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 Xylolabs/flung-8b-MLX-3bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Xylolabs/flung-8b-MLX-3bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Xylolabs/flung-8b-MLX-3bit"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "Xylolabs/flung-8b-MLX-3bit" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
flung-8b-MLX-3bit
Calibrated MLX 3-bit build of black-forest-labs/flung-8b (@38e2406e4850) with a standalone flung_mlx.py runtime and CLI. The identically zero flow_velocity_head (12.85 M parameters, unused at T_MIN = 0.01) is omitted; flung_mlx.py returns exact zeros if return_flow=True is requested.
How to run
Requires mlx >= 0.30, transformers >= 4.57, and numpy (no mlx-lm required).
pip install -U mlx transformers numpy huggingface_hub
hf download Xylolabs/flung-8b-MLX-3bit --local-dir flung-8b-MLX-3bit
python flung-8b-MLX-3bit/flung_mlx.py --model flung-8b-MLX-3bit --prompt "A train leaves at 9:40 and arrives at 13:15. How long is the trip in minutes?"
Start an interactive multi-turn session with --chat:
python flung-8b-MLX-3bit/flung_mlx.py --model flung-8b-MLX-3bit --chat --steps 64 --stable-stop 4
Which file for your hardware
| Repo | Size | Bits / weight | Memory guidance |
|---|---|---|---|
| Xylolabs/flung-8b-MLX-8bit | 9.61 GB (8.95 GiB) | 8.51 | 16 GB+ unified memory; minimal quantization loss |
| Xylolabs/flung-8b-MLX-6bit | 7.64 GB (7.12 GiB) | 6.77 | 12 GB+ unified memory; near-8-bit quality in 7.64 GB |
| Xylolabs/flung-8b-MLX-4bit | 6.16 GB (5.74 GiB) | 5.46 | 8 GB+ unified memory; compact mixed-precision build |
| Xylolabs/flung-8b-MLX-3bit | 4.69 GB (4.36 GiB) | 4.15 | below 4.5 bits per weight: for memory-limited use |
Accuracy
Tensor-class precision
| Tensor class | Precision (group_size=64) |
Method |
|---|---|---|
embed_table |
8-bit affine (g64, unit-sphere normalized) |
GPU L2-MSE clip + 2-step ALS |
output_head.proj |
8-bit affine (g64) |
Full-H 2-pass OBS + Gauss-Seidel refit |
self_cond_proj |
8-bit affine (g64) |
Full-H 2-pass OBS + Gauss-Seidel refit |
blocks.0..33 (mod1, mod2) |
3-bit affine (g64) |
Exact manifold Full-H OBS + refit |
blocks.0..33 (attn, mlp) |
3-bit affine (g64) |
Full-H OBS + refit + end-to-end full-vocab KL alignment |
time_embed, ref_time_embed, QK-RMSNorm, biases |
BF16 | Lossless / end-to-end KL aligned |
flow_velocity_head |
Omitted (identically zero in upstream) | Exact zero output in flung_mlx.py |
Denoising quality
| Release | Size | bpw | WikiText-2 KL | top-1 | x0 cos | Chat KL | Held-out KL | 11-item answers |
|---|---|---|---|---|---|---|---|---|
| Xylolabs/flung-8b-MLX-8bit | 9.61 GB | 8.51 | 0.003142 | 96.63% | 0.99907 | 0.004276 | 0.004126 | 11/11 |
| Xylolabs/flung-8b-MLX-6bit | 7.64 GB | 6.77 | 0.005823 | 96.14% | 0.99894 | 0.004894 | 0.005827 | 11/11 |
| Xylolabs/flung-8b-MLX-4bit | 6.16 GB | 5.46 | 0.014336 | 93.07% | 0.99530 | 0.013944 | 0.012556 | 11/11 |
| Xylolabs/flung-8b-MLX-3bit (below 4.5 bits per weight: for memory-limited use) | 4.69 GB | 4.15 | 0.071349 | 82.76% | 0.97743 | 0.085370 | 0.068492 | 11/11 |
Full comparison with stock MLX round-to-nearest baselines: BENCHMARKS.md and accuracy-by-size.csv.
License and notices
Model weights and architecture follow cc-by-nc-4.0 (LICENSE included verbatim from black-forest-labs/flung-8b@38e2406e4850). Qwen3 tokenizer files are redistributed unmodified under Apache-2.0 (NOTICE_TOKENIZER).
Updates
- 2026-12-05: Initial calibrated MLX 3-bit release (Full-Hessian OBS + refit + end-to-end full-vocab KL alignment) with bundled
flung_mlx.pyruntime, 4-tier benchmarks, CSV, and dark charts.
FLUNG 8B
FLUNG is our first step into language modeling. It brings the flow models behind FLUX to text: instead of writing one token at a time, FLUNG drafts 128 tokens at once as noise and refines all of them in parallel, decoding up to 6.5 tokens per forward pass.
FLUNG 8B is a 7.9B parameter (9.0B including embeddings) language flow transformer, trained with variational flow matching on about 1T tokens of open-source data and post-trained for chat. It is competitive with open-source discrete diffusion models on math, code and instruction following, and runs on a single GPU.
Released as a research artifact under CC BY-NC 4.0 with the paper Towards Training Your Language Flow Model from Scratch (Abdessaied et al., Black Forest Labs, 2026). It is not intended for commercial use or production deployment.
Key features
- A flow model that works as a general-purpose language model at 8B scale, trained from scratch on open-source data only.
- Parallel decoding: 4.8 tokens per forward pass with the default sampler and 6.5 at 32 steps with early stop, within 2 points of full 64-step denoising on every benchmark below.
- Weights released for non-commercial research under CC BY-NC 4.0.
Usage
Requires torch and transformers (tested with 4.57.6).
import torch
from transformers import AutoModel, AutoTokenizer
repo = "black-forest-labs/flung-8b"
tokenizer = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = AutoModel.from_pretrained(repo, trust_remote_code=True, dtype=torch.bfloat16).to("cuda").eval()
messages = [{"role": "user", "content": "A train leaves at 9:40 and arrives at 13:15. How long is the trip in minutes?"}]
out = model.generate_chat(messages, tokenizer) # 64 steps per 128-token block, early stop n=4
print(out["text"])
# Sampling settings can also be overridden per call.
fast = model.generate_chat(messages, tokenizer, steps=32, stable_stop=0, max_new_tokens=512, seed=1973)
Training
About 1T tokens in total, from open-source datasets only.
- Pre-training: ~0.82T tokens (web, code, math).
- Mid-training: 200B tokens (higher-quality web, code and math, plus instruction data).
- Supervised fine-tuning: 4.7B tokens (code, math, instruction following, chat, science, safety).
- Distillation: guidance distillation, then flow-map step distillation, so the model samples in 32-64 steps per 128-token block.
- Preference tuning: offline DPO, then online GRPO with rewards from unit tests, reference answers, constraint checkers and an LLM judge.
Main data sources: Nemotron-CC, Nemotron pre-training code and math, FinePDFs-Edu, FineMath, Dolma 3 Dolmino, OpenMathInstruct-2, OpenCodeInstruct, Nemotron post-training sets, Tülu 3 and SmolTalk. The full list of datasets, with mixture weights and licenses, is in the paper's data appendix. No training data is redistributed with this model.
Evaluation
Zero-shot generative benchmarks from the paper (mean of 3 seeds; MT-Bench judged by GPT-4.1). Early stop (ES) stops denoising a block once its argmax readout has not changed for 4 consecutive steps; ES rows are in green. HE = HumanEval.
| Steps | tok/fwd | Math | Code | Alignment | |||||
|---|---|---|---|---|---|---|---|---|---|
| GSM8K | MATH | HE | HE+ | MBPP | MBPP+ | IFEval | MT-Bench | ||
| 64 + ES (default) | 4.8 | 87.9 | 50.5 | 70.7 | 65.7 | 56.5 | 60.8 | 76.0 | 5.68 |
| 64 | 2 | 88.9 | 51.0 | 71.7 | 67.1 | 57.7 | 62.7 | 76.3 | 5.78 |
| 32 + ES | 6.5 | 88.5 | 49.7 | 70.3 | 65.7 | 56.1 | 61.9 | 75.6 | 5.71 |
| 32 | 4 | 89.1 | 50.3 | 70.5 | 65.9 | 56.8 | 62.5 | 76.1 | 5.64 |
Sampler for all rows: temperature 0.3, top-p 0.9. See the paper for baselines and evaluation details.
Intended use and limitations
- Intended use: non-commercial research on language flow models and non-autoregressive generation.
- Out of scope: commercial use, production deployment, and any use where incorrect or harmful output can cause harm without human review.
- Accuracy: like other language models of this size, FLUNG can produce plausible but incorrect statements, code and reasoning.
- Language: trained mostly on English text and code; other languages are not evaluated.
License and attribution
- Weights and code: CC BY-NC 4.0 (see
LICENSE). - Tokenizer files: Qwen3 tokenizer, Apache 2.0 (see
NOTICE_TOKENIZER). - Training datasets are credited in the paper's data appendix.
Citation
@article{abdessaied2026flung,
title = {Towards Training Your Language Flow Model from Scratch},
author = {Abdessaied, Adnen and Addanki, Ravichandra and Sauer, Axel and Podell, Dustin and Rombach, Robin},
journal = {arXiv preprint arXiv:2612.06003},
year = {2026}
}
- Downloads last month
- -
3-bit
Model tree for Xylolabs/flung-8b-MLX-3bit
Base model
black-forest-labs/flung-8b