shikumi-optimize
Safe HaskellNone
LanguageGHC2024

Shikumi.Optimize

Description

The public surface of the optimizer framework (EP-10).

optimize is the one stable entry point EP-12's CLI calls: it applies an Optimizer strategy to a starting program and returns a CompiledProgram. The shared search-state plumbing (selectBest, scoreOn, freezeProgram) lives in Shikumi.Optimize.Search and is re-exported here; the four strategies are re-exported from their own modules.

No global mutable state. Candidate programs are threaded as ordinary values through pure folds; the only effectful step is scoring a candidate (which runs it over the dataset via scoreOn). This is the "thread candidates explicitly" discipline the MasterPlan mandates.

Synopsis

The driver

optimize :: forall (es :: [Effect]) i o. (LLM :> es, Concurrent :> es, Error ShikumiError :> es, Time :> es, Prim :> es) => Optimizer i o -> Dataset i o -> Metric o -> Program i o -> Eff es (CompiledProgram i o) Source #

Apply an optimizer to a starting program. A thin wrapper around the strategy so the public API is one stable name (and so EP-12's CLI dispatches on one function regardless of which optimizer the user picked).

Re-exports