opensi·si

Flint is Recursive's mixture-of-experts language model. Compared to a standard SwiGLU mixture-of-experts transformer

Flint

This model was contributed to Hugging Face Transformers on 2026-10-21.

Flint

Flint is Recursive's mixture-of-experts language model. Compared to a standard SwiGLU mixture-of-experts transformer such as Qwen3-MoE, it has:

  • Hybrid attention. Most layers use sliding-window attention over the current token and the 512 tokens before it, with rotary position embeddings. The remaining layers, listed in layer_types, use full attention without positional encoding.
  • Attention sinks. Every attention head has a learned sink logit that enters the softmax normalization without attending to any value, as in GPT-OSS. Queries and keys are RMS-normalized per head.
  • Sigmoid routing and a shared expert. Each sparse layer routes a token to 6 of 256 experts by sigmoid score, renormalizes the selected scores, and adds an ungated shared expert. The first two layers are dense.

Usage

Pipeline

from transformers import pipeline

pipe = pipeline("text-generation", model="RecursiveSI/flint", dtype="auto", device_map="auto")
messages = [{"role": "user", "content": "Write a haiku about autumn leaves."}]
print(pipe(messages, max_new_tokens=1024)[0]["generated_text"][-1]["content"])

AutoModel

from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "RecursiveSI/flint"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype="auto", device_map="auto")

messages = [{"role": "user", "content": "Write a haiku about autumn leaves."}]
inputs = tokenizer.apply_chat_template(
    messages, add_generation_prompt=True, return_tensors="pt", return_dict=True
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=1024)
print(tokenizer.decode(outputs[0, inputs["input_ids"].shape[-1] :], skip_special_tokens=True))

Notes

  • Attention backends. SDPA cannot apply attention sinks, so Flint defaults to the eager implementation, which computes attention scores in float32. For long inputs, use a sink-aware FlashAttention kernel: kernels-community/vllm-flash-attn3 on Hopper or flash_attention_4 on Blackwell. Requesting flash_attention_2 selects one of these instead.
  • Checkpoint format. Checkpoints store one tensor per expert and the sinks as self_attn.softmax_offset. They are fused and renamed on load, and saved back in the same format.

FlintConfig

[[autodoc]] FlintConfig

FlintModel

[[autodoc]] FlintModel - forward

FlintForCausalLM

[[autodoc]] FlintForCausalLM - forward

Source and license

Source: Transformers documentation, adapted for this site. Licensing and attribution follow the terms of the upstream project.