Instructions to use MachinePulseAI/karpo-decision-31B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MachinePulseAI/karpo-decision-31B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="MachinePulseAI/karpo-decision-31B")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("MachinePulseAI/karpo-decision-31B") model = AutoModelForMultimodalLM.from_pretrained("MachinePulseAI/karpo-decision-31B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Running this model on Apple Silicon Macs (unofficial port, MPS and MLX)
Thank you for releasing Karpo Decision. We wanted to run it on Macs and found that the first decide() call fails there, because the sliding-window layers use a flash-attention call that PyTorch only provides for CUDA (aten::_flash_attention_forward is not implemented for MPS or CPU).
We wrote a small unofficial port and are sharing it in case it helps other Mac users:
- Code (Apache-2.0, no weights): https://github.com/fluxcodestudio/karpo-apple-silicon
karpo_apple_silicon.install()replaces that one function at run time with ordinary masked attention. Nothing in the installed karpo-decision package is edited.- Quantized MLX copies of the 31B for Macs with less memory (text requests only, experimental):
- 8-bit, about 32 GB: https://huggingface.co/jonnyArt/karpo-decision-31B-mlx-8bit
- 4-bit, about 18 GB: https://huggingface.co/jonnyArt/karpo-decision-31B-mlx-4bit
Checked against your published 31B results (340 requests, 1,606 questions, up to 8,072 tokens; request hashes and token counts all matched):
| Run | Questions | Top answer changed | Mean difference | Largest difference |
|---|---|---|---|---|
| PyTorch on MPS, bfloat16 | 1,606 | 1 | 0.0011 | 0.103 |
| MLX 8-bit | 1,606 | 2 | 0.0016 | 0.079 |
| MLX 4-bit (145 of the requests) | 681 | 3 | 0.0067 | 0.183 |
Not checked: images, requests longer than 8,072 tokens, and the Decision Index score of the quantized copies. The port is not affiliated with or endorsed by MachinePulse; if you would like it named or described differently, tell us and we will change it.
Thanks for putting this together and for sharing the detailed validation! We appreciate you catching the CUDA-only attention path and helping make Karpo Decision usable on Macs. The comparison results are very helpful, especially with the testing scope and limitations clearly documented. Describing it as an unofficial community port works for us.
If you’re interested, we’d welcome a PR for the PyTorch attention fallback so we can review it for inclusion upstream. Thanks again for sharing both the port and the MLX conversions with the community!