alt.freeweights.minicpm / InfLLM-V2-Long-Sparse-Base
From: openbmb <huggingface.co/openbmb>Newsgroups: alt.freeweights.minicpmSubject:

InfLLM-V2-Long-Sparse-Base

Date: 2026-11-15Commit: ef54e62Signed: 2DC28CC7B26A283B ✓

Model with 8.2B parameters. Safetensors weights, 32.7 GB in all. Published by openbmb under Apache-2.0.

8.2B params32.7GBInfLLM-V2-Long-Sparse-Basesafetensorspermissive
FactsParams8.2BSize32.7 GBFormatssafetensorsTasknot taggedLicenseApache-2.0From sourcepermissive
$ fw get openbmb/InfLLM-V2-Long-Sparse-Base
# manifest sha256 1ba4209b2a7c… · 32.7 GB · 19 files
$ fw verify ./InfLLM-V2-Long-Sparse-Base openbmb/InfLLM-V2-Long-Sparse-Base
From sourceHosted (signed)openbmb/InfLLM-V2-Long-Sparse-BaseLast check: 2026-11-15 04:00 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Works with

Runs with

Ranked by fit to this model (safetensors), then by GitHub stars.

Overview

Size
32.7 GB
Weights
32.7 GB (safetensors)
Parameters
8.2B
Formats
safetensors
Task
not tagged
License
Apache-2.0 (permissive)
Files
19, each with a sha256
Publisher
openbmb
Added
2026-11-15
Section
alt.freeweights.minicpm
Lineage

Original release from the publisher.

Where these bytes come from
Publisher at the pinned commitโ†’You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-15 04:00 UTCpassed

Model card

From the publisher at commit ef54e62. Shown as plain text with links; images open at the publisher.

InfLLM-V2-Long-Sparse-Base#

Project Links: [Paper] [InfLLM-V2 Models] [CUDA Kernel Code]


๐Ÿš€ Model Description#

InfLLM-V2-Long-Sparse-Base is the final, long-context capable model in the InfLLM-V2 series, featuring a native sparse attention mechanism.

This model is the result of continued training on the InfLLM-V2-Short-Dense-Base model using just 5B tokens of high-quality long-text data from the InfLLM-V2-data-5B dataset.

Its core feature is the InfLLM-V2 architecture, which allows it to seamlessly switch between high-performance dense attention for short texts and highly efficient sparse attention for long texts. This enables the model to process extremely long sequences with significant end-to-end acceleration while preserving performance on standard tasks.

๐Ÿ“Œ The Training Journey#

This model is the final product of the transparent and reproducible InfLLM-V2 training workflow:

  • Step 1: Start from the base model.
  • Step 2: Continue training on long-text data.
  • Step 3: Get the final long-context model.
    • โžก๏ธ The result is InfLLM-V2-Long-Sparse-Base (This Model), which has unlocked powerful long-context capabilities.

๐Ÿ’ป Usage#

InfLLM-V2-Long-Sparse-Base supports both dense attention inference and sparse attention inference modes, where vLLM and SGLang currently only support dense inference mode. If you want to use sparse inference mode, please use Huggingface Transformers and CPM.cu.

  • Dense attention inference: vLLM, SGLang, Huggingface Transformers
  • Sparse attention inference: Huggingface Transformers, CPM.cu

To facilitate researches in sparse attention, we provide InfLLM-V2 Kernels and CPM.cu.

Inference with Transformers#

InfLLM-V2-Long-Sparse-Base requires transformers>=4.56.

  • Inference with Dense Attention
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
torch.manual_seed(0)
path = 'openbmb/InfLLM-V2-Long-Sparse-Base'
device = "cuda"
tokenizer = AutoTokenizer.from_pretrained(path)
model = AutoModelForCausalLM.from_pretrained(path, torch_dtype=torch.bfloat16, device_map=device, trust_remote_code=True)
# User can directly use the chat interface
# responds, history = model.chat(tokenizer, "Write an article about Artificial Intelligence.", temperature=0.7, top_p=0.7)
# print(responds)
# User can also use the generate interface
messages = [
    {"role": "user", "content": "Write an article about Artificial Intelligence."},
]
prompt_text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True,
)
model_inputs = tokenizer([prompt_text], return_tensors="pt").to(device)
model_outputs = model.generate(
    **model_inputs,
    max_new_tokens=32768,
    top_p=0.95,
    temperature=0.6
)
output_token_ids = [
    model_outputs[i][len(model_inputs[i]):] for i in range(len(model_inputs['input_ids']))
]
responses = tokenizer.batch_decode(output_token_ids, skip_special_tokens=True)[0]
print(responses)
  • Inference with Sparse Attention

InfLLM-V2-Long-Sparse-Base supports InfLLM v2, a sparse attention mechanism designed for efficient long-sequence inference. It requires the infllmv2_cuda_impl library.

You can install it by running the following command:

git clone -b feature_infer https://github.com/OpenBMB/infllmv2_cuda_impl.git
cd infllmv2_cuda_impl
git submodule update --init --recursive
pip install -e . # or python setup.py install 

To enable InfLLM v2, you need to add the sparse_config field in config.json:

{
    ...,
    "sparse_config": {
        "kernel_size": 32,
        "kernel_stride": 16,
        "init_blocks": 1,
        "block_size": 64,
        "window_size": 2048,
        "topk": 64,
        "use_nope": false,
        "dense_len": 8192
    }
}

These parameters control the behavior of InfLLM v2:

  • kernel_size (default: 32): The size of semantic kernels.
  • kernel_stride (default: 16): The stride between adjacent kernels.
  • init_blocks (default: 1): The number of initial blocks that every query token attends to. This ensures attention to the beginning of the sequence.
  • block_size (default: 64): The block size for key-value blocks.
  • window_size (default: 2048): The size of the local sliding window.
  • topk (default: 64): The specifies that each token computes attention with only the top-k most relevant key-value blocks.
  • use_nope (default: false): Whether to use the NOPE technique in block selection for improved performance.
  • dense_len (default: 8192): Since Sparse Attention offers limited benefits for short sequences, the model can use standard (dense) attention for shorter texts. The model will use dense attention for sequences with a token length below dense_len and switch to sparse attention for sequences exceeding this length. Set this to -1 to always use sparse attention regardless of sequence length.

Citation#

If you use our work in your research, please cite our paper:

@misc{zhao2025infllmv2densesparseswitchableattention,
      title={InfLLM-V2: Dense-Sparse Switchable Attention for Seamless Short-to-Long Adaptation}, 
      author={Weilin Zhao and Zihan Zhou and Zhou Su and Chaojun Xiao and Yuxuan Li and Yanghao Li and Yudi Zhang and Weilun Zhao and Zhen Li and Yuxiang Huang and Ao Sun and Xu Han and Zhiyuan Liu},
      year={2025},
      eprint={2509.24663},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2509.24663}, 
}

Files

19 files ยท 32.7 GBWeights 32.7 GB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 19 files with their sha256
FileSizesha256
.gitattributes1.52 KB11ad7efa24975ee4b0c3c3a38ed18737f0658a5f75a0a96787b576a78a023361
README.md6.34 KB851939fbc1b0b8bb7732de7760d913c2526707ffad87135068aeb3977d4375f7
added_tokens.json216 B4760fcbf90bc193f33827ffe02f2e7ba1af1ec43644cc02ac22fdd611f6cca15
config.json4.05 KBe8f98b9ca76597238187a6ad4ef5e2fba75e1d2fbe4a18ee7cc5f0f3999beac8
configuration_minicpm.py9.66 KBf9014f14f71a175a53d48e862ebabb6007a09a2b7dd61eb6a00ddb0cee0ef9a5
generation_config.json182 B83595cf3b045d7ed16593ae399b0e3c13fe45640a4bec3a1cd371b057a6a98b7
model-00001-of-00007.safetensors5.00 GB885bf5ac59e4f6b571e06668403a95548d087d7ec2b3f7a5978b198738ccb522
model-00002-of-00007.safetensors4.88 GB795bec31b9bc26999d638c771d7ac197c02cb24318c2a686fb3d211dbc2e5d4b
model-00003-of-00007.safetensors4.74 GB3207e40538649aa1abbe1530b471b9e795d6d89a77668c24d73689f5d47d61fb
model-00004-of-00007.safetensors4.74 GB0642689abd2e6b02b62c947b7c39a284deb81bfb97c0c5cd541d91776ef1f2f5
model-00005-of-00007.safetensors4.74 GB5b628a5a9ac57fd4756e44096762726b13a1c2cc12ee9e2c22642f7885273f8b
model-00006-of-00007.safetensors4.74 GB402559ec2945bec228a0fc82d17ef2c05e5fbc4ccfa888025b821289de06a30b
model-00007-of-00007.safetensors3.90 GB469ee0c9e193684de98506b0b4401fc2aa585b885f2cc7fb8398a4e6eeaf6d73
model.safetensors.index.json24.0 KB3d7e05ff653f6d59258c3562f4c66c001ed0bc8b2ce0a6833e02f98564fc27e3
modeling_minicpm.py108 KB6c511c8b927631c10cdfc049fff5db5e4d557aebba9ff91e56ed30777dfc5a29
special_tokens_map.json630 B9ec9d6f07cb0e436598bf29b4d97c6355434c08fdbe9c264e6926907f3751c7e
tokenizer.json6.70 MBadf7208af154a5ca065d2eda4e5419e02aac58c2c00627874748b75ec6769094
tokenizer.model1.18 MBbb74d51116831c3bf65db812c553f94ab0c88dcf97a5bbb37e3504f6d359c530
tokenizer_config.json2.94 KB754ae39e7407a1f34c4fd76b37d8f46dae72ba14e52f01899ff9cac4254bf94e
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
ef54e627b7 pinned now2026-11-15 04:00 UTC19 files ยท 32.7 GB

Use it

$ fw get openbmb/InfLLM-V2-Long-Sparse-Base
# manifest sha256 1ba4209b2a7c… · 32.7 GB · 19 files
$ fw verify ./InfLLM-V2-Long-Sparse-Base openbmb/InfLLM-V2-Long-Sparse-Base
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/openbmb/InfLLM-V2-Long-Sparse-Base.json --dir ./InfLLM-V2-Long-Sparse-Base $ python3 fw.py verify ./InfLLM-V2-Long-Sparse-Base ./openbmb__InfLLM-V2-Long-Sparse-Base.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download openbmb/InfLLM-V2-Long-Sparse-Base --revision ef54e627b7f97973fb70372eb73cce6c639cb7d1 --local-dir ./InfLLM-V2-Long-Sparse-Base

License

Name
Apache License 2.0
Id
Apache-2.0
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-15
Text in
README.md
Text sha256
851939fbc1b0b8bb7732de7760d913c2526707ffad87135068aeb3977d4375f7
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: openbmb <huggingface.co/openbmb>Newsgroups: alt.freeweights.minicpmSubject: InfLLM-V2-Long-Sparse-BaseDate: 2026-11-15Commit: ef54e62Signed: 2DC28CC7B26A283B ✓
Upstream
openbmb/InfLLM-V2-Long-Sparse-Base
Pinned commit
ef54e627b7f97973fb70372eb73cce6c639cb7d1
Manifest
InfLLM-V2-Long-Sparse-Base.json ยท .minisig
Manifest sha256
1ba4209b2a7ccdfed041340bcc7cc2ff83046400c4b930bee838fa62b26d9f3e
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 04:00 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/openbmb/InfLLM-V2-Long-Sparse-Base.json $ curl -O https://freeweights.allternit.com/manifests/openbmb/InfLLM-V2-Long-Sparse-Base.json.minisig $ minisign -Vm InfLLM-V2-Long-Sparse-Base.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

No related models in this catalog.Nothing here lists this model as its parent, and it names no parent.
Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download openbmb/InfLLM-V2-Long-Sparse-Base
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. InfLLM-V2-Long-Sparse-Base.json. Provenance. Takedown history: none.
From: openbmb <huggingface.co/openbmb>Subject: AgentCPM-Explore-GGUF
From: openbmb <huggingface.co/openbmb>Subject: AgentCPM-Report
From: openbmb <huggingface.co/openbmb>Subject: AgentCPM-Report-GGUF
From: openbmb <huggingface.co/openbmb>Subject: BitCPM-CANN-0.5B-gguf
From: openbmb <huggingface.co/openbmb>Subject: BitCPM-CANN-1B-gguf
From: openbmb <huggingface.co/openbmb>Subject: BitCPM-CANN-3B-gguf