UNPKG

gepa-spo

Version:

Genetic-Pareto prompt optimizer to evolve system prompts from a few rollouts with modular support and intelligent crossover

27 lines (26 loc) 921 B
import type { Candidate, LLM, SystemExecute, FeedbackMuF, TaskItem } from './types.js'; export interface StrategyDef { id: string; hint: string; } export interface SeedArgs { seed: Candidate; screen: TaskItem[]; strategies: StrategyDef[]; K: number; execute: SystemExecute; muf: FeedbackMuF; llm: LLM; /** Optional budget guard: max total LLM calls allowed during seeding (mutations + evals) */ budgetLeft?: number; /** Whether judge (muf) calls should count towards usedCalls (default true) */ mufCosts?: boolean; } /** Generate seeded candidates with top-K strategies and keep the top few by average judge score */ export declare function seedPopulation({ seed, screen, strategies, K, execute, muf, llm, budgetLeft, mufCosts }: SeedArgs): Promise<{ candidates: Array<Candidate & { _via: string; _uplift: number; }>; usedCalls: number; }>;