rwkv-architecture

rwkv-architecture is a skill for Claude Code from Orchestra-Research/AI-Research-SKILLs. It costs 72 tokens per session (1,990 once invoked), scanned A, a copy of rwkv-architecture, MIT.

A language-model architecture that combines ideas from recurrent neural networks and Transformers. It can train in parallel like a Transformer and run step by step like a recurrent model, without a key-value cache.

In plain words
What is it for?
Use it to load RWKV models, generate text, run them in parallel or sequential mode, and work with models including RWKV-7.
Why use it?
It provides an alternative for efficient text generation and handling long sequences, especially when inference memory matters.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the model-architecture plugin — 5 skills shipped together

Good fit Use it to load RWKV models, generate text, run them in parallel or sequential mode, and work with models including RWKV-7.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/orchestra-research/ai-research-skills/rwkv
About the project

AI Research Skills Library is a collection of reusable instructions that guide AI agents through research and machine-learning engineering tasks, from finding ideas and writing papers to training, evaluation, and deployment. It is for configuring agents such as Claude Code, Codex, and Gemini to perform research workflows.

Orchestra-Research/AI-Research-SKILLs · 12,567 stars · on GitHub · orchestra-research.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Orchestra-Research/AI-Research-SKILLs --skill rwkv
Clone the repo
git clone --depth 1 https://github.com/Orchestra-Research/AI-Research-SKILLs

Made for: Claude Code.

Or install model-architecture, the plugin that ships this one along with the rest of its 5 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rwkv-architecture

README.md
[![agentmods](https://agentmods.dev/badge/skills/orchestra-research/ai-research-skills/rwkv/github.svg)](https://agentmods.dev/skills/orchestra-research/ai-research-skills/rwkv)
Your own site
<a href="https://agentmods.dev/skills/orchestra-research/ai-research-skills/rwkv"><img src="https://agentmods.dev/badge/skills/orchestra-research/ai-research-skills/rwkv/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rwkv-architecture

Your own site · 80×15
<a href="https://agentmods.dev/skills/orchestra-research/ai-research-skills/rwkv"><img src="https://agentmods.dev/badge/skills/orchestra-research/ai-research-skills/rwkv.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 72 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,990 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00072 $0.01990
Opus 5 $0.00036 $0.00995
Sonnet 5 $0.00014 $0.00398
Haiku 4.5 $0.00007 $0.00199

Measured 13d ago against content hash 17fc974b3f3b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

rwkv-architecture scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 13d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to rwkv-architecture — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

01-model-architecture/rwkv/SKILL.md · 261 lines

How it starts

The opening of the file, as written. The whole thing — 261 lines — stays where its author put it; the contents beside it link to each section on GitHub.

RWKV - Receptance Weighted Key Value

Quick start

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!

Common workflows

Workflow 1: Text generation (streaming)

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)

Workflow 2: Long context processing (infinite context)

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)!)

Read the full file on GitHub · 261 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 13d ago First seen · 261 lines · 72 tokens per session scan A 17fc974b3f3b

Subscribe to this mod's changes

rwkv-architecture is a skill published in the GitHub repository Orchestra-Research/AI-Research-SKILLs (12,567 stars, last pushed 2mo ago), licensed MIT. It adds 72 tokens to every session and 1,990 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to rwkv-architecture, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

rwkv-architecture

RNN+Transformer hybrid with O(n) inference. Linear time, infinite context, no KV cache. Train like GPT (parallel), infer like RNN (sequential). Linux Foundation AI project. Production at Windows, Office, NeMo. RWKV-7 (March 2025). Models up to 14B parameters.

ihatesea69/HieuNghi-AI-Skills · 72 tokens

rwkv-architecture

RNN+Transformer hybrid with O(n) inference. Linear time, infinite context, no KV cache. Train like GPT (parallel), infer like RNN (sequential). Linux Foundation AI project. Production at Windows, Office, NeMo. RWKV-7 (March 2025). Models up to 14B parameters.

davila7/claude-code-templates · 72 tokens

rwkv-architecture

RNN+Transformer hybrid with O(n) inference. Linear time, infinite context, no KV cache. Train like GPT (parallel), infer like RNN (sequential). Linux Foundation AI project. Production at Windows, Office, NeMo. RWKV-7 (March 2025). Models up to 14B parameters.

OpenLAIR/dr-claw · 72 tokens

rwkv-architecture

RNN+Transformer hybrid with O(n) inference. Linear time, infinite context, no KV cache. Train like GPT (parallel), infer like RNN (sequential). Linux Foundation AI project. Production at Windows, Office, NeMo. RWKV-7 (March 2025). Models up to 14B parameters.

liortesta/ClawdAgent · 72 tokens

rwkv-architecture

RNN+Transformer hybrid with O(n) inference. Linear time, infinite context, no KV cache. Train like GPT (parallel), infer like RNN (sequential). Linux Foundation AI project. Production at Windows, Office, NeMo. RWKV-7 (March 2025). Models up to 14B parameters.

OpenLAIR/dr-claw-plugin-cc · 72 tokens

mamba-architecture

State-space model with O(n) complexity vs Transformers' O(n²). 5× faster inference, million-token sequences, no KV cache. Selective SSM with hardware-aware design. Mamba-1 (dstate=16) and Mamba-2 (dstate=128, multi-head). Models 130M-2.8B on HuggingFace.

ihatesea69/HieuNghi-AI-Skills · 81 tokens