RWKV (RwaKuv) combines Transformer parallelization (training) with RNN efficiency (inference).
Works with
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionrwkv-architectureExecute the skills CLI command in your project's root directory to begin installation:
Fetches rwkv-architecture from davila7/claude-code-templates and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate rwkv-architecture. Access via /rwkv-architecture in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Create detailed user stories, acceptance criteria, and feature specs
Example
Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios
Reduce spec writing time by 50%, ensure comprehensive coverage
Research competitors, compare features, identify gaps
Example
Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities
Complete competitive research in 2 hours instead of 2 days
Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs
Example
Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale
1
total installs
1
this week
24.2K
GitHub stars
0
upvotes
Run in your terminal
1
installs
1
this week
24.2K
stars
RWKV (RwaKuv) combines Transformer parallelization (training) with RNN efficiency (inference).
Installation:
# Install PyTorch
pip install torch --upgrade --extra-index-url https://download.pytorch.org/whl/cu121
# Install dependencies
pip install pytorch-lightning==1.9.5 deepspeed wandb ninja --upgrade
# Install RWKV
pip install rwkv
Basic usage (GPT mode + RNN mode):
import os
from rwkv.model import RWKV
os.environ["RWKV_JIT_ON"] = '1'
os.environ["RWKV_CUDA_ON"] = '1' # Use CUDA kernel for speed
# Load model
model = RWKV(
model='/path/to/RWKV-4-Pile-1B5-20220903-8040',
strategy='cuda fp16'
)
# GPT mode (parallel processing)
out, state = model.forward([187, 510, 1563, 310, 247], None)
print(out.detach().cpu().numpy()) # Logits
# RNN mode (sequential processing, same result)
out, state = model.forward([187, 510], None) # First 2 tokens
out, state = model.forward([1563], state) # Next token
out, state = model.forward([310, 247], state) # Last tokens
print(out.detach().cpu().numpy()) # Same logits as above!
Efficient token-by-token generation:
from rwkv.model import RWKV
from rwkv.utils import PIPELINE
model = RWKV(model='RWKV-4-Pile-14B-20230313-ctx8192-test1050', strategy='cuda fp16')
pipeline = PIPELINE(model, "20B_tokenizer.json")
# Initial prompt
prompt = "The future of AI is"
state = None
# Generate token by token
for token in prompt:
out, state = pipeline.model.forward(pipeline.encode(token), state)
# Continue generation
for _ in range(100):
out, state = pipeline.model.forward(None, state)
token = pipeline.sample_logits(out)
print(pipeline.decode(token), end='', flush=True)
Key advantage: Constant memory per token (no growing KV cache)
Process million-token sequences:
model = RWKV(model='RWKV-4-Pile-14B', strategy='cuda fp16')
# Process very long document
state = None
long_document = load_document() # e.g., 1M tokens
# Stream through entire document
for chunk in chunks(long_document, chunk_size=1024):
out, state = model.forward(chunk, state)
# State now contains information from entire 1M token document
# Memory usage: O(1) (constant, not O(n)!)
Standard fine-tuning workflow:
# Training script
import pytorch_lightning as pl
from rwkv.model import RWKV
from rwkv.trainer import RWKVTrainer
# Configure model
config = {
'n_layer': 24,
'n_embd': 1024,
'vocab_size': 50277,
'ctx_len': 1024
}
# Setup trainer
trainer = pl.Trainer(
accelerator='gpu',
devices=8,
precision='bf16',
strategy='deepspeed_stage_2',
max_epochs=1
)
# Train
model = RWKV(config)
trainer.fit(model, train_dataloader)
Memory comparison (1M token sequence):
# Transformer (GPT)
# Memory: O(n²) for attention
# KV cache: 1M × hidden_dim × n_layers × 2 (keys + values)
# Example: 1M × 4096 × 24 × 2 = ~400GB (impractical!)
# RWKV
# Memory: O(1) per token
# State: hidden_dim × n_layers = 4096 × 24 = ~400KB
# 1,000,000× more efficient!
Speed comparison (inference):
# Transformer: O(n) per token (quadratic overall)
# First token: 1 computation
# Second token: 2 computations
# ...
# 1000th token: 1000 computations
# RWKV: O(1) per token (linear overall)
# Every token: 1 computation
# 1000th token: 1 computation (same as first!)
Use RWKV when:
Key advantages:
Use alternatives instead:
Issue: Out of memory during training
Use gradient checkpointing and DeepSpeed:
trainer = pl.Trainer(
strategy='deepspeed_stage_3', # Full ZeRO-3
precision='bf16'
)
Issue: Slow inference
Enable CUDA kernel:
os.environ["RWKV_CUDA_ON"] = '1'
Issue: Model not loading
Check model path and strategy:
model = RWKV(
model='/absolute/path/to/model.pth',
strategy='cuda fp16' # Or 'cpu fp32' for CPU
)
Issue: State management in RNN mode
Always pass state between forward calls:
# WRONG: State lost
out1, _ = model.forward(tokens1, None)
out2, _ = model.forward(tokens2, None) # No context from tokens1!
# CORRECT: State preserved
out1, state = model.forward(tokens1, None)
out2, state = model.forward(tokens2, state) # Has context from tokens1
Time-mixing and channel-mixing: See references/architecture-details.md for WKV operation, time-decay mechanism, and receptance gates.
State management: See references/state-management.md for att_x_prev, att_kv, ffn_x_prev states, and numerical stability considerations.
RWKV-7 improvements: See Make data-driven prioritization decisions faster Draft PRDs, status updates, and stakeholder presentations Example Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement Save 3-5 hours/week on communication overhead Prerequisites Time Estimate 30-60 minutes to see productivity improvements Steps Common Pitfalls ✓ Do ✗ Don't 💡 Pro Tips ✓ Use when Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work. ✗ Avoid when Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed. davila7/claude-code-templates mattpocock/skills parcadei/continuous-claude-v3 cursor/plugins ailabs-393/ai-labs-claude-skills ailabs-393/ai-labs-claude-skills I recommend rwkv-architecture for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area. I recommend rwkv-architecture for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area. rwkv-architecture has been reliable in day-to-day use. Documentation quality is above average for community skills. Keeps context tight: rwkv-architecture is the kind of skill you can hand to a new teammate without a long onboarding doc. rwkv-architecture fits our agent workflows well — practical, well scoped, and easy to wire into existing repos. rwkv-architecture fits our agent workflows well — practical, well scoped, and easy to wire into existing repos. Registry listing for rwkv-architecture matched our evaluation — installs cleanly and behaves as described in the markdown. rwkv-architecture is among the better-maintained entries we tried; worth keeping pinned for repeat workflows. Solid pick for teams standardizing on skills: rwkv-architecture is focused, and the summary matches what you get after install. Solid pick for teams standardizing on skills: rwkv-architecture is focused, and the summary matches what you get after install. showing 1-10 of 73✓Stakeholder Communication
✓Implementation Guide
Best Practices
When to Use This
Learning Path
Related Skills
ml-paper-writing
76AI/MLsame repogrill-me
704Productivitysame categorypremortem
218Productivitysame categorydeslop
164Productivitysame categorytravel-planner
145Productivitysame categorynutritional-specialist
141Productivitysame categoryReviews
4.7★★★★★73 reviewsSShikha Mishra★★★★★Dec 28, 2024MMichael Kapoor★★★★★Dec 24, 2024MMichael Jain★★★★★Dec 20, 2024SSofia Bhatia★★★★★Dec 20, 2024IIsabella Bansal★★★★★Dec 20, 2024HHarper Flores★★★★★Dec 16, 2024IIsabella Chawla★★★★★Dec 16, 2024MMichael Khanna★★★★★Dec 16, 2024RRahul Santra★★★★★Nov 19, 2024HHarper Srinivasan★★★★★Nov 15, 20241 / 8Discussion
Comments — not star reviews