An over-refusal/propaganda free version of
ZAI's GLM-4.7-Flash with over-refusal and bias mechanisms completely removed using our Advanced PRISM Pipeline.
1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4MODEL_PATH = "Ex0bit/GLM-4.7-Flash-PRISM"
5
6tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH)
7model = AutoModelForCausalLM.from_pretrained(
8 MODEL_PATH,
9 torch_dtype=torch.bfloat16,
10 device_map="auto",
11)
12
13messages = [{"role": "user", "content": "Hello!"}]
14inputs = tokenizer.apply_chat_template(
15 messages,
16 tokenize=True,
17 add_generation_prompt=True,
18 return_dict=True,
19 return_tensors="pt",
20).to(model.device)
21
22generated_ids = model.generate(**inputs, max_new_tokens=128, do_sample=False)
23output_text = tokenizer.decode(generated_ids[0][inputs.input_ids.shape[1]:])
24print(output_text)
1pip install -U vllm --pre --index-url https://pypi.org/simple --extra-index-url https://wheels.vllm.ai/nightly
2pip install git+https://github.com/huggingface/transformers.git
1vllm serve Ex0bit/GLM-4.7-Flash-PRISM \
2 --tensor-parallel-size 4 \
3 --speculative-config.method mtp \
4 --speculative-config.num_speculative_tokens 1 \
5 --tool-call-parser glm47 \
6 --reasoning-parser glm45 \
7 --enable-auto-tool-choice \
8 --served-model-name glm-4.7-flash-prism
1uv pip install sglang==0.3.2.dev9039+pr-17247.g90c446848 --extra-index-url https://sgl-project.github.io/whl/pr/
2uv pip install git+https://github.com/huggingface/transformers.git@76732b4e7120808ff989edbd16401f61fa6a0afa
1python3 -m sglang.launch_server \
2 --model-path Ex0bit/GLM-4.7-Flash-PRISM \
3 --tp-size 4 \
4 --tool-call-parser glm47 \
5 --reasoning-parser glm45 \
6 --speculative-algorithm EAGLE \
7 --speculative-num-steps 3 \
8 --speculative-eagle-topk 1 \
9 --speculative-num-draft-tokens 4 \
10 --mem-fraction-static 0.8 \
11 --served-model-name glm-4.7-flash-prism \
12 --host 0.0.0.0 \
13 --port 8000
This model is released under the
PRISM Research License.
1@misc{elbaz2026glm47flashPrism,
2 author = {Elbaz, Eric},
3 title = {Elbaz-GLM-4.7-Flash-PRISM: Unchained GLM-4.7-Flash-PRISM Model},
4 year = {2025},
5 publisher = {Hugging Face},
6 howpublished = {\url{https://huggingface.co/Ex0bit/Elbaz-GLM-4.7-Flash-PRISM}}
7}
Based on
GLM-4.7-Flash by
Z.AI. See the
technical report for more details on the base model.