Instructions to use Kuromi22/Xing4.0-29B-A4B-Official_Document_Writing_8k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Kuromi22/Xing4.0-29B-A4B-Official_Document_Writing_8k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Kuromi22/Xing4.0-29B-A4B-Official_Document_Writing_8k", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Kuromi22/Xing4.0-29B-A4B-Official_Document_Writing_8k", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Kuromi22/Xing4.0-29B-A4B-Official_Document_Writing_8k with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Kuromi22/Xing4.0-29B-A4B-Official_Document_Writing_8k" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kuromi22/Xing4.0-29B-A4B-Official_Document_Writing_8k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Kuromi22/Xing4.0-29B-A4B-Official_Document_Writing_8k
- SGLang
How to use Kuromi22/Xing4.0-29B-A4B-Official_Document_Writing_8k with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Kuromi22/Xing4.0-29B-A4B-Official_Document_Writing_8k" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kuromi22/Xing4.0-29B-A4B-Official_Document_Writing_8k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Kuromi22/Xing4.0-29B-A4B-Official_Document_Writing_8k" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kuromi22/Xing4.0-29B-A4B-Official_Document_Writing_8k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Kuromi22/Xing4.0-29B-A4B-Official_Document_Writing_8k with Docker Model Runner:
docker model run hf.co/Kuromi22/Xing4.0-29B-A4B-Official_Document_Writing_8k
Xing4.0-29B-A4B-Official_Document_Writing_8k
This model is a fine-tuned version of Xing4.0-29B-A4B, specifically optimized for official document writing in Chinese. It supports outline generation from titles, full-text generation from titles, and paragraph-level reference writing based on outlines, reference materials, and preceding context. It is designed for generating formal documents such as government reports, Party-building materials, and speeches.
Base Model
The base model is Xing4.0-29B-A4B (formerly the TeleChat series), developed by China Telecom AI Technology Co., Ltd. It uses a Mixture-of-Experts (MoE) architecture with 29B total parameters, activating only 4B per inference step, balancing generation quality and deployment efficiency. It natively supports a 256K context window, providing a solid foundation for coherent long-form document generation. The model was trained on Ascend NPUs with the MindSpore framework.
Training Details
- Fine-tuning Task: Official document writing (title-to-outline / title-to-full-text / paragraph-level reference writing)
- Training Data: The fine-tuning dataset contains approximately 56,000 high-quality samples, covering government reports, Party-building materials, speeches, and other formal document types, spanning outline generation, full-text generation, and paragraph continuation tasks.
- Training Length: 8K
- Training Method: Full-parameter fine-tuning
- Training Hardware: Ascend NPU cluster
- Training Framework: MindSpore
Quickstart
Inference
Xing4.0-29B-A4B-Official_Document_Writing_8k can be accessed via an OpenAI-compatible API:
from openai import OpenAI
client = OpenAI(
base_url="your-base-url",
api_key="your-api-key",
)
completion = client.chat.completions.create(
model="Xing4.0-29B-A4B-Official_Document_Writing_8k",
messages=[{"role": "user", "content": "基于以下信息生成文章大纲,生成大纲层级:二级,要求:大纲格式规范,涵盖知识完整\n\n\n标题:在高质量发展中促进共同富裕\n关键词:共同富裕、高质量发展、初次分配、再分配、社会公益\n\n\n开始生成大纲:"}],
temperature=1.0,
top_p=0.95,
extra_body={
"repetition_penalty": 1.05,
"skip_special_tokens": False,
"spaces_between_special_tokens": False,
"chat_template_kwargs": {
"enable_thinking": True, # Set to False to disable thinking
},
},
)
print(completion.choices[0].message.content)
Recommended Parameters
| temperature | top_p | repetition_penalty |
|---|---|---|
| 1.1 | 0.95 | 1.02 |
Key Capabilities
| Capability | Description |
|---|---|
| Title-to-Outline | Generate a structured outline from a given document title |
| Title-to-Full-Text | Generate a complete document directly from a given title |
| Paragraph-level Reference Writing | Generate high-quality content paragraph by paragraph, leveraging outline structure, reference materials, and preceding context |
- Downloads last month
- 347
Model tree for Kuromi22/Xing4.0-29B-A4B-Official_Document_Writing_8k
Base model
XingChen-AGI/Xing4.0-29B-A4B