Install downloads via proxy-aware llama.py download (fs.download/hf go direct or fail TLS behind corp proxy)

This commit is contained in:
Stefano Zini
2026-11-04 11:24:54 +01:00
parent 946f88c2ef
commit 5341f6c704
2 changed files with 38 additions and 23 deletions
+14 -2
View File
@@ -239,6 +239,18 @@ def login(provider, if_needed=False):
except RuntimeError: pass
subprocess.run([exe, "login", provider], env=omp_env()) # inherits stdin/stdout: device code / browser URL shown in the Pinokio terminal
def download(url, dest):
"""Proxy-aware, resumable file download (Pinokio's fs.download goes direct and fails where corp DNS only resolves via the proxy; hf's own TLS stack rejects the corp CA). Skips an existing dest."""
dest = Path(dest)
if dest.exists(): print("kept", dest); return
dest.parent.mkdir(parents=True, exist_ok=True); part = dest.with_name(dest.name + ".part")
have = part.stat().st_size if part.exists() else 0
h = {"User-Agent": "teams-whisper-install", **({"Range": f"bytes={have}-"} if have else {})}
with _ropen()(urllib.request.Request(url, headers=h), timeout=900) as r, open(part, "ab" if have and r.status == 206 else "wb") as f: shutil.copyfileobj(r, f, 1 << 20)
part.replace(dest); print("downloaded", dest)
if __name__ == "__main__":
if sys.argv[1:] == ["install-omp"]: install_omp()
elif sys.argv[1:2] == ["login"]: login(sys.argv[2], "--if-needed" in sys.argv)
a = sys.argv[1:]
if a == ["install-omp"]: install_omp()
elif a[:1] == ["login"]: login(a[1], "--if-needed" in a)
elif a[:1] == ["download"]: download(a[1], a[2])
+24 -21
View File
@@ -80,18 +80,18 @@ module.exports = {
},
// llama.cpp server (CUDA 13.4 / 12.4 / CPU build, per detection above) for the Qwen VLM + bge-m3 embeddings
{
method: "fs.download",
method: "shell.run",
params: {
uri: "https://github.com/ggml-org/llama.cpp/releases/download/b11889/llama-b11889-bin-win-{{local.build}}-x64.zip",
dir: "app/bin"
path: "app",
message: "uv run --script llama.py download https://github.com/ggml-org/llama.cpp/releases/download/b11889/llama-b11889-bin-win-{{local.build}}-x64.zip bin/llama-b11889-bin-win-{{local.build}}-x64.zip"
}
},
{
when: "{{local.build !== 'cpu'}}",
method: "fs.download",
method: "shell.run",
params: {
uri: "https://github.com/ggml-org/llama.cpp/releases/download/b11889/cudart-llama-bin-win-{{local.build}}-x64.zip",
dir: "app/bin"
path: "app",
message: "uv run --script llama.py download https://github.com/ggml-org/llama.cpp/releases/download/b11889/cudart-llama-bin-win-{{local.build}}-x64.zip bin/cudart-llama-bin-win-{{local.build}}-x64.zip"
}
},
{
@@ -124,17 +124,17 @@ module.exports = {
},
// speaker diarization (sherpa-onnx)
{
method: "fs.download",
method: "shell.run",
params: {
uri: "https://github.com/k2-fsa/sherpa-onnx/releases/download/speaker-recongition-models/3dspeaker_speech_eres2net_base_sv_zh-cn_3dspeaker_16k.onnx",
path: "app/models/emb.onnx"
path: "app",
message: "uv run --script llama.py download https://github.com/k2-fsa/sherpa-onnx/releases/download/speaker-recongition-models/3dspeaker_speech_eres2net_base_sv_zh-cn_3dspeaker_16k.onnx models/emb.onnx"
}
},
{
method: "fs.download",
method: "shell.run",
params: {
uri: "https://github.com/k2-fsa/sherpa-onnx/releases/download/speaker-segmentation-models/sherpa-onnx-pyannote-segmentation-3-0.tar.bz2",
path: "app/models/seg.tar.bz2"
path: "app",
message: "uv run --script llama.py download https://github.com/k2-fsa/sherpa-onnx/releases/download/speaker-segmentation-models/sherpa-onnx-pyannote-segmentation-3-0.tar.bz2 models/seg.tar.bz2"
}
},
{
@@ -146,31 +146,34 @@ module.exports = {
},
// embeddings for cross-meeting memory
{
method: "hf.download",
method: "shell.run",
params: {
path: "app",
_: ["gpustack/bge-m3-GGUF", "bge-m3-Q8_0.gguf"],
"local-dir": "models"
message: "uv run --script llama.py download https://huggingface.co/gpustack/bge-m3-GGUF/resolve/main/bge-m3-Q8_0.gguf models/bge-m3-Q8_0.gguf"
}
},
// 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",
method: "shell.run",
params: {
path: "app",
_: ["unsloth/Qwen3.5-4B-GGUF", "mmproj-BF16.gguf", "Qwen3.5-4B-Q4_K_S.gguf"],
"local-dir": "models/qwen3.5-4b"
message: [
"uv run --script llama.py download https://huggingface.co/unsloth/Qwen3.5-4B-GGUF/resolve/main/mmproj-BF16.gguf models/qwen3.5-4b/mmproj-BF16.gguf",
"uv run --script llama.py download https://huggingface.co/unsloth/Qwen3.5-4B-GGUF/resolve/main/Qwen3.5-4B-Q4_K_S.gguf models/qwen3.5-4b/Qwen3.5-4B-Q4_K_S.gguf"
]
}
},
// big MoE LLM + vision projector (~23 GB, experts in RAM): only when chosen at install
{
when: "{{local.onprem === '35b'}}",
method: "hf.download",
method: "shell.run",
params: {
path: "app",
_: ["unsloth/Qwen3.6-35B-A3B-GGUF", "mmproj-BF16.gguf", "Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf"],
"local-dir": "models"
message: [
"uv run --script llama.py download https://huggingface.co/unsloth/Qwen3.6-35B-A3B-GGUF/resolve/main/mmproj-BF16.gguf models/mmproj-BF16.gguf",
"uv run --script llama.py download https://huggingface.co/unsloth/Qwen3.6-35B-A3B-GGUF/resolve/main/Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf models/Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf"
]
}
},
// pre-build the uv script environments (whisper, prefect, sherpa-onnx, openvino, ...)