Model reference · open weights
Yarn-Llama-2-128k is an open-weight language model from NousResearch. Yarn-Llama-2-7b-128k (BF16) weighs 13.5 GB; the smallest configuration that runs it is 2× RTX 3060 12 GB.
For self-hosting, compare this build's requirements below with the GPU you plan to rent.
Summary of the NousResearch/Yarn-Llama-2-7b-128k model card, 2026-10-01
What it is
| Released by | NousResearch |
|---|---|
| Released | 2023-08-31 |
| VRAM | 13.5 GB for the weights |
What it runs on
| Card | Requests at once | Context max | Memory | |
|---|---|---|---|---|
| 8K each | 32K each | |||
| RTX 3060 12 GB | 11.6 GB | |||
| RTX 4060 Ti 16 GB | 2K | 15.4 GB | ||
| RTX 3090 24 GB | 2 | 17K | 23.4 GB | |
| RTX 4090 24 GB | 2 | 17K | 23.4 GB | |
| RTX 5090 32 GB | 3 | 31K | 31.0 GB | |
| L40S 48 GB | 6 | 1 | 55K | 44.0 GB |
| A100 80 GB | 14 | 3 | 119K | 78.2 GB |
| H100 80 GB | 14 | 3 | 113K | 78.1 GB |
| RTX PRO 6000 Blackwell 96 GB | 17 | 4 | all 128K | 93.8 GB |
| DGX Spark (GB10) 128 GB unified | 21 | 5 | all 128K | 107 GB |
| H200 141 GB | 28 | 7 | all 128K | 138 GB |
| B200 180 GB | 36 | 9 | all 128K | 176 GB |
| 2× RTX 3060 12 GB tensor parallel | 1 | 15K | 11.6 GB a card | |
| 2× RTX 4060 Ti 16 GB tensor parallel | 3 | 29K | 15.4 GB a card | |
| 2× RTX 5090 32 GB tensor parallel | 11 | 2 | 88K | 31.0 GB a card |
| 2× L40S 48 GB tensor parallel | 17 | 4 | all 128K | 44.0 GB a card |
| 4× RTX 4090 24 GB tensor parallel | 18 | 4 | all 128K | 23.4 GB a card |
| 4× RTX 3090 24 GB tensor parallel | 18 | 4 | all 128K | 23.4 GB a card |
| Requests at once | 8K tokens each | 32K tokens each |
|---|---|---|
| 1 | 18.4 GB | 31.3 GB |
| 5 | 35.6 GB | 100.0 GB |
| 8 | 48.5 GB | 152 GB |
| 16 | 82.8 GB | 289 GB |
| 32 | 152 GB | 564 GB |
| 64 | 289 GB | 1114 GB |
One card, with vLLM's small-card settings.
From the model card
Nous-Yarn-Llama-2-13b-128k is a state-of-the-art language model for long context, further pretrained on long context data for 600 steps. This model is the Flash Attention 2 patched version of the original model: https://huggingface.co/conceptofmind/Yarn-Llama-2-13b-128k
Note that this model requires the Flash Attention library in order to function correctly, see the Model Usage section for installation instructions.
Starting from the base Llama 2 models, this model was further pretrained on a subset of the PG19 dataset, allowing it to effectively utilize up to 128k tokens of context.
The authors would like to thank Stability AI, Carper AI, and Eleuther AI for their generous support of significant computing resources that enabled the training of these models and the completion of this research. We would also like to thank Jonathan Tow and Dakota Mahan directly for their help in advising on the use of the Stability AI compute cluster. Additionally, we would like to thank a16z, and PygmalionAI, for providing resources to run evaluations and experiments on the models.
Install FA2 and Rotary Extensions:
pip install flash-attn --no-build-isolation
pip install git+https://github.com/HazyResearch/flash-attention.git#subdirectory=csrc/rotary
There are no specific prompt formats as this is a pretrained base model.
TODO
We plan to continue training when we have more compute and to improve the dataset and/or instruct tune the models in order to improve the long context performance even further.
The model is available for download on HuggingFace.
Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.