Instructions to use fla-hub/RWKV7-G1j-1.5B-20260831 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use fla-hub/RWKV7-G1j-1.5B-20260831 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="fla-hub/RWKV7-G1j-1.5B-20260831") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("fla-hub/RWKV7-G1j-1.5B-20260831", device_map="auto") - RWKV
How to use fla-hub/RWKV7-G1j-1.5B-20260831 with RWKV:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use fla-hub/RWKV7-G1j-1.5B-20260831 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "fla-hub/RWKV7-G1j-1.5B-20260831" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fla-hub/RWKV7-G1j-1.5B-20260831", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/fla-hub/RWKV7-G1j-1.5B-20260831
- SGLang
How to use fla-hub/RWKV7-G1j-1.5B-20260831 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 "fla-hub/RWKV7-G1j-1.5B-20260831" \ --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": "fla-hub/RWKV7-G1j-1.5B-20260831", "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 "fla-hub/RWKV7-G1j-1.5B-20260831" \ --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": "fla-hub/RWKV7-G1j-1.5B-20260831", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use fla-hub/RWKV7-G1j-1.5B-20260831 with Docker Model Runner:
docker model run hf.co/fla-hub/RWKV7-G1j-1.5B-20260831
This repository provides the RWKV-7 G1j 1.5B checkpoint in the
flash-linear-attention
(FLA) RWKV7 layout for Transformers-compatible inference.
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.
G1j identifies this checkpoint revision. The source checkpoint is available
from BlinkDL/rwkv7-g1.
Model details
| Property | Value |
|---|---|
| Architecture | RWKV-7 G1j |
| 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 | 16,384 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, PreTrainedConfig
model_id = "fla-hub/RWKV7-G1j-1.5B-20260831"
tokenizer = AutoTokenizer.from_pretrained(
model_id,
config=PreTrainedConfig(),
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,
thinking=False,
)
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
with torch.inference_mode():
output_ids = model.generate(
**inputs,
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 thinking=True when applying the chat template to leave an open thinking
prefix. This changes only the prompt format; it does not turn the base model
into an instruction-tuned or safety-aligned assistant.
Tokenizer
This repository bundles tokenization_rwkv7.py, an exact linear-time trie
implementation of the RWKV World tokenizer. It reads the self-contained
tokenizer.json, preserves canonical token IDs, and avoids the poor scaling of
the generic Unigram tokenizer on long repetitive inputs. Loading it requires
trust_remote_code=True, as shown above.
Compatibility and validation
The package was checked with FLA commit
8e84ed4a6727be082c34a3855c60623fd11411e9 and Transformers 4.50.2. Its
configuration, tokenizer, chat template, BF16 weights, and Transformers model
loading were validated locally. All model weights load into
RWKV7ForCausalLM without missing, unexpected, or mismatched keys.
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.
References
- Downloads last month
- 696
Model tree for fla-hub/RWKV7-G1j-1.5B-20260831
Base model
BlinkDL/rwkv7-g1
Install from pip and serve model
# Install vLLM from pip: pip install vllm# Start the vLLM server: vllm serve "fla-hub/RWKV7-G1j-1.5B-20260831"# Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fla-hub/RWKV7-G1j-1.5B-20260831", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'