feat(app): M5 step 4a, install the runtime and voice models into the data folder

- download: resumed downloads checked against a pinned SHA-256.
- install: uv 0.11.20, the worker/brain venv (Python 3.12, the new
  src/voice_worker/requirements-brain.txt), the MeloTTS venv (Python 3.11,
  PyTorch cu128), Whisper large-v3-turbo, the Korean MeloTTS voice and
  Strata, the M0 kit's recipe; markers per step and version, cancel, retry,
  everything (caches, temp, HF and NLTK data) inside the data folder, the uv
  cache cleaned and the worker settings pointed at the venvs when done.
- The services give the worker the same environment once installed.
- The wizard's model step shows and drives the install.

Installed from an empty folder on Linux and started the services on it:
worker connected, STT and TTS ready, nothing written outside the folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-12 17:11:23 +09:00
parent b68eef3ec1
commit a4436698c8
13 changed files with 970 additions and 11 deletions

View File

@@ -429,9 +429,41 @@ async function wizard(status) {
p.driver && !p.driverOk ? h("p", {}, "NVIDIA 드라이버를 최신으로 올려 주세요: ", h("a", { href: "https://www.nvidia.com/drivers", target: "_blank" }, "nvidia.com/drivers")) : null,
nav(true, () => go(2))];
},
async () => [h("h2", {}, "받을 모델"),
h("p", {}, "대화 모델 Qwen3.6-35B-A3B(약 23GB)와 받아 적기(Whisper)·음성(MeloTTS) 모델을 받습니다. 고를 것은 없고, 설치가 끝나면 이 PC에 맞는 설정을 스스로 정합니다."),
h("p", { class: "muted small" }, "자동 설치는 다음 업데이트에서 이 단계에 들어옵니다."), nav(true, () => go(3))],
async () => {
// The install runs in the app; this step shows it and polls while it is on screen.
const list = h("table");
const btn = h("button", { class: "btn" });
const next = nav(true, () => go(3));
const nextBtn = next.lastChild;
const SIZE = (b) => (b >= 1e9 ? (b / 1e9).toFixed(1) + " GB" : (b / 1e6).toFixed(0) + " MB");
const STEP = { pending: ["대기", ""], running: ["설치 중", "warn"], done: ["완료", "ok"], failed: ["실패", "bad"] };
const my = wgen;
async function poll() {
if (my !== wgen) return;
let st;
try { st = await api("install_status"); } catch (e) { return fail(e); }
if (my !== wgen) return;
list.replaceChildren(h("tbody", {}, st.steps.map((x) => {
const [label, cls] = STEP[x.state] ?? [x.state, ""];
const bytes = x.bytes && x.state === "running" ? ` ${SIZE(x.bytes[0])}${x.bytes[1] ? " / " + SIZE(x.bytes[1]) : ""}` : "";
return h("tr", {}, h("td", {}, x.label, h("div", { class: "small muted" }, x.sizeHint)),
h("td", {}, h("span", { class: "badge " + cls }, label + bytes)),
h("td", { class: "small muted", style: "max-width:320px;word-break:break-all" }, x.state === "done" ? "" : (x.note ?? "")));
})));
btn.textContent = st.running ? "취소" : st.done ? "설치됨" : st.steps.some((x) => x.state === "failed") ? "다시 시도" : "설치 시작";
btn.disabled = st.done && !st.running;
btn.onclick = async () => {
try { await api(st.running ? "install_cancel" : "install_start"); } catch (e) { fail(e); }
poll();
};
nextBtn.disabled = !st.done;
if (st.running) setTimeout(poll, 1000);
}
poll();
return [h("h2", {}, "런타임과 모델 설치"),
h("p", {}, "음성 워커와 두뇌를 돌릴 Python 환경, 받아 적기(Whisper)·음성(MeloTTS) 모델, LLM 엔진(Strata)을 데이터 폴더 안에 받습니다. 끊겨도 다음에 이어서 받습니다. 대화 모델 Qwen3.6-35B-A3B(약 23GB)는 Strata를 처음 켤 때 받습니다."),
list, h("div", { class: "row", style: "margin-top:12px" }, btn), next];
},
async () => {
const input = h("input", { type: "password", placeholder: "디스코드 봇 토큰", autocomplete: "off" });
const out = h("div");