Instructions to use summerAIO/diffusion-lfm2.5-24b-a2b-blocktune with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use summerAIO/diffusion-lfm2.5-24b-a2b-blocktune with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="summerAIO/diffusion-lfm2.5-24b-a2b-blocktune") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("summerAIO/diffusion-lfm2.5-24b-a2b-blocktune") model = AutoModelForCausalLM.from_pretrained("summerAIO/diffusion-lfm2.5-24b-a2b-blocktune", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use summerAIO/diffusion-lfm2.5-24b-a2b-blocktune with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "summerAIO/diffusion-lfm2.5-24b-a2b-blocktune" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "summerAIO/diffusion-lfm2.5-24b-a2b-blocktune", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/summerAIO/diffusion-lfm2.5-24b-a2b-blocktune
- SGLang
How to use summerAIO/diffusion-lfm2.5-24b-a2b-blocktune with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "summerAIO/diffusion-lfm2.5-24b-a2b-blocktune" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "summerAIO/diffusion-lfm2.5-24b-a2b-blocktune", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "summerAIO/diffusion-lfm2.5-24b-a2b-blocktune" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "summerAIO/diffusion-lfm2.5-24b-a2b-blocktune", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use summerAIO/diffusion-lfm2.5-24b-a2b-blocktune with Docker Model Runner:
docker model run hf.co/summerAIO/diffusion-lfm2.5-24b-a2b-blocktune
DLFM ยท BlockTune
Diffusion LFM2.5 ยท 24B-A2B ยท Merged BF16
Block prediction, measured end to end.
Quick start ยท Results ยท Research report ยท ๆฅๆฌ่ช
License โ LFM Open License v1.0
This model is derived from LiquidAI's LFM2.5-24B-A2B and remains subject to the
LFM Open License v1.0, licensed by Liquid AI, Inc. The complete,
unmodified upstream license text is included as LICENSE and
licenses/LFM-Open-License-v1.0.txt.
The license contains a commercial-use revenue threshold defined as
US$10,000,000 annual revenue or more; Section 5 sets out the commercial-use
limitation and the qualified non-profit exception. Read the original terms for
the operative conditions. Redistribution must retain the license and applicable
notices and identify modified files. See NOTICE for this release's
modifications and license-notice.txt for retained model/data attribution.
LFM Open License v1.0 is not an Apache-2.0 or MIT license. This derivative does not replace it or grant rights beyond applicable upstream model and data terms.
A research checkpointโwith the evidence attached
DLFM ยท BlockTune is an experimental block-diffusion derivative of
summerAIO/diffusion-lfm2.5-24b-a2b.
It incorporates the final rank-8 attention LoRA from a short adaptation study,
then packages the resulting weights as a complete, sharded BF16 checkpoint.
No separate LoRA application or base-model download is required once this repository is downloaded.
The release includes the diffusion sampler, batched best-of-N selection, repetition controls, reproducible configuration, and both positive and negative results.
Research previewโnot a production-quality coding model. BF16 merging did not meet the predeclared prediction-equivalence tolerance. The fastest decoding setting produces mostly incorrect answers. No tested configuration combined the quality gate with 1,000 returned token/s. Full-checkpoint byte/structure checks are documented separately from model-loading tests; a fresh end-to-end reload of this assembled full checkpoint has not been run.
At a glance
| Component | Release |
|---|---|
| Backbone | LFM2.5-24B-A2B-derived hybrid convolution / attention MoE |
| Stored precision | BF16 weights; inherited FP32 buffers preserved |
| Adaptation | Rank 8, alpha 16, q/k/v/out projections in all 10 attention layers |
| Runtime | Explicit block-diffusion sampler; causal prefix, bidirectional canvas |
| Evaluated hardware | H100 80GB for adaptation; A100 80GB for decoding |
| Tested temperature | 0.9 |
| Weight format | 13 Safetensors shards, approximately 47.94 GB |
| Recommended status | Experimental; no quality-approved throughput preset |
Quick start
Use an 80GB-class CUDA GPU for the demonstrated BF16 setup. Download this repository, then run the included inference script from its folder:
hf download summerAIO/diffusion-lfm2.5-24b-a2b-blocktune \
--local-dir ./dlfm-blocktune
Inside dlfm-blocktune:
uv run --python 3.11 --locked python inference.py \
--model . \
--preset balanced \
--prompt "Write only Python code defining add(a,b) that returns their sum. No explanation."
The balanced preset uses block32 / 16 steps / top-k20 / best-of4 at temperature0.9.
It selects candidates using syntax, the function name requested in the prompt,
model likelihood and repetitionโnot reference answers or hidden tests.
Optional code-prefix extraction is enabled by default. This was the best
observed speed/accuracy compromise among the completed small-task comparisons,
but it did not pass the overall quality gate.
Throughput diagnosticโnot a quality recommendation:
uv run --python 3.11 --locked python inference.py \
--model . --preset throughput --seed 900 \
--prompt "Explain masked diffusion text generation and autoregressive text generation in detail. Write a coherent essay of at least 1000 words comparing their operation, advantages, and limitations."
This preset uses block1024 / 1 step / top-k50. It prints the output to stdout and the actual output length, elapsed time and throughput to stderr.
Python API
from inference import load_model
from selection_runtime import cfg, generate_selected
sampler, tokenizer = load_model(".")
settings = cfg(block=32, steps=16, best_of=4, top_k=20, repair=True)
text, metrics = generate_selected(
sampler, tokenizer,
"Write only Python code defining square(x) that returns x*x. No explanation.",
settings, seed=2201,
)
print(text)
print(metrics)
The native Transformers model can load the weights, but its ordinary
model.generate() is autoregressive. Use inference.py for the block-diffusion
path measured in this report. The loader deliberately avoids the upstream
custom AutoModel mapping and does not enable the numerically unverified prefix cache.
What the experiments show
1 ยท Adaptation improved a narrow block-prediction metric
On 32 held-out Python-code blocks, with 128 context tokens and a fully masked 64-token target, single-forward token accuracy increased from 6.15% to 8.69% after adaptation. Entire-block exact match stayed at 0/32.
These are pre-merge adapter-path results, not a claim that the assembled BF16 checkpoint reproduces that accuracy. The test set was reused across exploratory stages; near-duplicate contamination and prior training exposure were not ruled out.
2 ยท More candidate tokens do not mean faster useful answers
All rows below use temperature0.9. Task correctness is a small suite of 6 English fact/code tasks ร 3 seeds; speed is measured separately on a long-form prompt.
| Decoding setting | Returned token/s, median | Task correctness |
|---|---|---|
| block1024 / 1 step / top-k50 | 8,623.29 | 1/18 ยท 5.6% |
| Same block/steps + 32-token-window bigram ban, controlled sampler | 3,771.05 | 0/18 ยท 0% |
| block32 / 16 steps / best-of4 / top-k20 | 17.89 | 13/18 ยท 72.2% |
| Same quality-oriented setting, best-of16 | 13.24 | 13/18 ยท 72.2% |
| Same quality-oriented setting, best-of64 | 4.52 | 13/18 ยท 72.2% |
| Same quality-oriented setting, best-of256 | 1.33 | 13/18 ยท 72.2% |
Read the speed column carefully. Timings are CUDA-synchronized and count actual tokens emitted before EOS. Output lengths differ. Best-of-N timings include candidate generation, rejection sampling, ranking and post-processing. Discarded candidates are not counted as returned tokens. The controlled sampler has additional CPU work and a slightly different candidate distribution; its slowdown is not an isolated estimate of repetition-control cost.
The 8,623 token/s figure is a throughput result with poor correctnessโnot a claim of useful coding output at that speed. High distinct-n-gram rates can simply reflect random, incoherent text.
3 ยท The merge has a known numerical discrepancy
The measured BF16 merge had top-1 agreement of 82.81โ96.88% across four probes, below the fixed 98% per-probe acceptance threshold. Maximum absolute logit deviation reached 2.5996. Saved merged weights reload byte-exactly, but that is a different check from agreement with the unmerged LoRA computation.
See merge_validation.json and the full report.
Repetition controls and best-of-N
uv run --python 3.11 --locked python inference.py \
--model . --preset balanced \
--block 32 --steps 16 --best-of 4 --top-k 20 \
--window 128 --ngram 3 --penalty 1.1 \
--prompt "Write only Python code defining reverse(xs) returning the list in reverse order. No explanation."
This is a custom-control example, not the measured best preset. Stronger penalties and harder bans were not consistently better. Constraints inspect resolved, contiguous left context; with multiple diffusion steps, they do not guarantee a globally repetition-free completed canvas across previously masked gaps.
For the balanced preset, --long continues selected blocks up to
max(1024, block) tokens, respecting EOS. --max-new-tokens controls the throughput
preset. The sampler is fixed at temperature0.9 to match the experiments.
Release contents
model-00001-of-00013.safetensors ... model-00013-of-00013.safetensors
model.safetensors.index.json # complete checkpoint index
config.json + tokenizer files
diffusion.safetensors # learned mask embedding
inference.py # full-checkpoint loader and CLI
diffusion_runtime.py # evaluated reference sampler
selection_runtime.py # window constraints and best-of-N
REPORT.md # consolidated research report
reports/ # detailed reports and raw measurements
release_manifest.json # source/output hashes and replaced tensor names
merge_validation.json # pre/post merge checks
adapter_reference.safetensors # provenance/reproduction only; already merged
licenses/ + license-notice.txt
Do not apply adapter_reference.safetensors again to these already-merged weights.
It is included only to preserve the adaptation provenance.
Provenance and licensing
- Immediate source:
summerAIO/diffusion-lfm2.5-24b-a2b, pinned revision9b7f240522cfdbebc65c955be567c1474c8bf399. - Backbone ancestry:
LiquidAI/LFM2.5-24B-A2B, LFM Open License v1.0. - Additional adaptation data:
iamtarun/python_code_instructions_18k_alpaca, pinned revision7cae181e29701a8663a07a3ea43c8e105b663ba1. - The source checkpoint also declares Alpaca CC-BY-NC-4.0 and ARC CC-BY-SA-4.0 training ancestry. Attribution and notices are retained in
license-notice.txtandlicenses/.
This release does not grant unrestricted commercial rights or replace upstream model/data terms. The additional dataset card did not specify a license in the metadata inspected during preparation; review the relevant source terms.
ๆฅๆฌ่ชใตใใช
ใฉใคใปใณในใฏLiquid AI, Inc.ใฎLFM Open License v1.0ใงใใ ๅๆๅ
จๆใ
LICENSEใซๅๆขฑใใๅนดๅๅบๆบใซ้ขใใๅ็จๅฉ็จๆกไปถใๅ้
ๅธใปๅคๆด่กจ็คบๆกไปถใ
ๅๆใฉใใ้ฉ็จใใพใใ่ฟฝๅ ๅญฆ็ฟใใใผใธใซใใฃใฆๅฅใฉใคใปใณในใธ็ฝฎใๆใใฆใใพใใใ
ๆ็ตLoRAใ็ตฑๅใใใใใซ้ใฟไปใใฎ็ ็ฉถ็จใใงใใฏใใคใณใใงใใ READMEใปๆจ่ซใณใผใใปๅญฆ็ฟใจ้ๅบฆๆข็ดขใฎใฌใใผใใป็ใฎ่ฉไพกใใผใฟใๅๆขฑใใฆใใพใใ
- ่ฟฝๅ ๅญฆ็ฟใงblockๅ tokenๆญฃ่งฃ็ใฏ6.15%โ8.69%ใซๆนๅใใใ ใใใฎๆฐๅคใฏใใผใธๅใฎ่ฉไพกใงใใ
- ้ๅบฆๅชๅ ่จญๅฎใฏ8,623 token/sใงใใใ่ชฒ้กๆญฃ่งฃ็ใฏ1/18ใ้ซๅ่ณชใช็ๆ้ๅบฆใๆๅณใใพใใใ
- ๅ่ณชๅฏใใฎๆซๅฎ่จญๅฎใฏblock32ใป16stepใปtop-k20ใปbest-of4ใ13/18ๆญฃ่งฃใ่ฟๅด้ๅบฆ17.89 token/sใงใใใ
- 16ใ256ๅ่ฃใธๅขใใใฆใๅใ่จญๅฎใฎๆญฃ่งฃ็ใฏไผธใณใพใใใงใใใ
- ใใผใธๅๅพใฎๆฐๅคๅ็ญๆงใฏๆช้ใๅ่ณชใจ1000 token/sใฎไธก็ซใๆช้ใงใใ
่ฉณใใใฏ็ทๅใฌใใผใใๅญฆ็ฟใฌใใผใใ A100ๆข็ดขใฌใใผใใใ่ฆงใใ ใใใ
- Downloads last month
- 62
Model tree for summerAIO/diffusion-lfm2.5-24b-a2b-blocktune
Base model
LiquidAI/LFM2.5-24B-A2B-Base