Instructions to use sasa2000/glm-4-1v-9b-thinking-text-only with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sasa2000/glm-4-1v-9b-thinking-text-only with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sasa2000/glm-4-1v-9b-thinking-text-only") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sasa2000/glm-4-1v-9b-thinking-text-only") model = AutoModelForCausalLM.from_pretrained("sasa2000/glm-4-1v-9b-thinking-text-only") 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
- vLLM
How to use sasa2000/glm-4-1v-9b-thinking-text-only with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sasa2000/glm-4-1v-9b-thinking-text-only" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sasa2000/glm-4-1v-9b-thinking-text-only", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sasa2000/glm-4-1v-9b-thinking-text-only
- SGLang
How to use sasa2000/glm-4-1v-9b-thinking-text-only 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 "sasa2000/glm-4-1v-9b-thinking-text-only" \ --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": "sasa2000/glm-4-1v-9b-thinking-text-only", "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 "sasa2000/glm-4-1v-9b-thinking-text-only" \ --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": "sasa2000/glm-4-1v-9b-thinking-text-only", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use sasa2000/glm-4-1v-9b-thinking-text-only with Docker Model Runner:
docker model run hf.co/sasa2000/glm-4-1v-9b-thinking-text-only
GLM-4.1V-9B-Thinking Text-Only
This is a text-only extraction of zai-org/GLM-4.1V-9B-Thinking.
It keeps the language model weights and tokenizer assets, and removes the vision/multimodal components.
This repository is not an official ZhipuAI/zai-org release.
Conversion
- Source model:
zai-org/GLM-4.1V-9B-Thinking - Target model type:
glm4 - Target architecture:
Glm4ForCausalLM - Kept tensors: 523
- Dropped tensors: 181
- Weight format: sharded
safetensors - Weight files: 4 shards at repository root
The original VLM config uses a multimodal GLM4V architecture. For text-only loading with Transformers
AutoModelForCausalLM, the language backbone was converted to a loadable glm4 CausalLM config.
Validation
Validated locally with Transformers:
AutoConfig.from_pretrained(...)loads asGlm4ConfigAutoTokenizer.from_pretrained(...)loads successfullyAutoModelForCausalLM.from_pretrained(..., torch_dtype="auto", low_cpu_mem_usage=True)loads asGlm4ForCausalLM- A tiny forward pass succeeds and returns logits with shape
(1, 1, 151552) - No vision/projector/multimodal tensor names remain in the sharded weight index
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "sasa2000/glm-4-1v-9b-thinking-text-only"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype="auto",
device_map="auto",
)
inputs = tokenizer("Explain why the sky looks blue.", return_tensors="pt").to(model.device)
with torch.no_grad():
output_ids = model.generate(**inputs, max_new_tokens=128)
print(tokenizer.decode(output_ids[0], skip_special_tokens=True))
Limitations
This checkpoint is text-only. Image and video inputs are not supported because the vision encoder, multimodal projector, and related preprocessing assets were removed.
Please review the upstream model card and license for the original model's intended use, limitations, and terms.
- Downloads last month
- 35