Instructions to use lightseekorg/Inkling-MXFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lightseekorg/Inkling-MXFP4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lightseekorg/Inkling-MXFP4")# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("lightseekorg/Inkling-MXFP4") model = AutoModelForMultimodalLM.from_pretrained("lightseekorg/Inkling-MXFP4") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use lightseekorg/Inkling-MXFP4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lightseekorg/Inkling-MXFP4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lightseekorg/Inkling-MXFP4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/lightseekorg/Inkling-MXFP4
- SGLang
How to use lightseekorg/Inkling-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 "lightseekorg/Inkling-MXFP4" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lightseekorg/Inkling-MXFP4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "lightseekorg/Inkling-MXFP4" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lightseekorg/Inkling-MXFP4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use lightseekorg/Inkling-MXFP4 with Docker Model Runner:
docker model run hf.co/lightseekorg/Inkling-MXFP4
Inkling-MXFP4
Model Overview
- Model Architecture: Thinking Machines Lab Inkling
- Input: Text, Image, Audio
- Output: Text
- Inference Engine: TokenSpeed
- Model Optimizer: AMD Quark (0.12.post1+rocm72.torch2.11)
- Quantized layers: MoE routed experts only
- Weight quantization: OCP MXFP4, static
- Activation quantization: OCP MXFP4, dynamic
This model was built by applying AMD Quark MXFP4 quantization to the BF16 Thinking Machines Lab Inkling checkpoint. The quantization targets the MoE routed experts, while attention layers and shared experts are kept in BF16.
Environment
The quantization workflow was prepared on an AMD gfx950 system. The inspected container environment was:
- GPU: AMD MI350/MI355
- Target graphics version: gfx950
- ROCm: 7.2.1
- amdgpu driver: 6.16.13
- OS: Linux 6.8.0-84, x86_64
- Python: 3.12.3
- PyTorch: 2.13.0+rocm7.1
- AMD Quark: 0.12.post1+rocm72.torch2.11
- Safetensors: 0.8.0
- Transformers: 5.13.1
Create and activate the Quark environment:
python3 -m venv ~/.venv-quark
source ~/.venv-quark/bin/activate
Install the required packages:
python -m pip install torch torchvision --index-url https://download.pytorch.org/whl/rocm7.1
python -m pip install amd-quark --extra-index-url https://pypi.amd.com/quark/rocm72/simple
python -m pip install safetensors transformers accelerate tqdm
Model Quantization
The model was quantized with the Quark file-to-file flow. This avoids loading the full BF16 checkpoint into GPU memory at once, which is important for very large MoE checkpoints. Run the quantization script:
python quantize_quark.py \
--model_dir /path/to/model \
--output_dir /path/to/output \
--quant_scheme mxfp4 \
--file2file_quantization
The script applies the model-specific exclusion policy automatically in file-to-file mode. The resulting checkpoint stores MXFP4 routed-expert weights and scales while preserving non-routed-expert components in BF16.
Deployment
This model can be served with TokenSpeed:
tokenspeed serve \
--model lightseekorg/Inkling-MXFP4 \
--attn-tp-size 4 \
--moe-tp-size 4 \
--max-model-len 81920 \
--max-num-seqs 16 \
--max-prefill-tokens 8192 \
--chunked-prefill-size 8192 \
--gpu-memory-utilization 0.95 \
--disable-cuda-graph-padding \
--trust-remote-code \
--dtype bfloat16 \
--disable-kvstore \
--kvstore-ratio 0 \
--block-size 128 \
--host 127.0.0.1 \
--port 22015
Evaluation
The following validation results are placeholders and will be updated before public release.
| Benchmark | BF16 Reference | MXFP4 |
|---|---|---|
| BFCL exact calls | 78.3% | 79.1% |
| BFCL all-live macro | 75.4% | 75.3% |
| MMAU | 77.2% | 76.0% |
| GPQA Diamond | 88.1% | 85.4% |
| AIME26 | 96.4% | 96.7% |
- Downloads last month
- 2
Model tree for lightseekorg/Inkling-MXFP4
Base model
thinkingmachines/Inkling