zai-org / LongWriter-llama3.1-8b

huggingface.co
Total runs: 209
24-hour runs: 0
7-day runs: 0
30-day runs: 3
Model's Last Updated: August 18 2024
text-generation

Introduction of LongWriter-llama3.1-8b

Model Details of LongWriter-llama3.1-8b

LongWriter-llama3.1-8b

🤗 [LongWriter Dataset] • 💻 [Github Repo] • 📃 [LongWriter Paper]

LongWriter-llama3.1-8b is trained based on Meta-Llama-3.1-8B , and is capable of generating 10,000+ words at once.

Environment: transformers>=4.43.0

Please ahere to the prompt template (system prompt is optional): <<SYS>>\n{system prompt}\n<</SYS>>\n\n[INST]{query1}[/INST]{response1}[INST]{query2}[/INST]{response2}...

A simple demo for deployment of the model:

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
tokenizer = AutoTokenizer.from_pretrained("THUDM/LongWriter-llama3.1-8b", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("THUDM/LongWriter-llama3.1-8b", torch_dtype=torch.bfloat16, trust_remote_code=True, device_map="auto")
model = model.eval()
query = "Write a 10000-word China travel guide"
prompt = f"[INST]{query}[/INST]"
input = tokenizer(prompt, truncation=False, return_tensors="pt").to(device)
context_length = input.input_ids.shape[-1]
output = model.generate(
    **input,
    max_new_tokens=32768,
    num_beams=1,
    do_sample=True,
    temperature=0.5,
)[0]
response = tokenizer.decode(output[context_length:], skip_special_tokens=True)
print(response)

You can also deploy the model with vllm , which allows 10,000+ words generation within a minute. Here is an example code:

model = LLM(
    model= "THUDM/LongWriter-llama3.1-8b",
    dtype="auto",
    trust_remote_code=True,
    tensor_parallel_size=1,
    max_model_len=32768,
    gpu_memory_utilization=0.5,
)
tokenizer = model.get_tokenizer()
generation_params = SamplingParams(
    temperature=0.5,
    top_p=0.8,
    top_k=50,
    max_tokens=32768,
    repetition_penalty=1,
)
query = "Write a 10000-word China travel guide"
prompt = f"[INST]{query}[/INST]"
input_ids = tokenizer(prompt, truncation=False, return_tensors="pt").input_ids[0].tolist()
outputs = model.generate(
    sampling_params=generation_params,
    prompt_token_ids=[input_ids],
)
output = outputs[0]
print(output.outputs[0].text)

License: Llama-3.1 License

Citation

If you find our work useful, please consider citing LongWriter:

@article{bai2024longwriter,
  title={LongWriter: Unleashing 10,000+ Word Generation from Long Context LLMs}, 
  author={Yushi Bai and Jiajie Zhang and Xin Lv and Linzhi Zheng and Siqi Zhu and Lei Hou and Yuxiao Dong and Jie Tang and Juanzi Li},
  journal={arXiv preprint arXiv:2408.07055},
  year={2024}
}

Runs of zai-org LongWriter-llama3.1-8b on huggingface.co

209
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
3
30-day runs

More Information About LongWriter-llama3.1-8b huggingface.co Model

More LongWriter-llama3.1-8b license Visit here:

https://choosealicense.com/licenses/llama3.1

LongWriter-llama3.1-8b huggingface.co

LongWriter-llama3.1-8b huggingface.co is an AI model on huggingface.co that provides LongWriter-llama3.1-8b's model effect (), which can be used instantly with this zai-org LongWriter-llama3.1-8b model. huggingface.co supports a free trial of the LongWriter-llama3.1-8b model, and also provides paid use of the LongWriter-llama3.1-8b. Support call LongWriter-llama3.1-8b model through api, including Node.js, Python, http.

LongWriter-llama3.1-8b huggingface.co Url

https://huggingface.co/zai-org/LongWriter-llama3.1-8b

zai-org LongWriter-llama3.1-8b online free

LongWriter-llama3.1-8b huggingface.co is an online trial and call api platform, which integrates LongWriter-llama3.1-8b's modeling effects, including api services, and provides a free online trial of LongWriter-llama3.1-8b, you can try LongWriter-llama3.1-8b online for free by clicking the link below.

zai-org LongWriter-llama3.1-8b online free url in huggingface.co:

https://huggingface.co/zai-org/LongWriter-llama3.1-8b

LongWriter-llama3.1-8b install

LongWriter-llama3.1-8b is an open source model from GitHub that offers a free installation service, and any user can find LongWriter-llama3.1-8b on GitHub to install. At the same time, huggingface.co provides the effect of LongWriter-llama3.1-8b install, users can directly use LongWriter-llama3.1-8b installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

LongWriter-llama3.1-8b install url in huggingface.co:

https://huggingface.co/zai-org/LongWriter-llama3.1-8b

Url of LongWriter-llama3.1-8b

LongWriter-llama3.1-8b huggingface.co Url

Provider of LongWriter-llama3.1-8b huggingface.co

zai-org
ORGANIZATIONS

Other API from zai-org

huggingface.co

Total runs: 5.3M
Run Growth: 4.8M
Growth Rate: 90.17%
Updated:September 07 2026
huggingface.co

Total runs: 1.8M
Run Growth: -176.2K
Growth Rate: -9.66%
Updated:September 11 2026
huggingface.co

Total runs: 1.8M
Run Growth: -104.0K
Growth Rate: -5.84%
Updated:January 29 2026
huggingface.co

Total runs: 1.4M
Run Growth: 1.2M
Growth Rate: 89.02%
Updated:September 04 2026
huggingface.co

Total runs: 710.4K
Run Growth: -454.0K
Growth Rate: -62.10%
Updated:September 01 2026
huggingface.co

Total runs: 499.9K
Run Growth: -808.6K
Growth Rate: -152.17%
Updated:September 01 2026
huggingface.co

Total runs: 461.7K
Run Growth: 18.8K
Growth Rate: 4.07%
Updated:August 04 2024
huggingface.co

Total runs: 323.2K
Run Growth: 210.9K
Growth Rate: 65.25%
Updated:August 11 2025
huggingface.co

Total runs: 306.5K
Run Growth: 238.4K
Growth Rate: 77.79%
Updated:August 11 2026
huggingface.co

Total runs: 229.0K
Run Growth: 104.8K
Growth Rate: 54.87%
Updated:May 13 2026
huggingface.co

Total runs: 116.1K
Run Growth: 30.7K
Growth Rate: 26.44%
Updated:August 11 2025
huggingface.co

Total runs: 102.7K
Run Growth: 20.1K
Growth Rate: 19.60%
Updated:December 10 2025
huggingface.co

Total runs: 102.3K
Run Growth: 37.2K
Growth Rate: 36.35%
Updated:January 29 2026
huggingface.co

Total runs: 70.6K
Run Growth: -16.9K
Growth Rate: -23.93%
Updated:March 13 2025
huggingface.co

Total runs: 67.7K
Run Growth: -11.8K
Growth Rate: -17.43%
Updated:December 05 2024
huggingface.co

Total runs: 40.0K
Run Growth: -10.5K
Growth Rate: -26.27%
Updated:October 25 2025
huggingface.co

Total runs: 32.5K
Run Growth: 28.2K
Growth Rate: 85.74%
Updated:September 04 2026
huggingface.co

Total runs: 28.3K
Run Growth: -349.2K
Growth Rate: -1127.58%
Updated:April 16 2026
huggingface.co

Total runs: 21.0K
Run Growth: -723.4K
Growth Rate: -3437.18%
Updated:April 05 2026
huggingface.co

Total runs: 18.6K
Run Growth: 2.2K
Growth Rate: 12.08%
Updated:November 23 2024
huggingface.co

Total runs: 18.2K
Run Growth: 2.9K
Growth Rate: 15.82%
Updated:September 30 2025
huggingface.co

Total runs: 17.2K
Run Growth: -3.5K
Growth Rate: -20.19%
Updated:November 23 2024
huggingface.co

Total runs: 16.0K
Run Growth: -12.6K
Growth Rate: -78.55%
Updated:April 14 2025
huggingface.co

Total runs: 14.4K
Run Growth: -5.5K
Growth Rate: -38.53%
Updated:December 23 2025
huggingface.co

Total runs: 14.1K
Run Growth: -7.2K
Growth Rate: -51.09%
Updated:March 03 2025
huggingface.co

Total runs: 12.1K
Run Growth: 7.3K
Growth Rate: 60.25%
Updated:December 09 2025
huggingface.co

Total runs: 7.8K
Run Growth: -3.7K
Growth Rate: -47.03%
Updated:April 22 2025
huggingface.co

Total runs: 7.3K
Run Growth: 1.0K
Growth Rate: 13.94%
Updated:October 16 2025
huggingface.co

Total runs: 6.4K
Run Growth: -3.0K
Growth Rate: -47.08%
Updated:January 15 2026
huggingface.co

Total runs: 6.1K
Run Growth: -3.0K
Growth Rate: -49.11%
Updated:March 11 2025
huggingface.co

Total runs: 3.8K
Run Growth: -193
Growth Rate: -5.10%
Updated:December 09 2025
huggingface.co

Total runs: 3.0K
Run Growth: 1.8K
Growth Rate: 60.37%
Updated:August 12 2025
huggingface.co

Total runs: 3.0K
Run Growth: 255
Growth Rate: 8.54%
Updated:August 04 2024
huggingface.co

Total runs: 2.1K
Run Growth: -8.4K
Growth Rate: -395.14%
Updated:January 27 2025
huggingface.co

Total runs: 2.1K
Run Growth: -774
Growth Rate: -37.57%
Updated:October 25 2025
huggingface.co

Total runs: 986
Run Growth: 679
Growth Rate: 68.86%
Updated:October 20 2023
huggingface.co

Total runs: 500
Run Growth: 241
Growth Rate: 48.20%
Updated:December 10 2024
huggingface.co

Total runs: 453
Run Growth: -287
Growth Rate: -63.36%
Updated:August 11 2025
huggingface.co

Total runs: 431
Run Growth: -148
Growth Rate: -34.34%
Updated:March 02 2023
huggingface.co

Total runs: 395
Run Growth: -1.0K
Growth Rate: -256.46%
Updated:January 02 2025
huggingface.co

Total runs: 389
Run Growth: 152
Growth Rate: 39.07%
Updated:October 25 2025
huggingface.co

Total runs: 313
Run Growth: 26
Growth Rate: 8.31%
Updated:January 13 2026
huggingface.co

Total runs: 237
Run Growth: -34
Growth Rate: -14.35%
Updated:November 20 2023
huggingface.co

Total runs: 227
Run Growth: 16
Growth Rate: 7.05%
Updated:October 20 2023