zai-org / LongWriter-glm4-9b

huggingface.co
Total runs: 539
24-hour runs: 0
7-day runs: -24
30-day runs: 249
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

539
Total runs
0
24-hour runs
-19
3-day runs
-24
7-day runs
249
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: 1.9M
Run Growth: -1.3M
Growth Rate: -66.15%
Updated:September 11 2026
huggingface.co

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

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

Total runs: 1.3M
Run Growth: -706.1K
Growth Rate: -53.41%
Updated:September 01 2026
huggingface.co

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

Total runs: 712.6K
Run Growth: 660.2K
Growth Rate: 98.68%
Updated:September 04 2026
huggingface.co

Total runs: 445.4K
Run Growth: -19.8K
Growth Rate: -4.45%
Updated:August 04 2024
huggingface.co

Total runs: 238.4K
Run Growth: -226.6K
Growth Rate: -90.56%
Updated:April 16 2026
huggingface.co

Total runs: 175.4K
Run Growth: -833.5K
Growth Rate: -410.62%
Updated:April 05 2026
huggingface.co

Total runs: 98.4K
Run Growth: -151.6K
Growth Rate: -156.36%
Updated:August 11 2025
huggingface.co

Total runs: 91.7K
Run Growth: 97
Growth Rate: 0.12%
Updated:May 13 2026
huggingface.co

Total runs: 90.6K
Run Growth: 12.7K
Growth Rate: 15.16%
Updated:January 29 2026
huggingface.co

Total runs: 87.3K
Run Growth: -1.9K
Growth Rate: -2.15%
Updated:March 13 2025
huggingface.co

Total runs: 82.5K
Run Growth: -41.2K
Growth Rate: -50.94%
Updated:August 11 2025
huggingface.co

Total runs: 77.0K
Run Growth: -74.8K
Growth Rate: -96.73%
Updated:December 10 2025
huggingface.co

Total runs: 63.6K
Run Growth: -8.1K
Growth Rate: -10.65%
Updated:December 05 2024
huggingface.co

Total runs: 56.8K
Run Growth: -65.8K
Growth Rate: -111.71%
Updated:August 11 2026
huggingface.co

Total runs: 44.8K
Run Growth: -76.8K
Growth Rate: -170.84%
Updated:October 25 2025
huggingface.co

Total runs: 22.2K
Run Growth: 4.4K
Growth Rate: 20.03%
Updated:November 23 2024
huggingface.co

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

Total runs: 20.1K
Run Growth: -20.2K
Growth Rate: -100.35%
Updated:April 14 2025
huggingface.co

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

Total runs: 15.9K
Run Growth: -2.3K
Growth Rate: -14.12%
Updated:November 23 2024
huggingface.co

Total runs: 14.2K
Run Growth: 13.5K
Growth Rate: 96.55%
Updated:September 04 2026
huggingface.co

Total runs: 13.7K
Run Growth: -14.0K
Growth Rate: -99.89%
Updated:December 23 2025
huggingface.co

Total runs: 13.1K
Run Growth: 2.4K
Growth Rate: 18.60%
Updated:December 09 2025
huggingface.co

Total runs: 9.4K
Run Growth: 207
Growth Rate: 2.11%
Updated:January 15 2026
huggingface.co

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

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

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

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

Total runs: 4.3K
Run Growth: -4.9K
Growth Rate: -126.66%
Updated:December 09 2025
huggingface.co

Total runs: 3.1K
Run Growth: -1.6K
Growth Rate: -56.33%
Updated:October 25 2025
huggingface.co

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

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

Total runs: 678
Run Growth: 282
Growth Rate: 41.53%
Updated:March 02 2023
huggingface.co

Total runs: 576
Run Growth: -56
Growth Rate: -9.54%
Updated:August 11 2025
huggingface.co

Total runs: 439
Run Growth: -1.2K
Growth Rate: -266.28%
Updated:January 02 2025
huggingface.co

Total runs: 427
Run Growth: 242
Growth Rate: 57.76%
Updated:October 20 2023
huggingface.co

Total runs: 383
Run Growth: 86
Growth Rate: 24.86%
Updated:December 10 2024
huggingface.co

Total runs: 326
Run Growth: -403
Growth Rate: -125.55%
Updated:October 25 2025
huggingface.co

Total runs: 297
Run Growth: 130
Growth Rate: 43.33%
Updated:March 02 2023
huggingface.co

Total runs: 279
Run Growth: 68
Growth Rate: 24.46%
Updated:November 20 2023
huggingface.co

Total runs: 263
Run Growth: 111
Growth Rate: 43.02%
Updated:October 20 2023
huggingface.co

Total runs: 249
Run Growth: 105
Growth Rate: 42.17%
Updated:October 20 2023