Downloads · 30 days
23
9% of all-time downloads
aifeifei798/QiMing-LongWriter-20B-MXFP4
QiMing-LongWriter-20B-MXFP4 is a text generation model from aifeifei798. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
Downloads · 30 days
23
9% of all-time downloads
All-time downloads
257
Public
Parameters
1.8B
13.8 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors13.8 GB · 100%
How the weights are stored.
U819.7B · 92%
From the Hugging Face model README
"Logic is the soul of a model, for it defines:
If a model pursues nothing but sheer scale or computational power, ignoring the depth and breadth of its logic, it risks becoming a "paper tiger"—imposing on the surface, yet hollow at its core. Conversely, a model built upon elegant logic, even with fewer parameters, can unleash its true vitality in our complex world."
https://huggingface.co/mradermacher/QiMing-LongWriter-20B-MXFP4-GGUF
https://huggingface.co/mradermacher/QiMing-LongWriter-20B-MXFP4-i1-GGUF
QiMing-LongWriter-20B-MXFP4 is more than just a language model; it is a "Narrative Engine," architected from the ground up to understand and execute the logic of professional creative writing.
This model is built on a 20B parameter Mixture-of-Experts (MoE) architecture and has been quantized to MXFP4 format, enabling high-performance inference on consumer-grade hardware. Its most striking feature is a staggering 131,072-token theoretical context length, made possible by YaRN Rope Scaling, which unlocks the potential for epic-scale long-form storytelling.
However, its true power is revealed in its exceptional performance demonstrated within a practical 8,192-token window. This proves that its remarkable capabilities stem not from brute-force memory, but from its unique training methodology: "Process-Oriented Overfitting," a paradigm that teaches the model the 'how' of creation, not just the 'what'.
QiMing-LongWriter is a model built for the future, and its performance today is merely a glimpse of its vast potential.
The core innovation of this model lies in its unique training paradigm. Instead of the traditional approach of learning from the "results" of massive text corpora, we focused on teaching the model the "process" of creation.
We constructed a structured creation framework named the "Writer's Long-form Logic," which deconstructs the professional writing process into logical modules (e.g., Genesis Core, Architect Agent, Dramatist Agent). Using a method we term "Process-Oriented Overfitting," we guided the model to deeply learn and internalize this creative workflow, making it an instinct.
The result is a model that instinctively thinks in terms of structure when faced with a creative task. This explains why it maintains long-range logical coherence even within a limited context window—its intelligence stems more from its intrinsic "methodology" than from a vast "memory."
QiMing-LongWriter-20B-MXFP4 model run within 16GB of memory. All evals were performed with the same MXFP4 quantization.You can use QiMing-LongWriter-20B-MXFP4 with Transformers. If you use the Transformers chat template, it will automatically apply the harmony response format. If you use model.generate directly, you need to apply the harmony format manually using the chat template or use our openai-harmony package.
To get started, install the necessary dependencies to setup your environment:
pip install -U transformers kernels torch
Once, setup you can proceed to run the model by running the snippet below:
from transformers import pipeline
import torch
model_id = "aifeifei798/QiMing-LongWriter-20B-MXFP4"
pipe = pipeline(
"text-generation",
model=model_id,
torch_dtype="auto",
device_map="auto",
)
prompt = """
Outline the core plot for a tomb-raiding adventure story:
Protagonist: A seasoned but greedy tomb raider.
Setting: A cursed ancient tomb in Chang'an.
Core Event: The protagonist encounters supernatural monsters and intricate traps.
Ending Requirement: The protagonist narrowly escapes with their life, but fails to secure any treasure.
Design a key turning point for the protagonist's escape.
"""
messages = [
{"role": "user", "content": prompt},
]
outputs = pipe(
messages,
max_new_tokens=2560,
)
print(outputs[0]["generated_text"][-1])
Alternatively, you can run the model via Transformers Serve to spin up a OpenAI-compatible webserver:
transformers serve
transformers chat localhost:8000 --model-name-or-path aifeifei798/QiMing-LongWriter-20B-MXFP4
Learn more about how to use gpt-oss with Transformers.
vLLM recommends using uv for Python dependency management. You can use vLLM to spin up an OpenAI-compatible webserver. The following command will automatically download the model and start the server.
uv pip install --pre vllm==0.10.1+gptoss \
--extra-index-url https://wheels.vllm.ai/gpt-oss/ \
--extra-index-url https://download.pytorch.org/whl/nightly/cu128 \
--index-strategy unsafe-best-match
vllm serve aifeifei798/QiMing-LongWriter-20B-MXFP4
Learn more about how to use gpt-oss with vLLM.
To learn about how to use this model with PyTorch and Triton, check out our reference implementations in the gpt-oss repository.
If you are using LM Studio you can use the following commands to download.
# QiMing-LongWriter-20B-MXFP4
lms get aifeifei798/QiMing-LongWriter-20B-MXFP4
Check out our awesome list for a broader collection of gpt-oss resources and inference partners.
You can download the model from Hugging Face CLI:
# QiMing-LongWriter-20B-MXFP4
huggingface-cli download aifeifei798/QiMing-LongWriter-20B-MXFP4 --local-dir QiMing-LongWriter-20B-MXFP4/
pip install gpt-oss
python -m gpt_oss.chat QiMing-LongWriter-20B-MXFP4/
You can adjust the reasoning level that suits your task across three levels:
The reasoning level can be set in the system prompts, e.g., "Reasoning: high".
The gpt-oss models are excellent for:
QiMing-LongWriter-20B-MXFP4 models can be fine-tuned for a variety of specialized use cases.
This smaller model QiMing-LongWriter-20B-MXFP4 can be fine-tuned on consumer hardware
If you use this model in your research or projects, please consider citing:
@misc{QiMingLongWriter2025,
author = {aifeifei798},
title = {QiMing-LongWriter-20B-MXFP4: A Narrative Engine with a 131k Context Window, Powered by Process-Oriented Training},
year = {2025},
publisher = {Hugging Face},
journal = {Hugging Face repository},
howpublished = {\url{https://huggingface.co/aifeifei798/QiMing-LongWriter-20B-MXFP4}}
}