---
title: domux
canonical_url: "https://www.modelscope.cn/models/iflytek/domux"
md_url: "https://www.modelscope.cn/models/iflytek/domux.md"
repository: iflytek/domux
chinese_name: domux
last_updated: 2026-07-01
license: gemma
model_type:
  - gemma4
architectures:
  - Gemma4ForConditionalGeneration
base_model:
  - google/gemma-4-E2B-it
base_model_relation: finetune
parameters: 5.1B
tensor_type:
  - BF16
library_name:
  - safetensors
language:
  - en
downloads: 23
stars: 7
tags:
  - smart-home
  - intent-parsing
  - slot-filling
  - command-understanding
  - gemma
  - iflytek
  - edge
---

# domux

> domux - iflytek 在 ModelScope 开源的模型。A lightweight low-latency model converting natural home commands into structured data, fine-tuned via SFT and GRPO.

iflytek/domux 是 ModelScope 魔搭社区上的 5.1B 参数机器学习模型，采用 gemma 许可，基于 google/gemma-4-E2B-it 构建。

- **Repository**: iflytek/domux
- **License**: gemma
- **Parameters**: 5.1B
- **Base model**: google/gemma-4-E2B-it
- **Tags**: smart-home, intent-parsing, slot-filling, command-understanding, gemma, iflytek, edge
- **Downloads**: 23
- **Stars**: 7
- **Last updated**: 2026-07-01

Source: https://www.modelscope.cn/models/iflytek/domux

---

<div align="center">
  <h1>Domux</h1>
  <p><b>面向智能家居控制的轻量级低延迟指令理解模型</b></p>

  <p>
    <a href="https://github.com/iflytek/domux"><img src="https://img.shields.io/badge/GitHub-Repo-181717?logo=github"></a>
    <a href="https://huggingface.co/iFlytekOpenSource/Domux"><img src="https://img.shields.io/badge/🤗%20Hugging%20Face-模型-yellow"></a>
    <a href="https://ai.google.dev/gemma/terms"><img src="https://img.shields.io/badge/License-Gemma%20Terms-green"></a>
    <img src="https://img.shields.io/badge/推理-vLLM%20%7C%20SGLang-orange">
  </p>
</div>

---

Domux (`Domux-Gemma-4-E2B-it`) 是基于 **Gemma-4-E2B-it** 微调的语言模型。它将自然语言智能家居指令转换为结构化的竖线分隔槽位。训练结合了监督微调（SFT）与基于组相对策略优化（GRPO）的强化学习和自定义奖励函数。

> 📦 **代码、训练脚本、评测套件、完整技术报告与数据集** 均在 GitHub 仓库：**[github.com/iflytek/domux](https://github.com/iflytek/domux)**。

## ✨ 核心特性

- **快速响应** — 针对边缘设备和服务器的低延迟推理进行优化。
- **结构化槽位输出** — 将自由格式指令解析为固定的 7 字段竖线分隔格式。
- **高准确率** — 98.37% 结果准确率，100% 格式合规性，超越体量大得多的模型。
- **轻量级基座** — 构建于紧凑的 Gemma-4-E2B-it 之上，适合设备端和边缘部署。
- **多动作支持** — 处理映射到多个槽位行的复合指令。
- **跨设备泛化** — 处理每个类别下的任意设备名，而非固定白名单。

## 🎬 输出格式

模型输出包含 7 个字段的竖线分隔槽位。使用 `*` 表示未指定或无关字段。

```
action|device|attribute|value|unit|room|floor
```

### 基础示例

| 输入 | 输出 |
| --- | --- |
| Turn on the living room light（打开客厅的灯） | `turnOn\|Light\|*\|*\|*\|Living Room\|*` |
| Set bedroom AC to 22 degrees（将卧室空调设为 22 度） | `set\|AC\|temperature\|22\|Celsius\|Bedroom\|*` |
| Close the curtains 20 percent（关闭窗帘 20%） | `adjustDown\|Curtain\|openness\|20\|Percent\|*\|*` |

### 复杂多属性指令

**输入：**
```
Turn on the Master Light in the Master Bedroom on the Second Floor,
set brightness to 80%, color temperature to 4000K, color to Blue, and mode to Reading.
（打开二楼主卧的主灯，将亮度设为 80%，色温设为 4000K，颜色设为蓝色，模式设为阅读）
```

**输出：**
```
turnOn|Light|*|*|*|Master Bedroom|Second Floor
set|Light|brightness|80|Percent|Master Bedroom|Second Floor
set|Light|colorTemperature|4000|Kelvin|Master Bedroom|Second Floor
set|Light|color|Blue|*|Master Bedroom|Second Floor
set|Light|mode|Reading|*|Master Bedroom|Second Floor
```

完整规范见：[输出格式文档](https://github.com/iflytek/domux/blob/main/docs/output-spec.zh.md)。

## 🏠 支持的控制能力

Domux **不依赖固定的设备白名单** —— 模型通过语义理解处理各类设备名称。

| 设备类型 | 命名示例 | 可控属性 | 取值范围 |
| --- | --- | --- | --- |
| **灯具** `Light` | Light、Strip Light、Spot Light、Desk Lamp | `brightness` 亮度 / `color` 颜色 / `colorTemperature` 色温 / `mode` 模式 | 0–100% / Blue、Red、Green… / 3000–6500 K / Reading、Romance、Soft… |
| **空调** `AC` | AC、AC 1 | `temperature` 温度 / `mode` 模式 / `windSpeed` 风速 | 16–30 °C / Cool、Heat、Dry、Fan、Auto / Low、Medium、High |
| **窗饰** `Curtain` / `Blind` | Curtain、Blind、Sheer Curtain | `position` 开合位置 | 0–100% |
| **场景模式** | Romantic Mode、Party Mode、Sleeping Mode | — | — |

**控制动作**：`turnOn`、`turnOff`、`set`、`adjustUp`、`adjustDown`、`activate`、`deactivate`、`pause`。

**空间定位**：房间（Living Room、Bedroom、Kitchen、Majlis、Prayer Room 等）与楼层（Ground Floor、Upstairs、Downstairs 等），支持编号变体。

## 📊 Benchmark

在涵盖 4 个维度（单意图、多意图、属性省略、非标准命名）的 **4,057 个样本**的综合测试集上进行评估，与 **11 个主流模型**进行基准对比，包括 Qwen3.5 系列（2B-27B）、Gemma 4 系列以及领先的闭源 API（DeepSeek-V4、Claude Haiku 4.5、Gemini 3.5 Flash）。

结果准确率达到 **98.37%**，格式合规性 **100%**。

📄 完整技术报告与 Benchmark 图表：[GitHub 仓库](https://github.com/iflytek/domux#-benchmark)。

**测试集**与**评测脚本**已在 [`eval/`](https://github.com/iflytek/domux/tree/main/eval) 开源，方便你复现结果或评估自己的模型。

## 🚀 快速开始

### 硬件

模型以 **BF16 精度**运行，单卡部署需要 **20GB 及以上显存**。

### 下载

```bash
# 方式 1：ModelScope（推荐）
pip install modelscope
python -c "from modelscope import snapshot_download; snapshot_download('iflytek/domux', cache_dir='./models')"

# 方式 2：Hugging Face
git lfs install
git clone https://huggingface.co/iFlytekOpenSource/Domux
```

### 使用 vLLM 推理

```bash
pip install "vllm==0.22.0"
```

```python
from vllm import LLM, SamplingParams

# 指向你下载的模型目录
llm = LLM(model="models/iflytek/domux", dtype="bfloat16")
sampling = SamplingParams(temperature=0.0, max_tokens=256)

prompt = "Turn on the Master Light in the Master Bedroom on the Second Floor, set brightness to 80%, color temperature to 4000K, color to Blue, and mode to Reading."
output = llm.chat([{"role": "user", "content": prompt}], sampling)
print(output[0].outputs[0].text)

# 输出：
# turnOn|Light|*|*|*|Master Bedroom|Second Floor
# set|Light|brightness|80|Percent|Master Bedroom|Second Floor
# set|Light|colorTemperature|4000|Kelvin|Master Bedroom|Second Floor
# set|Light|color|Blue|*|Master Bedroom|Second Floor
# set|Light|mode|Reading|*|Master Bedroom|Second Floor
```

### 部署为 OpenAI 兼容 API

```bash
# vLLM
python -m vllm.entrypoints.openai.api_server \
  --model models/iflytek/domux \
  --served-model-name domux \
  --host 0.0.0.0 --port 8000 \
  --dtype bfloat16 --max-model-len 2048 --gpu-memory-utilization 0.9
```

```bash
# SGLang
pip install "sglang[all]==0.5.12"
python -m sglang.launch_server \
  --model-path models/iflytek/domux \
  --host 0.0.0.0 --port 8000 \
  --dtype bfloat16 --context-length 2048
```

```python
from openai import OpenAI

client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
response = client.chat.completions.create(
    model="domux",
    messages=[{"role": "user", "content": "Turn on the bedroom light and set brightness to 60%"}],
    temperature=0.0,
)
print(response.choices[0].message.content)
```

## 📄 许可证

**模型权重**是 Google Gemma 的衍生产物，其使用受 **[Gemma Terms of Use](https://ai.google.dev/gemma/terms)** 和 **[Gemma Prohibited Use Policy](https://ai.google.dev/gemma/prohibited_use_policy)** 约束。"Gemma" 是 Google LLC 的商标。

仓库内随附的**源代码**（训练脚本、奖励插件、评测工具）以 **Apache-2.0** 协议授权，详见 [GitHub 仓库](https://github.com/iflytek/domux)。

## 🙏 致谢

- 基座模型：[Gemma](https://ai.google.dev/gemma)
- 训练框架：[ModelScope-Swift](https://github.com/modelscope/swift)
- 实验跟踪：[SwanLab](https://swanlab.cn/)

## 引用

```bibtex
@misc{domux2026,
  title  = {Domux: A Lightweight Low-Latency Command Understanding Model for Smart-Home Control},
  author = {iFLYTEK CO., LTD.},
  year   = {2026},
  url    = {https://github.com/iflytek/domux}
}
```
