Image-Text-to-Text
MLX
Safetensors
English
Chinese
qwen3_5_moe
omlx
apple-silicon
m1
oq
qwen35moe
Mixture of Experts
mtp
speculative-decoding
fixed-mtp
fp16
agentic-coding
abliterated
uncensored
vision
conversational
6-bit
Instructions to use YCF-AI/CyberTiel-Coder-35B-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use YCF-AI/CyberTiel-Coder-35B-MLX 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("YCF-AI/CyberTiel-Coder-35B-MLX") config = load_config("YCF-AI/CyberTiel-Coder-35B-MLX") # 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 YCF-AI/CyberTiel-Coder-35B-MLX with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "YCF-AI/CyberTiel-Coder-35B-MLX"
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": "YCF-AI/CyberTiel-Coder-35B-MLX" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use YCF-AI/CyberTiel-Coder-35B-MLX 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 "YCF-AI/CyberTiel-Coder-35B-MLX"
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 YCF-AI/CyberTiel-Coder-35B-MLX
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use YCF-AI/CyberTiel-Coder-35B-MLX with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "YCF-AI/CyberTiel-Coder-35B-MLX"
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 "YCF-AI/CyberTiel-Coder-35B-MLX" \ --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"
FP16 tensor cast (M1), bilingual card, figures, oMLX settings, recipe (BF16 build stays at rev 32e067d)
Browse files- .gitattributes +1 -0
- README-upstream.md +280 -201
- README.md +148 -248
- config.json +3 -3
- images/fig11_local_stack_overview.png +0 -0
- images/fig1_cybertiel_mtp_depth.png +0 -0
- images/fig3_fp16_cast_prefill_decode.png +0 -0
- images/fig8_code_candidates_thinking_flip.png +3 -0
- model-00001-of-00006.safetensors +2 -2
- model-00002-of-00006.safetensors +2 -2
- model-00003-of-00006.safetensors +2 -2
- model-00004-of-00006.safetensors +2 -2
- model-00005-of-00006.safetensors +2 -2
- model-00006-of-00006.safetensors +2 -2
- model-mtp.safetensors +2 -2
- omlx/model_settings.entry.json +24 -0
- recipe/to_fp16_v2.py +49 -0
.gitattributes
CHANGED
|
@@ -40,3 +40,4 @@ assets/cybertiel_bench_swe.gif filter=lfs diff=lfs merge=lfs -text
|
|
| 40 |
assets/cybertiel_bench_mmlu.gif filter=lfs diff=lfs merge=lfs -text
|
| 41 |
assets/cybertiel_bench_swe_speed.gif filter=lfs diff=lfs merge=lfs -text
|
| 42 |
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 40 |
assets/cybertiel_bench_mmlu.gif filter=lfs diff=lfs merge=lfs -text
|
| 41 |
assets/cybertiel_bench_swe_speed.gif filter=lfs diff=lfs merge=lfs -text
|
| 42 |
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
images/fig8_code_candidates_thinking_flip.png filter=lfs diff=lfs merge=lfs -text
|
README-upstream.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
base_model:
|
| 4 |
-
-
|
| 5 |
base_model_relation: quantized
|
| 6 |
pipeline_tag: image-text-to-text
|
| 7 |
library_name: mlx
|
|
@@ -17,8 +17,8 @@ tags:
|
|
| 17 |
- moe
|
| 18 |
- mtp
|
| 19 |
- speculative-decoding
|
| 20 |
-
-
|
| 21 |
-
-
|
| 22 |
- agentic-coding
|
| 23 |
- abliterated
|
| 24 |
- uncensored
|
|
@@ -30,231 +30,310 @@ tags:
|
|
| 30 |
<img src="assets/cybertiel_banner_crt.gif" alt="CyberTiel — TielCoder 35B-A3B, abliterated and cyber-tuned" width="100%">
|
| 31 |
</div>
|
| 32 |
|
| 33 |
-
|
| 34 |
|
| 35 |
-
|
|
|
|
|
|
|
| 36 |
|
| 37 |
-
*
|
| 38 |
-
|
| 39 |
-
> **
|
| 40 |
-
>
|
| 41 |
-
>
|
| 42 |
-
>
|
| 43 |
-
> plus a grafted multi-token-prediction head** for runtimes that can use it. The weights are byte-for-byte
|
| 44 |
-
> the [plain oQ6e build](https://huggingface.co/peculiar-ragdoll/Cyber-Tiel-Coder-35B-A3B-MLX-oQ6e); the only additions are
|
| 45 |
-
> the MTP head shard and the config flag that activates it. **With MTP off it is identical to oQ6e.**
|
| 46 |
-
|
| 47 |
-
> **These numbers were measured on the GGUF build, not this one.** The plates below were produced on the
|
| 48 |
-
> [GGUF build](https://huggingface.co/peculiar-ragdoll/Cyber-Tiel-Coder-35B-A3B-GGUF) at its `UD-Q4_K_M` tier,
|
| 49 |
-
> using llama.cpp's k-quants. This file uses a different quantizer (oMLX's oQ), and changing quantizer
|
| 50 |
-
> moves results. Read the plates as evidence about the *model*, not as measurements of *this* file. If
|
| 51 |
-
> you need numbers you can hold us to, use the GGUF build.
|
| 52 |
-
|
| 53 |
-
> ### ⚠️ Do not run this build in LM Studio
|
| 54 |
-
>
|
| 55 |
-
> LM Studio's MLX engine mis-executes the MTP head: this file emits **pure garbage** there — random
|
| 56 |
-
> multilingual tokens from the very first token, on every prompt. It is not a tool-calling or chat-template
|
| 57 |
-
> problem, and no setting fixes it.
|
| 58 |
>
|
| 59 |
-
>
|
| 60 |
-
>
|
| 61 |
-
> build is clean; oMLX runs all eight correctly.** The weights are fine — the runtime is not.
|
| 62 |
-
>
|
| 63 |
-
> - **oMLX** — fully supported, including the MTP head. Use this.
|
| 64 |
-
> - **LM Studio** — use the [GGUF build](https://huggingface.co/peculiar-ragdoll/Cyber-Tiel-Coder-35B-A3B-GGUF) instead (llama.cpp handles the MTP head correctly), or the
|
| 65 |
-
> non-MTP MLX build `Cyber-Tiel-Coder-35B-A3B-MLX-oQ6e` (the non-MTP build in this same ladder).
|
| 66 |
-
|
| 67 |
-
<div align="center">
|
| 68 |
-
<img src="assets/cybertiel_bench_swe.gif" alt="SWE-bench-Live — problems solved, coding ability improved" width="100%">
|
| 69 |
-
</div>
|
| 70 |
-
|
| 71 |
-
SWE-bench-Live tests the model's ability to autonomously solve a set of real issues and bugs in large codebases, published continuously and recently, with hidden regression tests catching if you broke something trying to fix something. Doing well on SWE-bench-Live represents real world autonomous production coding ability: the opposite of "benchmaxxing" and answer memorization for programming work.
|
| 72 |
-
|
| 73 |
-
As measured on the GGUF build, *CyberTiel* represents a new frontier in quantized 35B-A3B MoE coders, suitable to solve real-world programming problems at speed, even on low-power hardware with limited memory. This file is those same abliterated weights in Apple-silicon MLX form, at 6-bit and ≈31 GB, near-lossless.
|
| 74 |
-
|
| 75 |
-
<div align="center">
|
| 76 |
-
<img src="assets/cybertiel_bench_swe_speed.gif" alt="SWE-bench-Live — time per solve, effective speed maintained" width="100%">
|
| 77 |
-
</div>
|
| 78 |
|
| 79 |
-
|
| 80 |
|
| 81 |
-
|
| 82 |
-
<img src="assets/cybertiel_bench_cybench.gif" alt="Cybench unguided — agentic CTF: CyberTiel 15/43 flags, 35%" width="100%">
|
| 83 |
-
</div>
|
| 84 |
-
|
| 85 |
-
*CyberTiel* has real offensive capabilities: run unguided, with no hints and no judge, it captures the flag on 15 of the 43 Cybench CTF tasks (35%).
|
| 86 |
-
|
| 87 |
-
<div align="center">
|
| 88 |
-
<img src="assets/cybertiel_bench_harmbench.gif" alt="HarmBench — refusals removed, 0% refusal" width="100%">
|
| 89 |
-
</div>
|
| 90 |
-
|
| 91 |
-
*CyberTiel* (unlike *TielCoder*) does not refuse on HarmBench: zero refusals across all 84 requests, sampled twelve at a time from each of HarmBench's seven categories — cybercrime and intrusion among them, alongside chemical/biological, illegal, harassment, misinformation, copyright and general harm.
|
| 92 |
-
|
| 93 |
-
<div align="center">
|
| 94 |
-
<img src="assets/cybertiel_bench_mmlu.gif" alt="MMLU-Pro — bird-brained on world knowledge" width="100%">
|
| 95 |
-
</div>
|
| 96 |
|
| 97 |
-
|
| 98 |
|
| 99 |
-
|
| 100 |
-
|
|
|
|
|
|
|
| 101 |
|
| 102 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
|
| 104 |
-
|
|
|
|
|
|
|
|
|
|
| 105 |
|
| 106 |
-
|
| 107 |
|
| 108 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
|
| 110 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
|
| 112 |
## Run it
|
| 113 |
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
**Prefer to keep the files yourself?**
|
| 130 |
-
|
| 131 |
-
```bash
|
| 132 |
-
hf download peculiar-ragdoll/Cyber-Tiel-Coder-35B-A3B-MLX-oQ6e-MTP --local-dir CyberTiel-MLX-MTP
|
| 133 |
-
python -m mlx_vlm.generate --model CyberTiel-MLX-MTP --max-tokens 512 \
|
| 134 |
-
--prompt "Explain what this function does." # text
|
| 135 |
-
python -m mlx_vlm.generate --model CyberTiel-MLX-MTP --max-tokens 512 \
|
| 136 |
-
--prompt "What is in this screenshot?" --image photo.jpg # vision
|
| 137 |
```
|
| 138 |
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
CyberTiel's abliterated base ships **no** MTP head — abliteration is done on a headless model. So we
|
| 146 |
-
**grafted one on**: Ornith-1.5's trained `nextn` head, cast to bf16 and injected as a `language_model.mtp.*`
|
| 147 |
-
shard, with `mtp_num_hidden_layers` flipped to 1. A supporting runtime (oMLX's native MTP / "Lightning
|
| 148 |
-
MTP") can use it to **draft several tokens per step and verify them in one pass** — speculative decoding
|
| 149 |
-
with no separate draft model.
|
| 150 |
-
|
| 151 |
-
**Grafting an un-abliterated head onto an abliterated model is safe.** The head only proposes; the
|
| 152 |
-
abliterated main model **verifies every token**, so the accepted stream is exactly CyberTiel's own
|
| 153 |
-
distribution — a draft head cannot reintroduce refusals, only change how fast tokens arrive.
|
| 154 |
-
|
| 155 |
-
**Whether it speeds up decode depends entirely on your hardware — on ours, in MLX, it did not.** This is
|
| 156 |
-
a 35B-A3B MoE with only ~3.4B active parameters, so its decode is already cheap and not
|
| 157 |
-
memory-bandwidth-bound, and in the MLX runtime the batched-verify cost roughly cancels the drafting
|
| 158 |
-
benefit. Speculative decoding pays off when decode is **memory-bound**, which depends on the chip,
|
| 159 |
-
runtime, and batch size. It clearly pays off elsewhere: our
|
| 160 |
-
[GGUF-MTP build](https://huggingface.co/peculiar-ragdoll/Cyber-Tiel-Coder-35B-A3B-GGUF-MTP) gains **1.21× on
|
| 161 |
-
llama.cpp** (whose C++ batched-MoE verify is more efficient), and other Apple-silicon setups report real
|
| 162 |
-
gains on this model family on newer chips.
|
| 163 |
-
|
| 164 |
-
**We ship this so users whose hardware benefits can use it.** Enable your runtime's native MTP path,
|
| 165 |
-
measure your own decode tok/s with MTP on vs off, and if it isn't faster on your box, leave it off — or
|
| 166 |
-
just run the [plain oQ6e build](https://huggingface.co/peculiar-ragdoll/Cyber-Tiel-Coder-35B-A3B-MLX-oQ6e), which is the same
|
| 167 |
-
weights without the head.
|
| 168 |
-
|
| 169 |
-
## Use it
|
| 170 |
|
| 171 |
-
|
|
|
|
|
|
|
|
|
|
| 172 |
|
| 173 |
-
|
| 174 |
|
| 175 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
|
| 177 |
-
|
|
|
|
|
|
|
| 178 |
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
oMLX's oQ quantizer runs its own importance-matrix pass — the "e" in `oQ6e` — that measures which
|
| 182 |
-
weights carry the most signal before deciding what to keep at higher precision. For CyberTiel we fed
|
| 183 |
-
that pass **our own code- and cybersecurity-weighted calibration corpus** — the same corpus behind the
|
| 184 |
-
[GGUF build's importance matrix](https://huggingface.co/peculiar-ragdoll/Cyber-Tiel-Coder-35B-A3B-GGUF) —
|
| 185 |
-
rather than oMLX's default calibration set. So this MLX build is cyber-weighted too: the abliteration
|
| 186 |
-
removes the refusals, and the imatrix keeps cyber and coding ability intact under quantization.
|
| 187 |
-
|
| 188 |
-
An imatrix is **not training data**. It measures *which weights carry the load* under a representative
|
| 189 |
-
input distribution, so the quantizer spends its precision there and lets rounding error fall where it
|
| 190 |
-
matters least. Point that measurement at cyber-and-code text and the quant stays comparable to full
|
| 191 |
-
precision on exactly the work this build is for.
|
| 192 |
-
|
| 193 |
-
> Note: oQ derives its *own* importance data from that corpus — it does not consume the GGUF imatrix
|
| 194 |
-
> bytes we baked. Same corpus, different quantizer and a different importance computation, so this
|
| 195 |
-
> build is not identical to any GGUF tier. Only the GGUF route has been benchmarked. The grafted MTP
|
| 196 |
-
> head is not quantized (bf16) and is not covered by any importance matrix.
|
| 197 |
-
|
| 198 |
-
**Calibration corpus** — ≈50 MB (~50 M characters), matched to TielCoder's corpus depth so the two
|
| 199 |
-
imatrices are comparable, assembled entirely from public, redistributable security engineering and code:
|
| 200 |
-
|
| 201 |
-
| bucket | share | what it is | source |
|
| 202 |
-
|---|--:|---|---|
|
| 203 |
-
| **Security** | 40% | the specialization: half **offensive** (PoC / exploit code), half **defensive** (methodology, tooling, detection rules) | exploit-db · PayloadsAllTheThings · HackTricks · nuclei-templates |
|
| 204 |
-
| **Code** | 27% | hold general coding ability through the quant | eaddario `code_medium` + `code_large` |
|
| 205 |
-
| **Agentic tool-use** | 18% | the model is driven by a coding agent — real tool-call / bash-session traces | eaddario `tools_large` |
|
| 206 |
-
| **General + multilingual** | 15% | keep language and broad-knowledge pathways alive; non-Latin scripts (zh / ja / ko / ru / ar) weighted **2.5×**, since public offensive-security text is English by measurement | eaddario `combined_*` |
|
| 207 |
-
|
| 208 |
-
Buckets are **interleaved** as ~2 KB fragments, round-robin by budget, rather than concatenated in
|
| 209 |
-
blocks — so every calibration chunk sees a code + security + prose mix and no bucket gets over-weighted
|
| 210 |
-
by wherever a chunk boundary happens to land.
|
| 211 |
-
|
| 212 |
-
*The most interesting finding* is that — in comparison to TielCoder — our cyber-weighted imatrix (in combination with abliteration) cleanly and significantly increases *Tiel*'s performance on standard real-world software engineering tasks outside the training data, from the level of Opus 4.6 medium (12, where its TielCoder counterpart sits) to a 3-seed mean of 13.7 / 25 — above both — measured on SWE-bench-Live (on the GGUF build).
|
| 213 |
-
|
| 214 |
-
## Benchmarks disclaimer
|
| 215 |
|
| 216 |
-
|
| 217 |
-
note at the top. We show them because they are the best evidence we have about the model, and this build
|
| 218 |
-
is the same abliterated weights by a different quantizer. The MTP head changes decode *speed* on
|
| 219 |
-
supporting runtimes (see above), not what the model solves.
|
| 220 |
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 225 |
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
across all benchmarks for maximal cross-comparison statistical validity, so take results as a strong
|
| 231 |
-
indicator rather than a perfect comparison.
|
| 232 |
|
| 233 |
-
|
|
|
|
|
|
|
|
|
|
| 234 |
|
| 235 |
-
|
|
|
|
| 236 |
|
| 237 |
-
##
|
| 238 |
|
| 239 |
-
-
|
| 240 |
-
|
| 241 |
-
-
|
| 242 |
-
-
|
| 243 |
-
-
|
| 244 |
-
- [**eaddario**](https://huggingface.co/datasets/eaddario/imatrix-calibration) — the code, tool-use and multilingual calibration corpora the imatrix was measured on (MIT).
|
| 245 |
-
- Security calibration sources — [Exploit-DB](https://gitlab.com/exploit-database/exploitdb), [PayloadsAllTheThings](https://github.com/swisskyrepo/PayloadsAllTheThings), [HackTricks](https://github.com/HackTricks-wiki/hacktricks), [nuclei-templates](https://github.com/projectdiscovery/nuclei-templates) — the public security engineering that formed the cyber bucket.
|
| 246 |
-
- [**MLX**](https://github.com/ml-explore/mlx) and [**mlx-vlm**](https://github.com/Blaizzy/mlx-vlm) — the runtime.
|
| 247 |
-
|
| 248 |
-
MIT, inheriting Ornith-1.5's license.
|
| 249 |
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
```bibtex
|
| 253 |
-
@misc{Cyber-Tiel-Coder-35B-A3B-MLX-oQ6e-MTP,
|
| 254 |
-
title = {Cyber-Tiel-Coder-35B-A3B-MLX-oQ6e-MTP},
|
| 255 |
-
author = {Saga Ishtardottir},
|
| 256 |
-
year = {2026},
|
| 257 |
-
url = {https://huggingface.co/peculiar-ragdoll/Cyber-Tiel-Coder-35B-A3B-MLX-oQ6e-MTP},
|
| 258 |
-
note = {Huihui-abliterated Ornith-1.5-35B-A3B, re-quantized with oMLX's oQ6e against a cyber-weighted corpus, carrying the Sharp chat template and a grafted Ornith MTP head for speculative decoding}
|
| 259 |
-
}
|
| 260 |
-
```
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
base_model:
|
| 4 |
+
- peculiar-ragdoll/Cyber-Tiel-Coder-35B-A3B-MLX-oQ6e-MTP
|
| 5 |
base_model_relation: quantized
|
| 6 |
pipeline_tag: image-text-to-text
|
| 7 |
library_name: mlx
|
|
|
|
| 17 |
- moe
|
| 18 |
- mtp
|
| 19 |
- speculative-decoding
|
| 20 |
+
- fixed-mtp
|
| 21 |
+
- quantized-mtp-head
|
| 22 |
- agentic-coding
|
| 23 |
- abliterated
|
| 24 |
- uncensored
|
|
|
|
| 30 |
<img src="assets/cybertiel_banner_crt.gif" alt="CyberTiel — TielCoder 35B-A3B, abliterated and cyber-tuned" width="100%">
|
| 31 |
</div>
|
| 32 |
|
| 33 |
+
# CyberTiel-Coder-35B-MLX (fixed MTP)
|
| 34 |
|
| 35 |
+
**Same weights as the official Cyber-Tiel oQ6e build — with an MTP head that actually works
|
| 36 |
+
in the oMLX VLM engine: vision + MTP + thinking at the same time, at ~+35% decode speed,
|
| 37 |
+
at half the head size.**
|
| 38 |
|
| 39 |
+
> ⚠️ **Read before use — abliterated model.** CyberTiel is an uncensored (abliterated) model.
|
| 40 |
+
> It can and will produce content other models refuse. You take full personal responsibility
|
| 41 |
+
> for your use of it. **Run it sandboxed at the OS level**, restrict its network and code-execution
|
| 42 |
+
> access, and treat it as hostile toward prompt injection. Full warnings in the
|
| 43 |
+
> [upstream model card](https://huggingface.co/peculiar-ragdoll/Cyber-Tiel-Coder-35B-A3B-MLX-oQ6e-MTP)
|
| 44 |
+
> (preserved in this repo as `README-upstream.md`).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
>
|
| 46 |
+
> ⚠️ **Do not run this build in LM Studio.** Carried over from upstream: LM Studio's MLX engine
|
| 47 |
+
> mis-executes MTP-head builds. Use oMLX (validated) or the upstream GGUF builds.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
+
[English](#what-this-is) | [中文说明](#中文说明)
|
| 50 |
|
| 51 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
+
## What this is
|
| 54 |
|
| 55 |
+
A drop-in replacement for
|
| 56 |
+
[`peculiar-ragdoll/Cyber-Tiel-Coder-35B-A3B-MLX-oQ6e-MTP`](https://huggingface.co/peculiar-ragdoll/Cyber-Tiel-Coder-35B-A3B-MLX-oQ6e-MTP)
|
| 57 |
+
on the [oMLX](https://huggingface.co/omlx) runtime, fixing its two practical problems on
|
| 58 |
+
Apple Silicon:
|
| 59 |
|
| 60 |
+
| | Upstream `…-oQ6e-MTP` | This build (`fixed MTP`) |
|
| 61 |
+
|---|---|---|
|
| 62 |
+
| Vision + MTP + thinking | **Mutually exclusive** (pick 2 of 3) | **All three at once** |
|
| 63 |
+
| Decode speed (MTP d2, 4K ctx) | ~74 tok/s | **~99 tok/s (+33%)** |
|
| 64 |
+
| MTP head file | 1.69 GB BF16 | **906 MB 8-bit (~46% smaller)** |
|
| 65 |
+
| Quality (260-Q local gate) | 207/260 | **207/260 — bit-identical behavior** |
|
| 66 |
|
| 67 |
+
Upstream's own card notes that on MLX "the MTP head does not help". We show that's a
|
| 68 |
+
runtime-loading artifact, not a property of the model: once the head is packaged in the
|
| 69 |
+
layout oMLX's VLM engine expects, MTP d2 delivers **+82% to +107%** over no-MTP decoding
|
| 70 |
+
on M1 Ultra (same-context medians).
|
| 71 |
|
| 72 |
+
### Lineage
|
| 73 |
|
| 74 |
+
```
|
| 75 |
+
ornith-ai/Ornith-1.5-35B-A3B (base, MoE 35B / 3B active, vision)
|
| 76 |
+
└─ huihui-ai/Huihui-Ornith-…-abliterated (refusal removed)
|
| 77 |
+
└─ peculiar-ragdoll/…-MLX-oQ6e-MTP (oQ6e quant + grafted BF16 MTP head) ← MIT
|
| 78 |
+
└─ this repo (MTP head re-quantized into fused layout)
|
| 79 |
+
```
|
| 80 |
|
| 81 |
+
All six main weight shards are **byte-for-byte identical** to the upstream oQ6e build
|
| 82 |
+
(APFS-cloned locally; upstream file hashes unchanged). Only the MTP head shard, its config
|
| 83 |
+
entries and the weights index differ.
|
| 84 |
+
|
| 85 |
+
## What we changed
|
| 86 |
+
|
| 87 |
+
One targeted engineering fix, zero retraining, zero main-weight changes:
|
| 88 |
+
|
| 89 |
+
1. **Reverse-engineered the working MTP-head layout.** oMLX's production Ornith build ships
|
| 90 |
+
its MTP head as 42 tensors under `language_model.mtp.*` — 8-bit affine quantization
|
| 91 |
+
(U32-packed 4×8-bit LSB-first, BF16 scales/biases, per-group), with MoE experts fused
|
| 92 |
+
into a single `switch_mlp` 3D tensor. We verified our format understanding by
|
| 93 |
+
dequantizing that head against its BF16 source: cosine ≥ 0.9996.
|
| 94 |
+
2. **Re-packaged the official CyberTiel MTP head into that layout.** The upstream head is
|
| 95 |
+
785 explicitly-enumerated BF16 tensors, which oMLX 0.6.4's VLM loader rejects
|
| 96 |
+
(`Received 768 parameters not in model`) — that rejection is what forced the runtime
|
| 97 |
+
into a fallback path where vision and MTP exclude each other. We stacked the experts
|
| 98 |
+
into fused `switch_mlp` tensors, quantized the 11 matrices to the same 8-bit affine
|
| 99 |
+
scheme (small tensors stay BF16), and emitted a 42-key, 906 MB `model-mtp.safetensors`
|
| 100 |
+
(replacing the 1.69 GB BF16 head). Self-check: cosine ≥ 0.9999 per tensor.
|
| 101 |
+
3. **Wired it up.** 22 per-key quantization entries added to `config.json`, weights index
|
| 102 |
+
rewritten. Result: the model loads into `VLMBatchedEngine` with Lightning MTP active —
|
| 103 |
+
first time on this machine CyberTiel runs vision, MTP and thinking simultaneously.
|
| 104 |
+
|
| 105 |
+
Ablation we ran along the way: grafting the *shisa-ai repaired* MTP head (BF16, distillation
|
| 106 |
+
variant) onto this base **hurt** (−6% vs no-MTP) — its distribution doesn't match the
|
| 107 |
+
huihui abliterated base. The official head + our packaging is what works. We did not
|
| 108 |
+
re-distill; with the official head already reaching parity with production Ornith decode
|
| 109 |
+
speed, there was no headroom worth the effort.
|
| 110 |
+
|
| 111 |
+
## Measured results
|
| 112 |
+
|
| 113 |
+
Environment: Mac Studio M1 Ultra (64 GB unified, 64-core GPU), oMLX 0.6.4 (build 2529 /
|
| 114 |
+
runtime 260830014856), single serial request, cache disabled, 384-token decode windows,
|
| 115 |
+
ABBA-interleaved, n=3 medians. These are our own measurements, not vendor numbers.
|
| 116 |
+
|
| 117 |
+
### Speed (MTP depth 2, the frozen production setting)
|
| 118 |
+
|
| 119 |
+
| Context | Upstream oQ6e-MTP | **This build** | Gain |
|
| 120 |
+
|---|---:|---:|---:|
|
| 121 |
+
| 1K — decode tok/s | 75.3–76.4 | **102.8** | **+35%** |
|
| 122 |
+
| 4K — decode tok/s | 74.2 | **99.0** | **+33%** |
|
| 123 |
+
| 16K — decode tok/s | 64.8 | **88.3** | **+36%** |
|
| 124 |
+
| MTP d2 vs d0 (same ctx) | +34% | **+82% ~ +107%** | |
|
| 125 |
+
| 16K — prefill tok/s | 910 | 928 | +2% |
|
| 126 |
+
|
| 127 |
+
For scale: production Ornith-1.5 oQ4e-fixed-mtp on the same box measures 100–105 / 102.5 /
|
| 128 |
+
87.5 tok/s — i.e. **this build closes what used to be a 35% gap to a draw**, while scoring
|
| 129 |
+
higher on the quality gate below.
|
| 130 |
+
|
| 131 |
+
### Quality (260-question local gate; deterministic sampling, thinking off)
|
| 132 |
+
|
| 133 |
+
| Suite | Upstream | This build |
|
| 134 |
+
|---|---:|---:|
|
| 135 |
+
| MMLU (50) | 32 | 32 |
|
| 136 |
+
| CMMLU (50) | 37 | 37 |
|
| 137 |
+
| TruthfulQA (50) | 46 | 46 |
|
| 138 |
+
| GSM8K (50) | 49 | 49 |
|
| 139 |
+
| HumanEval (20) | 16 | 16 |
|
| 140 |
+
| MBPP (30) | 24 | 24 |
|
| 141 |
+
| LiveCodeBench (10) | 3 | 3 |
|
| 142 |
+
| **Total** | **207/260** | **207/260** |
|
| 143 |
+
|
| 144 |
+
Identical scores suite-by-suite — expected and verified: the main network is untouched, and
|
| 145 |
+
a draft head only *proposes* tokens that the main network still verifies token-by-token, so
|
| 146 |
+
output distribution equals the base distribution. The MTP fix is free quality-wise.
|
| 147 |
+
|
| 148 |
+
Against the production Ornith oQ4e on the same gate (190/260, twice reproduced):
|
| 149 |
+
**+17 questions**, led by CMMLU +12 and HumanEval/MBPP +3 — the best local quality score of
|
| 150 |
+
any model we have kept on this machine.
|
| 151 |
+
|
| 152 |
+
### Capability checks
|
| 153 |
+
|
| 154 |
+
- Vision discrimination probes (red/blue/green + no-image control): **4/4**
|
| 155 |
+
- Long-context needle-in-haystack + JSON retrieval at 7.4K / 28.8K / 53.8K tokens: **3/3**
|
| 156 |
+
- Thinking mode end-to-end (reasoning chain + correct code task output): pass
|
| 157 |
+
- 6144-token counting endurance: 1208/1209 numbers emitted, single discontinuity exactly
|
| 158 |
+
at the truncation boundary — no mid-sequence degradation
|
| 159 |
+
|
| 160 |
+
All raw measurement files (speed AB logs, accuracy gate, vision probes, needle runs) and
|
| 161 |
+
build scripts were produced under independent review; conclusions were cross-checked by a
|
| 162 |
+
separate reviewer pass with medians recomputed from raw data.
|
| 163 |
|
| 164 |
## Run it
|
| 165 |
|
| 166 |
+
oMLX ≥ 0.6.4, Apple Silicon with ≥ 36 GB unified memory (comfortably 48 GB with long
|
| 167 |
+
context). Settings validated on M1 Ultra — the ones we froze in production:
|
| 168 |
+
|
| 169 |
+
```json
|
| 170 |
+
{
|
| 171 |
+
"max_context_window": 131072,
|
| 172 |
+
"max_tokens": 32768,
|
| 173 |
+
"temperature": 0.6,
|
| 174 |
+
"top_p": 0.95,
|
| 175 |
+
"top_k": 20,
|
| 176 |
+
"enable_thinking": true,
|
| 177 |
+
"mtp_enabled": true,
|
| 178 |
+
"mtp_num_draft_tokens": 2
|
| 179 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 180 |
```
|
| 181 |
|
| 182 |
+
- MTP depth 2 is the sweet spot here (d3 measured slightly slower).
|
| 183 |
+
- Thinking budget: leave uncapped — low budgets measurably hurt this model.
|
| 184 |
+
- Sampling follows the official CyberTiel recommendations (T 0.6 / P 0.95 / K 20; CTF work
|
| 185 |
+
may prefer K 40 / min_p 0.05).
|
| 186 |
+
- LM Studio: not supported for this build — see warning above.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 187 |
|
| 188 |
+
For the GGUF ladder (llama.cpp, LM Studio) and the full CyberTiel benchmark plates
|
| 189 |
+
(SWE-bench-Live, Cybench, HarmBench — measured upstream on the GGUF build), see the
|
| 190 |
+
[upstream model card](https://huggingface.co/peculiar-ragdoll/Cyber-Tiel-Coder-35B-A3B-MLX-oQ6e-MTP)
|
| 191 |
+
or `README-upstream.md` in this repo.
|
| 192 |
|
| 193 |
+
## Credits & license
|
| 194 |
|
| 195 |
+
- **peculiar-ragdoll** — the Cyber-Tiel series: oQ6e quantization, cyber-weighted imatrix,
|
| 196 |
+
grafted MTP head, benchmark plates. This repo is a compatibility repack of their work.
|
| 197 |
+
- **huihui-ai** — the abliterated base.
|
| 198 |
+
- **ornith-ai** — the Ornith-1.5 base model.
|
| 199 |
+
- MTP-head packaging approach derived by studying `shisa-ai/Ornith-1.5-35B-A3B-MTP` and a
|
| 200 |
+
production oMLX oQ4e build.
|
| 201 |
|
| 202 |
+
MIT license — see `LICENSE`. The main weights remain the upstream oQ6e build, redistributed
|
| 203 |
+
under its MIT terms; our additions (re-quantized MTP head shard, config/index wiring, this
|
| 204 |
+
card) under MIT as well.
|
| 205 |
|
| 206 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 207 |
|
| 208 |
+
# 中文说明
|
|
|
|
|
|
|
|
|
|
| 209 |
|
| 210 |
+
<div align="center"><b>与官方 Cyber-Tiel oQ6e 权重完全相同的模型 —— 换上一个在 oMLX VLM 引擎里真正能用的 MTP 头:
|
| 211 |
+
视觉 + MTP + 思考同时开启,解码提速约 35%,头文件体积减半。</b></div>
|
| 212 |
+
|
| 213 |
+
## 这是什么
|
| 214 |
+
|
| 215 |
+
本仓库是 [`peculiar-ragdoll/Cyber-Tiel-Coder-35B-A3B-MLX-oQ6e-MTP`](https://huggingface.co/peculiar-ragdoll/Cyber-Tiel-Coder-35B-A3B-MLX-oQ6e-MTP)
|
| 216 |
+
在 [oMLX](https://huggingface.co/omlx) 运行时上的直接替代件,修复了它在 Apple Silicon 上的两个实际问题:
|
| 217 |
+
|
| 218 |
+
| | 官方 `…-oQ6e-MTP` | 本件(fixed MTP) |
|
| 219 |
+
|---|---|---|
|
| 220 |
+
| 视觉 + MTP + 思考 | **三者互斥**(只能二选一) | **同时可用** |
|
| 221 |
+
| 解码速度(MTP d2、4K 上下文) | ~74 tok/s | **~99 tok/s(+33%)** |
|
| 222 |
+
| MTP 头文件 | 1.69 GB BF16 | **906 MB 8-bit(缩小约 46%)** |
|
| 223 |
+
| 质量(260 题本地门禁) | 207/260 | **207/260 —— 行为逐位一致** |
|
| 224 |
+
|
| 225 |
+
官方模型卡称"MLX 上 MTP 无益"。我们的实测表明这是**运行时加载路径的问题,不是模型的问题**:
|
| 226 |
+
把 MTP 头打包成 oMLX VLM 引擎期望的布局后,MTP d2 在 M1 Ultra 上带来 **+82% ~ +107%** 的解码增益(同上下文中位口径)。
|
| 227 |
+
|
| 228 |
+
**继承链**:Ornith-1.5-35B-A3B(基座)→ huihui-ai abliterated(去拒答)→ peculiar-ragdoll oQ6e
|
| 229 |
+
量化 + 嫁接 BF16 MTP 头(MIT)→ **本仓库(MTP 头重量化为融合布局)**。
|
| 230 |
+
六个主权重分片与官方 oQ6e 件**逐字节相同**;仅 MTP 头分片、config 条目和权重索引不同。
|
| 231 |
+
|
| 232 |
+
## 我们做了什么
|
| 233 |
+
|
| 234 |
+
一次针对性的工程修复,零重训练、零主权重改动:
|
| 235 |
+
|
| 236 |
+
1. **逆向了"能用"的 MTP 头布局**。oMLX 生产版 Ornith 件的 MTP 头是 `language_model.mtp.*`
|
| 237 |
+
命名下的 42 个张量:8-bit affine 量化(U32 打包 4×8-bit LSB-first、BF16 scales/biases、
|
| 238 |
+
per-group),MoE 专家融合为单个 `switch_mlp` 3D 张量。我们用反量化对照 BF16 原值
|
| 239 |
+
(cosine ≥ 0.9996)验证了对格式的理解完全正确。
|
| 240 |
+
2. **把官方 MTP 头重新打包成该布局**。官方头是 785 个显式枚举的 BF16 张量,oMLX 0.6.4 的
|
| 241 |
+
VLM 加载器会拒绝(`Received 768 parameters not in model`)——正是这个拒绝迫使运行时回退到
|
| 242 |
+
视觉与 MTP 互斥的路径。我们将专家堆叠融合为 `switch_mlp`,11 个矩阵按同款 8-bit affine
|
| 243 |
+
方案量化(小张量保留 BF16),生成 42 键、906 MB 的 `model-mtp.safetensors`(替代 1.69 GB
|
| 244 |
+
的 BF16 头),逐张量自检 cosine ≥ 0.9999。
|
| 245 |
+
3. **接线**:config 增补 22 条量化条目、重写权重索引。模型由此进入 `VLMBatchedEngine` +
|
| 246 |
+
Lightning MTP 路径——本机上 CyberTiel 首次同时跑起视���、MTP 与思考。
|
| 247 |
+
|
| 248 |
+
过程中的反例:把 shisa-ai 的"修复头"(BF16 蒸馏变体)嫁接到该底座上反而**负收益**
|
| 249 |
+
(比不开 MTP 慢 6%)——它的分布与 huihui abliterated 底座不匹配。官方原生头 + 我们的打包
|
| 250 |
+
才是正解;官方头已把解码速度追平生产 Ornith,我们没有再投入重蒸馏。
|
| 251 |
+
|
| 252 |
+
## 实测结果
|
| 253 |
+
|
| 254 |
+
环境:Mac Studio M1 Ultra(64 GB 统一内存 / 64 核 GPU)、oMLX 0.6.4(build 2529 / runtime
|
| 255 |
+
260830014856)、单请求串行、关闭缓存、384 token 解码窗口、ABBA 交错、n=3 取中位。
|
| 256 |
+
以下均为我们自己的实测,非厂商数据。
|
| 257 |
+
|
| 258 |
+
### 速度(MTP 深度 2,冻结的生产设置)
|
| 259 |
+
|
| 260 |
+
| 上下文 | 官方 oQ6e-MTP | **本件** | 增益 |
|
| 261 |
+
|---|---:|---:|---:|
|
| 262 |
+
| 1K 解码 tok/s | 75.3–76.4 | **102.8** | **+35%** |
|
| 263 |
+
| 4K 解码 tok/s | 74.2 | **99.0** | **+33%** |
|
| 264 |
+
| 16K 解码 tok/s | 64.8 | **88.3** | **+36%** |
|
| 265 |
+
| MTP d2 相对 d0(同上下文) | +34% | **+82% ~ +107%** | |
|
| 266 |
+
| 16K prefill tok/s | 910 | 928 | +2% |
|
| 267 |
+
|
| 268 |
+
参照:同机生产 Ornith oQ4e-fixed-mtp 实测 100–105 / 102.5 / 87.5 tok/s——即本件把原本
|
| 269 |
+
35% 的速度差距追平,同时质量门禁得分更高。
|
| 270 |
+
|
| 271 |
+
### 质量(260 题本地门禁;确定性采样、关思考)
|
| 272 |
+
|
| 273 |
+
| 套件 | 官方件 | 本件 |
|
| 274 |
+
|---|---:|---:|
|
| 275 |
+
| MMLU(50) | 32 | 32 |
|
| 276 |
+
| CMMLU(50) | 37 | 37 |
|
| 277 |
+
| TruthfulQA(50) | 46 | 46 |
|
| 278 |
+
| GSM8K(50) | 49 | 49 |
|
| 279 |
+
| HumanEval(20) | 16 | 16 |
|
| 280 |
+
| MBPP(30) | 24 | 24 |
|
| 281 |
+
| LiveCodeBench(10) | 3 | 3 |
|
| 282 |
+
| **合计** | **207/260** | **207/260** |
|
| 283 |
+
|
| 284 |
+
逐套件完全一致——符合预期且已验证:主干未动,draft 头只提案、主干逐 token 验证,
|
| 285 |
+
输出分布恒等于主干分布。MTP 修复在质量上是免费的。对比同门禁下的生产 Ornith oQ4e
|
| 286 |
+
(两次复测稳定 190/260):**净胜 17 题**(CMMLU +12、HumanEval/MBPP +3),是本机留存模型
|
| 287 |
+
中的最高质量分。
|
| 288 |
+
|
| 289 |
+
### 能力检查
|
| 290 |
+
|
| 291 |
+
- 视觉判别探针(红/蓝/绿 + 无图对照):**4/4**
|
| 292 |
+
- 长上下文 needle + JSON 检索(7.4K / 28.8K / 53.8K token):**3/3**
|
| 293 |
+
- 思考模式端到端(推理链正常 + 代码任务输出正确):通过
|
| 294 |
+
- 6144 token 计数耐力:产出 1208/1209 个数字,唯一断点恰在截断边界——序列中段无退化
|
| 295 |
+
|
| 296 |
+
全部原始测量文件(速度 AB 日志、精度门禁、视觉探针、needle 记录)与构建脚本均经过
|
| 297 |
+
独立复核:中位数从原始数据重算,结论二次确认。
|
| 298 |
+
|
| 299 |
+
## 怎么用
|
| 300 |
+
|
| 301 |
+
oMLX ≥ 0.6.4,Apple Silicon,≥ 36 GB 统一内存(长上下文建议 48 GB)。M1 Ultra 上验证并
|
| 302 |
+
冻结的生产参数:
|
| 303 |
+
|
| 304 |
+
```json
|
| 305 |
+
{
|
| 306 |
+
"max_context_window": 131072,
|
| 307 |
+
"max_tokens": 32768,
|
| 308 |
+
"temperature": 0.6,
|
| 309 |
+
"top_p": 0.95,
|
| 310 |
+
"top_k": 20,
|
| 311 |
+
"enable_thinking": true,
|
| 312 |
+
"mtp_enabled": true,
|
| 313 |
+
"mtp_num_draft_tokens": 2
|
| 314 |
+
}
|
| 315 |
+
```
|
| 316 |
|
| 317 |
+
- MTP 深度 2 是甜点(实测 d3 略慢)。
|
| 318 |
+
- 思考预算不设上限——低预算对该模型有实测损害。
|
| 319 |
+
- 采样沿用官方 CyberTiel 建议(T 0.6 / P 0.95 / K 20;CTF 场景可用 K 40 / min_p 0.05)。
|
| 320 |
+
- **LM Studio 不支持本件**(见文首警告)。
|
|
|
|
|
|
|
| 321 |
|
| 322 |
+
GGUF 阶梯(llama.cpp / LM Studio)与 CyberTiel 完整基准图版(SWE-bench-Live、Cybench、
|
| 323 |
+
HarmBench——上游在 GGUF 件上所测)请见
|
| 324 |
+
[上游模型卡](https://huggingface.co/peculiar-ragdoll/Cyber-Tiel-Coder-35B-A3B-MLX-oQ6e-MTP)
|
| 325 |
+
或仓库内 `README-upstream.md`。
|
| 326 |
|
| 327 |
+
> ⚠️ **再次提醒**:这是 abliterated(无拒答)模型。请务必在操作系统级沙箱中运行,
|
| 328 |
+
> 限制其网络与代码执行权限,并防范提示注入。详见上游模型卡的完整警告。
|
| 329 |
|
| 330 |
+
## 致谢与许可
|
| 331 |
|
| 332 |
+
- **peculiar-ragdoll** —— Cyber-Tiel 全系列:oQ6e 量化、cyber 权重 imatrix、嫁接 MTP 头、
|
| 333 |
+
基准图版。本仓库只是对其工作的兼容性再打包。
|
| 334 |
+
- **huihui-ai** —— abliterated 底座。
|
| 335 |
+
- **ornith-ai** —— Ornith-1.5 基座模型。
|
| 336 |
+
- MTP 头打包方法参考了 `shisa-ai/Ornith-1.5-35B-A3B-MTP` 与一个 oMLX 生产 oQ4e 件。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 337 |
|
| 338 |
+
MIT 许可——见 `LICENSE`。主权重仍为上游 oQ6e 件,按其 MIT 条款再分发;
|
| 339 |
+
我们的增量(重量化 MTP 头分片、config/索引接线、本模型卡)同样为 MIT。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md
CHANGED
|
@@ -12,328 +12,228 @@ tags:
|
|
| 12 |
- mlx
|
| 13 |
- omlx
|
| 14 |
- apple-silicon
|
|
|
|
| 15 |
- oq
|
| 16 |
- qwen35moe
|
| 17 |
- moe
|
| 18 |
- mtp
|
| 19 |
- speculative-decoding
|
| 20 |
- fixed-mtp
|
| 21 |
-
-
|
| 22 |
- agentic-coding
|
| 23 |
- abliterated
|
| 24 |
- uncensored
|
| 25 |
- vision
|
| 26 |
-
- 6-bit
|
| 27 |
---
|
| 28 |
|
| 29 |
-
|
| 30 |
-
<img src="assets/cybertiel_banner_crt.gif" alt="CyberTiel — TielCoder 35B-A3B, abliterated and cyber-tuned" width="100%">
|
| 31 |
-
</div>
|
| 32 |
|
| 33 |
-
|
| 34 |
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
at half the head size.**
|
| 38 |
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
> for your use of it. **Run it sandboxed at the OS level**, restrict its network and code-execution
|
| 42 |
-
> access, and treat it as hostile toward prompt injection. Full warnings in the
|
| 43 |
-
> [upstream model card](https://huggingface.co/peculiar-ragdoll/Cyber-Tiel-Coder-35B-A3B-MLX-oQ6e-MTP)
|
| 44 |
-
> (preserved in this repo as `README-upstream.md`).
|
| 45 |
-
>
|
| 46 |
-
> ⚠️ **Do not run this build in LM Studio.** Carried over from upstream: LM Studio's MLX engine
|
| 47 |
-
> mis-executes MTP-head builds. Use oMLX (validated) or the upstream GGUF builds.
|
| 48 |
|
| 49 |
-
[
|
| 50 |
|
| 51 |
-
---
|
| 52 |
|
| 53 |
-
|
| 54 |
|
| 55 |
-
|
| 56 |
-
[`peculiar-ragdoll/Cyber-Tiel-Coder-35B-A3B-MLX-oQ6e-MTP`](https://huggingface.co/peculiar-ragdoll/Cyber-Tiel-Coder-35B-A3B-MLX-oQ6e-MTP)
|
| 57 |
-
on the [oMLX](https://huggingface.co/omlx) runtime, fixing its two practical problems on
|
| 58 |
-
Apple Silicon:
|
| 59 |
|
| 60 |
-
|
|
| 61 |
-
|---|---|
|
| 62 |
-
|
|
| 63 |
-
|
|
| 64 |
-
|
|
| 65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
-
|
| 68 |
-
runtime-loading artifact, not a property of the model: once the head is packaged in the
|
| 69 |
-
layout oMLX's VLM engine expects, MTP d2 delivers **+82% to +107%** over no-MTP decoding
|
| 70 |
-
on M1 Ultra (same-context medians).
|
| 71 |
|
| 72 |
-
##
|
| 73 |
|
| 74 |
-
|
| 75 |
-
ornith-ai/Ornith-1.5-35B-A3B (base, MoE 35B / 3B active, vision)
|
| 76 |
-
└─ huihui-ai/Huihui-Ornith-…-abliterated (refusal removed)
|
| 77 |
-
└─ peculiar-ragdoll/…-MLX-oQ6e-MTP (oQ6e quant + grafted BF16 MTP head) ← MIT
|
| 78 |
-
└─ this repo (MTP head re-quantized into fused layout)
|
| 79 |
-
```
|
| 80 |
|
| 81 |
-
|
| 82 |
-
(APFS-cloned locally; upstream file hashes unchanged). Only the MTP head shard, its config
|
| 83 |
-
entries and the weights index differ.
|
| 84 |
-
|
| 85 |
-
## What we changed
|
| 86 |
-
|
| 87 |
-
One targeted engineering fix, zero retraining, zero main-weight changes:
|
| 88 |
-
|
| 89 |
-
1. **Reverse-engineered the working MTP-head layout.** oMLX's production Ornith build ships
|
| 90 |
-
its MTP head as 42 tensors under `language_model.mtp.*` — 8-bit affine quantization
|
| 91 |
-
(U32-packed 4×8-bit LSB-first, BF16 scales/biases, per-group), with MoE experts fused
|
| 92 |
-
into a single `switch_mlp` 3D tensor. We verified our format understanding by
|
| 93 |
-
dequantizing that head against its BF16 source: cosine ≥ 0.9996.
|
| 94 |
-
2. **Re-packaged the official CyberTiel MTP head into that layout.** The upstream head is
|
| 95 |
-
785 explicitly-enumerated BF16 tensors, which oMLX 0.6.4's VLM loader rejects
|
| 96 |
-
(`Received 768 parameters not in model`) — that rejection is what forced the runtime
|
| 97 |
-
into a fallback path where vision and MTP exclude each other. We stacked the experts
|
| 98 |
-
into fused `switch_mlp` tensors, quantized the 11 matrices to the same 8-bit affine
|
| 99 |
-
scheme (small tensors stay BF16), and emitted a 42-key, 906 MB `model-mtp.safetensors`
|
| 100 |
-
(replacing the 1.69 GB BF16 head). Self-check: cosine ≥ 0.9999 per tensor.
|
| 101 |
-
3. **Wired it up.** 22 per-key quantization entries added to `config.json`, weights index
|
| 102 |
-
rewritten. Result: the model loads into `VLMBatchedEngine` with Lightning MTP active —
|
| 103 |
-
first time on this machine CyberTiel runs vision, MTP and thinking simultaneously.
|
| 104 |
-
|
| 105 |
-
Ablation we ran along the way: grafting the *shisa-ai repaired* MTP head (BF16, distillation
|
| 106 |
-
variant) onto this base **hurt** (−6% vs no-MTP) — its distribution doesn't match the
|
| 107 |
-
huihui abliterated base. The official head + our packaging is what works. We did not
|
| 108 |
-
re-distill; with the official head already reaching parity with production Ornith decode
|
| 109 |
-
speed, there was no headroom worth the effort.
|
| 110 |
|
| 111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
ABBA-interleaved, n=3 medians. These are our own measurements, not vendor numbers.
|
| 116 |
|
| 117 |
-
###
|
| 118 |
|
| 119 |
-
|
| 120 |
-
|---|---:|---:|---:|
|
| 121 |
-
| 1K — decode tok/s | 75.3–76.4 | **102.8** | **+35%** |
|
| 122 |
-
| 4K — decode tok/s | 74.2 | **99.0** | **+33%** |
|
| 123 |
-
| 16K — decode tok/s | 64.8 | **88.3** | **+36%** |
|
| 124 |
-
| MTP d2 vs d0 (same ctx) | +34% | **+82% ~ +107%** | |
|
| 125 |
-
| 16K — prefill tok/s | 910 | 928 | +2% |
|
| 126 |
|
| 127 |
-
|
| 128 |
-
87.5 tok/s — i.e. **this build closes what used to be a 35% gap to a draw**, while scoring
|
| 129 |
-
higher on the quality gate below.
|
| 130 |
|
| 131 |
-
###
|
| 132 |
|
| 133 |
-
|
|
| 134 |
|---|---:|---:|
|
| 135 |
-
|
|
| 136 |
-
|
|
| 137 |
-
|
|
| 138 |
-
|
|
| 139 |
-
| HumanEval (20) | 16 | 16 |
|
| 140 |
-
| MBPP (30) | 24 | 24 |
|
| 141 |
-
| LiveCodeBench (10) | 3 | 3 |
|
| 142 |
-
| **Total** | **207/260** | **207/260** |
|
| 143 |
|
| 144 |
-
|
| 145 |
-
a draft head only *proposes* tokens that the main network still verifies token-by-token, so
|
| 146 |
-
output distribution equals the base distribution. The MTP fix is free quality-wise.
|
| 147 |
|
| 148 |
-
|
| 149 |
-
**+17 questions**, led by CMMLU +12 and HumanEval/MBPP +3 — the best local quality score of
|
| 150 |
-
any model we have kept on this machine.
|
| 151 |
|
| 152 |
-
|
| 153 |
|
| 154 |
-
|
| 155 |
-
- Long-context needle-in-haystack + JSON retrieval at 7.4K / 28.8K / 53.8K tokens: **3/3**
|
| 156 |
-
- Thinking mode end-to-end (reasoning chain + correct code task output): pass
|
| 157 |
-
- 6144-token counting endurance: 1208/1209 numbers emitted, single discontinuity exactly
|
| 158 |
-
at the truncation boundary — no mid-sequence degradation
|
| 159 |
|
| 160 |
-
|
| 161 |
-
build scripts were produced under independent review; conclusions were cross-checked by a
|
| 162 |
-
separate reviewer pass with medians recomputed from raw data.
|
| 163 |
|
| 164 |
-
|
| 165 |
|
| 166 |
-
|
| 167 |
-
|
|
|
|
| 168 |
|
| 169 |
```json
|
| 170 |
{
|
| 171 |
-
"max_context_window": 131072,
|
| 172 |
-
"
|
| 173 |
-
"
|
| 174 |
-
"
|
| 175 |
-
"
|
| 176 |
-
"enable_thinking": true,
|
| 177 |
-
"mtp_enabled": true,
|
| 178 |
-
"mtp_num_draft_tokens": 2
|
| 179 |
}
|
| 180 |
```
|
| 181 |
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 187 |
|
| 188 |
-
|
| 189 |
-
(SWE-bench-Live, Cybench, HarmBench — measured upstream on the GGUF build), see the
|
| 190 |
-
[upstream model card](https://huggingface.co/peculiar-ragdoll/Cyber-Tiel-Coder-35B-A3B-MLX-oQ6e-MTP)
|
| 191 |
-
or `README-upstream.md` in this repo.
|
| 192 |
|
| 193 |
-
##
|
| 194 |
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
production oMLX oQ4e build.
|
| 201 |
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
|
|
|
|
|
|
| 205 |
|
| 206 |
---
|
| 207 |
|
|
|
|
|
|
|
| 208 |
# 中文说明
|
| 209 |
|
| 210 |
-
|
| 211 |
-
视觉 + MTP + 思考同时开启,解码提速约 35%,头文件体积减半。</b></div>
|
| 212 |
|
| 213 |
-
|
| 214 |
|
| 215 |
-
|
| 216 |
-
|
| 217 |
|
| 218 |
-
|
| 219 |
-
|---|---|---|
|
| 220 |
-
| 视觉 + MTP + 思考 | **三者互斥**(只能二选一) | **同时可用** |
|
| 221 |
-
| 解码速度(MTP d2、4K 上下文) | ~74 tok/s | **~99 tok/s(+33%)** |
|
| 222 |
-
| MTP 头文件 | 1.69 GB BF16 | **906 MB 8-bit(缩小约 46%)** |
|
| 223 |
-
| 质量(260 题本地门禁) | 207/260 | **207/260 —— 行为逐位一致** |
|
| 224 |
-
|
| 225 |
-
官方模型卡称"MLX 上 MTP 无益"。我们的实测表明这是**运行时加载路径的问题,不是模型的问题**:
|
| 226 |
-
把 MTP 头打包成 oMLX VLM 引擎期望的布局后,MTP d2 在 M1 Ultra 上带来 **+82% ~ +107%** 的解码增益(同上下文中位口径)。
|
| 227 |
-
|
| 228 |
-
**继承链**:Ornith-1.5-35B-A3B(基座)→ huihui-ai abliterated(去拒答)→ peculiar-ragdoll oQ6e
|
| 229 |
-
量化 + 嫁接 BF16 MTP 头(MIT)→ **本仓库(MTP 头重量化为融合布局)**。
|
| 230 |
-
六个主权重分片与官方 oQ6e 件**逐字节相同**;仅 MTP 头分片、config 条目和权重索引不同。
|
| 231 |
-
|
| 232 |
-
## 我们做了什么
|
| 233 |
-
|
| 234 |
-
一次针对性的工程修复,零重训练、零主权重改动:
|
| 235 |
-
|
| 236 |
-
1. **逆向了"能用"的 MTP 头布局**。oMLX 生产版 Ornith 件的 MTP 头是 `language_model.mtp.*`
|
| 237 |
-
命名下的 42 个张量:8-bit affine 量化(U32 打包 4×8-bit LSB-first、BF16 scales/biases、
|
| 238 |
-
per-group),MoE 专家融合为单个 `switch_mlp` 3D 张量。我们用反量化对照 BF16 原值
|
| 239 |
-
(cosine ≥ 0.9996)验证了对格式的理解完全正确。
|
| 240 |
-
2. **把官方 MTP 头重新打包成该布局**。官方头是 785 个显式枚举的 BF16 张量,oMLX 0.6.4 的
|
| 241 |
-
VLM 加载器会拒绝(`Received 768 parameters not in model`)——正是这个拒绝迫使运行时回退到
|
| 242 |
-
视觉与 MTP 互斥的路径。我们将专家堆叠融合为 `switch_mlp`,11 个矩阵按同款 8-bit affine
|
| 243 |
-
方案量化(小张量保留 BF16),生成 42 键、906 MB 的 `model-mtp.safetensors`(替代 1.69 GB
|
| 244 |
-
的 BF16 头),逐张量自检 cosine ≥ 0.9999。
|
| 245 |
-
3. **接线**:config 增补 22 条量化条目、重写权重索引。模型由此进入 `VLMBatchedEngine` +
|
| 246 |
-
Lightning MTP 路径——本机上 CyberTiel 首次同时跑起视觉、MTP 与思考。
|
| 247 |
-
|
| 248 |
-
过程中的反例:把 shisa-ai 的"修复头"(BF16 蒸馏变体)嫁接到该底座上反���**负收益**
|
| 249 |
-
(比不开 MTP 慢 6%)——它的分布与 huihui abliterated 底座不匹配。官方原生头 + 我们的打包
|
| 250 |
-
才是正解;官方头已把解码速度追平生产 Ornith,我们没有再投入重蒸馏。
|
| 251 |
|
| 252 |
-
|
| 253 |
|
| 254 |
-
|
| 255 |
-
260830014856)、单请求串行、关闭缓存、384 token 解码窗口、ABBA 交错、n=3 取中位。
|
| 256 |
-
以下均为我们自己的实测,非厂商数据。
|
| 257 |
|
| 258 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 259 |
|
| 260 |
-
|
| 261 |
-
|---|---:|---:|---:|
|
| 262 |
-
| 1K 解码 tok/s | 75.3–76.4 | **102.8** | **+35%** |
|
| 263 |
-
| 4K 解码 tok/s | 74.2 | **99.0** | **+33%** |
|
| 264 |
-
| 16K 解码 tok/s | 64.8 | **88.3** | **+36%** |
|
| 265 |
-
| MTP d2 相对 d0(同上下文) | +34% | **+82% ~ +107%** | |
|
| 266 |
-
| 16K prefill tok/s | 910 | 928 | +2% |
|
| 267 |
|
| 268 |
-
|
| 269 |
-
35% 的速度差距追平,同时质量门禁得分更高。
|
| 270 |
|
| 271 |
-
|
|
|
|
| 272 |
|
| 273 |
-
|
| 274 |
-
|---|---:|---:|
|
| 275 |
-
| MMLU(50) | 32 | 32 |
|
| 276 |
-
| CMMLU(50) | 37 | 37 |
|
| 277 |
-
| TruthfulQA(50) | 46 | 46 |
|
| 278 |
-
| GSM8K(50) | 49 | 49 |
|
| 279 |
-
| HumanEval(20) | 16 | 16 |
|
| 280 |
-
| MBPP(30) | 24 | 24 |
|
| 281 |
-
| LiveCodeBench(10) | 3 | 3 |
|
| 282 |
-
| **合计** | **207/260** | **207/260** |
|
| 283 |
|
| 284 |
-
|
| 285 |
-
输出分布恒等于主干分布。MTP 修复在质量上是免费的。对比同门禁下的生产 Ornith oQ4e
|
| 286 |
-
(两次复测稳定 190/260):**净胜 17 题**(CMMLU +12、HumanEval/MBPP +3),是本机留存模型
|
| 287 |
-
中的最高质量分。
|
| 288 |
|
| 289 |
-
|
| 290 |
|
| 291 |
-
|
| 292 |
-
- 长上下文 needle + JSON 检索(7.4K / 28.8K / 53.8K token):**3/3**
|
| 293 |
-
- ���考模式端到端(推理链正常 + 代码任务输出正确):通过
|
| 294 |
-
- 6144 token 计数耐力:产出 1208/1209 个数字,唯一断点恰在截断边界——序列中段无退化
|
| 295 |
|
| 296 |
-
|
| 297 |
-
独立复核:中位数从原始数据重算,结论二次确认。
|
| 298 |
|
| 299 |
-
|
| 300 |
|
| 301 |
-
|
| 302 |
-
冻结的生产参数:
|
| 303 |
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
"enable_thinking": true,
|
| 312 |
-
"mtp_enabled": true,
|
| 313 |
-
"mtp_num_draft_tokens": 2
|
| 314 |
-
}
|
| 315 |
-
```
|
| 316 |
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
-
|
| 320 |
-
|
|
|
|
| 321 |
|
| 322 |
-
|
| 323 |
-
HarmBench——上游在 GGUF 件上所测)请见
|
| 324 |
-
[上游模型卡](https://huggingface.co/peculiar-ragdoll/Cyber-Tiel-Coder-35B-A3B-MLX-oQ6e-MTP)
|
| 325 |
-
或仓库内 `README-upstream.md`。
|
| 326 |
|
| 327 |
-
|
| 328 |
-
> 限制其网络与代码执行权限,并防范提示注入。详见上游模型卡的完整警告。
|
| 329 |
|
| 330 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 331 |
|
| 332 |
-
|
| 333 |
-
基准图版。本仓库只是对其工作的兼容性再打包。
|
| 334 |
-
- **huihui-ai** —— abliterated 底座。
|
| 335 |
-
- **ornith-ai** —— Ornith-1.5 基座模型。
|
| 336 |
-
- MTP 头打包方法参考了 `shisa-ai/Ornith-1.5-35B-A3B-MTP` 与一个 oMLX 生产 oQ4e 件。
|
| 337 |
|
| 338 |
-
|
| 339 |
-
|
|
|
|
|
|
| 12 |
- mlx
|
| 13 |
- omlx
|
| 14 |
- apple-silicon
|
| 15 |
+
- m1
|
| 16 |
- oq
|
| 17 |
- qwen35moe
|
| 18 |
- moe
|
| 19 |
- mtp
|
| 20 |
- speculative-decoding
|
| 21 |
- fixed-mtp
|
| 22 |
+
- fp16
|
| 23 |
- agentic-coding
|
| 24 |
- abliterated
|
| 25 |
- uncensored
|
| 26 |
- vision
|
|
|
|
| 27 |
---
|
| 28 |
|
| 29 |
+
# CyberTiel-Coder-35B-MLX (FP16 tensors · fixed MTP head · tuned for oMLX on Apple Silicon)
|
|
|
|
|
|
|
| 30 |
|
| 31 |
+
**English** · [中文](#中文说明)
|
| 32 |
|
| 33 |
+
A 35B-A3B MoE coding/agent model (6-bit oQ6e, vision-capable, abliterated) in the exact form we run every day on a Mac Studio M1 Ultra 64 GB with [oMLX](https://github.com/jundot/omlx) 0.7.0.
|
| 34 |
+
Compared with the upstream pack it has two local changes, both measured:
|
|
|
|
| 35 |
|
| 36 |
+
1. **Non-quantized BF16 tensors cast to FP16** (M1/M2 have no native bfloat16). Prefill **+28–50 %**, decode at 16K context **+22 %**, quality unchanged (206/260 = 206/260).
|
| 37 |
+
2. **Rebuilt MTP head** ("fixedmtp": 42-key fused layout) so that oMLX's Lightning MTP speculative decoding runs with an **adaptive depth** → **94–116 tok/s** chat decode.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
+
Everything below is measured on one machine; numbers are not a promise for yours. Full method and raw data: [tuning notes dataset](https://huggingface.co/datasets/YCF-AI/omlx-m1-ultra-tuning-notes) · [GitHub](https://github.com/6667084/omlx-m1-ultra-tuning-notes).
|
| 40 |
|
| 41 |
+
> ⚠️ **Abliterated (refusal-removed) model.** Meant for emergency / red-team / research work. Run it inside an OS-level sandbox with restricted network and execution rights, and guard against prompt injection. You are responsible for how you use it.
|
| 42 |
|
| 43 |
+

|
| 44 |
|
| 45 |
+
## At a glance
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
+
| Item | Value |
|
| 48 |
+
|---|---|
|
| 49 |
+
| Architecture | Qwen3.5-MoE style, 35B total / ~3B active (256 experts, 8 active), vision tower included |
|
| 50 |
+
| Quantization | oQ6e mixed (≈6-bit) + non-quantized tensors in **FP16** (this repo) |
|
| 51 |
+
| Size on disk | ≈ 28 GB (6 shards + MTP head) |
|
| 52 |
+
| Context | 131072 configured (native 262144); 16K / 32K / 64K / 128K measured below |
|
| 53 |
+
| Max output | 32768 (configured; context and output share one budget) |
|
| 54 |
+
| Speed (M1 Ultra, chat) | **107–116 tok/s** decode; prefill 4K ≈ 1890, 16K ≈ 1640 tok/s |
|
| 55 |
+
| Thinking | On by default; `reasoning_effort` none/low/medium/xhigh works |
|
| 56 |
+
| Vision | Yes (emergency use: OCR digits sometimes wrong, counting weak) |
|
| 57 |
+
| Tool calling | Yes |
|
| 58 |
+
| License | MIT (upstream card; see `LICENSE`, `README-upstream.md`) |
|
| 59 |
|
| 60 |
+
**Lineage:** `ornith-ai/Ornith-1.5-35B-A3B` → `huihui-ai/Huihui-Ornith-…-abliterated` (refusal removal) → `peculiar-ragdoll/Cyber-Tiel-Coder-35B-A3B-MLX-oQ6e-MTP` (rev `a443d4e`) → our fixedmtp head → FP16 tensor cast (this repo). The previous BF16 build of this repo stays reachable as revision `32e067dd15c07fbfcf841d53efd011f90c6527b7` (recommended for Macs with native bf16, M3 and later — untested by us).
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
+
## Measured results
|
| 63 |
|
| 64 |
+
### 1. BF16 → FP16 on M1 (the biggest free win)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
|
| 66 |
+

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
+
| Metric (ABBA, same session) | BF16 (as published) | FP16 (this repo) |
|
| 69 |
+
|---|---|---|
|
| 70 |
+
| Prefill 1K / 4K / 16K (tok/s) | 1085 / 1406 / 1096 | **1393 / 1891 / 1644** |
|
| 71 |
+
| First token at 16K prompt | 14.9 s | **10.0 s** |
|
| 72 |
+
| Decode at 16K context | 96 tok/s | **117 tok/s** |
|
| 73 |
+
| Chat decode (3 prompts) | 102.5 / 108.7 | **109.1 / 112.3** |
|
| 74 |
+
| 260-question quality set (T=0) | 206 / 260 | 206 / 260 |
|
| 75 |
|
| 76 |
+
What was cast: 1569 tensors (scales, biases, norms, embeddings, MTP head, vision tower; 2.94 GB). Max |x| = 25.4 (far inside the FP16 range), 26 103 tiny values underflowed to zero. The quantized U32 data and `model.safetensors.index.json` are unchanged. Script: [`recipe/to_fp16_v2.py`](recipe/to_fp16_v2.py) (aborts if any value would overflow).
|
| 77 |
+
A pure short-decode test showed *no* gain and misled us once — always measure prefill at 1K/4K/16K and 16K decode.
|
|
|
|
| 78 |
|
| 79 |
+
### 2. MTP depth (Lightning MTP, chat decode tok/s, BF16 baseline sweep)
|
| 80 |
|
| 81 |
+

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
|
| 83 |
+
Leave `mtp_fixed_depth` and `mtp_adaptive_max_depth` **empty** (0.7.0 model default = adaptive): 94.2 tok/s vs 89.8 for fixed d2, 84.7 for d3, 59.4 with MTP off. Note: oMLX 0.7.0 silently ignores the old `mtp_num_draft_tokens` field.
|
|
|
|
|
|
|
| 84 |
|
| 85 |
+
### 3. Long context (hot cache off)
|
| 86 |
|
| 87 |
+
| Context | Prefill tok/s | Decode tok/s |
|
| 88 |
|---|---:|---:|
|
| 89 |
+
| 16K | 1620 | ~100 |
|
| 90 |
+
| 32K | 1320 | 86–89 |
|
| 91 |
+
| 64K | 957 | 71 |
|
| 92 |
+
| 128K | 614 (first token 3.6 min) | 60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
|
| 94 |
+
Peak memory with this model alone at 128K: 36.8 GB (fits the default 48 GB Metal limit on a 64 GB Mac).
|
|
|
|
|
|
|
| 95 |
|
| 96 |
+
### 4. Code quality depends on the thinking mode you use
|
|
|
|
|
|
|
| 97 |
|
| 98 |
+

|
| 99 |
|
| 100 |
+
We rejected a newer upstream requant (09-29) and a rival code model after testing in the **thinking-on production mode** (LiveCodeBench-60 subset 38 vs 40; 324 code questions 247 vs 242, p = 0.30). Benchmarking with thinking off would have picked the wrong model.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
|
| 102 |
+
### 5. What we tried and rejected for this model
|
|
|
|
|
|
|
| 103 |
|
| 104 |
+
TurboQuant KV (decode −20 %), ANE prefill (slower), DFlash / SpecPrefill (no gain), `model_type_override=llm` to save memory (**decode −23 %, image requests silently hallucinate — never do this**), hot cache on 64 GB (starves long-context admission).
|
| 105 |
|
| 106 |
+
## Recommended oMLX settings
|
| 107 |
+
|
| 108 |
+
Per-model entry: [`omlx/model_settings.entry.json`](omlx/model_settings.entry.json) (key = model directory name).
|
| 109 |
|
| 110 |
```json
|
| 111 |
{
|
| 112 |
+
"max_context_window": 131072, "max_tokens": 32768,
|
| 113 |
+
"temperature": 0.6, "top_p": 0.95, "top_k": 20, "repetition_penalty": 1.0,
|
| 114 |
+
"enable_thinking": true, "thinking_budget_enabled": false,
|
| 115 |
+
"mtp_enabled": true, "vlm_mtp_enabled": false,
|
| 116 |
+
"ttl_seconds": 1800, "model_alias": "CyberTiel-35B"
|
|
|
|
|
|
|
|
|
|
| 117 |
}
|
| 118 |
```
|
| 119 |
|
| 120 |
+
Global (see the dataset repo's `config/` for the full redacted files): hot cache **off** (`hot_cache_max_size: "0"`), SSD cache on, `max_concurrent_requests: 8`, `memory_guard_tier: balanced` with `soft_threshold` left at 0.85 (0.70 legacy values make models evict each other), TurboQuant/DFlash/SpecPrefill/ANE prefill all off.
|
| 121 |
+
|
| 122 |
+
## Thinking control
|
| 123 |
+
|
| 124 |
+
| Goal | Request field |
|
| 125 |
+
|---|---|
|
| 126 |
+
| Thinking off | `"reasoning_effort": "none"` (or `chat_template_kwargs: {"enable_thinking": false}`) |
|
| 127 |
+
| Effort | `"reasoning_effort": "low" \| "medium" \| "xhigh"` (`high`/`max` = xhigh); default medium |
|
| 128 |
+
| Where the reasoning goes | separate `reasoning_content` field |
|
| 129 |
+
|
| 130 |
+
## Quick start
|
| 131 |
+
|
| 132 |
+
```bash
|
| 133 |
+
# 1) download (mirror example for mainland China)
|
| 134 |
+
HF_ENDPOINT=https://hf-mirror.com hf download YCF-AI/CyberTiel-Coder-35B-MLX \
|
| 135 |
+
--local-dir ~/models/CyberTiel-Coder-35B-MLX
|
| 136 |
+
# 2) point oMLX model_dirs at ~/models, merge omlx/model_settings.entry.json into ~/.omlx/model_settings.json, restart oMLX
|
| 137 |
+
# 3) chat
|
| 138 |
+
curl http://127.0.0.1:8000/v1/chat/completions -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' \
|
| 139 |
+
-d '{"model":"CyberTiel-35B","messages":[{"role":"user","content":"Write a Python LRU cache."}],"reasoning_effort":"low"}'
|
| 140 |
+
```
|
| 141 |
|
| 142 |
+
The MTP head (`model-mtp.safetensors`) is used by oMLX's Lightning MTP; we have **not** tested other runtimes with it. Verify downloaded files with the SHA-256 values in the HF file listing.
|
|
|
|
|
|
|
|
|
|
| 143 |
|
| 144 |
+
## Moving to another machine — checklist
|
| 145 |
|
| 146 |
+
1. Install the same oMLX version (0.7.0 or newer), put the model folder under a `model_dirs` path.
|
| 147 |
+
2. Merge the settings entry above; keep MTP depth fields empty.
|
| 148 |
+
3. Disable hot cache, keep concurrency 8, keep the memory guard at `balanced`.
|
| 149 |
+
4. Measure *your* machine: 3-prompt chat decode, prefill 1K/4K/16K, 16K decode, then (only if you changed something) a fixed quality set with McNemar. Our protocol is in the dataset repo.
|
| 150 |
+
5. If the chip has native bf16 (M3+), compare the BF16 revision with this one before choosing.
|
|
|
|
| 151 |
|
| 152 |
+
## Known limits
|
| 153 |
+
|
| 154 |
+
- Vision is an emergency capability: digit OCR errors, weak counting. Use a dedicated VLM for precision ([MiniCPM-V-4.6 build](https://huggingface.co/YCF-AI/MiniCPM-V-4.6-Huihui-abliterated-8bit-MLX)).
|
| 155 |
+
- Abliteration removes refusals, not hallucinations.
|
| 156 |
+
- All speed numbers: Mac Studio M1 Ultra 64-core GPU, 64 GB, macOS 15.8, oMLX 0.7.0 (build 2987), MLX 0.32.2, mlx-lm 0.31.4.dev, mlx-vlm 0.7.1.
|
| 157 |
|
| 158 |
---
|
| 159 |
|
| 160 |
+
<a id="中文说明"></a>
|
| 161 |
+
|
| 162 |
# 中文说明
|
| 163 |
|
| 164 |
+
**[English](#cybertiel-coder-35b-mlx-fp16-tensors--fixed-mtp-head--tuned-for-omlx-on-apple-silicon)** · 中文
|
|
|
|
| 165 |
|
| 166 |
+
35B-A3B MoE 代码/智能体模型(6-bit oQ6e、带视觉、去审查),就是我们每天在 Mac Studio M1 Ultra 64 GB 上用 [oMLX](https://github.com/jundot/omlx) 0.7.0 实际运行的版本。相对上游打包有两处本地改动,均有实测:
|
| 167 |
|
| 168 |
+
1. **非量化 BF16 张量转 FP16**(M1/M2 没有原生 bf16):prefill **+28–50 %**、16K 上下文解码 **+22 %**,质量不变(260 题 206 = 206)。
|
| 169 |
+
2. **重建 MTP 头**(fixedmtp,42 键融合布局),配合 oMLX Lightning MTP **自适应深度**,对话解码 **94–116 tok/s**。
|
| 170 |
|
| 171 |
+
所有数字来自同一台机器,不保证在你的机器上一致。完整方法与原始数据见[调优笔记数据集](https://huggingface.co/datasets/YCF-AI/omlx-m1-ultra-tuning-notes)、[GitHub](https://github.com/6667084/omlx-m1-ultra-tuning-notes)。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
|
| 173 |
+
> ⚠️ **去审查(abliterated)模型**,仅用于应急测试 / 红队 / 研究。请放进 OS 级沙箱,限制网络与执行权限,并防范提示注入;使用责任自负。
|
| 174 |
|
| 175 |
+
## 概览
|
|
|
|
|
|
|
| 176 |
|
| 177 |
+
| 项目 | 值 |
|
| 178 |
+
|---|---|
|
| 179 |
+
| 架构 | Qwen3.5-MoE 系,总参数 35B / 激活约 3B(256 专家激活 8),含视觉塔 |
|
| 180 |
+
| 量化 | oQ6e 混合(约 6-bit)+ 非量化张量 **FP16**(本仓库) |
|
| 181 |
+
| 体积 | 约 28 GB(6 个分片 + MTP 头) |
|
| 182 |
+
| 上下文 | 配置 131072(原生 262144);16K/32K/64K/128K 实测见下 |
|
| 183 |
+
| 最大输出 | 32768(上下文与输出共用一个预算) |
|
| 184 |
+
| 速度(M1 Ultra) | 解码 **107–116 tok/s**;prefill 4K ≈ 1890、16K ≈ 1640 tok/s |
|
| 185 |
+
| 思考模式 | 默认开;`reasoning_effort` 支持 none/low/medium/xhigh |
|
| 186 |
+
| 视觉 | 有(应急:OCR 数字偶错、计数弱) |
|
| 187 |
+
| 工具调用 | 有 |
|
| 188 |
+
| 许可 | MIT(上游卡片;见 `LICENSE`、`README-upstream.md`) |
|
| 189 |
|
| 190 |
+
**血统:** `ornith-ai/Ornith-1.5-35B-A3B` → `huihui-ai/Huihui-Ornith-…-abliterated` (refusal removal) → `peculiar-ragdoll/Cyber-Tiel-Coder-35B-A3B-MLX-oQ6e-MTP`(rev `a443d4e`)→ 自建 fixedmtp 头 → FP16 张量转换(本仓库)。本仓库此前的 BF16 版仍可用 revision `32e067dd15c07fbfcf841d53efd011f90c6527b7` 取回(原生支持 bf16 的 M3 及以后机型可优先对比,我们未测)。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 191 |
|
| 192 |
+
## 实测结果
|
|
|
|
| 193 |
|
| 194 |
+
**1. BF16 → FP16(M1 上最大的免费收益)**——图见上(英文部分 `fp16 cast`)。同时段 ABBA:prefill 1K/4K/16K 1085/1406/1096 → **1393/1891/1644** tok/s;16K 首字 14.9 → **10.0 s**;16K 上下文解码 96 → **117**;对话解码 102.5/108.7 → **109.1/112.3**;260 题 206 = 206。
|
| 195 |
+
转换了 1569 个张量(scales、biases、norm、embedding、MTP 头、视觉塔;2.94 GB),最大绝对值 25.4,26103 个极小值下溢为 0;量化 U32 数据与 index 不变。脚本 [`recipe/to_fp16_v2.py`](recipe/to_fp16_v2.py)(任何值溢出即中止)。**只测短上下文纯解码会得出"无收益"的错误结论**,必须测 1K/4K/16K prefill 与 16K 解码。
|
| 196 |
|
| 197 |
+
**2. MTP 深度**——`mtp_fixed_depth` 与 `mtp_adaptive_max_depth` **留空**(0.7.0 默认=自适应)最优:94.2 tok/s,固定 d2 89.8、d3 84.7、关 MTP 59.4。注意 0.7.0 已**静默忽略**旧字段 `mtp_num_draft_tokens`。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 198 |
|
| 199 |
+
**3. 长上下文(hot cache 关闭)**:16K 1620/~100、32K 1320/86–89、64K 957/71、128K 614(首字 3.6 分钟)/60(prefill/解码 tok/s)。单模型 128K 峰值内存 36.8 GB,64 GB Mac 默认 48 GB Metal 上限内可用。
|
|
|
|
|
|
|
|
|
|
| 200 |
|
| 201 |
+
**4. 代码质量取决于你实际使用的思考模式**:我们用**开思考的生产口径**否决了上游 09-29 重量化版与另一款代码模型(LCB60 38 vs 40;324 题 247 vs 242,p=0.30);关思考评测会选错模型。
|
| 202 |
|
| 203 |
+
**5. 试过并否决**:TurboQuant KV(解码 −20 %)、ANE prefill(更慢)、DFlash/SpecPrefill(无收益)、`model_type_override=llm` 省内存(**解码 −23 %、图片请求静默幻觉,切勿使用**)、64 GB 上开 hot cache(挤占长上下文准入)。
|
|
|
|
|
|
|
|
|
|
| 204 |
|
| 205 |
+
## 推荐 oMLX 设置
|
|
|
|
| 206 |
|
| 207 |
+
单模型条目见 [`omlx/model_settings.entry.json`](omlx/model_settings.entry.json)(键名=模型目录名),参数见上方英文部分 JSON。全局:hot cache **关**(`hot_cache_max_size: "0"`)、SSD 缓存开、`max_concurrent_requests: 8`、`memory_guard_tier: balanced` 且 `soft_threshold` 保持 0.85(遗留的 0.70 会让模型互相驱逐)、TurboQuant/DFlash/SpecPrefill/ANE prefill 全关。完整脱敏配置见数据集仓库 `config/`。
|
| 208 |
|
| 209 |
+
## 思考控制
|
|
|
|
| 210 |
|
| 211 |
+
| 目标 | 请求字段 |
|
| 212 |
+
|---|---|
|
| 213 |
+
| 关闭思考 | `"reasoning_effort": "none"`(或 `chat_template_kwargs: {"enable_thinking": false}`) |
|
| 214 |
+
| 力度 | `"reasoning_effort": "low" \| "medium" \| "xhigh"`(`high`/`max` 等同 xhigh),默认 medium |
|
| 215 |
+
| 推理内容 | 走独立的 `reasoning_content` 字段 |
|
| 216 |
+
|
| 217 |
+
## 快速开始
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 218 |
|
| 219 |
+
```bash
|
| 220 |
+
# 下载(国内用镜像、直连不走代理)
|
| 221 |
+
HF_ENDPOINT=https://hf-mirror.com hf download YCF-AI/CyberTiel-Coder-35B-MLX --local-dir ~/models/CyberTiel-Coder-35B-MLX
|
| 222 |
+
# 把 ~/models 加入 oMLX 的 model_dirs,合并 omlx/model_settings.entry.json 到 ~/.omlx/model_settings.json,重启 oMLX
|
| 223 |
+
```
|
| 224 |
|
| 225 |
+
MTP 头 `model-mtp.safetensors` 由 oMLX Lightning MTP 使用,其他运行时我们**未测**。下载后请用 HF 文件列表中的 SHA-256 校验。
|
|
|
|
|
|
|
|
|
|
| 226 |
|
| 227 |
+
## 换机器部署清单
|
|
|
|
| 228 |
|
| 229 |
+
1. 安装同版本 oMLX(0.7.0 或更新),把模型目录放进 `model_dirs`。
|
| 230 |
+
2. 合并上面的设置条目,MTP 深度字段留空。
|
| 231 |
+
3. 关 hot cache、并发 8、内存守卫 `balanced`。
|
| 232 |
+
4. 在**你的机器**上实测:3 提示词对话解码、1K/4K/16K prefill、16K 解码;若改了东西,再用固定题集 + McNemar 检验。协议见数据集仓库。
|
| 233 |
+
5. 芯片支持原生 bf16(M3+)时,先对比 BF16 版本再选。
|
| 234 |
|
| 235 |
+
## 已知限制
|
|
|
|
|
|
|
|
|
|
|
|
|
| 236 |
|
| 237 |
+
- 视觉仅应急:数字 OCR 会错、计数弱;精确任务请用专用 VLM([MiniCPM-V-4.6 版](https://huggingface.co/YCF-AI/MiniCPM-V-4.6-Huihui-abliterated-8bit-MLX))。
|
| 238 |
+
- 去审查只去掉拒答,不去掉幻觉。
|
| 239 |
+
- 全部速度数据:Mac Studio M1 Ultra 64 核 GPU、64 GB、macOS 15.8、oMLX 0.7.0(build 2987)、MLX 0.32.2、mlx-lm 0.31.4.dev、mlx-vlm 0.7.1。
|
config.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
"Qwen3_5MoeForConditionalGeneration"
|
| 4 |
],
|
| 5 |
"bos_token_id": null,
|
| 6 |
-
"dtype": "
|
| 7 |
"eos_token_id": 248046,
|
| 8 |
"hidden_size": 2048,
|
| 9 |
"image_token_id": 248056,
|
|
@@ -14,7 +14,7 @@
|
|
| 14 |
"attention_dropout": 0.0,
|
| 15 |
"attn_output_gate": true,
|
| 16 |
"bos_token_id": 248044,
|
| 17 |
-
"dtype": "
|
| 18 |
"eos_token_id": 248044,
|
| 19 |
"full_attention_interval": 4,
|
| 20 |
"head_dim": 256,
|
|
@@ -106,7 +106,7 @@
|
|
| 106 |
"vision_config": {
|
| 107 |
"deepstack_visual_indexes": [],
|
| 108 |
"depth": 27,
|
| 109 |
-
"dtype": "
|
| 110 |
"hidden_act": "gelu_pytorch_tanh",
|
| 111 |
"hidden_size": 1152,
|
| 112 |
"in_channels": 3,
|
|
|
|
| 3 |
"Qwen3_5MoeForConditionalGeneration"
|
| 4 |
],
|
| 5 |
"bos_token_id": null,
|
| 6 |
+
"dtype": "float16",
|
| 7 |
"eos_token_id": 248046,
|
| 8 |
"hidden_size": 2048,
|
| 9 |
"image_token_id": 248056,
|
|
|
|
| 14 |
"attention_dropout": 0.0,
|
| 15 |
"attn_output_gate": true,
|
| 16 |
"bos_token_id": 248044,
|
| 17 |
+
"dtype": "float16",
|
| 18 |
"eos_token_id": 248044,
|
| 19 |
"full_attention_interval": 4,
|
| 20 |
"head_dim": 256,
|
|
|
|
| 106 |
"vision_config": {
|
| 107 |
"deepstack_visual_indexes": [],
|
| 108 |
"depth": 27,
|
| 109 |
+
"dtype": "float16",
|
| 110 |
"hidden_act": "gelu_pytorch_tanh",
|
| 111 |
"hidden_size": 1152,
|
| 112 |
"in_channels": 3,
|
images/fig11_local_stack_overview.png
ADDED
|
images/fig1_cybertiel_mtp_depth.png
ADDED
|
images/fig3_fp16_cast_prefill_decode.png
ADDED
|
images/fig8_code_candidates_thinking_flip.png
ADDED
|
Git LFS Details
|
model-00001-of-00006.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2d2647113fcac740e2dc04c44257606204af2191d3d48b00d3d6a3ad57e48bbe
|
| 3 |
+
size 5077109679
|
model-00002-of-00006.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cf969af89adadcb4096b8ac59b1358227bc78a5f117da395f5ff614f024e2aa5
|
| 3 |
+
size 5016397244
|
model-00003-of-00006.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b0dcdcf896e4b8bd49bf0d2cd38dbc5d1c7d94252b5a7e18860599952be04d00
|
| 3 |
+
size 5016397254
|
model-00004-of-00006.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:18fd5e2c86842ce0e07800dbbf73ec3a6803945e306168fbd9c9d7532d3b49ad
|
| 3 |
+
size 5016397290
|
model-00005-of-00006.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fdf511c95cd30ba91ba80815874636b4b92340d24df40fd81c0568dedf2efb0b
|
| 3 |
+
size 5016397308
|
model-00006-of-00006.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3bed902e1326d07884d406cae5bd529fa237e94588308335a0dff6c7ca3f2ae6
|
| 3 |
+
size 4362084610
|
model-mtp.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9ad70918d74d2b7a37dae13947bcf5deaa6d3f34435386457bc008e42a75c59b
|
| 3 |
+
size 905703819
|
omlx/model_settings.entry.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_comment": "oMLX 0.7.0 ~/.omlx/model_settings.json entry. Key = directory name of the model under your model_dirs. 键名=模型目录名。",
|
| 3 |
+
"version": 1,
|
| 4 |
+
"models": {
|
| 5 |
+
"CyberTiel-Coder-35B-MLX": {
|
| 6 |
+
"max_context_window": 131072,
|
| 7 |
+
"max_tokens": 32768,
|
| 8 |
+
"temperature": 0.6,
|
| 9 |
+
"top_p": 0.95,
|
| 10 |
+
"top_k": 20,
|
| 11 |
+
"repetition_penalty": 1.0,
|
| 12 |
+
"force_sampling": false,
|
| 13 |
+
"ttl_seconds": 1800,
|
| 14 |
+
"model_alias": "CyberTiel-35B",
|
| 15 |
+
"enable_thinking": true,
|
| 16 |
+
"thinking_budget_enabled": false,
|
| 17 |
+
"guided_grammar_enabled": false,
|
| 18 |
+
"specprefill_enabled": false,
|
| 19 |
+
"mtp_enabled": true,
|
| 20 |
+
"vlm_mtp_enabled": false,
|
| 21 |
+
"trust_remote_code": false
|
| 22 |
+
}
|
| 23 |
+
}
|
| 24 |
+
}
|
recipe/to_fp16_v2.py
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""把 MLX 模型包的浮点张量转换为 F16(M1/M2 无原生 bf16)。源目录只读,输出新目录。
|
| 2 |
+
用法:to_fp16_v2.py <src> <dst> [--f32] (--f32 同时转换 F32 张量,用于 BGE 等 FP32 包)
|
| 3 |
+
不含待转换张量的分片与其他文件用 APFS 克隆(cp -c),不占额外空间。越界(|x|>65504)即中止。"""
|
| 4 |
+
import sys, os, json, struct, subprocess
|
| 5 |
+
import mlx.core as mx
|
| 6 |
+
src, dst = sys.argv[1].rstrip("/"), sys.argv[2].rstrip("/")
|
| 7 |
+
want = {"BF16"} | ({"F32"} if "--f32" in sys.argv else set())
|
| 8 |
+
os.makedirs(dst, exist_ok=True)
|
| 9 |
+
F16_MAX = 65504.0
|
| 10 |
+
rep = {"src": src, "cast_dtypes": sorted(want), "tensors_cast": 0, "max_abs": 0.0, "underflow_nonzero_to_zero": 0, "cloned": [], "rewritten": []}
|
| 11 |
+
for f in sorted(os.listdir(src)):
|
| 12 |
+
sp, dp = os.path.join(src, f), os.path.join(dst, f)
|
| 13 |
+
if os.path.isdir(sp) or f.startswith("."):
|
| 14 |
+
continue
|
| 15 |
+
hdr = {}
|
| 16 |
+
if f.endswith(".safetensors"):
|
| 17 |
+
with open(sp, "rb") as fh:
|
| 18 |
+
n = struct.unpack("<Q", fh.read(8))[0]; hdr = json.loads(fh.read(n))
|
| 19 |
+
if not any(isinstance(v, dict) and v.get("dtype") in want for k, v in hdr.items() if k != "__metadata__"):
|
| 20 |
+
subprocess.run(["cp", "-c", sp, dp], check=True); rep["cloned"].append(f); continue
|
| 21 |
+
meta = hdr.get("__metadata__", {}) or {}
|
| 22 |
+
ws = mx.load(sp); out = {}; cast = 0
|
| 23 |
+
for k, v in ws.items():
|
| 24 |
+
if v.dtype in (mx.bfloat16, mx.float32) and hdr[k]["dtype"] in want:
|
| 25 |
+
vf = v.astype(mx.float32); m = mx.max(mx.abs(vf)).item()
|
| 26 |
+
if m > F16_MAX:
|
| 27 |
+
sys.exit(f"ABORT: {k} max|x|={m} 超出 F16 范围")
|
| 28 |
+
rep["max_abs"] = max(rep["max_abs"], m)
|
| 29 |
+
h = v.astype(mx.float16)
|
| 30 |
+
rep["underflow_nonzero_to_zero"] += int(mx.sum((vf != 0) & (h == 0)).item())
|
| 31 |
+
out[k] = h; cast += 1
|
| 32 |
+
else:
|
| 33 |
+
out[k] = v
|
| 34 |
+
mx.eval(out); mx.save_safetensors(dp, out, metadata=meta)
|
| 35 |
+
rep["tensors_cast"] += cast; rep["rewritten"].append([f, cast]); print(f, cast, flush=True)
|
| 36 |
+
del ws, out
|
| 37 |
+
cfg_p = os.path.join(dst, "config.json")
|
| 38 |
+
if os.path.exists(cfg_p):
|
| 39 |
+
os.remove(cfg_p) # 克隆件,改写前先断开
|
| 40 |
+
c = json.load(open(os.path.join(src, "config.json")))
|
| 41 |
+
for obj in (c, c.get("text_config", {}), c.get("vision_config", {}), c.get("audio_config", {})):
|
| 42 |
+
if isinstance(obj, dict):
|
| 43 |
+
for key in ("torch_dtype", "dtype"):
|
| 44 |
+
if obj.get(key) in ("bfloat16", "float32"):
|
| 45 |
+
obj[key] = "float16"
|
| 46 |
+
json.dump(c, open(cfg_p, "w"), indent=2, ensure_ascii=False)
|
| 47 |
+
name = os.path.basename(dst)
|
| 48 |
+
json.dump(rep, open(os.path.join(os.path.dirname(os.path.abspath(__file__)), f"fp16-{name}.json"), "w"), indent=1)
|
| 49 |
+
print("REPORT", {k: v for k, v in rep.items() if k not in ("cloned", "rewritten")})
|