Cloud/on-prem install choice, omp auth (Copilot + Anthropic), omp status in GUI

This commit is contained in:
Stefano Zini
2026-11-04 09:46:52 +01:00
parent 71b0d39b2a
commit d423e18f57
6 changed files with 285 additions and 51 deletions
+104 -21
View File
@@ -1,3 +1,5 @@
const { execFileSync } = require("child_process")
module.exports = {
requires: {
bundle: "ai"
@@ -9,14 +11,66 @@ module.exports = {
raw: "Hardware: {{gpu_model}} · {{vram}} GB VRAM · {{ram}} GB RAM"
}
},
// floor: NVIDIA with 4 GB VRAM (llama.cpp CUDA build + whisper on GPU)
{
when: "{{gpu !== 'nvidia' || vram < 4}}",
method: "notify",
// highest CUDA the driver supports ("CUDA Version: 13.0", newer drivers "CUDA UMD Version: 13.4" in nvidia-smi) -> llama.cpp build; no NVIDIA/driver -> CPU build
method: async (req, ondata, kernel) => {
let m = null
try { m = execFileSync("nvidia-smi", { encoding: "utf8" }).match(/CUDA (?:UMD )?Version:\s*(\d+)\.(\d+)/) } catch (e) {}
const v = m ? +m[1] * 100 + +m[2] : 0
const build = v >= 1300 ? "cuda-13.4" : v >= 1204 ? "cuda-12.4" : "cpu"
ondata({ raw: `CUDA: ${m ? m[1] + "." + m[2] : "none"} -> llama.cpp ${build}\r\n` })
return { build }
}
},
{ method: "local.set", params: { build: "{{input.build}}" } },
// on-prem LLM choice (35B needs 48+ GB RAM); transcription, diarization and embeddings always stay local
{
when: "{{local.build !== 'cpu' && vram >= 4 && ram >= 48}}",
method: "input",
params: {
html: "Teams Whisper needs an NVIDIA GPU with at least 4 GB VRAM (found: {{gpu_model}}, {{vram}} GB)."
},
next: null
title: "Local LLM",
description: "Transcription, speakers and search always run locally. Cloud models (GitHub Copilot / Anthropic via omp) stay selectable in the Web UI either way.",
form: [{
type: "select", key: "onprem", title: "On-prem models", default: "35b",
items: [
{ text: "Cloud only (no LLM download)", value: "none" },
{ text: "Qwen3.5 4B on-prem (~3.3 GB, all in VRAM)", value: "4b" },
{ text: "Qwen3.5 4B + Qwen3.6 35B on-prem (~26 GB, experts in RAM)", value: "35b" }
]
}]
}
},
{
when: "{{local.build !== 'cpu' && vram >= 4 && ram >= 48}}",
method: "local.set",
params: { onprem: "{{input.onprem}}" }
},
{
when: "{{local.build !== 'cpu' && vram >= 4 && ram < 48}}",
method: "input",
params: {
title: "Local LLM",
description: "Transcription, speakers and search always run locally. Cloud models (GitHub Copilot / Anthropic via omp) stay selectable in the Web UI either way.",
form: [{
type: "select", key: "onprem", title: "On-prem models", default: "4b",
items: [
{ text: "Cloud only (no LLM download)", value: "none" },
{ text: "Qwen3.5 4B on-prem (~3.3 GB, all in VRAM)", value: "4b" }
]
}]
}
},
{
when: "{{local.build !== 'cpu' && vram >= 4 && ram < 48}}",
method: "local.set",
params: { onprem: "{{input.onprem}}" }
},
{
when: "{{local.build === 'cpu' || vram < 4}}",
method: "log",
params: {
raw: "No CUDA GPU with 4+ GB VRAM: cloud models only; transcription, diarization and embeddings run on CPU."
}
},
{
method: "shell.run",
@@ -24,14 +78,19 @@ module.exports = {
message: "conda install -y -c conda-forge ffmpeg 7zip"
}
},
// llama.cpp server (CUDA 13) for the Qwen VLM + bge-m3 embeddings
// llama.cpp server (CUDA 13.4 / 12.4 / CPU build, per detection above) for the Qwen VLM + bge-m3 embeddings
{
method: "fs.download",
params: {
uri: [
"https://github.com/ggml-org/llama.cpp/releases/download/b11889/llama-b11889-bin-win-cuda-13.4-x64.zip",
"https://github.com/ggml-org/llama.cpp/releases/download/b11889/cudart-llama-bin-win-cuda-13.4-x64.zip"
],
uri: "https://github.com/ggml-org/llama.cpp/releases/download/b11889/llama-b11889-bin-win-{{local.build}}-x64.zip",
dir: "app/bin"
}
},
{
when: "{{local.build !== 'cpu'}}",
method: "fs.download",
params: {
uri: "https://github.com/ggml-org/llama.cpp/releases/download/b11889/cudart-llama-bin-win-{{local.build}}-x64.zip",
dir: "app/bin"
}
},
@@ -39,22 +98,28 @@ module.exports = {
method: "shell.run",
params: {
path: "app/bin",
message: [
"7z x -y llama-b11889-bin-win-cuda-13.4-x64.zip",
"7z x -y cudart-llama-bin-win-cuda-13.4-x64.zip"
]
message: "7z x -y llama-b11889-bin-win-{{local.build}}-x64.zip"
}
},
{
when: "{{local.build !== 'cpu'}}",
method: "shell.run",
params: {
path: "app/bin",
message: "7z x -y cudart-llama-bin-win-{{local.build}}-x64.zip"
}
},
{
method: "fs.rm",
params: {
path: "app/bin/llama-b11889-bin-win-cuda-13.4-x64.zip"
path: "app/bin/llama-b11889-bin-win-{{local.build}}-x64.zip"
}
},
{
when: "{{local.build !== 'cpu'}}",
method: "fs.rm",
params: {
path: "app/bin/cudart-llama-bin-win-cuda-13.4-x64.zip"
path: "app/bin/cudart-llama-bin-win-{{local.build}}-x64.zip"
}
},
// speaker diarization (sherpa-onnx)
@@ -88,8 +153,9 @@ module.exports = {
"local-dir": "models"
}
},
// small VLM (Qwen3.5 4B, ~3.3 GB), all layers in 4 GB VRAM: always installed, enough for 32 GB RAM machines
// small VLM (Qwen3.5 4B, ~3.3 GB), all layers in 4 GB VRAM: chosen at install
{
when: "{{local.onprem === '4b' || local.onprem === '35b'}}",
method: "hf.download",
params: {
path: "app",
@@ -97,9 +163,9 @@ module.exports = {
"local-dir": "models/qwen3.5-4b"
}
},
// big MoE LLM + vision projector (~23 GB, experts in RAM): only with 48+ GB RAM
// big MoE LLM + vision projector (~23 GB, experts in RAM): only when chosen at install
{
when: "{{ram >= 48}}",
when: "{{local.onprem === '35b'}}",
method: "hf.download",
params: {
path: "app",
@@ -119,10 +185,27 @@ module.exports = {
]
}
},
// omp (cloud auth): installed into app/bin unless already on PATH; seeds ~/.omp/agent/models.yml only if absent
{
method: "shell.run",
params: {
path: "app",
message: "uv run --script llama.py install-omp"
}
},
{
method: "notify",
params: {
html: "Installation finished ({{ram >= 48 ? 'Qwen3.6 35B + Qwen3.5 4B: pick one in the Web UI header' : 'Qwen3.5 4B'}}). Click 'Start', then load the browser extension from the 'Extension' tab."
html: "Installation finished ({{local.onprem === '35b' ? 'Qwen3.6 35B + Qwen3.5 4B' : local.onprem === '4b' ? 'Qwen3.5 4B' : 'cloud models only'}}; pick the model in the Web UI header). Log in to GitHub Copilot in this terminal now; Anthropic: menu 'Cloud login'."
}
},
// last: an aborted device flow cannot leave the install half done; skips itself when omp already has a valid login
{
method: "shell.run",
params: {
path: "app",
input: true,
message: "uv run --script llama.py login github-copilot --if-needed"
}
}
]