---
title: Qwen3.5-4B-3D-Coder-OptiQ-4bit
canonical_url: "https://www.modelscope.cn/models/mlx-community/Qwen3.5-4B-3D-Coder-OptiQ-4bit"
md_url: "https://www.modelscope.cn/models/mlx-community/Qwen3.5-4B-3D-Coder-OptiQ-4bit.md"
repository: mlx-community/Qwen3.5-4B-3D-Coder-OptiQ-4bit
last_updated: 2026-11-03
license: apache-2.0
pipeline_tag: text-generation
tasks:
  - text-generation
model_type:
  - qwen3_5
architectures:
  - Qwen3_5ForConditionalGeneration
base_model:
  - ccore/Qwen3.5-4B-3D-Coder
base_model_relation: quantized
parameters: 883.6M
tensor_type:
  - F16
  - U32
  - BF16
library_name:
  - mlx
  - safetensors
  - pytorch
frameworks:
  - pytorch
downloads: 19
stars: 4
tags:
  - mlx
  - quantized
  - mixed-precision
  - 4bit
  - 8bit
  - optiq
  - apple-silicon
  - text-generation
  - qwen3.5
  - three.js
  - 3d
  - game-assets
---

# Qwen3.5-4B-3D-Coder-OptiQ-4bit

> Qwen3.5-4B-3D-Coder-OptiQ-4bit - mlx-community 在 ModelScope 开源的模型。mlx-community/Qwen3.5-4B-3D-Coder-OptiQ-4bit

mlx-community/Qwen3.5-4B-3D-Coder-OptiQ-4bit 是 ModelScope 魔搭社区上的 883.6M 参数text-generation模型，采用 apache-2.0 许可，基于 ccore/Qwen3.5-4B-3D-Coder 构建。

- **Repository**: mlx-community/Qwen3.5-4B-3D-Coder-OptiQ-4bit
- **License**: apache-2.0
- **Tasks**: text-generation
- **Parameters**: 883.6M
- **Base model**: ccore/Qwen3.5-4B-3D-Coder
- **Tags**: mlx, quantized, mixed-precision, 4bit, 8bit, optiq, apple-silicon, text-generation, qwen3.5, three.js, 3d, game-assets
- **Downloads**: 19
- **Stars**: 4
- **Last updated**: 2026-11-03

Source: https://www.modelscope.cn/models/mlx-community/Qwen3.5-4B-3D-Coder-OptiQ-4bit

---

# mlx-community/Qwen3.5-4B-3D-Coder-OptiQ-4bit

> **Built with [mlx-optiq](https://mlx-optiq.com)**, the MLX-native toolkit to quantize, fine-tune, and serve LLMs locally on Apple Silicon, no PyTorch and no cloud. [Try the Lab](https://mlx-optiq.com/docs/lab/) · [All OptiQ quants](https://mlx-optiq.com/models) · [Docs](https://mlx-optiq.com/docs/)

A 4-bit mixed-precision MLX quant of [ccore/Qwen3.5-4B-3D-Coder](https://huggingface.co/ccore/Qwen3.5-4B-3D-Coder), a Qwen3.5 4B fine-tune that writes 3D scenes and assets as single-file Three.js HTML. It runs at about 26 tokens/s on a 24 GB M4, with peak memory between 4 and 6 GB.

## Generated by this quant

Every asset below was written by this quant on an M4, then opened in a browser. The code is unedited, and the HTML is in [`examples/`](./examples) so you can open each one and orbit it yourself.

These are hand-picked from 18 attempts, not a typical sample. See [What to expect](#what-to-expect) for how the rest went.

| | |
|---|---|
| ![Stone golem boss, front](examples/golem-front.png) | ![Stone golem boss, turned](examples/golem-side.png) |
| **Stone golem boss** ([HTML](examples/golem.html)), 10,771 tokens | Same golem, turned on its turntable |
| ![Pirate deck cannon](examples/cannon.png) | ![Three potion bottles on a tray](examples/potions.png) |
| **Pirate deck cannon** ([HTML](examples/cannon.html)), 14,269 tokens | **Potion set** ([HTML](examples/potions.html)), 12,802 tokens |
| ![Voxel swamp goblin](examples/voxel-goblin.png) | ![Castle guard tower](examples/tower.png) |
| **Voxel swamp goblin** ([HTML](examples/voxel-goblin.html)), 20,079 tokens | **Castle guard tower** ([HTML](examples/tower.html)), 14,070 tokens |

They aren't flawless. The potions have no visible corks, the goblin's ears are flat from the side, and the tower's battlements are oversized.

<details>
<summary>Prompts and settings</summary>

System prompt, from the model's author:

```text
Use only the Three.js core ES module from
https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js.
Do not import addons or legacy examples/js paths;
implement any camera controls directly inside the HTML.
```

Settings: temperature 0.6, top_p 0.95, top_k 20, no repetition penalty, `max_tokens` 64000, thinking on, seeded.

**Golem:** Please create one self-contained HTML file with Three.js from cdnjs showing a stone golem boss with glowing green crystals growing from its shoulders. Make it a single game-ready asset: centred on a plain ground plane, a clear readable silhouette, built from separate named meshes, slowly turning on a turntable, with mouse orbit controls.

**Cannon:** Please create one self-contained HTML file with Three.js from cdnjs showing a pirate deck cannon on a wooden carriage with a stack of cannonballs. Make it a single game-ready asset: centred on a plain ground plane, a clear readable silhouette, built from separate named meshes, slowly turning on a turntable, with mouse orbit controls.

**Potions:** Please create one self-contained HTML file with Three.js from cdnjs showing a set of three potion bottles, red, blue and green, with corks, on a small wooden tray. Make it a single game-ready asset: centred on a plain ground plane, a clear readable silhouette, built from separate named meshes, slowly turning on a turntable, with mouse orbit controls.

**Voxel goblin:** Please create one self-contained HTML file with Three.js from cdnjs showing a swamp goblin enemy with big ears, a leather vest and a spiked wooden club. Render it as a deliberate 3D voxel model built from visible cubic blocks, with clear depth, readable silhouettes, and solid spatial relationships. Make it a single game-ready asset centred on a plain ground plane, slowly turning on a turntable, with mouse orbit controls.

**Tower:** Please create one self-contained HTML file with Three.js from cdnjs showing a medieval castle guard tower module with battlements, a wooden door and a flag waving at the top. Make it a single game-ready asset: centred on a plain ground plane, a clear readable silhouette, built from separate named meshes, slowly turning on a turntable, with mouse orbit controls.

</details>

## What to expect

Out of 18 attempts across 10 asset prompts and 8 voxel prompts:

| Outcome | Count |
|---|---:|
| Rendered in the browser | 11 |
| Crashed on load | 3 |
| Reasoning looped until the 64k token cap, no HTML | 4 |

- **An asset takes minutes.** The ones that finished ran 10,000 to 22,000 tokens, or 7 to 14 minutes, most of it reasoning. Set `max_tokens` high. A 20k cap cut off one run that wasn't stuck.
- **Set a cap anyway.** All four loops came from voxel prompts, and each ran about 53 minutes before hitting the cap.
- **Rendering doesn't mean it looks right.** Some that rendered had floating parts or broken animation, and those were left out of the picks above.
- **The crashes were small code errors.** One was a duplicate variable name, which the author lists as a known issue.

No attempts were run on the parent model, so this card makes no claim about how these rates compare with it.

## Quantization details

| Property | Value |
|---|---|
| Predominant precision | 4-bit |
| Layers at 8-bit | 76 |
| Layers at 4-bit | 173 |
| Group size | 64 |
| Vision tower | bf16, in `optiq_vision.safetensors` |
| Size on disk | 3.7 GB, including the vision tower |
| MTP head | None; the source model doesn't ship one, so `--mtp` isn't available |

## How the bit-widths were chosen

**The per-layer allocation was not measured on this model.** It was transferred from [mlx-community/Qwen3.5-4B-OptiQ-4bit](https://huggingface.co/mlx-community/Qwen3.5-4B-OptiQ-4bit), whose allocation came from a KL-divergence sensitivity pass over a six-domain calibration mix.

The two models share an architecture, so each layer in that recipe has a counterpart with the same role and shape. All 249 tensors matched, with none unmatched.

Sensitivity measures how much a layer's role in the architecture suffers from precision loss. It can't tell whether this fine-tune's training moved that sensitivity. To measure the allocation against the model itself, run `optiq convert`.

## What was verified

- 249/249 tensors matched the recipe, 0 unmatched.
- 18 generation runs, with each result opened in headless Chromium and checked for script errors and a drawn canvas.
- Text and image input, both loaded directly and through `optiq serve`.
- OptiQ's release contract.

**Not run for this model:** the six-metric Capability Score. The published scores for the Qwen3.5-4B quant describe that model, not this one, and are not claimed here.

## Use it

```bash
pip install mlx-optiq
optiq serve --model mlx-community/Qwen3.5-4B-3D-Coder-OptiQ-4bit
```

Or with `mlx-lm` directly, for text only:

```python
from mlx_lm import generate, load
from mlx_lm.sample_utils import make_sampler

SYSTEM = """Use only the Three.js core ES module from
https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js.
Do not import addons or legacy examples/js paths;
implement any camera controls directly inside the HTML."""

model, tokenizer = load("mlx-community/Qwen3.5-4B-3D-Coder-OptiQ-4bit")
prompt = tokenizer.apply_chat_template(
    [{"role": "system", "content": SYSTEM},
     {"role": "user", "content": "Please create one self-contained HTML file with Three.js from cdnjs showing a stone golem boss with glowing green crystals growing from its shoulders."}],
    add_generation_prompt=True, tokenize=False)
print(generate(model, tokenizer, prompt=prompt, max_tokens=64000,
               sampler=make_sampler(temp=0.6, top_p=0.95, top_k=20)))
```

The author recommends temperature 0.6 to 0.8, top_p 0.90 to 0.95, top_k 20 to 40, and repeat penalty 1.0.

The per-layer bit map is in `optiq/metadata.json` and in the `quantization` block of `config.json`.
