# RWKV

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/llms/rwkv/RWKV)

RWKV language models.

To use, you should have the ``rwkv`` python package installed, the
pre-trained model file, and the model's config information.

## Signature

```python
RWKV()
```

## Description

**Example:**

.. code-block:: python

from langchain_community.llms import RWKV
model = RWKV(model="./models/rwkv-3b-fp16.bin", strategy="cpu fp32")

# Simplest invocation
response = model.invoke("Once upon a time, ")

## Extends

- `LLM`
- `BaseModel`

## Properties

- `model`
- `tokens_path`
- `strategy`
- `rwkv_verbose`
- `temperature`
- `top_p`
- `penalty_alpha_frequency`
- `penalty_alpha_presence`
- `CHUNK_LEN`
- `max_tokens_per_generation`
- `client`
- `tokenizer`
- `pipeline`
- `model_tokens`
- `model_state`
- `model_config`

## Methods

- [`validate_environment()`](https://reference.langchain.com/python/langchain-community/llms/rwkv/RWKV/validate_environment)
- [`run_rnn()`](https://reference.langchain.com/python/langchain-community/llms/rwkv/RWKV/run_rnn)
- [`rwkv_generate()`](https://reference.langchain.com/python/langchain-community/llms/rwkv/RWKV/rwkv_generate)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/4b280287bd55b99b44db2dd849f02d66c89534d5/libs/community/langchain_community/llms/rwkv.py#L17)