zai-org / LongWriter-glm4-9b

huggingface.co
Total runs: 525
24-hour runs: 0
7-day runs: -38
30-day runs: 217
Model's Last Updated: October 02 2024
text-generation

Introduction of LongWriter-glm4-9b

Model Details of LongWriter-glm4-9b

LongWriter-glm4-9b

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

LongWriter-glm4-9b is trained based on glm-4-9b , and is capable of generating 10,000+ words at once.

Environment: Same environment requirement as glm-4-9b-chat ( transformers>=4.43.0 ).

A simple demo for deployment of the model:

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
tokenizer = AutoTokenizer.from_pretrained("THUDM/LongWriter-glm4-9b", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("THUDM/LongWriter-glm4-9b", torch_dtype=torch.bfloat16, trust_remote_code=True, device_map="auto")
model = model.eval()
query = "Write a 10000-word China travel guide"
response, history = model.chat(tokenizer, query, history=[], max_new_tokens=32768, temperature=0.5)
print(response)

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

from vllm import LLM, SamplingParams
model = LLM(
    model= "THUDM/LongWriter-glm4-9b",
    dtype="auto",
    trust_remote_code=True,
    tensor_parallel_size=1,
    max_model_len=32768,
    gpu_memory_utilization=1,
)
tokenizer = model.get_tokenizer()
stop_token_ids = [tokenizer.eos_token_id, tokenizer.get_command("<|user|>"), tokenizer.get_command("<|observation|>")]
generation_params = SamplingParams(
    temperature=0.5,
    top_p=0.8,
    top_k=50,
    max_tokens=32768,
    repetition_penalty=1,
    stop_token_ids=stop_token_ids
)
query = "Write a 10000-word China travel guide"
input_ids = tokenizer.build_chat_input(query, history=[], role='user').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: glm-4-9b 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-glm4-9b on huggingface.co

525
Total runs
0
24-hour runs
5
3-day runs
-38
7-day runs
217
30-day runs

More Information About LongWriter-glm4-9b huggingface.co Model

LongWriter-glm4-9b huggingface.co

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

LongWriter-glm4-9b huggingface.co Url

https://huggingface.co/zai-org/LongWriter-glm4-9b

zai-org LongWriter-glm4-9b online free

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

zai-org LongWriter-glm4-9b online free url in huggingface.co:

https://huggingface.co/zai-org/LongWriter-glm4-9b

LongWriter-glm4-9b install

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

LongWriter-glm4-9b install url in huggingface.co:

https://huggingface.co/zai-org/LongWriter-glm4-9b

Url of LongWriter-glm4-9b

LongWriter-glm4-9b huggingface.co Url

Provider of LongWriter-glm4-9b huggingface.co

zai-org
ORGANIZATIONS

Other API from zai-org

huggingface.co

Total runs: 2.7M
Run Growth: 2.4M
Growth Rate: 100.00%
Updated:September 07 2026
huggingface.co

Total runs: 1.9M
Run Growth: -130.1K
Growth Rate: -6.95%
Updated:January 29 2026
huggingface.co

Total runs: 1.7M
Run Growth: -1.2M
Growth Rate: -67.31%
Updated:September 11 2026
huggingface.co

Total runs: 1.0M
Run Growth: -538.6K
Growth Rate: -41.82%
Updated:September 01 2026
huggingface.co

Total runs: 989.4K
Run Growth: -1.8M
Growth Rate: -179.77%
Updated:September 01 2026
huggingface.co

Total runs: 888.1K
Run Growth: 829.6K
Growth Rate: 98.95%
Updated:September 04 2026
huggingface.co

Total runs: 455.8K
Run Growth: -6.2K
Growth Rate: -1.35%
Updated:August 04 2024
huggingface.co

Total runs: 186.7K
Run Growth: -264.1K
Growth Rate: -131.82%
Updated:April 16 2026
huggingface.co

Total runs: 104.6K
Run Growth: 31.2K
Growth Rate: 30.81%
Updated:January 29 2026
huggingface.co

Total runs: 102.9K
Run Growth: -120.2K
Growth Rate: -115.49%
Updated:August 11 2025
huggingface.co

Total runs: 94.9K
Run Growth: -895.1K
Growth Rate: -836.90%
Updated:April 05 2026
huggingface.co

Total runs: 92.3K
Run Growth: -27.8K
Growth Rate: -30.74%
Updated:August 11 2025
huggingface.co

Total runs: 88.8K
Run Growth: 11.6K
Growth Rate: 12.84%
Updated:May 13 2026
huggingface.co

Total runs: 80.2K
Run Growth: -57.5K
Growth Rate: -73.47%
Updated:December 10 2025
huggingface.co

Total runs: 67.8K
Run Growth: -16.6K
Growth Rate: -24.53%
Updated:December 05 2024
huggingface.co

Total runs: 56.5K
Run Growth: -70.9K
Growth Rate: -129.48%
Updated:August 11 2026
huggingface.co

Total runs: 46.2K
Run Growth: -61.5K
Growth Rate: -134.00%
Updated:October 25 2025
huggingface.co

Total runs: 20.4K
Run Growth: -49.8K
Growth Rate: -244.24%
Updated:March 03 2025
huggingface.co

Total runs: 19.0K
Run Growth: -18.5K
Growth Rate: -96.68%
Updated:April 14 2025
huggingface.co

Total runs: 19.0K
Run Growth: -9.7K
Growth Rate: -50.22%
Updated:September 30 2025
huggingface.co

Total runs: 18.8K
Run Growth: 3.7K
Growth Rate: 19.49%
Updated:November 23 2024
huggingface.co

Total runs: 15.8K
Run Growth: 15.0K
Growth Rate: 96.89%
Updated:September 04 2026
huggingface.co

Total runs: 14.8K
Run Growth: -3.7K
Growth Rate: -24.91%
Updated:November 23 2024
huggingface.co

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

Total runs: 13.2K
Run Growth: 2.5K
Growth Rate: 19.25%
Updated:December 09 2025
huggingface.co

Total runs: 9.4K
Run Growth: -504
Growth Rate: -5.29%
Updated:January 15 2026
huggingface.co

Total runs: 7.9K
Run Growth: -1.9K
Growth Rate: -23.39%
Updated:October 16 2025
huggingface.co

Total runs: 7.0K
Run Growth: -1.4K
Growth Rate: -19.98%
Updated:March 11 2025
huggingface.co

Total runs: 6.8K
Run Growth: -7.0K
Growth Rate: -101.87%
Updated:April 22 2025
huggingface.co

Total runs: 4.6K
Run Growth: -4.0K
Growth Rate: -89.11%
Updated:December 09 2025
huggingface.co

Total runs: 3.2K
Run Growth: -1.0K
Growth Rate: -32.63%
Updated:October 25 2025
huggingface.co

Total runs: 3.0K
Run Growth: -5.9K
Growth Rate: -159.64%
Updated:January 27 2025
huggingface.co

Total runs: 2.9K
Run Growth: 813
Growth Rate: 28.53%
Updated:August 04 2024
huggingface.co

Total runs: 1.7K
Run Growth: 214
Growth Rate: 13.20%
Updated:August 12 2025
huggingface.co

Total runs: 677
Run Growth: 277
Growth Rate: 41.10%
Updated:March 02 2023
huggingface.co

Total runs: 488
Run Growth: 303
Growth Rate: 62.09%
Updated:October 20 2023
huggingface.co

Total runs: 471
Run Growth: -244
Growth Rate: -51.69%
Updated:August 11 2025
huggingface.co

Total runs: 414
Run Growth: -1.1K
Growth Rate: -259.41%
Updated:January 02 2025
huggingface.co

Total runs: 390
Run Growth: 138
Growth Rate: 35.38%
Updated:December 10 2024
huggingface.co

Total runs: 358
Run Growth: -375
Growth Rate: -105.34%
Updated:October 25 2025
huggingface.co

Total runs: 273
Run Growth: 52
Growth Rate: 19.05%
Updated:November 20 2023
huggingface.co

Total runs: 262
Run Growth: 111
Growth Rate: 42.37%
Updated:October 20 2023
huggingface.co

Total runs: 253
Run Growth: 104
Growth Rate: 41.11%
Updated:October 20 2023