Documentation

Last updated in git: 2026-06-11

AI

Everlock embeds a small LLM and exposes it in two places:

  1. As a free-text prompt mode inside the admin SSH session (backend-ai-ssh + backend-admin-ssh + frontend-ssh).
  2. As an image-captioning provider for backend-image-http, sharing the already-loaded model so there is no second copy in memory.

The shared runtime lives in its own crate, everlock-ai-runtime, which owns the model bytes and the worker thread. Backends consume it through small traits (AiTool, ImageInferenceProvider).

How the admin shell behaves

  • lines starting with / remain admin commands
  • all other lines are treated as AI prompts
  • // escapes a leading slash and sends the rest of the line to the model
  • model output is streamed back into the session as it is generated
  • the model can call explicit admin tools that map onto the current command surface
  • a built-in search_docs tool lets the model query the bundled docs for Everlock-specific context

There is no separate /ai ... command family.

Enabling it

The AI backend is always linked into the binary; the model is downloaded and embedded by build.rs. There is no Cargo feature gating the backend itself.

Toggle the SSH prompt path from the admin session:

/backends enable ai-ssh
/backends disable ai-ssh

Even when the SSH /ai mode is disabled the runtime still starts so that backend-image-http can use it for captioning.

Access control

Prompting uses the normal Everlock access model on:

ssh/ai/default

To allow a user to prompt the model:

/users grant alice ssh/ai/default writer

The image-captioning path is not gated on ssh/ai/default — access control for that lives entirely in backend-image-http.

Models

The build embeds one of two models, selected by a Cargo feature on everlock-ai-runtime:

FeatureModelApprox. size
defaultSmolVLM-256M-Instruct (Q8_0) + mmproj~250 MB
qwen3Qwen3.5-2B (Q3_K_M) + mmproj~1.9 GB

Both are vision-capable, which is what lets the same runtime serve image captioning.

Switch to Qwen3:

cargo build --release --features qwen3

Models are downloaded into target/models/ on first build. The default SmolVLM build embeds them via include_bytes!; the Qwen3 build uses assembly .incbin to bypass an LLVM rlib size limit at ~2 GB.

ai ssh admin