Instructions to use haanjack/K-EXAONE-236B-A23B-MXFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use haanjack/K-EXAONE-236B-A23B-MXFP4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="haanjack/K-EXAONE-236B-A23B-MXFP4") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("haanjack/K-EXAONE-236B-A23B-MXFP4") model = AutoModelForCausalLM.from_pretrained("haanjack/K-EXAONE-236B-A23B-MXFP4") 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 haanjack/K-EXAONE-236B-A23B-MXFP4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "haanjack/K-EXAONE-236B-A23B-MXFP4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "haanjack/K-EXAONE-236B-A23B-MXFP4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/haanjack/K-EXAONE-236B-A23B-MXFP4
- SGLang
How to use haanjack/K-EXAONE-236B-A23B-MXFP4 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 "haanjack/K-EXAONE-236B-A23B-MXFP4" \ --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": "haanjack/K-EXAONE-236B-A23B-MXFP4", "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 "haanjack/K-EXAONE-236B-A23B-MXFP4" \ --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": "haanjack/K-EXAONE-236B-A23B-MXFP4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use haanjack/K-EXAONE-236B-A23B-MXFP4 with Docker Model Runner:
docker model run hf.co/haanjack/K-EXAONE-236B-A23B-MXFP4
K-EXAONE-236B-A23B-MXFP4
MXFP4 quantized version of LGAI-EXAONE/K-EXAONE-236B-A23B, with MoE routed expert weights and activations quantized to OCP MXFP4 format.
K-EXAONE-236B-A23B is a Mixture-of-Experts language model developed by LG AI Research, featuring 236B total parameters with 23B active parameters per token, 128 routed experts, and 1 shared expert per layer.
Quantization Details
| Property | Value |
|---|---|
| Base Model | LGAI-EXAONE/K-EXAONE-236B-A23B (236B params, MoE) |
| Precision | MXFP4 (E2M1 weights + E8M0 scales, group_size=32) |
| Activation Quantization | MXFP4 (E2M1), Dynamic, group_size=32 |
| Quantization Tool | quanto + AMD Quark 0.11.1 (file-to-file) |
| Algorithm | RTN (Round-To-Nearest) |
| Original Size | 443 GB |
| Quantized Size | 130 GB |
| Compression Ratio | 3.4x |
Excluded Layers
This model uses the attn-excl strategy: all attention projections and all shared expert projections are excluded from quantization, leaving only MoE routed expert weights quantized to MXFP4.
- Self-Attention (all 48 layers): q_proj, k_proj, v_proj, o_proj
- Shared Expert MLP (all 48 layers): gate_proj, up_proj, down_proj
- MoE Router Gates: All mlp.gate layers
- Standard exclusions: lm_head, embed_tokens, all norm layers
Total: 382 excluded layers.
Hardware
- Quantized on: AMD MI355 (gfx950), 288 GB VRAM
- Tested with: vLLM v0.18.2 (ROCm), TP=1
- Compatible with: vLLM with Quark quantization support (quant_method: "quark")
Usage
vLLM
vllm serve haanjack/K-EXAONE-236B-A23B-MXFP4 \
--trust-remote-code \
--tensor-parallel-size 1 \
--max-model-len 4096
Quantization Reproduction
from quanto import UnifiedQuantizer, UnifiedConfig
NUM_LAYERS = 48
exclude = ["lm_head", "*embed*", "*norm*", "*.gate"]
for i in range(NUM_LAYERS):
for proj in ["q_proj", "k_proj", "v_proj", "o_proj"]:
exclude.append(f"model.layers.{i}.self_attn.{proj}")
for proj in ["gate_proj", "up_proj", "down_proj"]:
exclude.append(f"model.layers.{i}.mlp.shared_experts.{proj}")
config = UnifiedConfig(
model_path="LGAI-EXAONE/K-EXAONE-236B-A23B",
output_dir="./K-EXAONE-236B-A23B-MXFP4",
precision="mxfp4",
sensitivity_analysis=False,
exclude_layers=exclude,
trust_remote_code=True,
)
UnifiedQuantizer(config).run()
Credits
- Base Model: LG AI Research — K-EXAONE
- Quantization: quanto with AMD Quark
- Hardware: AMD MI355 (gfx950), 288 GB VRAM
License
This model inherits the EXAONE License from the base model.
- Downloads last month
- 52
Model tree for haanjack/K-EXAONE-236B-A23B-MXFP4
Base model
LGAI-EXAONE/K-EXAONE-236B-A23B