evalcli

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 20 Imported by: ? 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 evalcli embeds a local experiment CLI in an application's eval program.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main(ctx context.Context, args []string, cfg Config) int

Main runs args (normally os.Args[1:]) without installing signal handlers. It returns 0 for successful commands, 1 for operational failures, 2 for usage errors, and 3 for rejected checks. Completed run commands return 0 regardless of verdicts. The caller supplies cancellation through ctx.

Types

type Config

type Config struct {
	// Extensions enables only explicitly supplied application commands.
	Extensions []Extension
	// Compaction enables offline summary evaluation independently of Harness and Scenarios.
	Compaction     *summaryeval.Config
	Name           string
	Harness        eval.HarnessFunc
	AttemptHarness eval.AttemptHarnessFunc
	// CaptureEvidence durably captures canonical evidence before model dispatch.
	CaptureEvidence bool
	Scenarios       []eval.Scenario
	Variants        []eval.Variant
	// NewJudge optionally constructs the judge using the store's calibration cache.
	// --no-judge skips the factory; ErrLiveModelDisabled runs without judging.
	NewJudge       func(cache judge.Cache) (*judge.Judge, error)
	StoreDir       string
	Dir            string
	Stdout, Stderr io.Writer
}

Config supplies application scenarios, isolated harnesses and CLI destinations. Exactly one of Harness and AttemptHarness, and Scenarios are required except for help, check, and registered extension commands. Empty Name means "evals". Empty StoreDir uses eval.DefaultStoreDir(Dir); empty Dir uses os.Getwd. Nil output writers use os.Stdout and os.Stderr.

type Extension

type Extension struct {
	Name string
	Help string
	Run  func(context.Context, ExtensionRequest) error
}

Extension is an explicitly registered application command. Core evalcli has no dependency on optional exporters. Names cannot shadow built-in commands.

type ExtensionRequest

type ExtensionRequest struct {
	Args   []string
	Store  *eval.Store
	Stdout io.Writer
	Stderr io.Writer
}

ExtensionRequest supplies the selected local store and application I/O. Args follow the command name; the extension owns their validation.

Jump to

Keyboard shortcuts

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