Skip to main content

AI OS

用语音代替鼠标和键盘来操作 Windows 电脑。基于 DeepSeek(大模型、语音识别、语音合成),一个 API Key 即可运行。

两种用法:

  • 独立语音助手 ai-os:说“小爱,打开记事本写一首诗”,它会读取屏幕控件、点击、输入,并用语音汇报结果。
  • DeepSeek Harness 插件 dsh-ai-os:把桌面控制能力以 MCP 工具的形式提供给 DeepSeek Harness(也适用于 Claude Code、Cursor 等任何 MCP 客户端)。

安装

pip install ai-os-desktop

独立语音助手

在任意目录创建 .env(参考 .env.example),至少填写 DEEPSEEK_API_KEY,然后:

ai-os            # 语音模式
ai-os --text     # 键盘输入指令,调试用
ai-os --once "打开设置调高亮度"

语音模式下屏幕顶部会显示一个状态条(待命 / 聆听 / 识别 / 思考 / 执行 / 说话),它不抢焦点、鼠标可以点穿;不需要时加 --no-overlay。

唤醒词默认在本地离线识别,说出唤醒词之前的声音不会上传:

pip install "ai-os-desktop[wake]"
python -m ai_os.wake      # 下载唤醒模型(约 33 MB)

听到“嘀”一声后说指令;也可以一口气说“小爱,打开计算器”。没装本地模型时自动退回云端识别唤醒词。

接入 DeepSeek Harness

dsh plugin add dsh-ai-os

其他 MCP 客户端可直接把 ai-os-mcp 配置为 stdio 服务器。

插件还在输入框旁加了一个语音对话按钮:按 F8(或点按钮)开始说话,说完自动发送;任务完成后朗读回复,随后几秒内可以直接接着说。朗读时按 F8 打断,Esc 取消。

在别的程序里按 Ctrl+Alt+Space 也能用:它会把 DeepSeek Harness 拉到前台并开始听。这个热键由 ai-os-mcp 进程注册,所以依赖 Python 端正常运行。

ai-os-mcp 通过 MCP 提供 13 个桌面工具(读控件、点击、输入、按键、滚动、开应用/网址/文件、列窗口、切窗口、截图问视觉模型、等待)。它没有暴露命令执行工具,需要跑命令时由 DeepSeek Harness 自己的终端工具处理,走它自己的审批。

如果 agent 还是去写 PowerShell 而不是用这些工具,在工作区放一个 AGENTS.md 说明优先用 ai-os 工具即可(本仓库根目录有一份可以直接参考),或重启 DeepSeek Harness 让工具列表和指令重新加载。

语音识别复用 DeepSeek Harness 官方的语音输入插件(实验功能),无需另外配置 API Key:在侧栏插件中打开它,并按提示完成一次模型准备即可。插件页的「运行检查」会实地读取 MCP 状态:桌面工具连不上时这一行会变红并给出具体原因,不会假装正常。

实测效果

同一台 Windows 11 电脑、同样的 6 个桌面任务(计算器输入、计算器切换模式、系统设置切换深色模式、浏览器填写表单、资源管理器新建文件夹、记事本写入并保存),在 DeepSeek Harness 中分别关闭和开启 dsh-ai-os 运行,模型均为 deepseek-flash:

仅 DeepSeek Harness + dsh-ai-os
成功率 6/6 6/6
耗时中位数 166 秒 26 秒
平均工具调用 12.3 次 9.2 次
平均 token 用量 648K 326K

不装插件时,DeepSeek Harness 需要现写 PowerShell 脚本模拟按键、截图看图、再修改脚本;装上后直接按控件编号点击,每步只回传界面变化。每个任务各运行一次,测试于 2026-11-16。复现方法见 benchmark:python -m benchmark run --mode off|on。

真实会话里差距更大。同一个「列出当前所有窗口」的请求:桌面工具不可用时用时 17 分 10 秒、27 步,因为它去写 EnumWindows 的 PowerShell,每步都撞上 danger-full-access 审批;桌面工具可用后 3 秒完成,且没有任何审批弹窗。「用记事本写下“你好,AI OS”并保存到桌面」这类带写入的任务,全程 14 步、无审批,落盘内容正确。

另有 3 个更难的任务(确认弹窗、多标签页表单、300 项长列表中打开指定项并在详情窗口操作),用 --only hard 运行,结果通过测试程序自身的事件上报核验,无法靠改文件或注册表“作弊”。

工作原理

  1. 本地模型(sherpa-onnx)持续监听唤醒词;唤醒后按音量切分语句,发送到 DeepSeek ASR 转成文字。
  2. 通过 Windows UI Automation 读取前台窗口的控件,编号后连同指令一起交给 deepseek-flash。
  3. 模型通过工具调用点击控件、输入文字、按快捷键、切换窗口;每步之后读取新的屏幕状态再决定下一步。
  4. 结果通过 DeepSeek TTS 朗读;网络不可用时退回 Windows 本地语音。

安全

  • 执行 PowerShell 命令前必须语音确认;删除、发送、付款等不可逆操作会先询问。
  • 鼠标移到屏幕左上角立即中止当前操作。
  • MCP 模式下不提供命令执行工具,交给宿主自己的审批流程。

开发

pip install -e .
python -m ai_os --text
python -m ai_os.mcp_server

Metadata

Release files for ai-os-desktop 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ai-os-desktop 0.1.0
File Size Uploaded Provenance Actions
ai_os_desktop-0.1.0.tar.gz 28.4 kB Without provenance Details for ai_os_desktop-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ai-os-desktop 0.1.0
File Interpreter ABI Platform Actions
ai_os_desktop-0.1.0-py3-none-any.whl Python 3 none any Details for ai_os_desktop-0.1.0-py3-none-any.whl

Total release size: 58.7 kB

Release files / ai_os_desktop-0.1.0.tar.gz

Download URL ai_os_desktop-0.1.0.tar.gz
Size 28.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8b8c8a2a927a02fc37a1cabfdaf89c8b49d2795712ffae78d25267b70bce4121
BLAKE2b-256 checksum
How to use checksums
82310965fce63aa28cc3f34e333cd8e843eac4199611de9a3f8aa92977da8c61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Release files / ai_os_desktop-0.1.0-py3-none-any.whl

Download URL ai_os_desktop-0.1.0-py3-none-any.whl
Size 30.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
29e65b3a36330bd3a82c1fc10cb5fbe9020075b707309565f7efe368ddad865d
BLAKE2b-256 checksum
How to use checksums
2bad5ee88f1295a57777b9b6d88b40c71dcec379ce2272255327dfc32c3c0483
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Security for ai-os-desktop 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page