Documentation
¶
Overview ¶
Package visionremote is the CALLER side of the fleet vision lane (0.116.0): it decides where ONE single-image vision task (vqa / ocr / assess_image) runs — this box's own vision seat, or a fleet node's — and drives the wire when the answer is a node. The node side is fleetnode's POST /fleet/vision.
The route vocabulary mirrors agent_delegate's, with the same quality-first rule Place applies to contracts:
- local (the default, and "" ): run in-process, exactly as before the route existed — every caller that never passes a route is byte-identical.
- auto: an idle local card ALWAYS runs the work; only when the machine-wide GPU lease is held (delegate.LocalBusy — a render in flight or a text reservation) or the vision seat the call would run on is busy (another request in flight, a load in progress, or a load that would unload a loaded vLLM seat: delegate.LocalSeatBusy, the reading the delegator makes of its own seat, ADR 0078) is a fleet node considered, and when no node is eligible the work still runs local. Queued-local beats ineligible-remote.
- remote: force a fleet node; with none eligible the call DEFERS (defer_class capacity — or config when no remotes are configured at all), never a silent local run: "remote" is the caller saying its own card must stay untouched.
The image is read HERE, on the box that has it, through the same loader and the same vision_max_image_bytes cap the local path applies (imageio.LoadImageB64), and travels as a data URI inside the job; the node never sees a path that is not its own. The node's answer is the full core.Result it would have returned to a local caller, stamped with the node id and the placement reason (Meta.Node / Meta.Placement).
Index ¶
Constants ¶
const ( RouteLocal = "local" RouteAuto = "auto" RouteRemote = "remote" )
Route values. RouteLocal is the default: an empty route means local.
const Budget = 300 * time.Second
Budget bounds one remote call end to end: a cold seat swap on the node (llama.cpp vision seats load in 10-30 s; the node's own vision_gpu_wait_sec is 90 s by default when a render holds its card) plus a slow card's image prefill and decode, with room for a queued dispatch.
Variables ¶
var HTTPClient = &http.Client{Transport: netguard.SafeTransport(nil), Timeout: Budget, CheckRedirect: rosterprobe.NoRedirect}
HTTPClient is the transport every request uses; tests swap it. It rides netguard.SafeTransport for the same reason the delegator's health client does: the lane may only ever reach loopback or the operator's tailnet (never-cloud, ADR 0001), enforced at dial time.
Functions ¶
func Call ¶
Call runs req on the best eligible fleet node. The image is loaded here (a bad or oversize image is a DEFERRED result, not an error — the same shape the local loader produces); a placement or wire failure is an error the caller maps to a defer class; the node's own result — including its defers — comes back as the core.Result it produced.
func NormalizeRoute ¶
NormalizeRoute maps the caller's route to one of the three values; ok is false for anything unrecognized. "" is local.
func Run ¶
func Run(ctx context.Context, cfg config.Config, runner Runner, req core.Request, route string) core.Result
Run is THE entry point the MCP handlers and the CLI verbs share: it applies the route rule above to req and returns the result exactly as the pipeline would, plus Meta.Node / Meta.Placement when the route made a decision. A local run under the default route carries neither — byte-identical to before the route existed.