Model reference · open weights

Yarn-Llama-2-128k

LLMs NousResearch Text gen 1 build Licence not stated 3k dl/mo

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.

  • Yarn-Llama-2-128k is a text-generation model developed by NousResearch that extends the Llama 2 architecture to support a context length of 131,072 tokens.
  • The model was further pretrained on a subset of the PG19 dataset to effectively utilize long contexts.
  • It requires the Flash Attention library to function correctly and is available for download on HuggingFace.

Summary of the NousResearch/Yarn-Llama-2-7b-128k model card, 2026-10-01

What it is

Released byNousResearch
Released2023-08-31
VRAM13.5 GB for the weights

What it runs on

Memory and cards for Yarn-Llama-2-7b-128k (BF16)

13.5 GBweights, file size
524 MBcache per 1K tokens
620 MBruntime overhead, at least
131,072 tokenscontext max
CardRequests at onceContext maxMemory
8K each32K each
RTX 3060 12 GB11.6 GB
RTX 4060 Ti 16 GB2K15.4 GB
RTX 3090 24 GB217K23.4 GB
RTX 4090 24 GB217K23.4 GB
RTX 5090 32 GB331K31.0 GB
L40S 48 GB6155K44.0 GB
A100 80 GB143119K78.2 GB
H100 80 GB143113K78.1 GB
RTX PRO 6000 Blackwell 96 GB174all 128K93.8 GB
DGX Spark (GB10) 128 GB unified215all 128K107 GB
H200 141 GB287all 128K138 GB
B200 180 GB369all 128K176 GB
2× RTX 3060 12 GB
tensor parallel
115K11.6 GB a card
2× RTX 4060 Ti 16 GB
tensor parallel
329K15.4 GB a card
2× RTX 5090 32 GB
tensor parallel
11288K31.0 GB a card
2× L40S 48 GB
tensor parallel
174all 128K44.0 GB a card
4× RTX 4090 24 GB
tensor parallel
184all 128K23.4 GB a card
4× RTX 3090 24 GB
tensor parallel
184all 128K23.4 GB a card
Memory needed at each load
Requests at once8K tokens each32K tokens each
118.4 GB31.3 GB
535.6 GB100.0 GB
848.5 GB152 GB
1682.8 GB289 GB
32152 GB564 GB
64289 GB1114 GB

One card, with vLLM's small-card settings.

From the model card

What NousResearch says about Yarn-Llama-2-128k

Read the model card

Preprint (arXiv) GitHub

Model Description

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.

Model Training

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.

Collaborators

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.

Usage and Prompt Format

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.

Benchmark Results

TODO

Future Plans

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.

Model Usage

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.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms