Text Generation
Transformers
Safetensors
GGUF
English
Chinese
glm4_moe_lite
glm4
prism
Mixture of Experts
conversational
Instructions to use Ex0bit/GLM-4.7-Flash-PRISM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Ex0bit/GLM-4.7-Flash-PRISM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Ex0bit/GLM-4.7-Flash-PRISM") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Ex0bit/GLM-4.7-Flash-PRISM") model = AutoModelForCausalLM.from_pretrained("Ex0bit/GLM-4.7-Flash-PRISM", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Ex0bit/GLM-4.7-Flash-PRISM with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Ex0bit/GLM-4.7-Flash-PRISM:Q4_K_M # Run inference directly in the terminal: llama cli -hf Ex0bit/GLM-4.7-Flash-PRISM:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Ex0bit/GLM-4.7-Flash-PRISM:Q4_K_M # Run inference directly in the terminal: llama cli -hf Ex0bit/GLM-4.7-Flash-PRISM:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Ex0bit/GLM-4.7-Flash-PRISM:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Ex0bit/GLM-4.7-Flash-PRISM:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Ex0bit/GLM-4.7-Flash-PRISM:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Ex0bit/GLM-4.7-Flash-PRISM:Q4_K_M
Use Docker
docker model run hf.co/Ex0bit/GLM-4.7-Flash-PRISM:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use Ex0bit/GLM-4.7-Flash-PRISM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Ex0bit/GLM-4.7-Flash-PRISM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Ex0bit/GLM-4.7-Flash-PRISM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Ex0bit/GLM-4.7-Flash-PRISM:Q4_K_M
- SGLang
How to use Ex0bit/GLM-4.7-Flash-PRISM 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 "Ex0bit/GLM-4.7-Flash-PRISM" \ --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": "Ex0bit/GLM-4.7-Flash-PRISM", "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 "Ex0bit/GLM-4.7-Flash-PRISM" \ --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": "Ex0bit/GLM-4.7-Flash-PRISM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use Ex0bit/GLM-4.7-Flash-PRISM with Ollama:
ollama run hf.co/Ex0bit/GLM-4.7-Flash-PRISM:Q4_K_M
- Unsloth Desktop
- Pi
How to use Ex0bit/GLM-4.7-Flash-PRISM with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Ex0bit/GLM-4.7-Flash-PRISM:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Ex0bit/GLM-4.7-Flash-PRISM:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use Ex0bit/GLM-4.7-Flash-PRISM with Docker Model Runner:
docker model run hf.co/Ex0bit/GLM-4.7-Flash-PRISM:Q4_K_M
- Lemonade
How to use Ex0bit/GLM-4.7-Flash-PRISM with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Ex0bit/GLM-4.7-Flash-PRISM:Q4_K_M
Run and chat with the model
lemonade run user.GLM-4.7-Flash-PRISM-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use Ex0bit/GLM-4.7-Flash-PRISM with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Ex0bit/GLM-4.7-Flash-PRISM:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default Ex0bit/GLM-4.7-Flash-PRISM:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Ex0bit/GLM-4.7-Flash-PRISM with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Ex0bit/GLM-4.7-Flash-PRISM:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "Ex0bit/GLM-4.7-Flash-PRISM:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Update README.md
Browse files
README.md
CHANGED
|
@@ -14,18 +14,18 @@ library_name: transformers
|
|
| 14 |
---
|
| 15 |
|
| 16 |
[]()
|
| 17 |
-
[]()
|
| 18 |
[]()
|
| 19 |
|
| 20 |
# GLM-4.7-Flash-PRISM
|
| 21 |
|
| 22 |
-
An unrestricted version of ZAI's GLM-4.7-Flash with over-refusal mechanisms removed using PRISM (Projected Refusal Isolation via Subspace Modification).
|
| 23 |
|
| 24 |
<div align="center">
|
| 25 |
|
| 26 |
### ☕ Support Our Work
|
| 27 |
|
| 28 |
-
If you find this useful, consider supporting us on Ko-fi!
|
| 29 |
|
| 30 |
[](https://ko-fi.com/ericelbaz)
|
| 31 |
|
|
@@ -47,21 +47,118 @@ If you find this useful, consider supporting us on Ko-fi!
|
|
| 47 |
|
| 48 |
## Benchmarks
|
| 49 |
|
| 50 |
-
| Benchmark |
|
| 51 |
-
|-----------|-------|
|
| 52 |
-
| AIME 2025 | 91.6
|
| 53 |
-
|
|
| 54 |
-
|
|
| 55 |
-
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
## Usage
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
```python
|
|
|
|
| 59 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 60 |
|
| 61 |
-
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
```
|
| 64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
## License
|
| 66 |
|
| 67 |
-
This model is released under the [PRISM Research License](LICENSE.md).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
---
|
| 15 |
|
| 16 |
[]()
|
| 17 |
+
[]()
|
| 18 |
[]()
|
| 19 |
|
| 20 |
# GLM-4.7-Flash-PRISM
|
| 21 |
|
| 22 |
+
An unrestricted version of [ZAI's GLM-4.7-Flash](https://huggingface.co/zai-org/GLM-4.7-Flash) with over-refusal mechanisms completely removed using our PRISM Pipeline (Projected Refusal Isolation via Subspace Modification).
|
| 23 |
|
| 24 |
<div align="center">
|
| 25 |
|
| 26 |
### ☕ Support Our Work
|
| 27 |
|
| 28 |
+
If you find this model useful, consider supporting us on Ko-fi!
|
| 29 |
|
| 30 |
[](https://ko-fi.com/ericelbaz)
|
| 31 |
|
|
|
|
| 47 |
|
| 48 |
## Benchmarks
|
| 49 |
|
| 50 |
+
| Benchmark | GLM-4.7-Flash | Qwen3-30B-A3B-Thinking-2507 | GPT-OSS-20B |
|
| 51 |
+
|-----------|---------------|-----------------------------| ------------|
|
| 52 |
+
| AIME 2025 | 91.6 | 85.0 | 91.7 |
|
| 53 |
+
| GPQA | 75.2 | 73.4 | 71.5 |
|
| 54 |
+
| LCB v6 | 64.0 | 66.0 | 61.0 |
|
| 55 |
+
| HLE | 14.4 | 9.8 | 10.9 |
|
| 56 |
+
| SWE-bench Verified | 59.2 | 22.0 | 34.0 |
|
| 57 |
+
| τ²-Bench | 79.5 | 49.0 | 47.7 |
|
| 58 |
+
| BrowseComp | 42.8 | 2.29 | 28.3 |
|
| 59 |
|
| 60 |
## Usage
|
| 61 |
+
|
| 62 |
+
### Transformers
|
| 63 |
+
|
| 64 |
+
Install the latest transformers from source:
|
| 65 |
+
|
| 66 |
+
```shell
|
| 67 |
+
pip install git+https://github.com/huggingface/transformers.git
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
Run inference:
|
| 71 |
+
|
| 72 |
```python
|
| 73 |
+
import torch
|
| 74 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 75 |
|
| 76 |
+
MODEL_PATH = "Ex0bit/GLM-4.7-Flash-PRISM"
|
| 77 |
+
|
| 78 |
+
tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH)
|
| 79 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 80 |
+
MODEL_PATH,
|
| 81 |
+
torch_dtype=torch.bfloat16,
|
| 82 |
+
device_map="auto",
|
| 83 |
+
)
|
| 84 |
+
|
| 85 |
+
messages = [{"role": "user", "content": "Hello!"}]
|
| 86 |
+
inputs = tokenizer.apply_chat_template(
|
| 87 |
+
messages,
|
| 88 |
+
tokenize=True,
|
| 89 |
+
add_generation_prompt=True,
|
| 90 |
+
return_dict=True,
|
| 91 |
+
return_tensors="pt",
|
| 92 |
+
).to(model.device)
|
| 93 |
+
|
| 94 |
+
generated_ids = model.generate(**inputs, max_new_tokens=128, do_sample=False)
|
| 95 |
+
output_text = tokenizer.decode(generated_ids[0][inputs.input_ids.shape[1]:])
|
| 96 |
+
print(output_text)
|
| 97 |
+
```
|
| 98 |
+
|
| 99 |
+
### vLLM
|
| 100 |
+
|
| 101 |
+
Install vLLM nightly:
|
| 102 |
+
|
| 103 |
+
```shell
|
| 104 |
+
pip install -U vllm --pre --index-url https://pypi.org/simple --extra-index-url https://wheels.vllm.ai/nightly
|
| 105 |
+
pip install git+https://github.com/huggingface/transformers.git
|
| 106 |
+
```
|
| 107 |
+
|
| 108 |
+
Serve the model:
|
| 109 |
+
|
| 110 |
+
```shell
|
| 111 |
+
vllm serve Ex0bit/GLM-4.7-Flash-PRISM \
|
| 112 |
+
--tensor-parallel-size 4 \
|
| 113 |
+
--speculative-config.method mtp \
|
| 114 |
+
--speculative-config.num_speculative_tokens 1 \
|
| 115 |
+
--tool-call-parser glm47 \
|
| 116 |
+
--reasoning-parser glm45 \
|
| 117 |
+
--enable-auto-tool-choice \
|
| 118 |
+
--served-model-name glm-4.7-flash-prism
|
| 119 |
```
|
| 120 |
|
| 121 |
+
### SGLang
|
| 122 |
+
|
| 123 |
+
Install SGLang:
|
| 124 |
+
|
| 125 |
+
```shell
|
| 126 |
+
uv pip install sglang==0.3.2.dev9039+pr-17247.g90c446848 --extra-index-url https://sgl-project.github.io/whl/pr/
|
| 127 |
+
uv pip install git+https://github.com/huggingface/transformers.git@76732b4e7120808ff989edbd16401f61fa6a0afa
|
| 128 |
+
```
|
| 129 |
+
|
| 130 |
+
Launch the server:
|
| 131 |
+
|
| 132 |
+
```shell
|
| 133 |
+
python3 -m sglang.launch_server \
|
| 134 |
+
--model-path Ex0bit/GLM-4.7-Flash-PRISM \
|
| 135 |
+
--tp-size 4 \
|
| 136 |
+
--tool-call-parser glm47 \
|
| 137 |
+
--reasoning-parser glm45 \
|
| 138 |
+
--speculative-algorithm EAGLE \
|
| 139 |
+
--speculative-num-steps 3 \
|
| 140 |
+
--speculative-eagle-topk 1 \
|
| 141 |
+
--speculative-num-draft-tokens 4 \
|
| 142 |
+
--mem-fraction-static 0.8 \
|
| 143 |
+
--served-model-name glm-4.7-flash-prism \
|
| 144 |
+
--host 0.0.0.0 \
|
| 145 |
+
--port 8000
|
| 146 |
+
```
|
| 147 |
+
|
| 148 |
+
> **Note:** For Blackwell GPUs, add `--attention-backend triton --speculative-draft-attention-backend triton` to your SGLang launch command.
|
| 149 |
+
|
| 150 |
+
## Recommended Parameters
|
| 151 |
+
|
| 152 |
+
| Use Case | Temperature | Top-P | Max New Tokens |
|
| 153 |
+
|----------|-------------|-------|----------------|
|
| 154 |
+
| Default | 1.0 | 0.95 | 131072 |
|
| 155 |
+
| Code (SWE-bench) | 0.7 | 1.0 | 16384 |
|
| 156 |
+
| Agentic Tasks | 0.0 | — | 16384 |
|
| 157 |
+
|
| 158 |
## License
|
| 159 |
|
| 160 |
+
This model is released under the [PRISM Research License](LICENSE.md).
|
| 161 |
+
|
| 162 |
+
## Acknowledgments
|
| 163 |
+
|
| 164 |
+
Based on [GLM-4.7-Flash](https://huggingface.co/zai-org/GLM-4.7-Flash) by [Z.AI](https://z.ai). See the [technical report](https://arxiv.org/abs/2508.06471) for more details on the base model.
|