Documentation
¶
Overview ¶
Package sttremote is the CALLER side of the fleet stt upload door (ADR 0072): it decides where ONE transcription runs, this box's own whisper or a fleet node's, and drives the wire when the answer is a node. The node side is fleetnode's POST /fleet/stt.
The route vocabulary is the vision lane's (internal/visionremote), with the same quality-first rule:
- local (the default, and ""): run in-process, exactly as before the route existed. The one difference is on a refusal: a gpu_busy defer gains a hint that route auto or remote would let a fleet node take the work, when delegate_remotes is configured.
- auto: run local unless the local whisper request would actually be held right now (modelaffinity.WouldBlockUpstream: a lease fences the cards over the model AND the model is not already resident), in which case a fleet node is tried, and with none usable the work still runs local. Every node serves the same whisper family, so a spill costs no quality.
- 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 audio is read HERE, on the box that has it, converted to 16 kHz mono Opus at 32 kbps (about 14 MB per hour of speech; the original file is sent when conversion is impossible and it fits the node's cap) and travels as base64 inside the job. The node's answer is the full core.Result it would have returned to a local caller; on success this box writes its OWN .srt, .txt and .segments.json under media_dir from the full segment list (fetching the node's copy through /fleet/media when the inline one was cut), so the result's paths are local files and nothing here refers to a path on the node. The result is stamped with the node id and the placement reason (Meta.Node / Meta.Placement); the route itself is on the asker's ledger row.
Index ¶
Constants ¶
const ( RouteLocal = "local" RouteAuto = "auto" RouteRemote = "remote" )
Route values. RouteLocal is the default: an empty route means local.
Variables ¶
var HTTPClient = &http.Client{Transport: netguard.SafeTransport(nil), CheckRedirect: rosterprobe.NoRedirect}
HTTPClient is the transport every request uses; tests swap it. It rides netguard.SafeTransport like every other fleet client: the lane may only ever reach loopback or the operator's tailnet (never-cloud, ADR 0001), enforced at dial time. It carries no client-level Timeout on purpose: a transcription is waited on for up to stt_request_timeout_sec, so every request bounds itself with its own context.
Functions ¶
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 handler and the CLI verb 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.