Instructions to use andrzejmontano/tmax-27b-MTP-vision-BF16-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use andrzejmontano/tmax-27b-MTP-vision-BF16-8bit 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("andrzejmontano/tmax-27b-MTP-vision-BF16-8bit") config = load_config("andrzejmontano/tmax-27b-MTP-vision-BF16-8bit") # 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 andrzejmontano/tmax-27b-MTP-vision-BF16-8bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "andrzejmontano/tmax-27b-MTP-vision-BF16-8bit"
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": "andrzejmontano/tmax-27b-MTP-vision-BF16-8bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use andrzejmontano/tmax-27b-MTP-vision-BF16-8bit 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 "andrzejmontano/tmax-27b-MTP-vision-BF16-8bit"
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 andrzejmontano/tmax-27b-MTP-vision-BF16-8bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use andrzejmontano/tmax-27b-MTP-vision-BF16-8bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "andrzejmontano/tmax-27b-MTP-vision-BF16-8bit"
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 "andrzejmontano/tmax-27b-MTP-vision-BF16-8bit" \ --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"
tmax-27b-MTP-vision-BF16-8bit
Mixed-precision 8-bit quantization of TMax 27B with vision and MTP restored from the base model — a terminal-agent fine-tune of Qwen3.6-27B, optimized for efficient local inference with minimal quality loss.
Quick Stats
| Metric | Value |
|---|---|
| Base model | allenai/tmax-27b |
| Architecture | Qwen3.6-27B (64-layer hybrid attention) |
| Quantization | MLP-only 8-bit, group-size=64 |
| BF16 size | ~52 GB |
| Mixed 8-bit size | ~37 GB (29% reduction) |
| License | Apache 2.0 |
Quantization Strategy
This model uses surgical mixed-precision quantization: only the SwiGLU MLP projection matrices (gate_proj, up_proj, down_proj) in the language model are quantized to 8-bit. All other components remain in BF16:
- ✅ Quantized (8-bit): LLM MLP layers (192 tensors, ~66% of model mass)
- ✅ Protected (BF16): Linear attention, full attention, vision tower, MTP head, embeddings, LM head, all normalization layers
Rationale: MLP layers are "knowledge lookup" / feature transformation layers that are extremely quantization-tolerant. Attention mechanisms carry reasoning and context-window recall critical for agentic work and coding.
Benchmark Results
Code generation benchmarks (fixed seed sampling, no chain-of-thought):
| Benchmark | Qwen3.6-27B-MTP-Mixed-8bit | tmax-27b-Mixed-8bit | Δ |
|---|---|---|---|
| HumanEval | 93.3% | 93.3% | = |
| MBPP | 86.7% | 93.3% | +6.6% |
| LiveCodeBench | 60.0% | 63.3% | +3.3% |
Speed improvements (same tasks, lower latency):
| Benchmark | Qwen3.6-27B (s) | tmax-27b (s) | Speedup |
|---|---|---|---|
| HumanEval | 487.0 | 395.5 | 1.23x |
| MBPP | 304.2 | 274.6 | 1.11x |
| LiveCodeBench | 2027.9 | 1683.6 | 1.20x |
All benchmarks: 30 samples, sampled decoding, no thinking mode.
Model Architecture
- 64 dense layers alternating
[linear_attention × 3, full_attention × 1] × 16 - Hybrid attention: SSM-style linear attention (3/4 of layers) + full MHA with GQA 6:1 (1/4 of layers)
- Vision tower: 27-block ViT (BF16, restored from base model)
- MTP head: 1-layer multi-token prediction (BF16, restored from base model)
- Hidden size: 5120, Intermediate: 17408, Heads: 24Q / 4KV, Head dim: 256
- Vocab: 248,320, Context: 262,144 tokens
Restoring Vision + MTP from Base Model
The original allenai/tmax-27b checkpoint was distributed as a text-only model with the vision tower (333 tensors) and MTP head (15 tensors) stripped during DPPO training. This quantization restores both components from the base Qwen3.6-27B model.
The tmax-27b checkpoint (851 keys) is a strict subset of the base Qwen3.6-27B checkpoint (1199 keys). No keys were added or renamed during fine-tuning.
Merge process
- Load both indexes: Parse
model.safetensors.index.jsonfrom both tmax-27b and Qwen3.6-27B - Categorize keys: Identify which 348 keys are missing from tmax-27b (333 vision + 15 MTP)
- Stream tensors: Load LLM weights from tmax-27b (fine-tuned), vision + MTP from base (untouched)
- Verify shapes: Confirm all 851 shared keys have matching tensor shapes between models
- Save merged checkpoint: Write 1199 tensors to new sharded safetensors (~52 GB BF16)
Reproducing the merge
# Conceptual — full script at quantization_scripts/merge_tmax_27b_vision_mtp.py
from safetensors import safe_open
# Keys to source from each model
FROM_TMAX = {k for k in tmax_index if not k.startswith(('model.visual.', 'mtp.'))} # 851 keys
FROM_BASE = {k for k in base_index if k.startswith(('model.visual.', 'mtp.'))} # 348 keys
# Merge: fine-tuned LLM + base vision/MTP
merged = {}
for k in FROM_TMAX:
merged[k] = load_from_tmax(k) # DPPO-fine-tuned weights
for k in FROM_BASE:
merged[k] = load_from_base(k) # Untouched base weights
save_sharded(merged, 'tmax-27b-merged/') # 1199 tensors, 52 GB
Caveats
- Vision tower is not fine-tuned: The 27-block ViT and merger/projector are from the base Qwen3.6-27B. They may not be fully aligned with the DPPO-adapted LLM for vision-grounded terminal tasks.
- MTP is not fine-tuned: The single MTP prediction layer is from the base model. Multi-token prediction quality reflects the base model, not the tmax fine-tune.
- For text-only inference: If you only need text generation, you can skip the merge and quantize tmax-27b directly (~50 GB → ~36 GB).
Usage
oMLX (Recommended)
Loads with no hacks or workarounds.
MLX
from mlx_vlm.utils import load
model, processor = load("your-username/tmax-27b-Mixed-8bit", lazy=True)
# Model loads in ~37 GB vs ~52 GB for BF16
vLLM
vllm serve your-username/tmax-27b-Mixed-8bit \
--served-model-name tmax-27b-mixed-8bit \
--enable-auto-tool-choice \
--tool-call-parser qwen3_xml \
--quantization bitsandbytes \
--max-model-len 65536
Hugging Face Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"your-username/tmax-27b-Mixed-8bit",
torch_dtype=torch.bfloat16,
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("your-username/tmax-27b-Mixed-8bit")
Files
| File | Description |
|---|---|
model-00001.safetensors – model-00008.safetensors |
Sharded model weights (5 GB each) |
model.safetensors.index.json |
Weight index |
config.json |
Model configuration with quantization metadata |
tokenizer.json / tokenizer_config.json |
Tokenizer |
chat_template.jinja |
Chat template |
generation_config.json |
Generation parameters |
preprocessor_config.json |
Vision preprocessor config |
vocab.json / merges.txt |
Tokenizer vocabulary |
Training Provenance
This model is a quantization of allenai/tmax-27b, which was trained using DPPO on Qwen3.6-27B for terminal-agent tasks:
- Base model: Qwen3.6-27B
- Fine-tuning: DPPO on TMax-15K
- Training steps: 160 (best checkpoint on Terminal Bench)
- Vision/MTP: Restored from base Qwen3.6-27B (not trained during DPPO)
Limitations
- Mixed quantization may show minor quality degradation on edge cases compared to BF16
- Vision tower and MTP head are from the base model (not fine-tuned), so vision understanding and multi-token prediction may not be optimized for terminal-agent tasks
- The vision tower was stripped during the original DPPO training; these weights are restored from the base model and may not be fully aligned with the fine-tuned LLM
License
Apache 2.0 — same as allenai/tmax-27b
Citation
@misc{ivison2026tmaxsimplerecipeterminal,
title={Tmax: A simple recipe for terminal agents},
author={Hamish Ivison and Junjie Oscar Yin and Rulin Shao and Teng Xiao and Nathan Lambert and Hannaneh Hajishirzi},
year={2026},
eprint={2606.23321},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2606.23321},
}
- Downloads last month
- 6
Quantized