visionremote

package
v0.209.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2026 License: Apache-2.0 Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const (
	RouteLocal  = "local"
	RouteAuto   = "auto"
	RouteRemote = "remote"
)

Route values. RouteLocal is the default: an empty route means local.

View Source
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

View Source
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

func Call(ctx context.Context, cfg config.Config, req core.Request) (core.Result, error)

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

func NormalizeRoute(route string) (string, bool)

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.

Types

type Runner

type Runner interface {
	Run(ctx context.Context, req core.Request) core.Result
}

Runner runs one request in-process; *pipeline.Pipeline satisfies it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL