Improve question detection, capture stealth, latency; stop tracking model binaries

- Detection: broaden request-starters, handle contractions, allow 1-word '?'
- Audio: PTT pre-roll (no clipped first word), drop Whisper silence hallucinations,
  greedy decoding + domain initial_prompt for faster/cleaner transcription
- AI: cap spoken-answer tokens so replies return at conversational speed
- Overlay: answers persist (no auto-hide); wire Ctrl+Shift+H show/hide toggle
- Screen capture: freeze-frame at hotkey press (immune to focus-blur lockouts),
  hide selector from screen-share (NSWindowSharingNone), higher capture resolution
- Stop tracking models/ and *.zip (large binaries; add to .gitignore)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Charles Wambua
2026-06-26 14:36:06 +03:00
parent 1dd5b757be
commit dba78a2766
19 changed files with 1767 additions and 154102 deletions

View File

@@ -17,32 +17,37 @@ def install_dependencies():
def download_models():
"""Download AI models"""
print("🤖 Downloading AI models...")
"""Download the Qwen2.5-VL vision brain (model + mmproj) into models/.
# Create models directory
The Whisper STT model (distil-large-v3 by default) auto-downloads via
faster-whisper on first run, so it isn't fetched here.
"""
print("🤖 Downloading AI models (Qwen2.5-VL-7B + vision projector)...")
os.makedirs("models", exist_ok=True)
# Download TinyLlama (small, fast, works on CPU)
model_urls = {
"tinyllama-1.1b.Q4_K_M.gguf": "https://huggingface.co/TheBloke/TinyLlama-1.1B-GGUF/resolve/main/tinyllama-1.1b.Q4_K_M.gguf"
}
repo = "ggml-org/Qwen2.5-VL-7B-Instruct-GGUF"
files = [
"Qwen2.5-VL-7B-Instruct-Q4_K_M.gguf", # ~4.7 GB
"mmproj-Qwen2.5-VL-7B-Instruct-f16.gguf", # ~1.4 GB vision projector
]
import urllib.request
try:
from huggingface_hub import hf_hub_download
except ImportError:
print("❌ huggingface_hub not installed. Run: pip install -r requirements.txt")
return
for model_name, url in model_urls.items():
model_path = os.path.join("models", model_name)
if not os.path.exists(model_path):
print(f"Downloading {model_name}...")
try:
urllib.request.urlretrieve(url, model_path)
print(f"✅ Downloaded {model_name}")
except Exception as e:
print(f"❌ Failed to download {model_name}: {e}")
print("⚠️ Will run in fallback mode without local LLM")
else:
print(f"{model_name} already exists")
dest = os.path.abspath("models")
for fn in files:
if os.path.exists(os.path.join(dest, fn)):
print(f"{fn} already exists")
continue
print(f"Downloading {fn} (this is large; behind a proxy it may be slow)...")
try:
hf_hub_download(repo_id=repo, filename=fn, local_dir=dest)
print(f"✅ Downloaded {fn}")
except Exception as e:
print(f"❌ Failed to download {fn}: {e}")
def setup_audio():