Lakuna · docs

How a request is routed

A request only leaves the machine after a failed, strategy-augmented local answer. The fallback path is a policy decision backed by a deterministic check, not a black box.

01

Recall strategies

The agent fetches reusable strategies from prior cloud escalations on similar prompts, matched by embedding similarity. Best-effort, never blocks the request.

02

Attempt locally

The prompt, plus any matched strategies, goes to your local runtime (Ollama, llama.cpp, vLLM, LM Studio, or Jan.ai) over localhost.

03

Score the answer

A pluggable confidence check decides pass or escalate: dependency-free heuristics by default, or self-consistency sampling for a stronger signal, no second model call either way.

04

Pass → return. Fail → escalate.

A pass returns the local answer, no cloud call. A fail escalates once to the cloud API; its answer is saved as a new strategy for next time.