Skip to content

feat: add AI Lab with capability detection, local LLM, and MCP tools - #27

Merged
simonhagger merged 1 commit into
mainfrom
feat/ai-capability-lab
Aug 24, 2026
Merged

feat: add AI Lab with capability detection, local LLM, and MCP tools#27
simonhagger merged 1 commit into
mainfrom
feat/ai-capability-lab

Conversation

@simonhagger

Copy link
Copy Markdown
Owner

Summary

  • */ai/capabilities* — stdlib-only sidecar probe: NVIDIA GPUs via nvidia-smi (name/VRAM/driver), CPU/RAM, importable inference backends (llama_cpp/torch/onnxruntime/transformers via find_spec), local .gguf model scan, plain-language verdict + setup notes
  • */ai/generate* — local inference through llama-cpp-python when backend and a GGUF model exist (instance cache across requests, GPU layers enabled when CUDA driver detected); structured unavailable+guidance otherwise. Server upgraded to ThreadingHTTPServer so long generations cannot starve /health monitoring
  • *\POST /mcp* — JSON-RPC 2.0 Model-Context-Protocol surface in pure stdlib: initialize / notifications/initialized / tools/list / tools/call with echo, system_info, time_now tools; -32601/-32602 error semantics
  • Validated IPC channels \�i:capabilities/\�i:generate/\�i:mcp-invoke, preload \�i\ API namespace, \DesktopAiApi\
  • Renderer AI Lab route: capability matrix, local generation panel, interactive MCP tool explorer

Validation

  • Python sidecar suite: 20/20 passed at 98% coverage (incl. stubbed llama_cpp happy path, cache reuse, load-failure, validation errors, malformed nvidia-smi rows)
  • contracts/desktop-api/preload/desktop-main builds green; desktop-main TS tests green; renderer dev build emits 28.57 kB ai-lab chunk; renderer tests + repo lint green

Security Checklist

  • Security review completed
  • Threat model updated or N/A explained
  • Confirmed no secrets/sensitive data present in committed files

- Sidecar /ai/capabilities: stdlib-only probe of NVIDIA GPUs via
  nvidia-smi, CPU/RAM, importable inference backends, local gguf models
- Sidecar /ai/generate: llama-cpp-python when backend and model are
  present (instance cache, CUDA layers), structured unavailable guidance
  otherwise; ThreadingHTTPServer so generation cannot starve /health
- Sidecar POST /mcp: JSON-RPC 2.0 surface (initialize, tools/list,
  tools/call) with echo/system_info/time_now in pure stdlib
- aiCapabilities/aiGenerate/aiMcpInvoke validated IPC channels, preload
  ai API, DesktopAiApi surface
- Renderer AI Lab route: capability matrix, generation panel, MCP tool
  explorer; 20 python tests at 98% coverage incl. stubbed llama_cpp
@simonhagger
simonhagger merged commit e81339e into main Aug 24, 2026
17 checks passed
@simonhagger
simonhagger deleted the feat/ai-capability-lab branch August 24, 2026 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant