This repository provides the RWKV-7 G1m 1.5B checkpoint in the
flash-linear-attention
(FLA) RWKV7 layout for Transformers-compatible inference.
[!IMPORTANT] This is a base language model, not a safety-aligned instruction-tuned assistant. The included chat template provides a conversational prompt format, but the model may not follow instructions consistently.
About RWKV-7
RWKV-7, also called Goose, is an attention-free recurrent language model. It maintains a constant-size recurrent state instead of an attention KV cache that grows with the preceding sequence. Training remains parallelizable, while recurrent decoding uses constant state size and constant work per generated token with respect to sequence length.
G1m identifies this checkpoint revision. The source checkpoint is available
from BlinkDL/rwkv7-g1.
Model details
| Property | Value |
|---|---|
| Architecture | RWKV-7 G1m |
| Parameters in this FLA checkpoint | 1.527B |
| Layers | 24 |
| Hidden size | 2,048 |
| Heads | 32 × 64 |
| Feed-forward size | 8,192 |
| Vocabulary | RWKV World tokenizer, 65,536 tokens |
| Configured context length | 65,536 tokens |
| Weight dtype | BF16 |
| License | Apache-2.0 |
Run with FLA
Use a CUDA-capable NVIDIA GPU with BF16 support. Install the audited FLA revision with its CUDA dependency extra:
python -m pip install \
"flash-linear-attention[cuda] @ git+https://github.com/fla-org/flash-linear-attention.git@8e84ed4a6727be082c34a3855c60623fd11411e9" \
"transformers>=4.50.2"
Import fla before using the Auto classes so that the RWKV7 implementation is
registered:
import fla
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "shoumenchougou/RWKV7-G1m-1.5B-20261130-FLA"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
).to("cuda").eval()
messages = [
{"role": "user", "content": "Explain recurrent language models in one paragraph."}
]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
fake_cot_mode=True,
)
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
with torch.inference_mode():
output_ids = model.generate(
**inputs,
tokenizer=tokenizer,
top_k=32,
max_new_tokens=128,
do_sample=True,
temperature=0.7,
top_p=0.9,
)
new_tokens = output_ids[0, inputs.input_ids.shape[1]:]
print(tokenizer.decode(new_tokens, skip_special_tokens=True))
Set fake_cot_mode=False to leave Bot\u273f<think open (the default).
The NAS template uses Bot mode by default; set rwkv_prompt_template="assistant"
for the alternate Assistant format. Tool definitions select its function-calling format.
This changes only the prompt format; it does not turn the base model
into an instruction-tuned or safety-aligned assistant.
Compatibility and validation
The toolchain pins FLA commit 8e84ed4a6727be082c34a3855c60623fd11411e9.
Canonical G1m PTH tensor shapes and parameter counts were inspected with mmap;
the converted FLA package is expected to contain 795 tensors.
Converted-weight equality, model loading, and GPU generation must be checked
against the actual release artifacts before publication.
CUDA/Triton generation was not executed in the local CPU-only validation environment. Runtime behavior can depend on the GPU, CUDA, PyTorch, Triton, and FLA versions. Cross-check benchmark or evaluation results against the official RWKV implementation before reporting them.