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 RAS-LAB/GLM-4.7-Flash-24B-A3B-KREAP-Code with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RAS-LAB/GLM-4.7-Flash-24B-A3B-KREAP-Code with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="RAS-LAB/GLM-4.7-Flash-24B-A3B-KREAP-Code") 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("RAS-LAB/GLM-4.7-Flash-24B-A3B-KREAP-Code") model = AutoModelForCausalLM.from_pretrained("RAS-LAB/GLM-4.7-Flash-24B-A3B-KREAP-Code", 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 RAS-LAB/GLM-4.7-Flash-24B-A3B-KREAP-Code with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "RAS-LAB/GLM-4.7-Flash-24B-A3B-KREAP-Code" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RAS-LAB/GLM-4.7-Flash-24B-A3B-KREAP-Code", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/RAS-LAB/GLM-4.7-Flash-24B-A3B-KREAP-Code
- SGLang
How to use RAS-LAB/GLM-4.7-Flash-24B-A3B-KREAP-Code 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 "RAS-LAB/GLM-4.7-Flash-24B-A3B-KREAP-Code" \ --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": "RAS-LAB/GLM-4.7-Flash-24B-A3B-KREAP-Code", "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 "RAS-LAB/GLM-4.7-Flash-24B-A3B-KREAP-Code" \ --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": "RAS-LAB/GLM-4.7-Flash-24B-A3B-KREAP-Code", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use RAS-LAB/GLM-4.7-Flash-24B-A3B-KREAP-Code with Docker Model Runner:
docker model run hf.co/RAS-LAB/GLM-4.7-Flash-24B-A3B-KREAP-Code
Align the code-control card with the KREAP collection identity
Browse filesUpdate the public title, usage ID, and comparison labels while preserving the disclosure that this is a standard REAP control without Korean protection
Constraint: The collection name must not imply Korean hard protection
Confidence: high
Scope-risk: narrow
Tested: Editor title and status text inspected before commit
Not-tested: Inference behavior
16 unmodified lines1718192021222324253 unmodified lines293031323334353 unmodified lines394041424344453 unmodified lines49505152535455113 unmodified lines16917017117217317417517617717817918018118218318418518616 unmodified lines20320420520620720820916 unmodified lines- baseline---# GLM-4.7-Flash-REAP-Code-48ECode-calibrated standard REAP one-shot MoE Expert pruning of [zai-org/GLM-4.7-Flash](https://huggingface.co/zai-org/GLM-4.7-Flash). This checkpoint intentionally does not use Korean hard protection.Routed Experts were pruned **64 → 48 per layer (25.0%)** while top-4 routing was kept unchanged.This percentage is the reduction in routed Expert count, not total model parameters.3 unmodified lines| Status | Result ||---|---|| Checkpoint integrity checks | **PASS** || Internal release gate | **NOT APPLICABLE AS A K-GUARD CANDIDATE** || External reproduction | **NOT YET REPORTED** || Deployment status | **EXPERIMENTAL COMPARISON CONTROL** |3 unmodified lines## What this checkpoint shows- Method: **REAP-Code baseline**- Korean MC macro: **53.5** (base 68.8, -15.3 pp)- Overall non-Korean composite: **60.4** (base 65.5, -5.1 pp)- Coding 2-benchmark macro: **74.0** (base 76.0, -2.0 pp)3 unmodified lines## Benchmark results| benchmark | base | K-Guard 12.5% | K-Guard force-fit 25% | K-Guard force-fit 50% | **REAP-Code 25% (this checkpoint)** ||---|---:|---:|---:|---:|---:|| **Korean (held-out harness)** | | | | | || KMMLU | 49.4 | 48.8 | 42.4 | 23.6 | 35.0 |113 unmodified linesMachine-readable results and the exact survivor manifest are included under `evaluation/`.**Internal classification:** This is a code-centric REAP comparison control. K-Guard releasecriteria do not apply because Korean hard protection was intentionally omitted.### Interpretation boundaries- At the same 48-Expert size, K-Guard-48E has a 9.3 pp higher Korean MC macro, while this checkpointhas a 4.0 pp higher overall non-Korean composite, a 4.6 pp higher LiveCodeBench score, and a3.6 pp higher coding 3-benchmark macro.- This is not a controlled single-variable comparison: the two checkpoints differ in bothcalibration data and survivor-selection rules. It cannot isolate the causal effect of hardprotection.- Machine-readable results include direct K-Guard-48E versus REAP-Code-48E McNemar tests for 11non-Korean binary/pass-fail tasks. Direct paired tests for the Korean benchmark set, aggregatebootstrap confidence intervals, multiple-comparison correction, and repeated calibration seedsare absent.16 unmodified linesimport torchfrom transformers import AutoModelForCausalLM, AutoTokenizermodel_id = "buugiiiiii/GLM-4.7-Flash-REAP-Code-48E"tokenizer = AutoTokenizer.from_pretrained(model_id,trust_remote_code=False,16 unmodified lines1718192021222324253 unmodified lines293031323334353 unmodified lines394041424344453 unmodified lines49505152535455113 unmodified lines16917017117217317417517617717817918018118218318418518616 unmodified lines20320420520620720820916 unmodified lines- baseline---# GLM-4.7-Flash-24B-A3B-KREAP-CodeCode-calibrated standard REAP one-shot MoE Expert pruning of [zai-org/GLM-4.7-Flash](https://huggingface.co/zai-org/GLM-4.7-Flash), named KREAP-Code within the project collection but not a Korean-protected KREAP checkpointRouted Experts were pruned **64 → 48 per layer (25.0%)** while top-4 routing was kept unchanged.This percentage is the reduction in routed Expert count, not total model parameters.3 unmodified lines| Status | Result ||---|---|| Checkpoint integrity checks | **PASS** || Internal release gate | **NOT APPLICABLE AS A KOREAN-PROTECTED KREAP CANDIDATE** || External reproduction | **NOT YET REPORTED** || Deployment status | **EXPERIMENTAL COMPARISON CONTROL** |3 unmodified lines## What this checkpoint shows- Method: **KREAP-Code baseline**- Korean MC macro: **53.5** (base 68.8, -15.3 pp)- Overall non-Korean composite: **60.4** (base 65.5, -5.1 pp)- Coding 2-benchmark macro: **74.0** (base 76.0, -2.0 pp)3 unmodified lines## Benchmark results| benchmark | base | KREAP 12.5% | KREAP force-fit 25% | KREAP force-fit 50% | **REAP-Code 25% (this checkpoint)** ||---|---:|---:|---:|---:|---:|| **Korean (held-out harness)** | | | | | || KMMLU | 49.4 | 48.8 | 42.4 | 23.6 | 35.0 |113 unmodified linesMachine-readable results and the exact survivor manifest are included under `evaluation/`.**Internal classification:** This is a code-centric REAP comparison control. KREAP releasecriteria do not apply because Korean hard protection was intentionally omitted.### Interpretation boundaries- At the same 48-Expert size, KREAP-48E has a 9.3 pp higher Korean MC macro, while this checkpointhas a 4.0 pp higher overall non-Korean composite, a 4.6 pp higher LiveCodeBench score, and a3.6 pp higher coding 3-benchmark macro.- This is not a controlled single-variable comparison: the two checkpoints differ in bothcalibration data and survivor-selection rules. It cannot isolate the causal effect of hardprotection.- Machine-readable results include direct KREAP-48E versus REAP-Code-48E McNemar tests for 11non-Korean binary/pass-fail tasks. Direct paired tests for the Korean benchmark set, aggregatebootstrap confidence intervals, multiple-comparison correction, and repeated calibration seedsare absent.16 unmodified linesimport torchfrom transformers import AutoModelForCausalLM, AutoTokenizermodel_id = "RAS-LAB/GLM-4.7-Flash-24B-A3B-KREAP-Code"tokenizer = AutoTokenizer.from_pretrained(model_id,trust_remote_code=False,
README.md+9-9