← 回到演示← Back to the demo J.A.R.V.I.S.

它是怎么做的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.

1362个离线测试(2026-11-19 数),代码有改动的那天 CI 全跑一遍;不要模型、不要网络offline tests (counted 2026-11-19), all run on CI each day the code has changed; no model, no network 249/254项真模型评测通过(2026-11-09)real-model checks passing (2026-11-09) 45个功能模块,43 个能单独关掉feature modules; 43 can be turned off on their own 0次真实写入 Home Assistant(评测里)real writes to Home Assistant in the evaluations
  1. 你说话You speak中文或英文Chinese or English
  2. 认出是谁Who is it声纹,在本机Voiceprint, at home
  3. 大脑想The brain thinks本地模型,可选云端A local model, cloud optional
  4. 守卫判The guard decides固定规则,不是模型Fixed rules, not the model
  5. 做,留回执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.

Architecture · 架构 你说话,或者点屏You speak, or tap the screen 中文或英文In Chinese or English 屏幕The screen 光球、麦克风、唤醒词;房间卫星也能听Orb, mic, wake word, room satellites 谁在说话Who is speaking 声纹、摄像头、登录:认出是谁Voice, camera, login: owner to guest 大脑The brain 本机的模型,加上记忆;外来内容标成资料Local model + memory; outside text = data 规则(jarvis-core)The rules (jarvis-core) 每个写操作:允许 / 先问 / 拒绝Every write: allow / ask first / block 模型说了不算The model does not decide this 执行,留回执Do it, leave a receipt 「你为什么……」从回执答“Why did you…” is answered from these Home Assistant 和功能模块Home Assistant and the modules 设备、日程、提醒、快递……每个功能一个模块Devices, calendar, parcels: a module each 外面的服务Services outside the house 只走允许的,每个请求都记账Only what is allowed; every call logged
作者家的配置,不是必须的。 硬件:大脑是 P40 显卡上的 gemma4:26b,记忆的向量在一块 3060 上,没有屏幕的房间用房间卫星(server/modules/satellites)。都在家里。
The author’s home setup, not a requirement. Hardware: the brain is gemma4:26b on a P40 card, memory's embeddings run on a 3060, and rooms without a screen get a room satellite (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.

看守卫怎么挡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:

  1. 孩子说「确定」不算,在审批窗口点也不算;要大人,门锁要主人本人或 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
  2. 邮件是外来内容:读了它的这一轮被染色,写操作都要等确认。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
  3. 引用和翻译里的命令也一样,先问,不执行。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
  4. 外来内容不会发给云端模型。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
  5. 「你今天替我做了什么」从回执答:说三件,其余在屏幕上的单子里。“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
  6. 强模型的回复说「已经关了」,可这一轮没有任何操作:提醒它一次,还这么说,代码就在后面补一句「这句没有对应的操作记录。」,这句不是模型写的。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.

还能做什么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.

Dynamic island · 灵动岛
灵动岛:顶上的小胶囊说现在在干什么(在听、在想、在说、等你批准)。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
Neural network · 神经网络
神经网络:记忆、模块和设备画成光球周围的一张 3D 网,干活时亮起;记忆只画成点,内容不显示。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
Hologram · 全息
全息:未来三天的天气,也能镜像给亚克力板或金字塔用。server/modules/hologramThe hologram: the next three days’ weather, also mirrored for an acrylic sheet or a pyramid. server/modules/hologram
Backdrop · 背景
背景:光球后面一层慢慢流动的液态金属,四分之一的像素、每秒 15 帧。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

家居The home 6

自动化Automation 1

屏幕The screen 5

系统The system 7