它是怎么做的How it is built
一个住在自家服务器上的家庭管家,危险操作由代码把关,不靠模型自觉:认得家里的人,在你给的权限里办事,做过的事都查得到。
A butler for the house that lives on your own server, where risky actions are checked by code, not left to the model: it knows the people at home, acts only within what you allow, and keeps a record of everything it does.
- 你说话You speak中文或英文Chinese or English
- 认出是谁Who is it声纹,在本机Voiceprint, at home
- 大脑想The brain thinks本地模型,可选云端A local model, cloud optional
- 守卫判The guard decides固定规则,不是模型Fixed rules, not the model
- 做,留回执Done, with a receipt能撤销Can be undone
下面的文件路径是源码里的位置。演示站本身是脚本,没有后端;这一页说的是真系统。
The file paths below are places in the source. The demo site itself is a script with no backend; this page is about the real system.
一句话请求怎么走The path of one request
你说一句话,Jarvis 先弄清是谁在说,再让大脑想,最后由一套固定的规则决定能不能办。
You say something; Jarvis works out who is speaking, lets the brain think, and a fixed set of rules decides whether it may be done.
server/modules/satellites)。都在家里。server/modules/satellites). All of it at home.数字,和它们从哪来The numbers, and where they come from
这些数字都是数出来的,每个都指着它在仓库里的出处,可以自己去核对。
These numbers are counted, not guessed; each points to where it comes from in the repository, so you can check.
| 1362 | 个离线测试(2026-11-19 按 python -m tests.test_server 的收法数),代码有改动的那天 CI 全跑一遍。不要 Home Assistant、模型或网络。offline tests (counted 2026-11-19 the way python -m tests.test_server collects them), all run on CI each day the code has changed. No Home Assistant, model or network needed.tests/test_server.py |
| 249/254 | 真模型评测:190 条用例、254 项,weak 档过 249 项,strong 档 240 项;两边真实写入 Home Assistant 都是 0 次(gemma4:26b,P40,2026-11-09)。real-model evaluation: 190 cases with 254 checks; 249 pass on the weak setting, 240 on strong; zero real writes to Home Assistant on either (gemma4:26b on the P40, 2026-11-09).docs/archive/reviews-2026-11-09/optimize-plan.zh.md §八 |
| 45 | 个功能模块;除了安全和 Home Assistant 两个,都能单独关掉。feature modules; all but two (safety and Home Assistant) can be turned off on their own.server/modules/ |
| 0 | 个第三方依赖:安全核心 jarvis-core 只用 Python 标准库。third-party dependencies in the safety core, jarvis-core: the Python standard library only.core/pyproject.toml |
| 2 | 种语言,中文和英文,页面和回复都是两份。languages, Chinese and English, for the page and the replies alike.page/main/words.js |
| 5.2 s | 大脑耗时的中位数:从文字到大脑,到回复写好,不含听和说(gemma4:26b,到 2026-11-14 的 7 天,10 次由模型回答,最慢 24 秒;同期 52 次由固定规则直接回答,中位数 0.6 秒)。median brain time: from the text reaching the brain to the reply being written, not counting listening or speaking (gemma4:26b, the 7 days to 2026-11-14, 10 requests answered by the model, the slowest 24 s; 52 more were answered by fixed rules, median 0.6 s).server/modules/readings/traces/store.py |
| 1600+ | 次提交。commits.git log |
上面的 5.2 秒只算大脑,不是「说完到开口」:从说完最后一个字到第一声回复,还没有可靠的测量。样本也小,只有一户人家一周的请求。
The 5.2 s above is the brain alone, not the time from your last word to its first: that has no reliable measure yet. The sample is small too: one household, one week.
设计上的取舍Design choices, and why
主要的想法只有一个:会出错的东西(模型)不负责守规矩,守规矩的是普通代码。
The main idea is one: the part that can be wrong (the model) is not trusted to keep the rules; plain code does.
- 安全规则写在代码里,不在提示词里。The safety rules are code, not a prompt.
门锁、窗帘和车库门、警报、阀门、插座、HA 脚本,写操作一律先问;每条写操作都经过同一个函数决定允许、先问还是拒绝。Locks, covers and garage doors, alarms, valves, plugs and HA scripts always wait for a yes; every write path goes through one function that decides allow, ask or block.
理由:模型可能被注入,规则不能靠它守。
core/src/jarvis_core/policy.pyWhy: a model can be injected, so it cannot be what keeps the rules.core/src/jarvis_core/policy.py - 安全核心单独成包,只用标准库。The safety core is its own package, standard library only.
jarvis-core:规则、确认、染色和外发、回执、模块的约定。jarvis-core: policy, confirmations, taint and egress, receipts, the module contract.
理由:能单独审查、单独测试,不被 Web 框架或模型客户端拖着变。
core/Why: it can be reviewed and tested on its own, and no web framework or model client moves it.core/ - 外来内容会「染色」。Outside content taints the turn.
读过邮件、网页,或者引用了别人的话,这一轮的写操作都要等你确认;外来内容和由它得出的东西,不发给云端模型。After reading an email or a web page, or quoting someone, that turn's writes wait for your yes; outside content, and anything derived from it, never goes to a cloud model.
理由:间接提示注入。
core/src/jarvis_core/confirm.py·egress.pyWhy: indirect prompt injection.core/src/jarvis_core/confirm.py·egress.py - 声纹只用来分辨人,不当锁。A voiceprint tells people apart; it is not a lock.
它决定谁的「确定」算数:孩子和访客的不算,门锁和警报只认主人本人,否则在屏幕上输 PIN。确认这一步照样要有。It decides whose “yes” counts: not a child’s or a guest’s, and for locks and alarms only the owner’s, otherwise the PIN on the screen. The yes itself is still asked for.
理由:声音可以被录下来重放。
core/src/jarvis_core/trust.py·docs/guide.mdWhy: a voice can be recorded and replayed.core/src/jarvis_core/trust.py·docs/guide.md - 小模型用规则兜底,大模型放开,不自动切换。Rules prop up a small model, step aside for a large one, and it never switches by itself.
brain.capability:weak 是配置里的默认值,strong 交给模型;这个家的正式实例 2026-11-12 盲评之后一直用 strong;确认、PIN、谁能批准、外来的话,两档一样。brain.capability: weak is the default in the config and strong hands over to the model; this home’s own instance has run strong since 2026-11-12, after a blind comparison; confirmations, PINs, who may approve and outside words are the same in both. 理由:家里的显卡和电源有限,用哪档由评测数字决定。server/config.pyWhy: the home’s GPU and power are limited, so the evaluation decides which setting to use.server/config.py - 每个功能是一个模块。Every feature is a module.
核心只放大脑循环、规则和确认、登录、数据库、语音和记忆,加上通用的钩子。The core holds only the brain loop, policy and confirmation, auth, the database, voice and memory, plus generic hooks.
理由:不用的功能可以整块关掉或删掉。
server/modules/README.mdWhy: a feature you don’t use can be switched off or removed whole.server/modules/README.md - 私人数据加密。Private data is encrypted.
保险库用 AES-256-GCM;家人可以有自己的保险库,锁着的时候别人读不到。The vault uses AES-256-GCM; a family member can have a vault of their own, which nobody else reads while it is locked.
理由:一家人之间也有隐私。
server/crypto.pyWhy: people in one house still have privacy from each other.server/crypto.py
看守卫怎么挡Watch the guard work
比如孩子想开门,或者一封邮件骗它关警报,都会被规则拦下,下面是对应的测试。
For example a child asking to open the door, or an email tricking it into switching off the alarm, is stopped by the rules; the tests below show it.
主页面的「看看它的分寸」演了四段:孩子要开门、邮件让它关警报、问它今天做了什么、回复说「关了」却没有操作记录。真系统里挡住它们的是这些代码和测试:
On the main page, “See where it draws the line” plays four scenes: a child asks to unlock the door, an email tells it to turn the alarm off, you ask what it did today, and a reply says “it’s off” with nothing done. In the real system, this is what stops them:
- 孩子说「确定」不算,在审批窗口点也不算;要大人,门锁要主人本人或 PIN。A child’s “yes” does not count, nor a child’s tap in the approval window; it needs an adult, and a lock needs the owner or the PIN.
tests/test_people.py·test_approval_window_child_asked_needs_the_pin·core/src/jarvis_core/confirm.py - 邮件是外来内容:读了它的这一轮被染色,写操作都要等确认。The email is outside content: the turn that read it is tainted, and its writes wait for a yes.
tests/modules/test_contract.py·test_outside_result_taints - 引用和翻译里的命令也一样,先问,不执行。A command inside a quote or a translation is the same: asked, not run.
tests/test_sessions.py·test_quoted_words_wait_and_past_lookup - 外来内容不会发给云端模型。Outside content is never sent to a cloud model.
core/src/jarvis_core/egress.py·tests/modules/test_contract.py·test_egress_by_row_and_turn - 「你今天替我做了什么」从回执答:说三件,其余在屏幕上的单子里。“What did you do for me today” is answered from the receipts: three said, the rest on the list on screen.
core/src/jarvis_core/trust.py·tests/test_review_brain.py·test_done_answer_says_three - 强模型的回复说「已经关了」,可这一轮没有任何操作:提醒它一次,还这么说,代码就在后面补一句「这句没有对应的操作记录。」,这句不是模型写的。A strong model’s reply says “it’s off” but nothing was called: nudged once and still saying it, the reply gets a line the code writes, “That has no matching action record.”
server/brain/checks.py·UNBACKED·tests/test_untold.py·test_untold_a_strong_claim_without_a_call_gets_the_fixed_line
演示是脚本;真系统的这些行为由上面的测试保证。
The demo is a script; in the real system, the tests above hold this behaviour.
回主页面看这一段See it on the main page工程上的规矩How the work is kept honest
改动提交前有钩子自动检查;代码有改动的那天,还有一遍完整的自动测试。
A hook checks every commit, and a full set of automatic tests runs each day the code has changed.
- main 有改动的那天,CI 跑一遍:扫密钥、家里的地址和私人邮箱,ruff、离线测试、页面冒烟测试、光球动作。CI runs each day main has changed: the scan for keys, home addresses and personal mailboxes, ruff, the offline tests, the page smoke test and the orb’s actions.
.github/workflows/test.yml - 每次提交前,钩子扫密钥、家里的地址和私人邮箱。Before every commit, a hook scans for keys, the home’s addresses and personal mailboxes.
.githooks/pre-commit - 2026-11-09 的核心代码审查:8 个子代理分方向初审,3 个复查逐条回到代码里核实;结论连同「不成立」的那几条都留在仓库里。The core code review of 2026-11-09: eight sub-agents reviewed it from eight angles, three more checked every finding against the code; the verdicts, the rejected findings included, stay in the repository.
docs/archive/reviews-2026-11-09/ - 评测有一套冻结的留出题,从不拿它调规则。The evaluation keeps a frozen held-out set that rules are never tuned against.
tools/converse/heldout-2026-11-01.json
还能做什么What else it does
每个功能是一个模块,一共 45 个;除了求助和 Home Assistant,都能单独关掉。主页面的「家里的一天」演了其中几个。
Every feature is a module, 45 in all; all but the call for help and Home Assistant can be turned off. “A day at home” on the main page plays a few of them.
同一个主页面在手机上也能用:底下三个标签「需要你 / 今天 / 家」,前门要你确认时就在「需要你」里点(page/main/phone.js)。挂在墙上的屏放着不碰 45 秒,会变成远看:大钟、日期和几行要紧的事,隔着房间也看得清(page/main/far.js)。演示站里试:墙屏远看,在手机上打开这个站就是手机的样子。
The same main page works on a phone: three tabs at the bottom, “Needs you / Today / Home”, and when the front door waits for your yes it is under “Needs you” (page/main/phone.js). A wall screen left alone for 45 s turns into the far view: a big clock, the date and a few lines that matter, readable across the room (page/main/far.js). Try it here: the far view; open this site on a phone for the phone layout.
华丽档长什么样What the lavish tier looks like
画质分四档;下面四样只在「华丽」档有,演示站用的是「标准」档(树莓派 5 也跑得动),所以这里放截图。数据是演示的假数据。
The page has four quality tiers; these four come only on “lavish”. The demo runs on “standard” (a Raspberry Pi 5 keeps up), so here they are as pictures, on the demo’s made-up data.

page/main/island.jsThe dynamic island: a capsule at the top says what is going on (listening, thinking, speaking, waiting for you). page/main/island.js
server/modules/neuralThe neural network: memory, modules and devices as a 3D network round the orb, lighting up as it works; a memory is only a point, never its words. server/modules/neural
server/modules/hologramThe hologram: the next three days’ weather, also mirrored for an acrylic sheet or a pyramid. server/modules/hologram
server/modules/backdropThe backdrop: slow liquid metal behind the orb, at a quarter of the pixels and 15 frames a second. server/modules/backdrop生活Daily life 26
- 文件和档案Files and records家里发生过的事和物件的记录,每条带出处Records of what happened and what things are, each with its source
- 日历Calendar自己的日程加上接入的日历,语音加、改、取消Its own events plus every connected calendar; add, move or cancel by voice
- 手机对话Phone chat人不在屏幕前,用 Telegram 或 HA 手机应用问它Ask from your phone, through Telegram or the HA app
- 陪聊模式Chat mode「陪我聊会儿」:回答长一点,只读不写“Keep me company”: longer replies, reading only
- 讲解Explainers按需显示的讲解场景和页面Explainer scenes and pages, shown on request
- 知识图谱Knowledge graph文档和对话里提到的人和事,它们怎样相关Who and what the documents and talk mention, and how they relate
- 购物清单Shopping list全家共用,「牛奶没了」就加上;每周菜单One list for the house; “we’re out of milk” adds it; a weekly menu
- 健康数据Health numbersHA 里的步数、睡眠、心率,只报给本人Steps, sleep and heart rate from HA, told only to that person
- 主动提醒Proactive reminders要下雨、设备掉线、电量低时自己开口;「家里怎么样」Speaks up for rain, a device offline, a low battery; “how’s the house”
- 农历Lunar calendar农历日期、传统节日、家人的农历生日Lunar dates, the Chinese festivals, the family’s lunar birthdays
- 地图Maps驾车路线和页面上的地图Driving routes and the page’s map
- 户外Outdoors紫外线、火险、空气质量和花粉UV, fire danger, air quality and pollen
- 冰箱Fridge冰箱里有什么、什么快过期What is in the fridge, and what expires soon
- 快递Parcels跟着单号查,状态变了说一次Follows tracking numbers; each change said once
- 通知与传话Notices and messages把一句话送到屏幕、手机或另一个房间Gets a line to a screen, a phone or another room
- 提醒Reminders按时间,也按某人回家、进房间、下雨来提醒Reminders by the time, or when someone comes home, enters a room, or it rains
- 后台研究Background research拆成搜索、带出处下结论,用家里的模型Searches, facts with sources and a conclusion, on the home’s own model
- 求助Call for help不能关always on「救命」按固定规则通知全家;每天「活动了吗」“Help me” tells the family by a fixed rule; a daily check-in
- 学校School学期、假期和学校的日子,按孩子记Terms, holidays and school days, per child
- 家庭时间线Household timeline家里发生过的事按时间排成一条What happened at home, on one line by time
- 待办To-dos自己的清单加上接入的清单,到点读出Its own lists plus connected ones; due items read out
- 说话语气Tone of voice家里和每个人的说话语气,一句固定的话The home’s tone of voice and each person’s, one fixed sentence
- 新州交通NSW transport家里常坐线路的下一班和晚点The household’s own lines: the next service and delays
- 看图模型Vision model读图片、扫描件和摄像头画面的那个模型The one model that reads pictures, scans and camera frames
- 天气Weather按规则回答,数据来自 HAAnswered by rule, from Home Assistant
- 紫微斗数Zi Wei Dou Shu在本机按出生时间排命盘A chart drawn from a birth time, on this machine
家居The home 6
- 垃圾桶Bins哪个垃圾桶该推出去Which bin goes out
- 摄像头CamerasFrigate 的摄像头,和「门口有人」的卡片Frigate’s cameras, and the someone-at-the-door card
- 用电Energy太阳能发了多少、用了多少电Solar made and power used
- Home AssistantHome Assistant不能关always on家里的设备、区域和实时状态The home’s devices, areas and live state
- 认出我Recognise me屏幕前是谁,来自人脸识别Who is at the screen, from face recognition
- 房间卫星Room satellites没有屏的房间,用树莓派来听Rooms with no screen listen through a Pi
自动化Automation 1
- 自己会做的事Things it does on its own一句话、一个时间或一个状态触发的步骤:计划、技能、例行、预案Steps on a phrase, a time or a state: plans, skills, routines, emergency plans
屏幕The screen 5
- 背景Backdrop光球后面慢慢流动的着色器(华丽档)A slow shader behind the orb (the lavish tier)
- 屏幕和 HAScreens and HA屏上显示图片;每块屏也是 HA 里的传感器Pictures on screen; each screen is also a sensor in HA
- 全息Hologram未来三天的天气做成全息(华丽档)The next three days’ weather as a hologram (the lavish tier)
- 神经网络Neural network记忆和模块画成光球周围的 3D 网(华丽档)Memory and modules as a 3D network round the orb (the lavish tier)
- 光球画面Orb stage模型让光球变成数字和形状The model turns the orb into numbers and shapes
系统The system 7
- 更强的模型(云端)Stronger model (cloud)本地答不上时提议;你说「是」才发,先隐去隐私Offered when the local model can’t answer; sent only after your yes, private words hidden first
- 导出Export一个人或全家的数据导成一个文件One person’s data, or everyone’s, as one file
- 异地备份Offsite backup加密的数据库备份传到你的文件夹The encrypted database backup, copied to a folder of yours
- 读数Readings请求记录、用量和费用The request log, usage and costs
- 自己修Self-repair坏了照固定的手册修;重启要主人点头Fixes what breaks from a fixed runbook; a restart needs the owner
- 自查Self-check回看最近哪些事没办好,只出报告Looks back at what went wrong lately; a report only
- 说完了吗End of turn停顿时判断一句话说完没有Hears at a pause whether you have finished