Text Generation
Transformers
Safetensors
glm4_moe
AWQ
vLLM
conversational
4-bit precision
awq_marlin
Run this model with HF Jobs
Run QuantTrio/GLM-4.6-AWQ on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/QuantTrio/GLM-4.6-AWQ. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/QuantTrio/GLM-4.6-AWQ on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/QuantTrio/GLM-4.6-AWQ. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Instructions to use QuantTrio/GLM-4.6-AWQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use QuantTrio/GLM-4.6-AWQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="QuantTrio/GLM-4.6-AWQ") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("QuantTrio/GLM-4.6-AWQ") model = AutoModelForCausalLM.from_pretrained("QuantTrio/GLM-4.6-AWQ", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use QuantTrio/GLM-4.6-AWQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "QuantTrio/GLM-4.6-AWQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QuantTrio/GLM-4.6-AWQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/QuantTrio/GLM-4.6-AWQ
- SGLang
How to use QuantTrio/GLM-4.6-AWQ 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 "QuantTrio/GLM-4.6-AWQ" \ --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": "QuantTrio/GLM-4.6-AWQ", "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 "QuantTrio/GLM-4.6-AWQ" \ --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": "QuantTrio/GLM-4.6-AWQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use QuantTrio/GLM-4.6-AWQ with Docker Model Runner:
docker model run hf.co/QuantTrio/GLM-4.6-AWQ
Upload folder using huggingface_hub
Browse filesFiles changed (10)
- .gitattributes+2
- README.md+112-3
- chat_template.jinjaAdded+103
- config.jsonAdded+52
- configuration.jsonAdded+1
- generation_config.jsonAdded+11
- model.safetensors.index.jsonAdded+3
- mtp.safetensorsAdded+3
- tokenizer.jsonAdded+3
- tokenizer_config.jsonAdded+325
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines333435363732 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textmodel.safetensors.index.json filter=lfs diff=lfs merge=lfs -texttokenizer.json filter=lfs diff=lfs merge=lfs -text
123---license: apache-2.0---123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112---library_name: transformerslicense: mitpipeline_tag: text-generationtags:- AWQ- vLLMbase_model:- ZhipuAI/GLM-4.6base_model_relation: quantized---# GLM-4.6-AWQBase Model: [ZhipuAI/GLM-4.6](https://www.modelscope.cn/models/ZhipuAI/GLM-4.6)### 【Dependencies / Installation】As of **2025-10-01**, create a fresh Python environment and run:```bashpip install -U pippip install vllm==0.10.2```### 【vLLM Startup Command】<i>Note: When launching with TP=8, include `--enable-expert-parallel`;otherwise the expert tensors couldn’t be evenly sharded across GPU devices.</i>```CONTEXT_LENGTH=32768vllm serve \tclf90/GLM-4.6-AWQ \--served-model-name My_Model \--enable-auto-tool-choice \--tool-call-parser glm45 \--reasoning-parser glm45 \--swap-space 16 \--max-num-seqs 64 \--max-model-len $CONTEXT_LENGTH \--gpu-memory-utilization 0.9 \--tensor-parallel-size 8 \--enable-expert-parallel \--trust-remote-code \--disable-log-requests \--host 0.0.0.0 \--port 8000```### 【Logs】```2025-10-011. Initial commit```### 【Model Files】| File Size | Last Updated ||-----------|--------------|| `184GB` | `2025-10-01` |### 【Model Download】```pythonfrom modelscope import snapshot_downloadsnapshot_download('tclf90/GLM-4.6-AWQ', cache_dir="your_local_path")```### 【Overview】# GLM-4.6<div align="center"><img src=https://raw.githubusercontent.com/zai-org/GLM-4.5/refs/heads/main/resources/logo.svg width="15%"/></div><p align="center">👋 Join our <a href="https://discord.gg/QR7SARHRxK" target="_blank">Discord</a> community.<br>📖 Check out the GLM-4.6 <a href="https://z.ai/blog/glm-4.6" target="_blank">technical blog</a>, <a href="https://arxiv.org/abs/2508.06471" target="_blank">technical report(GLM-4.5)</a>, and <a href="https://zhipu-ai.feishu.cn/wiki/Gv3swM0Yci7w7Zke9E0crhU7n7D" target="_blank">Zhipu AI technical documentation</a>.<br>📍 Use GLM-4.6 API services on <a href="https://docs.z.ai/guides/llm/glm-4.6">Z.ai API Platform. </a><br>👉 One click to <a href="https://chat.z.ai">GLM-4.6</a>.</p>## Model IntroductionCompared with GLM-4.5, **GLM-4.6** brings several key improvements:* **Longer context window:** The context window has been expanded from 128K to 200K tokens, enabling the model to handle more complex agentic tasks.* **Superior coding performance:** The model achieves higher scores on code benchmarks and demonstrates better real-world performance in applications such as Claude Code、Cline、Roo Code and Kilo Code, including improvements in generating visually polished front-end pages.* **Advanced reasoning:** GLM-4.6 shows a clear improvement in reasoning performance and supports tool use during inference, leading to stronger overall capability.* **More capable agents:** GLM-4.6 exhibits stronger performance in tool using and search-based agents, and integrates more effectively within agent frameworks.* **Refined writing:** Better aligns with human preferences in style and readability, and performs more naturally in role-playing scenarios.We evaluated GLM-4.6 across eight public benchmarks covering agents, reasoning, and coding. Results show clear gains over GLM-4.5, with GLM-4.6 also holding competitive advantages over leading domestic and international models such as **DeepSeek-V3.1-Terminus** and **Claude Sonnet 4**.## Inference**Both GLM-4.5 and GLM-4.6 use the same inference method.**you can check our [github](https://github.com/zai-org/GLM-4.5) for more detail.## Recommended Evaluation ParametersFor general evaluations, we recommend using a **sampling temperature of 1.0**.For **code-related evaluation tasks** (such as LCB), it is further recommended to set:- `top_p = 0.95`- `top_k = 40`## Evaluation- For tool-integrated reasoning, please refer to [this doc](https://github.com/zai-org/GLM-4.5/blob/main/resources/glm_4.6_tir_guide.md).- For search benchmark, we design a specific format for searching toolcall in thinking mode to support search agent, please refer to [this](https://github.com/zai-org/GLM-4.5/blob/main/resources/trajectory_search.json). for the detailed template.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103[gMASK]<sop>{%- if tools -%}<|system|># Tools
You may call one or more functions to assist with the user query.
You are provided with function signatures within <tools></tools> XML tags:<tools>{% for tool in tools %}{{ tool | tojson(ensure_ascii=False) }}{% endfor %}</tools>
For each function call, output the function name and arguments within the following XML format:<tool_call>{function-name}<arg_key>{arg-key-1}</arg_key><arg_value>{arg-value-1}</arg_value><arg_key>{arg-key-2}</arg_key><arg_value>{arg-value-2}</arg_value>...</tool_call>{%- endif -%}{%- macro visible_text(content) -%} {%- if content is string -%} {{- content }} {%- elif content is iterable and content is not mapping -%} {%- for item in content -%} {%- if item is mapping and item.type == 'text' -%} {{- item.text }} {%- elif item is string -%} {{- item }} {%- endif -%} {%- endfor -%} {%- else -%} {{- content }} {%- endif -%}{%- endmacro -%}{%- set ns = namespace(last_user_index=-1) %}{%- for m in messages %} {%- if m.role == 'user' %} {% set ns.last_user_index = loop.index0 -%} {%- endif %}{%- endfor %}{% for m in messages %}{%- if m.role == 'user' -%}<|user|>{{ visible_text(m.content) }}{{- '/nothink' if (enable_thinking is defined and not enable_thinking and not visible_text(m.content).endswith("/nothink")) else '' -}}{%- elif m.role == 'assistant' -%}<|assistant|>{%- set reasoning_content = '' %}{%- set content = visible_text(m.content) %}{%- if m.reasoning_content is string %} {%- set reasoning_content = m.reasoning_content %}{%- else %} {%- if '</think>' in content %} {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %} {%- set content = content.split('</think>')[-1].lstrip('\n') %} {%- endif %}{%- endif %}{%- if loop.index0 > ns.last_user_index and reasoning_content -%}{{ '\n<think>' + reasoning_content.strip() + '</think>'}}{%- else -%}{{ '\n<think></think>' }}{%- endif -%}{%- if content.strip() -%}{{ '\n' + content.strip() }}{%- endif -%}{% if m.tool_calls %}{% for tc in m.tool_calls %}{%- if tc.function %} {%- set tc = tc.function %}{%- endif %}{{ '\n<tool_call>' + tc.name }}{% set _args = tc.arguments %}{% for k, v in _args.items() %}<arg_key>{{ k }}</arg_key><arg_value>{{ v | tojson(ensure_ascii=False) if v is not string else v }}</arg_value>{% endfor %}</tool_call>{% endfor %}{% endif %}{%- elif m.role == 'tool' -%}{%- if m.content is string -%}{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %} {{- '<|observation|>' }}{%- endif %}{{- '\n<tool_response>\n' }}{{- m.content }}{{- '\n</tool_response>' }}{%- else -%}<|observation|>{% for tr in m.content %}
<tool_response>{{ tr.output if tr.output is defined else tr }}</tool_response>{% endfor -%}{% endif -%}{%- elif m.role == 'system' -%}<|system|>{{ visible_text(m.content) }}{%- endif -%}{%- endfor -%}{%- if add_generation_prompt -%} <|assistant|>{{- '\n<think></think>' if (enable_thinking is defined and not enable_thinking) else '' -}}{%- endif -%}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152{ "name_or_path": "tclf90/GLM-4.6-AWQ", "architectures": [ "Glm4MoeForCausalLM" ], "attention_bias": true, "attention_dropout": 0.0, "pad_token_id": 151329, "eos_token_id": [ 151329, 151336, 151338 ], "head_dim": 128, "hidden_act": "silu", "hidden_size": 5120, "partial_rotary_factor": 0.5, "initializer_range": 0.02, "intermediate_size": 12288, "max_position_embeddings": 202752, "model_type": "glm4_moe", "moe_intermediate_size": 1536, "norm_topk_prob": true, "num_attention_heads": 96, "n_group": 1, "topk_group": 1, "n_routed_experts": 160, "n_shared_experts": 1, "routed_scaling_factor": 2.5, "num_experts_per_tok": 8, "first_k_dense_replace": 3, "num_hidden_layers": 92, "num_key_value_heads": 8, "rms_norm_eps": 1e-05, "rope_scaling": null, "rope_theta": 1000000, "num_nextn_predict_layers": 1, "tie_word_embeddings": false, "torch_dtype": "float16", "transformers_version": "4.54.0", "use_cache": true, "use_qk_norm": true, "vocab_size": 151552, "quantization_config": { "quant_method": "awq_marlin", "bits": 4, "group_size": 128, "version": "gemm", "zero_point": true, "modules_to_not_convert": ["embed_tokens", "shared_experts", "shared_head", "lm_head"] }}1{"framework":"Pytorch","task":"text-generation"}1234567891011{ "_from_model_config": true, "eos_token_id": [ 151329, 151336, 151338 ], "pad_token_id": 151329, "temperature": 1.0, "transformers_version": "4.56.2"}123version https://git-lfs.github.com/spec/v1oid sha256:b86a4611482d5f26d21e7a3c5b2eeac2d3325d08e0aeea8aea07b7bb08bd329csize 11837567123version https://git-lfs.github.com/spec/v1oid sha256:74a26e5f1245a153f3a9ab94219266aeb632e9dd90ce63fbada1a8c39f47924bsize 7976202392123version https://git-lfs.github.com/spec/v1oid sha256:9340665016419c825c4bdabbcc9acc43b7ca2c68ce142724afa829abb1be5efdsize 19970699123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325{ "added_tokens_decoder": { "151329": { "content": "<|endoftext|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151330": { "content": "[MASK]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151331": { "content": "[gMASK]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151332": { "content": "[sMASK]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151333": { "content": "<sop>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151334": { "content": "<eop>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151335": { "content": "<|system|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151336": { "content": "<|user|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151337": { "content": "<|assistant|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151338": { "content": "<|observation|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151339": { "content": "<|begin_of_image|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151340": { "content": "<|end_of_image|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151341": { "content": "<|begin_of_video|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151342": { "content": "<|end_of_video|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151343": { "content": "<|begin_of_audio|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151344": { "content": "<|end_of_audio|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151345": { "content": "<|begin_of_transcription|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151346": { "content": "<|end_of_transcription|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151347": { "content": "<|code_prefix|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151348": { "content": "<|code_middle|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151349": { "content": "<|code_suffix|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151350": { "content": "<think>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "151351": { "content": "</think>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "151352": { "content": "<tool_call>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "151353": { "content": "</tool_call>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "151354": { "content": "<tool_response>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "151355": { "content": "</tool_response>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "151356": { "content": "<arg_key>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "151357": { "content": "</arg_key>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "151358": { "content": "<arg_value>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "151359": { "content": "</arg_value>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "151360": { "content": "/nothink", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151361": { "content": "<|begin_of_box|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "151362": { "content": "<|end_of_box|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "151363": { "content": "<|image|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "151364": { "content": "<|video|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false } }, "additional_special_tokens": [ "<|endoftext|>", "[MASK]", "[gMASK]", "[sMASK]", "<sop>", "<eop>", "<|system|>", "<|user|>", "<|assistant|>", "<|observation|>", "<|begin_of_image|>", "<|end_of_image|>", "<|begin_of_video|>", "<|end_of_video|>", "<|begin_of_audio|>", "<|end_of_audio|>", "<|begin_of_transcription|>", "<|end_of_transcription|>", "<|code_prefix|>", "<|code_middle|>", "<|code_suffix|>", "/nothink" ], "clean_up_tokenization_spaces": false, "do_lower_case": false, "eos_token": "<|endoftext|>", "extra_special_tokens": {}, "model_max_length": 128000, "pad_token": "<|endoftext|>", "padding_side": "left", "remove_space": false, "tokenizer_class": "PreTrainedTokenizer"}.gitattributes+2
README.md+112-3
chat_template.jinjaAdded+103
config.jsonAdded+52
configuration.jsonAdded+1
generation_config.jsonAdded+11
model.safetensors.index.jsonAdded+3
mtp.safetensorsAdded+3
tokenizer.jsonAdded+3
tokenizer_config.jsonAdded+325