Documentation
¶
Overview ¶
Package textremote is the CALLER side of the fleet text lane (0.154.0): it decides where ONE classify or extract call runs (this box's own cascade, or a fleet node's own pipeline) and drives the wire when the answer is a node. The node side is fleetnode's POST /fleet/text. It is visionremote's shape, for a text payload.
The route vocabulary is visionremote's, and so is the quality-first rule:
- 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) 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.
A node is eligible only when its health lists "text" AND the task in text_tasks. The lane ships dark (no shipped tier declares a text task until measured data passes), so on a fleet where no node advertises it, remote defers and auto stays local. A node that predates the lane is never picked. The node's answer is the full core.Result its own pipeline produced (an unconstrained seat validated strictly, defers included), stamped with the node id and the placement reason (Meta.Node / Meta.Placement). summarize and triage are not routable: the node refuses them.
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 load on the node plus a slow runtime's prefill and decode (an NPU node decodes at single-digit tokens per second), with room for a queued dispatch. It is the vision lane's figure, and sits above the node's own request_timeout_sec.
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. 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 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.