# How to Run FLUNG 8B Locally with Transformers

> Source: <https://www.mindstudio.ai/blog/run-flung-8b-locally/>
> Published: 2026-12-05 00:00:00+00:00

**Key takeaway:** FLUNG 8B decodes up to 6.5 tokens per forward pass at 32 denoising steps with early stopping, versus about 4.8 at the default 64 steps, while staying within 2 points of 64-step quality on every reported benchmark.

# How to Run FLUNG 8B Locally with Transformers

A practical guide to loading Black Forest Labs' FLUNG 8B flow-matching model on a single GPU with the Transformers library.

## What is FLUNG 8B?

FLUNG 8B is a language flow model from Black Forest Labs, the team behind the FLUX image generators. Instead of predicting one token at a time like a standard autoregressive LLM, FLUNG drafts a block of 128 tokens as noise and refines the whole block in parallel through a denoising process borrowed from flow matching. It’s a 7.9B parameter transformer (9.0B counting embeddings), trained on roughly 1 trillion tokens of open-source data, and it runs on a single GPU through the Hugging Face Transformers library.

## TL;DR

- **FLUNG 8B applies flow matching to text** , the same family of technique used in FLUX image models, generating 128-token blocks that get denoised in parallel rather than token by token.
- **It decodes up to 6.5 tokens per forward pass** at 32 steps with early stopping, versus the usual one-token-per-step pace of autoregressive models, while staying within 2 points of full 64-step quality on every benchmark reported.
- **The model loads through standard Transformers code** with`trust_remote_code=True` , since FLUNG ships custom modeling and generation files rather than using a built-in architecture class.
- **It’s released under CC BY-NC 4.0** , a non-commercial research license, so it’s meant for experimentation and papers, not production or commercial products.
- **Benchmark scores are competitive with open discrete diffusion models** on math (GSM8K, MATH), code (HumanEval, MBPP), and instruction following (IFEval, MT-Bench).
- **The tokenizer is borrowed from Qwen3** and released under Apache 2.0, separate from the model weights’ license.
- **Training combined pre-training, mid-training, supervised fine-tuning, distillation, and preference tuning** (offline DPO followed by online GRPO) on openly available datasets only.

*Enterprises have Remy.*

**⌂** Self-hosted

**✓** SOC 2

**✚** HIPAA

**☰** Audit log

## How does FLUNG’s parallel decoding actually work?

Most LLMs you’ve used generate text autoregressively: predict token N+1, append it, predict N+2, and so on. FLUNG instead treats a chunk of 128 tokens as a block of noise and runs a denoising loop across the whole block simultaneously, similar to how diffusion image models turn static into a picture over several steps.

Each denoising step is a forward pass through the transformer. The model’s generation config defaults to 64 steps per 128-token block, with an early-stop mechanism that halts denoising on a given block once its predicted (argmax) tokens stop changing for four consecutive steps. That early stop pushes throughput to about 4.8 tokens produced per forward pass. Dropping to 32 steps with early stopping pushes it further, to 6.5 tokens per forward pass, while the model card reports scores within 2 points of the full 64-step run across every benchmark tested.

This is the practical selling point: fewer forward passes needed per generated token compared to a purely sequential decoder, which matters for latency on a single GPU where every forward pass costs wall-clock time.

## How do you load FLUNG 8B with Transformers?

The setup follows the same shape as loading any Hugging Face model, with one difference: FLUNG uses custom model code, so `trust_remote_code=True` is required on both the tokenizer and the model.

``` python
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()
```

Loading in `bfloat16` and moving the model to `cuda` keeps memory use reasonable for an 8B-class model on a single GPU. From there, chat-style generation goes through a dedicated method rather than the standard `generate()` call most Transformers users are used to:

```
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"])
```

`generate_chat` wraps the chat template, denoising loop, and early-stop logic together. By default it runs the full 64-step schedule with early stopping after 4 stable steps, matching the top-performing row in the model’s own benchmark table.

## How do you tune speed versus quality?

Sampling parameters can be overridden per call, which is where the speed/quality tradeoff in the model card becomes directly usable:

```
fast = model.generate_chat(messages, tokenizer, steps=32, stable_stop=0, max_new_tokens=512, seed=1973)
```

Reducing `steps` from 64 to 32 roughly doubles tokens decoded per forward pass, from 2 at full precision to about 4 (and up to 6.5 with early stopping re-enabled). The reported cost is marginal: all metrics in the model’s evaluation table, from GSM8K and MATH to HumanEval, MBPP, IFEval, and MT-Bench, shift by only a point or two between the 64-step and 32-step configurations. For latency-sensitive local use, that makes 32 steps with early stopping a reasonable default rather than an edge case.

The sampler itself runs at temperature 0.3 and top-p 0.9 across the benchmark runs documented by Black Forest Labs, which is worth matching if you’re trying to reproduce their reported numbers.

**›** Build a loan-approval app for 2,000 bankers.

*already included:*✓ SOC 2✓ role-based access✓ audit log✓ self-hosted

## Is FLUNG 8B worth running locally?

It depends on what you’re after. FLUNG isn’t positioned as a general-purpose production model: Black Forest Labs explicitly scopes it to non-commercial research into language flow models and non-autoregressive generation, and the CC BY-NC 4.0 license backs that up. It’s also only evaluated on English text and code, and like any 8B-parameter model it can produce fluent but wrong answers on math, code, or reasoning tasks.

What makes it worth a look is the architecture itself. Diffusion-style, non-autoregressive text generation has been a minority approach next to standard autoregressive LLMs, and FLUNG is a concrete, downloadable example of applying flow matching (the technique underlying FLUX image synthesis) to language at a meaningful scale (9B parameters, 1T training tokens). If you’re interested in parallel decoding, step-count/quality tradeoffs, or how image-generation techniques map onto text, FLUNG is a direct, runnable reference point rather than just a paper.

For anyone needing a chat assistant or coding tool in a commercial product, FLUNG is the wrong pick on licensing grounds alone. For researchers and builders curious about alternatives to token-by-token generation, it’s a reasonably accessible way to get hands-on with the idea on a single GPU.

## Frequently Asked Questions

### What hardware do you need to run FLUNG 8B?

The model card states it runs on a single GPU, loaded in `bfloat16`. As an 8B-parameter transformer, it fits the same general hardware tier as other models that size, though exact VRAM figures aren’t published in the model card itself.

### Can FLUNG 8B be used commercially?

No. It’s released under CC BY-NC 4.0, a non-commercial license. Black Forest Labs is explicit that it’s a research artifact, not intended for commercial use or production deployment.

### How is FLUNG different from a normal autoregressive LLM?

Normal LLMs generate one token at a time, left to right. FLUNG generates 128-token blocks at once, starting from noise and refining the whole block over multiple denoising steps, which lets it decode multiple tokens per forward pass (up to 6.5 at 32 steps with early stopping).

### What tokenizer does FLUNG 8B use?

It uses the Qwen3 tokenizer, released separately under the Apache 2.0 license, distinct from the CC BY-NC 4.0 license covering the model weights and code.

### How was FLUNG 8B trained?

Training proceeded in stages: roughly 0.82T tokens of pre-training on web, code, and math data, 200B tokens of mid-training on higher-quality and instruction data, 4.7B tokens of supervised fine-tuning, guidance and flow-map step distillation to compress the sampling schedule to 32-64 steps, and preference tuning via offline DPO followed by online GRPO using unit tests, reference answers, and an LLM judge as reward signals.
