Instructions to use Yanun/Sage-A1.5-oQ4e-mtp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Yanun/Sage-A1.5-oQ4e-mtp with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("Yanun/Sage-A1.5-oQ4e-mtp") config = load_config("Yanun/Sage-A1.5-oQ4e-mtp") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use Yanun/Sage-A1.5-oQ4e-mtp with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Yanun/Sage-A1.5-oQ4e-mtp"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Yanun/Sage-A1.5-oQ4e-mtp" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use Yanun/Sage-A1.5-oQ4e-mtp with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Yanun/Sage-A1.5-oQ4e-mtp"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default Yanun/Sage-A1.5-oQ4e-mtp
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Yanun/Sage-A1.5-oQ4e-mtp with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Yanun/Sage-A1.5-oQ4e-mtp"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "Yanun/Sage-A1.5-oQ4e-mtp" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Sage-A1.5-oQ4e-mtp
Model architecture
An oMLX oQ4e mixed-precision conversion of InternScience/Sage-A1.5, with the vision tower and native multi-token prediction (MTP) layer included. Sage-A1.5 is a 35B-class mixture-of-experts model from Shanghai AI Laboratory, based on Qwen3.6-35B-A3B.
| Component | Structure |
|---|---|
| Text backbone | 40 layers; hidden size 2,048; qwen3_5_moe architecture |
| Attention layout | 30 linear-attention layers and 10 full-attention layers, with full attention every fourth layer |
| Mixture of experts | 256 routed experts per layer; 8 selected per token, plus one shared expert; expert intermediate size 512 |
| Vocabulary | 248,320 tokens |
| Context configuration | 262,144 tokens; this full context length has not been validated for this conversion |
| MTP | One additional prediction layer; 42 tensors included under language_model.mtp.* |
| Vision | 27-layer vision tower; hidden size 1,152; output size 2,048; 333 tensors included |
The conversion occupies approximately 21.63 GB (20.15 GiB) on disk, including vision and MTP, across five Safetensors shards. These are file sizes, not RAM requirements.
Format compatibility: this is an MLX-format checkpoint produced by oMLX 0.7.2, not a Whallm installed-model artifact, GGUF file or standard Transformers weight export. Use oMLX with support for Qwen3.5-family VLMs and its MTP loading patches. MTP weights being present does not guarantee MTP support in other MLX loaders or a speed improvement.
The companion variant is Sage-A1.5-oQ4e-fp16-mtp.
Weight precision
This conversion uses mixed precision rather than uniform 4-bit weights:
| Component | Stored precision |
|---|---|
| Main-model routed experts | 4-bit affine, group size 64 |
| MTP routed experts | The same 4-bit affine, group size 64 |
| Shared experts, including MTP | 8-bit affine, group size 128 |
| Token embeddings and LM head | 8-bit affine, group size 64 |
| Attention projections | Mixed 4/5/6/8-bit affine; exact module settings in config.json |
| Routed-expert router weights | Unquantized BF16 |
| Shared-expert gates | 8-bit affine, group size 64 |
| Unquantized language tensors, including norms, convolutions and MTP fusion projection | BF16 |
| Quantization scales and biases | BF16 |
| Vision tower | Unquantized BF16 |
This is the BF16-backed variant: unquantized language tensors, quantization scales/biases and vision tensors use BF16. The packed quantized weights are integers, not BF16.
oQ4e quantization
- Produced from the original Sage-A1.5 checkpoint, including its separate MTP shard, using oMLX's streaming conversion path.
- Packed affine weights use
U32storage, together with per-group floating-point scales and biases. This is not MXFP4 or NVFP4. - The 4-bit expert representation occupies 4.5 bits per weight, including a 16-bit scale and a 16-bit bias per 64 weights. This is an expert-only storage figure, not the average for the whole model.
- All 123 routed-expert projection modules across the 40 main layers and one MTP layer use 4-bit/group-64 quantization. Higher-precision overrides protect selected non-expert modules.
- Attention projection modules use 49 four-bit/group-64, 114 five-bit/group-128, one six-bit/group-128 and 30 eight-bit/group-64 assignments.
language_model.model.layers.7.self_attn.v_projis the six-bit assignment. - The exported quantization map is authoritative;
oQ4eis the recipe name, not a claim that every tensor is four-bit.
Calibration and retained files
The oMLX conversion report records 128 samples of 512 tokens from its built-in oqe_code_multilingual calibration set. Calibration used a quantized proxy to fit available memory, rather than a fully resident original-precision model. Sensitivity measurement also used a local quantized proxy. The BF16-backed export reused the collected calibration cache.
The report contains 523 importance entries, no mismatched entries and no zero-count expert entries. It lists language_model.lm_head as missing from importance calibration. These are conversion diagnostics, not model-quality benchmark results. The report is included as oq_imatrix_report.json, with the local cache path removed.
The source tokenizer, tokenizer configuration, chat template and image processor files are byte-preserved. Weight names/layouts, precision and model configuration were adapted by oMLX; MTP weights are included in the main shard index. Quantization is lossy, and the original BF16 checkpoint cannot be reconstructed exactly.
All shard headers, tensor names, file boundaries and index entries were checked before publication; SHA-256 hashes are included in SHA256SUMS. This publication does not claim generation-quality, vision-quality, MTP-speed or long-context validation for these two oQ4e exports. Earlier tests of a separate uniform MLX 4-bit conversion do not validate these files.
Source and license
Source: InternScience/Sage-A1.5, revision ce23c7123fdd6e0ce55a9f8d067fbe3a86145c50.
Original model by Shanghai AI Laboratory / InternScience, based on Qwen3.6-35B-A3B by Qwen. Conversion and publication by Yanun, using oMLX.
This repository retains Apache License 2.0, as declared by the upstream Sage-A1.5 model card at the source revision. The full license text is included in LICENSE; attribution and conversion changes are recorded in NOTICE.
Apache-2.0 permits use, modification and redistribution, including commercial use, subject to its terms. Redistributors must retain the applicable license, attribution and change notices. The license provides no trademark rights or warranty. The complete license text governs. No Swift-specific license or commercial-use condition is applied to this Sage conversion.
- Downloads last month
- 326
4-bit
Model tree for Yanun/Sage-A1.5-oQ4e-mtp
Base model
InternScience/Sage-A1.5