profilestore

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package profilestore persists a model's measured capability profile as a typed resource and reads it back as a harness.ProfileSource, so a reliability measurement made once drives how hard the harness scaffolds that model on every later run. The profile is the integration point between the reliability evaluation that writes it and the dispatch waist that reads it: writing is an ordinary resource Put, so a profile is versioned, audited, and synced like any other record, and reading loads a snapshot the assembly consults with no per-call store access.

Index

Constants

View Source
const (
	// GroupVersion is the API group/version of a model profile resource.
	GroupVersion = "harness.ionagent.io/v1"
	// Kind is the resource kind name.
	Kind = "ModelProfile"
)

Variables

This section is empty.

Functions

func RegisterKind

func RegisterKind(reg *resource.Registry) error

RegisterKind registers the ModelProfile kind so the resource store admits and schema-validates profiles like any other resource.

func Write

func Write(ctx context.Context, rs resource.Store, spec Spec) error

Write persists a measured profile. The resource name is the (model, quant, runtime) key, so a re-measurement of the same target overwrites the prior record rather than accumulating duplicates. The store validates the spec against the schema on the way in.

Types

type Source

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

Source is a harness.ProfileSource backed by profiles in the resource store. It loads a snapshot once at construction and answers every lookup from memory, so the dispatch waist consults a model's capability without touching the store on the hot path. A model never measured is simply absent, which the harness treats as unknown and scaffolds most conservatively.

func NewSource

func NewSource(ctx context.Context, rs resource.Store) (Source, error)

NewSource loads every stored profile and indexes it by model id. When a model has more than one profile, for instance several quantizations, the indexed profile is the element-wise minimum across them: the lookup does not know which quant will be served, so it reports the least capable, and the harness never under-scaffolds a model on the strength of a more capable build it might not be running. A store read error is returned; an empty store yields an empty source that reports every model as unknown.

func (Source) Profile

func (s Source) Profile(model string) (harness.ModelProfile, bool)

Profile returns the measured profile for a model, or false when none is stored.

type Spec

type Spec struct {
	ModelID              string  `json:"modelID"`
	Quant                string  `json:"quant,omitempty"`
	Runtime              string  `json:"runtime,omitempty"`
	BatteryVersion       string  `json:"batteryVersion,omitempty"`
	ToolCallReliability  float64 `json:"toolCallReliability,omitempty"`
	StructuredOutput     float64 `json:"structuredOutput,omitempty"`
	InstructionFollowing float64 `json:"instructionFollowing,omitempty"`
	EffectiveContext     int     `json:"effectiveContext,omitempty"`
}

Spec is a measured profile for one model and, where they apply, the quantization and runtime it was measured on: a different quant is a different function, so it is recorded. The reliability fields mirror harness.ModelProfile; BatteryVersion records which probe set produced them, so a score is only compared to another taken the same way.

Jump to

Keyboard shortcuts

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