使用指南
User guide
写给第一次用的人:先说怎么做,再说为什么;每一节都写了出错会怎样。所有界面名字和工作台上的一致。
Written for a first-time user: what to do first, why second, and what happens when it goes wrong. Every UI name matches the Studio.
安装与启动Install and start
要什么What you need
| 项Item | 要求Requirement |
|---|---|
| 机器Machine | NVIDIA DGX Spark(128 GB 统一内存)。本页所有数字都来自它。NVIDIA DGX Spark (128 GB unified memory). Every number on this site comes from it. |
| 系统OS | Linux aarch64 + CUDA 13 运行库Linux aarch64 with the CUDA 13 runtime |
| 硬盘Disk | SSD 空闲约 320 GB(模型约 317 GB)~320 GB free SSD (the model is ~317 GB) |
| 火狐Firefox | 上网、做视频要用。Spark 上的 Ubuntu 自带;没有火狐时这几个工具不出现在工具表里,别的照常。Needed for the web and video tools. Ubuntu on the Spark ships it; without it those tools simply do not appear, everything else works. |
| Mac | make 编出 Metal 版,GPU 核测试全过;整模型还没在 Mac 上跑过。make builds the Metal version and its GPU kernel tests pass; the full model has not run on a Mac yet. |
编译并启动Build and start
git clone https://github.com/fodelf/YoungAi.git ~/ds4-main
cd ~/ds4-main
make cuda-spark
./ds4-train --host 0.0.0.0 --port 8000
ds4-train 是工作台主进程,一直开着别关:页面、助理、任务、训练都住在它里面。模型是它拉起的子进程(ds4-server,只听本机 127.0.0.1:8001),换模型、训练时会被停掉再拉起来,主进程不受影响。
ds4-train is the Studio's main process; leave it running. The page, the assistant, tasks and training all live inside it. The model is a child process it starts (ds4-server, listening only on 127.0.0.1:8001); switching models or training stops and restarts that child without touching the main process.
第一次打开First visit
- 浏览器打开
http://主机:8000/,设一个用户名和密码。以后每台浏览器登录一次,30 天免登,天天用会自动续期。 - Open
http://<host>:8000/and set a username and password. Each browser logs in once and stays logged in for 30 days, renewed as you use it. - 模型页点"下载"(约 317 GB,断点续传,下了一半关掉也不白下),下完点"加载"(约 2 分钟,先自己答对一句才算装好)。
- On Models, press Download (~317 GB, resumable — closing halfway loses nothing), then Load (~2 minutes; it must answer a self-test correctly before it counts as loaded).
- 去助理页说话。
- Go to Assistant and talk.
~/.ds4/studio/auth,刷新页面重新设置,不用重启。所有浏览器的旧登录同时作废。
Forgot the password: on the machine running the Studio, delete ~/.ds4/studio/auth and reload the page to set a new one; no restart needed. Every browser's old login is revoked at the same time.工作台地图Studio map
电脑上是左侧栏,手机上是底部四格(助理 / 模型 / 训练 / 更多),其余页签在"更多"里。
On a computer the tabs are in the left sidebar; on a phone there are four at the bottom (Assistant / Models / Train / More) and the rest are under More.
和助理对话Talking to the assistant
- 发送:电脑上 Enter 发送、Shift+Enter 换行;手机上回车只换行,点"发送"才发。
- 附件:输入框旁的附件按钮。文件存进工作区的
inbox/,消息里自动附一行"附件:inbox/x.docx (123 KB)",它就知道去哪读。 - 停止:随时能停。关掉网页它也照样干完——对话进度存在服务器上,换台设备打开还能接着看。
- 思考过程:它默认先想再做,想的内容折叠在"思考过程"里,点开能看。
- 工具卡:每次调用工具显示一行(工具名、参数、耗时、守门结果),点开看详情。
- 交付:只有它决定交东西时才出卡片或按钮——普通问答就是一段回答,不会硬塞个下载按钮。
- 领域下拉:金融 / 编程 / 法律 / 医疗 / 科研,切的是约 40 MB 的侧车,不到 1 秒,不重装模型。
- "后训练"开关:挂上你自己训出来的那份(见训练)。
- Send: on a computer Enter sends and Shift+Enter adds a line; on a phone Return adds a line and the Send button sends.
- Attachments: the attach button next to the input. Files land in the workspace's
inbox/and the message gets a line like "attachment: inbox/x.docx (123 KB)" so it knows where to read. - Stop: any time. Closing the page does not stop it — the conversation lives on the server, so another device can pick it up.
- Thinking: it thinks before acting by default; the thoughts are folded under "Thinking" and can be expanded.
- Tool cards: every tool call shows one line (name, arguments, time, gatekeeper decision); expand for details.
- Hand-off: cards and buttons appear only when it decides to deliver something. A plain question gets a plain answer, not a forced download button.
- Domain dropdown: finance / code / law / medicine / science switches a ~40 MB sidecar in under a second without reloading the model.
- Post-train switch: mounts the add-on you trained yourself (see training).
语音输入Voice input
用法和微信一样。语音识别在这台机器的 GPU 上跑,录音不离开它。
It works like WeChat. Speech recognition runs on this machine's GPU, so the recording never leaves it.
- 输入框空着时,最右边的圆钮是麦克风。点一下切到语音模式,第一次会问麦克风权限。
- With the input box empty, the rightmost round button is a microphone. Tap it to switch to voice mode; the first time, the browser asks for microphone permission.
- 输入框变成"按住 说话"长条。按住说,上方显示音量和秒数,最后 5 秒会倒数。
- The input turns into a "Hold to talk" bar. Hold it and speak; a level meter and timer appear above, counting down in the last 5 seconds.
- 松手 → "识别中…" → 识别出的文字直接作为消息发出,输入框里原来的草稿不动。手指往上滑超过一截再松手 = 取消,不上传。
- Let go → "Recognizing…" → the text is sent as a message right away; any draft in the input box is left alone. Slide your finger up before letting go to cancel; nothing is uploaded.
- 圆钮变成键盘时点它,回到打字。下次打开会记得你上次用的是哪种。
- Tap the button when it shows a keyboard to go back to typing. The page remembers which mode you used last.
| 项Item | 说明Details |
|---|---|
| 模型Model | moonshine-tiny-zh,2700 万参数、108 MB;推理是本项目自己写的 C + GPU 核(CUDA / Metal),没有 Python 和 ONNXmoonshine-tiny-zh, 27M parameters, 108 MB; inference is this project's own C + GPU kernels (CUDA / Metal), with no Python or ONNX |
| 速度Speed | Spark 上一段 3.4 秒的话识别 51 毫秒;手机先在页面里转成 16 kHz 再上传,30 秒的录音不到 1 MB51 ms for a 3.4-second utterance on the Spark; the page converts to 16 kHz before uploading, so 30 seconds is under 1 MB |
| 限制Limits | 只认中文;一次最长 30 秒(到点自动发出);按住不到 0.6 秒算太短,不上传Chinese only; up to 30 seconds (it sends automatically at the limit); holds under 0.6 seconds count as too short and are not uploaded |
| 准确率Accuracy | 它是最小的那一档:论文在难测试集(众包录音、各种口音)上的错字率约 29%~36%。对着手机清楚地说会好得多,但比大模型差一个档次The smallest tier: the paper reports a 29–36% character error rate on hard test sets (crowd-sourced recordings, many accents). Clear speech into a phone does much better, but it is a notch below large models |
| 现状Status | Mac 和 Spark 上的识别结果与官方参考实现逐字一致,Spark 生产服务冒烟通过;真手机上试过几句(三句错两个字);三台手机各念 10 句的正式验收还没跑Transcripts on the Mac and the Spark match the official reference character for character, and the Spark production server passed a smoke test; a real phone has been tried on a few sentences (two wrong characters in three); the formal run of 10 sentences on each of three phones has not been done yet |
怎么开How to turn it on
识别模型不随仓库发,要你自己下载。把下面几个文件放进 gguf/asr/moonshine-tiny-zh/,再到"模型"页重新加载一次,麦克风就出现了:
The recognizer is not shipped with the repo; download it yourself. Put these files in gguf/asr/moonshine-tiny-zh/, then load the model again on Models, and the microphone appears:
mkdir -p gguf/asr/moonshine-tiny-zh && cd gguf/asr/moonshine-tiny-zh
for f in config.json tokenizer.json model.safetensors LICENSE.txt; do
curl -fLO https://huggingface.co/moonshine-ai/moonshine-tiny-zh/resolve/main/$f
done
- 没有这个目录,这个功能就不存在:不出麦克风,也不报错。
- 麦克风要 https 或 localhost 打开页面才有(浏览器规定)。用
http://局域网IP打开时最右边只有发送键,见手机与外网。 - 识别跟着模型子进程走:训练时模型停下,语音也暂时用不了。
- Without that folder the feature simply does not exist: no microphone, no error.
- The microphone needs the page opened over https or localhost (a browser rule). Over
http://<LAN-IP>the rightmost button is just Send; see phone and internet. - Recognition lives in the model process: while training stops the model, voice input is unavailable too.
工具逐个看Every tool
你不用点名工具,正常说话就行,它自己挑。下面每组写了"可以这么说"、要什么前提、拿不到时会怎样。
You never name a tool; just talk and it picks. Each group below lists what you can say, what it needs and what happens when it cannot.
上网:web_search · visit_pageWeb: web_search · visit_page
可以这么说:"查一下今天 DGX Spark 的最低价"、"打开这个链接总结一下"。它用本机的无头火狐搜索(必应)和取正文,网页正文头 16 KB 回给模型,全文留在工作区。
Try: "What's the lowest DGX Spark price today?", "Open this link and summarize it." It uses headless Firefox on the machine to search (Bing) and fetch page text; the first 16 KB goes to the model and the full text stays in the workspace.
- 要登录或有验证码的网站打不开;它会说哪些没打开,不会去猜内容。
- 它不会访问本机或内网地址(防止绕过登录读工作台接口)。
- Sites behind a login or captcha stay closed; it says which ones it could not open instead of guessing.
- It will not visit local or LAN addresses (that would bypass the Studio login).
文件:read_file · list_dir · search_files · write_file · edit_fileFiles: read_file · list_dir · search_files · write_file · edit_file
可以这么说:"把 notes.md 里的 foo 都改成 bar"、"看看 Downloads 里有哪些 PDF"。工作区里自动放行;工作区外的路径会弹审批卡(见审批)。想让它常驻管某个目录,在"活动"页加进"允许的目录"。
Try: "Change every foo to bar in notes.md", "Which PDFs are in Downloads?" Inside the workspace it just proceeds; paths outside raise an approval card (see approvals). To let it manage a folder permanently, add it under "Allowed folders" on Activity.
- 改文件前它会先读原文;删除前整份复制到
workspace/.trash/。
- It reads a file before editing it; before deleting, it copies the whole file to
workspace/.trash/.
跑程序:runPrograms: run
可以这么说:"把这份 Word 转成 PDF"、"把 data.csv 按月汇总"。命令在内核沙盒里跑:没有网络、只能写工作区,所以默认不逐次审批。命令里写了别的路径也只是在沙盒里失败。
Try: "Convert this Word file to PDF", "Sum data.csv by month." Commands run in the kernel sandbox with no network and write access only to the workspace, which is why they do not need per-call approval. A path elsewhere in the command just fails inside the sandbox.
- 它能用的程序取决于你装了什么:启动后第一次用到时会探测
soffice pandoc ffmpeg magick python3 qpdf pdftotext node jq sqlite3 zip等,"活动"页显示"工具箱:已有 N · 缺 …"。没装的它不会瞎试;装软件是你的事。 - 不想让它跑程序:活动页关掉"允许在沙盒里跑程序"。
- What it can run depends on what you installed: on first use it probes
soffice pandoc ffmpeg magick python3 qpdf pdftotext node jq sqlite3 zipand more, and Activity shows "Toolbox: have N · missing …". It does not try programs that are absent; installing them is up to you. - To forbid running programs, turn off "Allow running programs in the sandbox" on Activity.
办公文档:write_document · write_xlsxOffice files: write_document · write_xlsx
可以这么说:"把这次调研写成 Word 报告,顺便出一份 PDF"、"做一份 6 页的 PPT 讲这个方案"、"把这些数做成 Excel,最后一行求和"。
Try: "Write this research up as a Word report, and a PDF too", "Make a 6-slide deck on this plan", "Put these numbers in Excel with a total row."
| 工具Tool | 出什么Output | 说明Notes |
|---|---|---|
write_document | .docx / .pdf / .pptx | 按扩展名定格式;内容是 Markdown(标题、列表、粗斜体、代码、引用、表格、图片)。PPT 用 --- 分页。A4 / 16:9、版式固定。also 一次多出一种(docx ↔ pdf)。Format from the extension; content is Markdown (headings, lists, bold/italic, code, quotes, tables, images). Slides split on ---. Fixed A4 / 16:9 layout. also writes a second format in one go (docx ↔ pdf). |
write_xlsx | .xlsx | 表名 / 列头 / 行;= 开头是公式。SUM、AVERAGE、MIN、MAX、COUNT、四则运算现场算好,手机预览直接看到数;别的函数留给 Excel 打开时算。Sheet name / columns / rows; strings starting with = are formulas. SUM, AVERAGE, MIN, MAX, COUNT and arithmetic are computed on the spot so phone previews show values; other functions are left for Excel. |
- 格式全部是本项目自己用 C 写的,不需要装 Office 或 LibreOffice。
- PDF 里的中文要本机有 TrueType 中文字体(Mac 自带;Linux 上如 Droid Sans Fallback、文泉驿)。找不到时 PDF 不内嵌字体,手机上可能显示成方块,结果里会写明"not embedded"。
- Every format is written by this project's own C code; no Office or LibreOffice needed.
- Chinese text in a PDF needs a TrueType CJK font on the machine (macOS has one; on Linux e.g. Droid Sans Fallback or WenQuanYi). Without one the PDF does not embed fonts and may show boxes on a phone; the result says "not embedded".
视频:make_videoVideo: make_video
可以这么说:"做一个 20 秒的竖屏视频介绍我们的新品,配中文旁白"。模型写一页 HTML 动画,火狐按时间逐帧截图,本项目自写的 H.264 + AAC 编码器出 mp4。这是"模型写动画程序",不是扩散模型生成实拍画面。
Try: "Make a 20-second portrait video introducing our new product, with narration." The model writes an HTML animation, Firefox captures it frame by frame, and the project's own H.264 + AAC encoder writes the mp4. It is the model writing an animation program, not a diffusion model generating footage.
- 要本机有火狐。旁白:Mac 用系统自带的
say;Linux 用随发布包下载的小语音模型(没有时退回系统自带的 espeak-ng,机械感明显)。背景音乐只认工作区里的.wav。 - 速度参考:30 秒 1080p 带旁白,Mac 约 1 分钟,约 5–6 MB。
- Needs Firefox. Narration: macOS uses the built-in
say; Linux uses a small voice model downloaded with the release (falling back to the system espeak-ng, which sounds robotic). Background music must be a.wavin the workspace. - For scale: a 30-second narrated 1080p clip takes about a minute on a Mac and is 5–6 MB.
地点:locate · nearbyPlaces: locate · nearby
可以这么说(在手机上):"附近有什么好吃的"、"帮我点个外卖"。locate 向手机要一次定位(同一对话里会记住,下一条消息直接用),地址由服务端反查;nearby 查周边。
Try (on a phone): "Anything good to eat nearby?", "Order me some takeout." locate asks the phone for a fix (remembered for the rest of the conversation) and the server looks up the address; nearby finds places around it.
- 高德 Key:到 lbs.amap.com 建一个"Web 服务"类型的 Key,填进"设置"里的"地图"。有 Key 返回最多 10 家真实店铺(距离、评分、人均、电话、坐标);没 Key 退成按你所在街道搜网页,名字来自点评页、距离没核过。
- Key 存在本机
~/.ds4/assistant/secrets/,只在发请求的那一刻填进去,模型永远看不到它。 - 点外卖:它只负责挑,按钮点开是美团 / 饿了么的搜索页,加购和付款你自己来——它没有登录态,也没有付款工具。
- AMap key: create a "Web Service" key at lbs.amap.com and enter it under "Maps" in Settings. With a key you get up to 10 real places (distance, rating, price, phone, coordinates); without one it falls back to a web search around your street, with names from review sites and no verified distances.
- The key is stored in
~/.ds4/assistant/secrets/on the machine and filled in only when the request is sent; the model never sees it. - Takeout: it only picks. The buttons open Meituan / Ele.me search pages; adding to cart and paying are yours — it has no login and no payment tool.
交给手机:share · copy_text · navigate · call · open_url · open_app · read_clipboard · pick_fileTo your phone: share · copy_text · navigate · call · open_url · open_app · read_clipboard · pick_file
这些工具在你正在用的那台设备上执行。页面开页时报告这台设备能做什么,模型只看得到真能用的那些。
These run on the device you are using. When the page opens it reports what the device can do, and the model only sees the tools that really work there.
| 工具Tool | 页面上是什么On the page |
|---|---|
share | 文件卡(下载 / 分享)或文字卡;分享打开系统面板,选微信、钉钉就是附件a file card (download / share) or a text card; Share opens the system sheet, where WeChat or DingTalk receive it as an attachment |
navigate | 导航按钮:iPhone 开苹果地图,安卓交给地图 app(没装就开高德网页),电脑开高德网页a Navigate button: Apple Maps on iPhone, a map app on Android (AMap web if none), AMap web on a computer |
call · open_url · copy_text | 拨号 / 打开 / 复制按钮Call / Open / Copy buttons |
open_app | 打开抖音(到搜索结果)、微信、钉钉、支付宝、美团、饿了么。电脑上没有opens Douyin (search results), WeChat, DingTalk, Alipay, Meituan, Ele.me. Not on computers |
read_clipboard · pick_file | 它要你的剪贴板内容或一个文件,设备交回后它接着干it asks for your clipboard or a file and continues once the device returns it |
任务与通知Tasks and notifications
交一件事给它持续跟Hand over a job to keep following
- 去任务页,输入一句话,比如 "每天看一下这款显卡的价格,降到 3 万以下告诉我",回车。
- On Tasks, type one sentence, e.g. "Check this GPU's price daily and tell me when it drops below X", and press Enter.
- 它马上做第一遍,然后自己决定多久后再看(并给下次的自己留一句话);做完了自己收口。没说下次几点时,默认一小时后再跟。
- It does a first pass right away, then decides itself when to look again (leaving a note for its next run); when done it closes the task. If it forgets to say when, it follows up an hour later.
- 列表每行:那句话、跟进了几次、下次几点、它留的话。按钮:打开(进它的专属对话,每一步都在里面)/ 现在跟进 / 暂停 / 完成 / 删除。
- Each row shows the sentence, how many follow-ups, the next time and its note. Buttons: Open (its own conversation with every step) / Follow up now / Pause / Done / Delete.
只有按时间触发,没有"文件变了就…"这种事件触发。删除的任务挪进回收站目录,不真删。
Triggers are time-based only; there is no "when this file changes…". Deleted tasks move to a trash folder rather than being erased.
把通知推到手机Push notifications to your phone
- 用 https 打开工作台(iPhone 还要先"添加到主屏幕"、从主屏幕图标打开)。
- Open the Studio over https (on iPhone, first Add to Home Screen and open it from the icon).
- 任务页顶上"通知"卡,打开"在这台设备上接收通知",浏览器问一次权限。
- In the "Notifications" card at the top of Tasks, turn on "Receive notifications on this device"; the browser asks for permission once.
- 点"发一条测试",看手机有没有弹。
- Press "Send a test" and check that it pops up.
之后三种情况会推:它用 notify 主动提醒你(可以定时,"明早 7 点半提醒我出发"、"30 秒后提醒我",准到秒);任务做完;任何一次回答跑了超过 2 分钟。你正开着页面在看的那台设备不推,直接在页面里显示,切走后再补推。
After that, three things push: it reminds you via notify (schedulable to the second — "remind me at 7:30 tomorrow", "remind me in 30 seconds"); a task finishes; any answer that took over 2 minutes. A device whose page you are looking at gets no push; it shows in the page and is pushed later if you switch away.
curl exit 28)。在通知卡里填"推送代理"(如 http://127.0.0.1:7890)。iPhone 走苹果的服务器,一般直连就行。没有任何设备开通知时,它会直接告诉你去任务页打开。
Android receives nothing: Android Chrome push goes through Google FCM, which times out from mainland China (Activity shows curl exit 28). Fill in a "Push proxy" in the notification card (e.g. http://127.0.0.1:7890). iPhones use Apple's servers, usually reachable directly. If no device has notifications on, it tells you to turn them on in Tasks.技能Skills
技能 = 一个文件夹,教它"某类活怎么干"。里面必有 SKILL.md,旁边放模板、示例、参考资料。它平时只看到每个技能的名字和一句描述;任务对上了,自己调 use_skill 读全文,再用自己的工具去干。格式照 Agent Skills 开放标准。
A skill is a folder that teaches it how to do a kind of job. It must contain SKILL.md, plus templates, examples or reference material. Normally it only sees each skill's name and one-line description; when a job matches, it calls use_skill to read the whole thing and then does the work with its own tools. The format follows the Agent Skills open standard.
---
name: weekly-report
description: 写部门周报用这个:按部门汇总本周导出的表格,产出 docx
---
# 周报
1. 读 reference/tpl.md 拿版式
2. 读 inbox 里的表格,按部门汇总
3. 用 write_document 出 docx,用 share 交出去
- 装:技能页点"新建"(名字只能是小写字母、数字、连字符),或"导入文件夹"选那个带
SKILL.md的文件夹本身。直接拷到~/.ds4/assistant/skills/也行。 description是它决定用不用的唯一依据,写清楚什么活用它。- 不许带脚本:
.py .sh .js等文件不收;md 里有代码块、以命令开头的行(python、bash、curl…)整份拒,报出第几行。把步骤写成"用 write_document / read_file …"这种工具名就能过。所以别处靠脚本干活的技能(比如 Anthropic 的 pptx)导不进来。 - 仓库自带一份合规的 PPT 技能:
skills/pptx/。 - 改了技能,进行中的对话里它已经读过的旧版不会自动刷新;开个新对话最干净。
- Install: on Skills press New (names are lowercase letters, digits and hyphens), or Import folder and pick the folder that itself contains
SKILL.md. Copying into~/.ds4/assistant/skills/works too. descriptionis the only thing it uses to decide whether a skill applies; say plainly which jobs it is for.- No scripts:
.py .sh .jsand similar files are rejected; a Markdown file with a code block or a line starting with a command (python,bash,curl…) is rejected whole, with the line number. Write steps in terms of tools ("use write_document / read_file …") and it passes. Skills that work by running scripts (e.g. Anthropic's pptx) cannot be imported. - The repo ships a compliant slide-deck skill:
skills/pptx/. - After editing a skill, a conversation that already read the old version will not refresh it; a new conversation is cleanest.
记忆与文件Memory and files
说 "记住我常住南京",它调 remember 往"关于你"里加一行,带日期和来源对话;说 "忘掉我住哪" 就删掉。它只记你亲口说的事实和偏好,不记猜测、不记别人的隐私、不记密码。
Say "Remember I mostly live in Nanjing" and it calls remember to add a dated line, with the source conversation, to "About you"; say "Forget where I live" to remove it. It only keeps facts and preferences you stated yourself — no guesses, no other people's private details, no passwords.
| 记忆页里的On Memory | 谁写Written by | 怎么用Used how |
|---|---|---|
关于你About you profile.md | 它(你可改)it (you can edit) | 每个新对话全文带上included in full in every new conversation |
规矩Rules rules.md | 你(它只读)you (it only reads) | 比如"回复用中文""别碰 ~/Documents/财务",优先于一切e.g. "reply in English", "never touch ~/Documents/finance"; overrides everything |
| 日记Diary | 自动automatic | 只读read-only |
记忆在对话开始时拍一次快照:对话中途新记的事,从下一个新对话起才读到。这样整段对话的前缀不变,不用每记一条就重读一遍上下文。
Memory is snapshotted when a conversation starts: something remembered mid-conversation is read from the next new conversation on. That keeps the conversation's prefix stable so the model never has to reread the whole context after each new memory.
盘上都在哪Where it all lives on disk
~/.ds4/assistant/
memory/profile.md rules.md diary/ # 记忆 / memory
sessions/<id>/ # 对话 / conversations
workspace/ # 它的读写地盘 / its working folder (inbox/ = 附件 attachments)
tasks/ skills/ push/ # 任务 · 技能 · 推送 / tasks · skills · push
audit.jsonl approvals.jsonl policy.json
secrets/ # 凭证, 0600 / credentials
全是纯文本,能直接打开、改、备份。删除对话是挪进 trash/,不真删。
All plain text you can open, edit and back up. Deleting a conversation moves it into trash/ rather than erasing it.
审批与活动Approvals and activity
每次工具调用都过同一个守门函数,按固定顺序判,命中即定:
Every tool call goes through the same gatekeeper function, checked in a fixed order; the first match decides:
- 你在
policy.json里禁用的工具 → 拒。 - 你的允许 / 拒绝规则(拒绝优先)。
- 参数像密码、卡号、验证码 → 直接拒,不问。它自己的配置目录 → 一律拒。
- 读过网页或工作区外的文件之后,外送类动作只能"仅这次"。
- 只读、工作区内写 → 自动放行;工作区外写、删除 → 要审批。
- 查你以前给过的授权;没有就弹审批卡,等你答复(关页也等着)。
- A tool you disabled in
policy.json→ refused. - Your allow / deny rules (deny first).
- Arguments that look like passwords, card numbers or one-time codes → refused, no question. Its own config folder → always refused.
- After reading a web page or a file outside the workspace, outbound actions can only be approved "this once".
- Reads and writes inside the workspace → allowed; writes and deletes outside → need approval.
- Look up approvals you gave before; if none, show an approval card and wait (even with the page closed).
审批卡显示工具名和参数原文(不缩写),四个按钮:仅这次 / 本会话都允许 / 总是允许 / 拒绝。"总是"针对一个目标:文件所在目录、网址的域名或命令的第一个词。拒了它会换办法或问你,不会反复撞同一个调用。
The approval card shows the tool and its full arguments (never abbreviated) with four buttons: Allow once / Allow for this chat / Always allow / Deny. "Always" applies to one target: the file's folder, the URL's domain or the command's first word. If denied, it finds another way or asks you instead of retrying the same call.
活动页:每次工具调用的流水(时间、工具、参数摘要、守门决定、耗时,可按对话筛);你给过的永久授权(可撤销);允许的目录(可加可删);"允许在沙盒里跑程序"开关;工具箱里有哪些程序。
Activity: a log of every tool call (time, tool, argument summary, decision, duration; filter by conversation); your standing approvals (revocable); allowed folders (add / remove); the "Allow running programs in the sandbox" switch; which programs are in the toolbox.
手机与外网Phone and internet access
装成手机 AppInstall as a phone app
| 设备Device | 操作Steps |
|---|---|
| 安卓 ChromeAndroid Chrome | 底栏"更多" → "安装到主屏幕"(或浏览器菜单里的"安装应用")More → "Install to home screen" (or "Install app" in the browser menu) |
| iPhone / iPad Safari | 分享按钮 → "添加到主屏幕"Share → "Add to Home Screen" |
| 电脑 Chrome / EdgeDesktop Chrome / Edge | 地址栏右侧的"安装"图标the Install icon at the right of the address bar |
http://192.168.x.x:8000 打开时,装不成 App,定位、剪贴板、分享、推送也都没有。页面本身照常能用。
Prerequisite: the page must be opened over https (or as localhost). That is a browser rule: over http://192.168.x.x:8000 it cannot be installed, and location, clipboard, sharing and push are all unavailable. The page itself still works.从互联网访问(设置 → 穿透 + 证书)Access from the internet (Settings → tunnel + certificate)
要一台有公网 IP 的云服务器(Linux、有 systemd、能用密码 SSH 登录)和一张解析到它的域名证书。全在工作台里点,不用登服务器:
You need a cloud server with a public IP (Linux with systemd, SSH password login) and a certificate for a domain pointing at it. Everything is done from the Studio; you never log into the server:
- 设置里填云服务器的公网 IP、SSH 端口、用户名、密码。"公网端口"留空 = 有证书用 443。服务器 443 被 nginx 占着,或大陆服务器域名没备案(云厂商会拦 80/443),就换成 8443 之类。
- In Settings, enter the server's public IP, SSH port, username and password. Leaving "Public port" empty means 443 with a certificate. If nginx already holds 443, or the server is in mainland China with an unregistered domain (providers block 80/443), use something like 8443.
- 去云厂商控制台 → 安全组 → 入方向,放行公网端口。这一步只能你自己点。
- In your provider's console → security group → inbound, open the public port. Only you can do this step.
- 打开穿透开关。第一次约半分钟,弹窗里一步步亮:连服务器 → 装 frp → 建 SSH 通道 → 检查公网端口。
- Turn on the Tunnel. The first time takes about half a minute; the dialog lights up each step: connect → install frp → SSH channel → check the public port.
- 上传证书压缩包:阿里云 / 腾讯云下载的 zip 直接传,它自己挑对的那套。之后手机打开
https://你的域名/就能装 App。 - Upload the certificate zip as downloaded from Alibaba Cloud / Tencent Cloud; it picks the right files itself. Then open
https://your-domain/on the phone and install the app.
TLS 在你家这台机器上解开,证书私钥不离开它;公网上照样要登录,/v1 照样要 API 密钥。不想用云服务器:Tailscale 的 tailscale serve --bg 8000 也行。完整排错表见 docs/pwa.md。
TLS terminates on your own machine, so the private key never leaves it; the internet still has to log in, and /v1 still needs an API key. No cloud server? Tailscale's tailscale serve --bg 8000 works too. Full troubleshooting table: docs/pwa.md (Chinese).
用自己的数据训练Train on your own data
训练出来的是一个约 100 MB 的小插件,叠在模型上,不改模型本体。一行一个 JSON,两种写法,和 Unsloth 一一对应:
Training produces a small ~100 MB add-on layered on top of the model; the base model is never changed. One JSON object per line, in either of Unsloth's two shapes:
{"messages":[{"role":"user","content":"入场价是多少?"},{"role":"assistant","content":"30.39"}],"context":"……原文材料……"}
{"text":"一段原文,原样训(续训)。"}
- 语料页把 .jsonl 拖进去。
- Drop the .jsonl on Data.
- 训练页点开始。训练时模型会先停下(聊天暂时不可用),训完自动装回来。
- Press Start on Train. The model is stopped during training (chat is unavailable) and comes back when it finishes.
- 训了几轮,它自动挑留出损失最低、且没比训练前更差的那一轮存下来。
- After the rounds finish it keeps the round with the lowest held-out loss that is not worse than before training.
- 训完不会自动挂上。回聊天页,打开输入框旁的"后训练"开关才用它;关掉就回到原样。
- Nothing is mounted automatically. Back in the chat, turn on the "Post-train" switch next to the input box to use it; turn it off to go back.
完整走一遍:技术细节 4.3。
Full walk-through: technical notes §4.3.
API
四个兼容接口:/v1/chat/completions、/v1/completions、/v1/responses(OpenAI)、/v1/messages(Anthropic)。先在 API 页建一把密钥——它只在新建时完整显示一次,服务端只存哈希,丢了就删掉重建。
Four compatible endpoints: /v1/chat/completions, /v1/completions, /v1/responses (OpenAI) and /v1/messages (Anthropic). First create a key on the API tab — it is shown in full only once and the server keeps only a hash; if lost, delete it and make a new one.
curl http://<host>:8000/v1/chat/completions \
-H "Authorization: Bearer sk-ds4-…" \
-H "Content-Type: application/json" \
-d '{"model":"deepseek-v4-flash","messages":[{"role":"user","content":"你好"}]}'
- OpenAI 兼容客户端填 Base URL
http://主机:8000/v1+ 密钥即可;Anthropic SDK 用x-api-key头。API 页上有按你的地址和模型名生成好的示例。 - 本机调也要带密钥,不带回 401。模型没加载时回 404。
"temperature": 0每次输出逐字节相同;要思考加"reasoning_effort": "high";图片用 OpenAI 的image_url或 Anthropic 的image块(data:URL)。- 装了识别模型时还有
/v1/audio/transcriptions:请求体直接放 16 kHz 单声道 WAV(不是 OpenAI 的 multipart 表单),回{"text":"…"};别的采样率或格式回 400 并说明收到的是什么。 - 只要 API、不要工作台、不想编译:
curl -fsSLO https://huggingface.co/wenzhouwu/YoungAi-DeepSeek-V4.1-Flash/resolve/main/install.sh && bash install.sh。
- OpenAI-compatible clients need Base URL
http://<host>:8000/v1plus the key; the Anthropic SDK uses thex-api-keyheader. The API tab shows ready-made examples with your address and model name. - Even local calls need the key, or you get 401. With no model loaded you get 404.
"temperature": 0gives byte-identical output every run; add"reasoning_effort": "high"for thinking; send images as OpenAIimage_urlor Anthropicimageblocks (data:URLs).- With the speech model installed there is also
/v1/audio/transcriptions: the body is a 16 kHz mono WAV as-is (not OpenAI's multipart form) and the reply is{"text":"…"}; other sample rates or formats get a 400 saying what arrived. - API only, no Studio, no build:
curl -fsSLO https://huggingface.co/wenzhouwu/YoungAi-DeepSeek-V4.1-Flash/resolve/main/install.sh && bash install.sh.
危险模式(云手机,实验性)Danger mode (cloud phone, experimental)
"设置"里打开后,主机上起一部虚拟 Android 13 手机(只在 Linux 主机上有,内核要有 binder;一次性准备要 sudo scripts/phone_prepare_linux.sh),模型多六个工具 phone_screen phone_tap phone_swipe phone_key phone_type phone_open,工作台多一个云手机页签显示实况画面。
Turned on in Settings, it starts a virtual Android 13 phone on the host (Linux only; the kernel needs binder; one-time setup with sudo scripts/phone_prepare_linux.sh). The model gets six tools — phone_screen phone_tap phone_swipe phone_key phone_type phone_open — and the Studio gets a live Phone tab.
- 模型自主操作,没人逐步确认。手机起来是空的,但你在里面登录的账号、装的 app,它都能用——可能发消息、下单、付款、删东西。后果由打开开关的人承担。
- 屏幕内容是不可信输入。手机跑在独立命名空间里,有内存硬顶,碰不到你的内网和宿主,但这不是对一切滥用的保证。
- 它不会替你过风控。遇到滑块验证,你自己在云手机页签上滑。别用它绕过任何 app 的服务条款或他人的权利。
- 实况视频要 https 或 localhost;http 局域网地址打开时退回每秒一张截图。
- The model acts on its own; nobody confirms each tap. The phone starts empty, but any account you sign into and any app you install there, it can use — it may send messages, order, pay or delete things. Whoever flips the switch bears the consequences.
- Screen content is untrusted input. The phone runs in its own namespaces with a hard memory cap and cannot reach your LAN or the host, but that is no guarantee against every misuse.
- It will not get past anti-bot checks for you. Slide captchas are yours to do in the Phone tab. Do not use this to circumvent any app's terms or other people's rights.
- Live video needs https or localhost; over a plain http LAN address it falls back to one screenshot per second.
出错时看这里When things go wrong
| 现象Symptom | 原因Cause | 怎么办Fix |
|---|---|---|
| 助理页顶上提示没有模型Assistant says no model is loaded | 模型没加载,或正在训练not loaded, or training is running | 去模型页点"加载";训练中就等它训完自动装回press Load on Models; during training wait for it to come back |
| 手机上没有定位 / 分享 / 推送No location / sharing / push on the phone | 用 http 局域网地址打开opened over a plain http LAN address | 走 https:设置里的穿透 + 证书,或 Tailscaleuse https: Settings tunnel + certificate, or Tailscale |
| 搜索、做视频的工具不见了Web and video tools are missing | 本机没有火狐no Firefox on the machine | 装火狐install Firefox |
| "附近"只给了网页搜索结果"Nearby" only gives web results | 没填高德 Key,或 Key 失效、额度用完(它会照实说)no AMap key, or it is invalid / out of quota (it says so) | 设置 → 地图,填"Web 服务"类型的 KeySettings → Maps, enter a "Web Service" key |
| PDF 中文是方块Chinese shows as boxes in a PDF | 本机没有 TrueType 中文字体no TrueType CJK font on the machine | 装一个(如 fonts-droid-fallback 或文泉驿)install one (e.g. fonts-droid-fallback or WenQuanYi) |
| 安卓收不到通知Android gets no notifications | 连不上谷歌 FCMGoogle FCM unreachable | 任务页通知卡填"推送代理"set a "Push proxy" in the Tasks notification card |
| 技能保存被拒,报 line NSkill rejected with "line N" | 那一行有代码块或命令that line has a code block or command | 改成用工具名描述步骤describe the step with tool names instead |
| 外部程序调 /v1 得 401Outside program gets 401 on /v1 | 没带密钥或密钥被删no key, or the key was deleted | API 页建一把,带 Authorization: Bearercreate one on API and send Authorization: Bearer |
| 穿透显示连通,手机却打不开Tunnel is up but the phone cannot connect | 大陆服务器 + 域名没备案,80/443 被拦mainland server with unregistered domain; 80/443 blocked | 公网端口换 8443,或去备案switch the public port to 8443, or register the domain |
| 输入框旁没有麦克风No microphone next to the input box | 没放识别模型,或页面是 http 局域网地址打开的no speech model installed, or the page is on a plain http LAN address | 见语音输入 · 怎么开;改用 httpssee Voice input · how to turn it on; use https |
| 提示"麦克风权限被拒了""Microphone access was denied" | 之前拒绝过浏览器的麦克风请求the browser's microphone prompt was refused earlier | 到浏览器(或系统)设置里给这个网址开麦克风allow the microphone for this site in browser (or system) settings |
| 忘了工作台密码Forgot the Studio password | — | 删 ~/.ds4/studio/auth,刷新重设delete ~/.ds4/studio/auth and reload |
还没解决:到 GitHub Issues 提问,或写信 310066827@qq.com。活动页的流水里通常有原因原文,一起贴上最好。
Still stuck: open a GitHub issue or write to 310066827@qq.com. The Activity log usually has the exact error; include it.
YoungAi