Hardware-aware install, per-step LLM profiles, tuned llama.cpp for 4 GB VRAM
Benchmarked on RTX 500 Ada 4 GB (~3.2 GB usable on Windows) + Core Ultra 7 155H.
- install.js: log GPU/VRAM/RAM, abort without NVIDIA >= 4 GB VRAM; always
install Qwen3.5-4B Q4_K_S, Qwen3.6-35B-A3B only with >= 48 GB RAM.
- llama.py: model registry with vision (shots) and text (report/ask)
profiles; KV q8, image tokens 1024-1536.
- 35B: vision encoder on GPU, -ngl 30 (shot 142 -> ~50 s); text: -ub 2048.
- 4B: vision encoder on GPU, FFN of layers 19-31 in RAM (shot 36 -> 22 s);
text fully on GPU (~30 tok/s, report 4.5 min).
- Per-step choice in out/llm.txt: default 4B for shots, biggest for report.
- flow.py: restart llama in text profile after shots (no mmproj for report).
- shots.py: prompt v3 (inline template + defined fields, Italian summary
rules) and bounded json_schema; stops 4B loops, title 1/38 -> 36/38.
- server.py: shots/report model selects, POST /cancel + stop button, reaper
thread that honours Prefect "Cancel" and closes runs whose process died.
- diarize.py: cut same-speaker paragraphs every 60 s (one 11-min paragraph
truncated every report at 28:52); 8 threads; CUDA provider with CPU
fallback via sherpa-onnx cuda12.cudnn9 wheel (CUDA path not yet verified).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
4ff3e6fe14
commit
a64d3fb275
+17
-3
@@ -29,7 +29,7 @@ def secs(s):
|
||||
|
||||
|
||||
def chat(system, user, max_tokens, retries=2):
|
||||
body = {"model": str(llama.MODEL), "temperature": 0.2, "max_tokens": max_tokens,
|
||||
body = {"model": llama.current(False), "temperature": 0.2, "max_tokens": max_tokens,
|
||||
"chat_template_kwargs": {"enable_thinking": False}, "response_format": {"type": "json_object"},
|
||||
"messages": [{"role": "system", "content": system}, {"role": "user", "content": user}]}
|
||||
for _ in range(retries):
|
||||
@@ -399,5 +399,19 @@ def render(name):
|
||||
body = markdown.markdown(text, extensions=["tables", "toc", "md_in_html"])
|
||||
body = re.sub(r'src="shots/([^"]+)"', lambda m: 'src="data:image/jpeg;base64,' + base64.b64encode((d / "shots" / m[1]).read_bytes()).decode() + '"', body)
|
||||
h1 = re.sub(r"[#]+ ", "", md[0])
|
||||
css = "body{max-width:1000px;margin:auto;font:15px system-ui;padding:20px} img{width:100%;border:1px solid #ccc} table{border-collapse:collapse} td,th{border:1px solid #ccc;padding:4px 8px} details{margin-top:20px}"
|
||||
(d / "report.html").write_text(f'<!doctype html><meta charset="utf-8"><title>{h1}</title><style>{css}</style>\n{body}', encoding="utf-8")
|
||||
css = """:root{--bg:#faf9f5;--card:#fff;--soft:#f0eee6;--line:#e8e6dc;--fg:#141413;--mut:#6b6a64;--acc:#c96442}
|
||||
@media screen and (prefers-color-scheme:dark){:root{--bg:#262624;--card:#30302e;--soft:#1f1e1d;--line:#3e3e38;--fg:#f5f4ed;--mut:#a3a29a;--acc:#d97757}}
|
||||
*{box-sizing:border-box}body{max-width:860px;margin:auto;padding:56px 24px 96px;background:var(--bg);color:var(--fg);font:16px/1.65 system-ui,-apple-system,"Segoe UI",sans-serif}
|
||||
h1,h2{font-family:ui-serif,Georgia,"Times New Roman",serif;font-weight:500;line-height:1.25;letter-spacing:-.01em}
|
||||
h1{font-size:2.2em;margin:0 0 .2em}h1+p{color:var(--mut);margin-top:0}
|
||||
h2{font-size:1.5em;margin:2em 0 .6em;padding-top:1em;border-top:1px solid var(--line)}
|
||||
h3{font-size:.78em;font-weight:600;text-transform:uppercase;letter-spacing:.07em;color:var(--mut);margin:1.8em 0 .4em}
|
||||
a{color:var(--acc);text-decoration:none}a:hover{text-decoration:underline}
|
||||
ul,ol{padding-left:1.4em}li{margin:.3em 0}li::marker{color:var(--acc)}
|
||||
#in-breve{border-top:0}#in-breve+ul{background:var(--soft);border-left:3px solid var(--acc);border-radius:10px;padding:16px 20px 16px 2.4em}
|
||||
table{border-collapse:separate;border-spacing:0;width:100%;background:var(--card);border:1px solid var(--line);border-radius:12px;overflow:hidden;font-size:.92em}
|
||||
td,th{padding:9px 14px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}tr:last-child td{border-bottom:0}th{background:var(--soft);font-weight:600}
|
||||
img{width:100%;border:1px solid var(--line);border-radius:12px;margin-top:.8em}p>em{color:var(--mut);font-size:.88em}
|
||||
details{margin-top:2.4em;background:var(--card);border:1px solid var(--line);border-radius:12px;padding:14px 18px}summary{cursor:pointer;color:var(--acc);font-weight:500}
|
||||
code{background:var(--soft);border-radius:5px;padding:.1em .35em;font-size:.9em}"""
|
||||
(d / "report.html").write_text(f'<!doctype html><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{h1}</title><style>{css}</style>\n{body}', encoding="utf-8")
|
||||
|
||||
Reference in New Issue
Block a user