Practical overview
When it fits
Use LongWriter when you need an open model and research resources for extended text generation, or when experimenting with the data, training and evaluation workflows that support it.
Who it is for
- Developers deploying long-context models for extended text generation
- Researchers studying long-form language-model output, training data or evaluation
Documented uses
- Generate lengthy reports, articles, guides or other extended prose with LongWriter models.
- Deploy model inference using the documented Transformers example or the repository's vLLM path.
- Prepare training data and run model-training experiments using LongWriter-6k and the provided training code.
- Construct ultra-long-output data with AgentWrite and assess output quality or length with the supplied benchmarks.
Requirements & limits
The repository is public and specifies the Apache-2.0 license. Deployment is described for a local or server environment; no hosted service access is described.
- The project offers two named LongWriter models, based respectively on GLM-4-9B and Meta-Llama-3.1-8B, as well as LongWriter-Zero.
- Deployment guidance recommends Transformers 4.43.0 or later; the repository also provides a vLLM inference path.
- Training uses LongWriter-6k and code adapted from LongAlign, with FlashAttention 2 required by the instructions.
- AgentWrite requires an API key configured in its files; the evaluation quality script also requires an OpenAI API key and uses GPT-4o as judge.
- LongBench-Write focuses on output quality and length, while LongWrite-Ruler is described as a lightweight stress test of maximum output length.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Load a LongWriter model for text generation
Use the README's Transformers example to request an extended response from LongWriter-glm4-9b.
Before you start
- Python environment with Transformers 4.43.0 or later, as recommended by the repository
- PyTorch and access to the model weights from THUDM/LongWriter-glm4-9b
- A device environment suitable for loading the selected model; the README example uses bfloat16 and device_map="auto"
Steps
Load the tokenizer and causal language model from THUDM/LongWriter-glm4-9b using the documented Transformers classes and trust_remote_code=True.
Set the model to evaluation mode.
Call model.chat with a prompt, an empty history, and generation settings such as the documented max_new_tokens and temperature values.
Print or otherwise use the returned response.
Expected outcome
A generated response from the selected LongWriter model; the README example prompts it to write a 10,000-word China travel guide.
Guide limitations
- The README recommends Transformers 4.43.0 or later; it does not specify hardware requirements or guarantee a particular generation time.
- The model-loading example uses bfloat16, trust_remote_code=True and automatic device mapping.
Compare options for Model inference and serving
These projects document a common task and share a project role. This is a source-based comparison, not an execution benchmark or a guarantee of interchangeability.
| Project | Documented purpose | Platform | Access and requirements |
|---|---|---|---|
| Longwriter | Generate lengthy reports, articles, guides or other extended prose with LongWriter models. | Linux, Self-hosted, Server | The repository is public and specifies the Apache-2.0 license. Deployment is described for a local or server environment; no hosted service access is described. |
| Pulse Of Motion | Estimate a video's physical frame rate from its visual dynamics. | Linux | The repository is public. Its README describes a released checkpoint that downloads from Hugging Face on first inference, with a manual download option. The strongest internal model is not fully released; the README directs interested users to contact the project about access. No license information is provided in the repository evidence. |
| Neural Image Assessment | Train the model using AVA images and rating annotations. | Cloud, Linux, macOS, Windows |
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 13 October 2026
- Original website title
- THUDM/LongWriter · Official homepage title · retained in its source language

