Files
capri-core-rust/crates/capri-models
nocodeandClaude Opus 5.5 844435f21f
CI / test (push) Has been cancelled
Linux port: first run, packaging, single instance, privacy and wiring
First run and backend
- The companion opens without Ollama or a model (OFFLINE / SETUP REQUIRED),
  opens Settings > Language model and picks the model up once downloaded.
- Model, provider and GPU changes apply without restarting (Ollama is
  restarted when launch settings change); no silent fallback from API mode.
- Fatal startup errors are shown in a window; the fallback avatar loads
  again; the shipped Capri artwork is used when nothing was imported.

Packaging and tooling
- packaging/arch/PKGBUILD, capri.desktop (KWin ScreenShot2 key), icons,
  artwork under /usr/share/capri/assets, Gitea Actions CI.
- xtask: `icons` and `release-check` (no private data or credentials).

Runtime
- One instance per data folder (flock + control socket): second launch
  shows the window; capri stop / restart / toggle / status (JSON, starts
  nothing) / doctor / setup / diagnostics export / purge.
- A foreign program on the Ollama port is refused; an Ollama left behind
  by Capri is replaced.

Privacy and security
- No raw Ollama log on disk; API keys are never saved in plaintext (old
  ones move to the keyring); refused credential notes are stored as
  [Credentials omitted]; launched apps get an allow-listed environment.

Fixes
- Stop/Escape silence the voice; saved voice effects apply to replies;
  settings_control glitch settings apply; distinct KWin cursor scripts;
  KDE window capture authorized for source builds; Linux wording.
- Voice pack references zipped with Windows separators are found.

Wired features
- Initiatives, request router, resource monitor, "clip that", questions
  about a snapshot, sleep mode, tap reactions, stopwatch, attachments,
  Internet mode button, voice-synced subtitles, wake visuals, dictation
  draft, tray switches, Spotify seek/shuffle/repeat; computer-control
  planner and classifier follow model switches and API mode.
- Approval cards: one shown, 8 queued, deduplicated, cancelled on stop,
  failure, lock or pause; one Application access switch.

Desktop
- Compositor detection (no black overlay on i3 without picom), i3lock
  detection, unsupported desktops reported at startup, screenshot-only
  control without AT-SPI, fontconfig fallbacks, translatable feature
  pages with French translations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 20:15:49 +01:00
..
2026-11-11 20:20:48 +01:00
2026-11-11 20:20:48 +01:00

capri-models

Model management for Capri, in Rust only: hardware probe, catalog and recommendations, local model lifecycle on the owned Ollama, Hugging Face GGUF library, request router, and the egui settings pages. Spec: docs/spec/02-inference.md. data/ holds Capri's data files verbatim: memory-estimates.json, qwen-download-sizes.json, model-language-benchmark.json, request-router-head.json and request-router-corpus.json (the corpus is used by tests).

Integration

Public API

Module Items
hardware probe.await -> Hardware {cpu, cpu_threads, ram_bytes, available_ram_bytes, gpus, warnings} reads /proc/meminfo, /sys/class/drm, nvidia-smi (VRAM, UUID, temperature) and amdgpu sysfs or rocm-smi. Also Gpu::device_id, Hardware::dedicated_gpu and the parsers
catalog CHOICES (Qwen3.5 0.8/2/4/9B, Ministral 3 3B, Gemma 4 E2B), EMBEDDING_ALIAS/EMBEDDING_BASE, recommend_profile, select_model_choice, recommend_models_for_language, estimate_memory_budget, context_choices, output_budget, download_size, apply_choice(&mut Settings, choice, threads)
manage ensure_native_alias (builds capri-qwen3.5:<size> from the upstream manifest, legacy or 0.40 manifests-v2 layout, with Capri's generation parameters), ensure_embedding_alias, ensure_router_alias, pull_model/pull_with_retry (transient retries 2/4/8 s, URL redaction), residency (CPU/GPU/partial placement), prepare_language_model (warm-up with identical runner options), release_language_model, delete_model, installed, runner_options, generation_params
hf Hub::{search, inspect, download} (host allowlist, manual redirects, token sent only to huggingface.co), choose_file (best quantization that fits VRAM, or half the RAM), plan (Capri-compatible hf-<24 hex> id), Library::{install, import, list, remove} (resumable SHA-256-verified download, GGUF check, /api/blobs + /api/create, template/context/capability checks, shared blobs kept on remove, operation lock), parse_repository, scrub
router Router::new(ollama, RouterSection).classify(text, &context).await -> Routing {mode: Fast/Normal, reason, score, similarity, elapsed_ms}, warm_up, guard (Capri regexes verbatim), Head
ui ModelsHandle::new(runtime_handle, Arc<SettingsStore>, ollama_client, SecretStore), settings_ui(ui, &store, &handle) (pages: Language model, External AI provider, Hugging Face, Model device, Startup; download progress with Cancel), Page