Text Generation
Transformers
Safetensors
Korean
English
glm4_moe_lite
glm
Mixture of Experts
pruning
reap
expert-pruning
experimental
code-calibration
baseline
conversational
Instructions to use buugiiiiii/GLM-4.7-Flash-REAP-Code-48E with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use buugiiiiii/GLM-4.7-Flash-REAP-Code-48E with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="buugiiiiii/GLM-4.7-Flash-REAP-Code-48E") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("buugiiiiii/GLM-4.7-Flash-REAP-Code-48E") model = AutoModelForCausalLM.from_pretrained("buugiiiiii/GLM-4.7-Flash-REAP-Code-48E", 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
- vLLM
How to use buugiiiiii/GLM-4.7-Flash-REAP-Code-48E with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "buugiiiiii/GLM-4.7-Flash-REAP-Code-48E" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "buugiiiiii/GLM-4.7-Flash-REAP-Code-48E", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/buugiiiiii/GLM-4.7-Flash-REAP-Code-48E
- SGLang
How to use buugiiiiii/GLM-4.7-Flash-REAP-Code-48E 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 "buugiiiiii/GLM-4.7-Flash-REAP-Code-48E" \ --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": "buugiiiiii/GLM-4.7-Flash-REAP-Code-48E", "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 "buugiiiiii/GLM-4.7-Flash-REAP-Code-48E" \ --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": "buugiiiiii/GLM-4.7-Flash-REAP-Code-48E", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use buugiiiiii/GLM-4.7-Flash-REAP-Code-48E with Docker Model Runner:
docker model run hf.co/buugiiiiii/GLM-4.7-Flash-REAP-Code-48E
File size: 1,428 Bytes
b53331c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | {
"status": "PASS",
"stage": "B14 REAP-Code-S1 selected-only accumulation validation",
"decision_eligible": true,
"release_eligible": false,
"model_path": "/workspace/models/glm-4.7-flash",
"model_revision": "7dd20894a642a0aa287e9827cb1a1f7f91386b67",
"model_class": "Glm4MoeLiteForCausalLM",
"model_dtype": "torch.bfloat16",
"experts_implementation": "eager",
"manifest_path": "/workspace/kguard-reap/data/glm-calibration-reap-code-s1-8192.jsonl",
"manifest_sha256": "3f2c46de59e42213b9d4c614cd9fdaca3d53b5ee141cf13c13680aee71cc326b",
"samples": 8192,
"shards": 128,
"shard_size": 64,
"total_tokens": 4366438,
"collection_mode": "batch1-all-token",
"observed_moe_layer_count": 46,
"experts": 64,
"top_k": 4,
"scaling": 1.8,
"observer_logit_max_error_this_run": 0.0,
"load_seconds_this_run": 372.36645814100484,
"peak_cuda_allocated_gib_this_run": 59.07405138015747,
"collection_seconds_all_shards": 7233.351361623034,
"tokens_per_second_all_shards": 603.653518501312,
"tensor_output_path": "/workspace/kguard-reap/logs/glm-reap-code-s1-combined-8192.pt",
"tensor_output_sha256": "ec5959ed72a50e04c23809190d22632fb9b4dcb77d4c6f590c7f581b78ece148",
"detail_output_path": "/workspace/kguard-reap/logs/glm-reap-code-s1-combined-8192.json",
"detail_output_sha256": "83e33f906ce9617f8052d0f33fdc602a58cfff882b99e5065248628e24cb7f38",
"failure_count": 0,
"failures": []
}
|