How to use from
vLLM
Install from pip and serve model
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "wangyue114514/rwkv7-g1g-2.9b-hf"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
	-H "Content-Type: application/json" \
	--data '{
		"model": "wangyue114514/rwkv7-g1g-2.9b-hf",
		"messages": [
			{
				"role": "user",
				"content": "What is the capital of France?"
			}
		]
	}'
Use Docker
docker model run hf.co/wangyue114514/rwkv7-g1g-2.9b-hf
Quick Links

RWKV-7 G1G 2.9B โ€” Hugging Face reference model

This repository is a self-contained Hugging Face conversion of rwkv7-g1g-2.9b-20260526-ctx8192.pth. Release v0.9.0 contains the complete readable, pure-PyTorch reference implementation next to the weights. Normal inference does not require rwkv7-hf, FLA, a custom CUDA wheel, JIT, or CUDA Graphs.

Install and use

python -m pip install torch transformers
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "wangyue114514/rwkv7-g1g-2.9b-hf"
revision = "v0.9.0"
tokenizer = AutoTokenizer.from_pretrained(
    model_id, revision=revision, trust_remote_code=True
)
model = AutoModelForCausalLM.from_pretrained(
    model_id, revision=revision, trust_remote_code=True, torch_dtype="auto"
).eval()
device = "cuda" if torch.cuda.is_available() else "cpu"
model = model.to(device)
inputs = tokenizer("The future of recurrent language models is", return_tensors="pt")
inputs = {key: value.to(device) for key, value in inputs.items()}
with torch.inference_mode():
    tokens = model.generate(**inputs, max_new_tokens=32)
print(tokenizer.decode(tokens[0], skip_special_tokens=True))

trust_remote_code=True loads the checked-in files configuration_rwkv7.py, cache_rwkv7.py, ops_rwkv7.py, modeling_rwkv7.py, and tokenization_rwkv7.py. The recurrent state has the canonical [batch, heads, key, value] layout. Cache lifecycle, loss, padding, generation, gradients, and the layer structure are visible in those files.

Fine-tuning and evaluation

The model follows the standard AutoModelForCausalLM contract and supports Trainer, Accelerate, PEFT LoRA, TRL SFT/DPO/GRPO, and lm_eval through the ordinary Transformers path. Set model.config.use_cache = False during training. Reproducible examples and evaluation manifests are in 123123213weqw/hf-adapter.

Reference versus optimized execution

The v0.9.0 model code intentionally favors readability and compatibility. It is the correctness/reference path, not a peak-throughput benchmark backend. Optional CUDA Graph and Triton work is maintained separately on perf/optional-native-backend-v0.10; older CUDA/JIT/quantization and KV-v2 experiments remain on perf/native-kernels-v0.8. Neither branch changes this model repository's public HF contract.

Model and provenance

  • Architecture: RWKV-7 recurrent causal language model
  • Checkpoint family: G1G
  • Parameters: 2,947,735,040
  • Layers: 32
  • Hidden size: 2560
  • Vocabulary size: 65536
  • Stored weight dtype: float16
  • Original checkpoint SHA256: 3d118ed77fe94e63e6fc0a6afd5a4fac49fe70da4e3d9d91b628951bb55dd798
  • Reference source revision: b8438cab0dc7d11238942efca4c05135d53fcaf8
  • Release tag: v0.9.0

conversion_manifest.json retains the immutable original conversion and weight provenance. v0.9.0 changes the checked-in runtime code and config only; the safetensors bytes are not rewritten or re-uploaded.

License

Apache-2.0. See LICENSE.

Downloads last month
486
Safetensors
Model size
3B params
Tensor type
F16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Collection including wangyue114514/rwkv7-g1g-2.9b-hf