pipeline

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Overview

Package pipeline orchestrates one offload request end to end: trivial-check -> context-budget trim -> cache -> build -> generate(grammar) -> parse -> verify -> validate -> (retry|defer|accept) -> cache + ledger.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnswersAgree

func AnswersAgree(task string, candidate string, finalData []byte) (agreed bool, ok bool)

AnswersAgree is a thin exported wrapper around answersAgree for use by the shadow-labeling flywheel (which lives in a separate package and cannot call the unexported function directly). task is a task-type string (e.g. "classify"). Behavior is identical to answersAgree.

Types

type Pipeline

type Pipeline struct {
	// contains filtered or unexported fields
}

func New

func (*Pipeline) Run

func (p *Pipeline) Run(ctx context.Context, req core.Request) core.Result

Run executes req through the Gemma-4 family cascade and always returns a Result (success or structured defer). Fast tasks (triage/classify) enter at the small tier; on a quality failure the request climbs to the next-larger local model before ever deferring to Opus. Infra errors do not escalate.

func (*Pipeline) RunTier

func (p *Pipeline) RunTier(ctx context.Context, req core.Request, model string) (core.Result, bool)

RunTier runs req through exactly the named tier (bypassing modelChain), with the full quality gate (grammar/verify/validate/ground/confidence) that attempt applies. It records NOTHING to the savings ledger — used by the offline shadow-labeling flywheel to evaluate a counterfactual tier without polluting the savings stats. Returns the tier's result and whether it was accepted.

Jump to

Keyboard shortcuts

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