---
title: LocoOperator-4B-MLX-4bit
canonical_url: "https://www.modelscope.cn/models/DJLougen/LocoOperator-4B-MLX-4bit"
md_url: "https://www.modelscope.cn/models/DJLougen/LocoOperator-4B-MLX-4bit.md"
repository: DJLougen/LocoOperator-4B-MLX-4bit
last_updated: 2026-04-07
license: mit
pipeline_tag: text-generation
tasks:
  - text-generation
model_type:
  - qwen3
architectures:
  - Qwen3ForCausalLM
base_model:
  - LocoreMind/LocoOperator-4B
base_model_relation: quantized
parameters: 628.7M
tensor_type:
  - BF16
  - U32
library_name:
  - mlx
  - safetensors
  - pytorch
frameworks:
  - pytorch
language:
  - en
inference_backends:
  - "deploy_task text/emb"
  - "lmdeploy_turbomind 0.9.1"
  - "sglang 0.5.2"
  - "vllm 0.9.2"
downloads: 12
stars: 0
tags:
  - mlx
  - qwen3
  - agent
  - tool-calling
  - code
  - 4-bit
  - quantized
---

# LocoOperator-4B-MLX-4bit

> LocoOperator-4B-MLX-4bit - DJLougen 在 ModelScope 开源的模型。LocoOperator-4B — MLX 4-bit Quantized

DJLougen/LocoOperator-4B-MLX-4bit 是 ModelScope 魔搭社区上的 628.7M 参数text-generation模型，采用 mit 许可，基于 LocoreMind/LocoOperator-4B 构建，可用 deploy_task text/emb、lmdeploy_turbomind 0.9.1、sglang 0.5.2 部署。

- **Repository**: DJLougen/LocoOperator-4B-MLX-4bit
- **License**: mit
- **Tasks**: text-generation
- **Parameters**: 628.7M
- **Base model**: LocoreMind/LocoOperator-4B
- **Inference backends**: deploy_task text/emb, lmdeploy_turbomind 0.9.1, sglang 0.5.2, vllm 0.9.2
- **Tags**: mlx, qwen3, agent, tool-calling, code, 4-bit, quantized
- **Downloads**: 12
- **Stars**: 0
- **Last updated**: 2026-04-07

Source: https://www.modelscope.cn/models/DJLougen/LocoOperator-4B-MLX-4bit

---

# LocoOperator-4B — MLX 4-bit Quantized

This is a **4-bit quantized MLX** version of [LocoreMind/LocoOperator-4B](https://huggingface.co/LocoreMind/LocoOperator-4B), converted for efficient inference on Apple Silicon using [MLX](https://github.com/ml-explore/mlx).

## Model Overview

| Attribute | Value |
|---|---|
| **Original Model** | [LocoreMind/LocoOperator-4B](https://huggingface.co/LocoreMind/LocoOperator-4B) |
| **Architecture** | Qwen3 (4B parameters) |
| **Quantization** | 4-bit (MLX) |
| **Base Model** | Qwen3-4B-Instruct-2507 |
| **Teacher Model** | Qwen3-Coder-Next |
| **Training Method** | Full-parameter SFT (distillation from 170K samples) |
| **Max Sequence Length** | 16,384 tokens |
| **License** | MIT |

## About LocoOperator-4B

LocoOperator-4B is a 4B-parameter tool-calling agent model trained via knowledge distillation from Qwen3-Coder-Next inference traces. It specializes in multi-turn codebase exploration — reading files, searching code, and navigating project structures within a Claude Code-style agent loop.

### Key Features

- **Tool-Calling Agent**: Generates structured `<tool_call>` JSON for Read, Grep, Glob, Bash, Write, Edit, and Task (subagent delegation)
- **100% JSON Validity**: Every tool call is valid JSON with all required arguments — outperforming the teacher model (87.6%)
- **Multi-Turn**: Handles conversation depths of 3–33 messages with consistent tool-calling behavior

### Performance

| Metric | Score |
|---|---|
| Tool Call Presence Alignment | **100%** (65/65) |
| First Tool Type Match | **65.6%** (40/61) |
| JSON Validity | **100%** (76/76) |
| Argument Syntax Correctness | **100%** (76/76) |

## Usage with MLX

```bash
pip install mlx-lm
```

```python
from mlx_lm import load, generate

model, tokenizer = load("DJLougen/LocoOperator-4B-MLX-4bit")

messages = [
    {
        "role": "system",
        "content": "You are a read-only codebase search specialist."
    },
    {
        "role": "user",
        "content": "Analyze the project structure at /workspace/myproject and explain the architecture."
    }
]

prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
response = generate(model, tokenizer, prompt=prompt, max_tokens=512)
print(response)
```

## Other Quantizations

| Variant | Link |
|---|---|
| MLX 4-bit | **This repo** |
| MLX 6-bit | [DJLougen/LocoOperator-4B-MLX-6bit](https://huggingface.co/DJLougen/LocoOperator-4B-MLX-6bit) |
| MLX 8-bit | [DJLougen/LocoOperator-4B-MLX-8bit](https://huggingface.co/DJLougen/LocoOperator-4B-MLX-8bit) |
| GGUF | [LocoreMind/LocoOperator-4B-GGUF](https://huggingface.co/LocoreMind/LocoOperator-4B-GGUF) |
| Full Weights | [LocoreMind/LocoOperator-4B](https://huggingface.co/LocoreMind/LocoOperator-4B) |

## Acknowledgments

- [LocoreMind](https://huggingface.co/LocoreMind) for the original LocoOperator-4B model
- [Qwen Team](https://huggingface.co/Qwen) for the Qwen3-4B-Instruct-2507 base model
- [Apple MLX Team](https://github.com/ml-explore/mlx) for the MLX framework
