You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Core concepts for understanding optimize-anything. For a hands-on tutorial, see [WALKTHROUGH.md](WALKTHROUGH.md).
4
+
5
+
## Artifact
6
+
7
+
The text being optimized. Can be a prompt, config, skill file, evaluator script, or any text where quality can be scored. Passed as a file path to the CLI.
8
+
9
+
## Evaluator
10
+
11
+
A function that scores an artifact candidate. Returns `{"score": <float>, ...}`. Three runtime modes:
12
+
13
+
-**Command** (`--evaluator-command`): shell script receiving JSON on stdin
14
+
-**HTTP** (`--evaluator-url`): endpoint receiving POST JSON
15
+
-**LLM judge** (`--judge-model`): litellm-backed model scoring against an objective
16
+
17
+
## Evaluator Protocol
18
+
19
+
-**Input:**`{"candidate": "<text>"}` via stdin (command) or POST body (HTTP)
20
+
-**Output:** JSON with required `score` key (0.0-1.0) and optional diagnostic keys
21
+
- Diagnostic keys become "Actionable Side Information" for gepa's reflection LM
22
+
23
+
## Evaluation Pattern vs Execution Mode
24
+
25
+
Two independent axes:
26
+
27
+
| Concept | What it answers | Values |
28
+
|---------|----------------|--------|
29
+
|`execution_mode`| How the evaluator runs (transport) |`command`, `http`|
30
+
|`evaluation_pattern`| What scoring strategy it implements (intent) |`verification`, `judge`, `simulation`, `composite`|
31
+
32
+
A verification evaluator can run as a command or HTTP endpoint. These are never conflated.
33
+
34
+
## gepa
35
+
36
+
The optimization engine. Runs propose/evaluate/reflect cycles to improve artifacts. Uses a proposer LLM to generate candidates and an evaluator to score them. Configure with `--model` (proposer) and `--budget` (max evaluator calls).
37
+
38
+
## Intake Specification
39
+
40
+
Schema describing what the evaluator expects: quality dimensions (with weights), hard constraints, evaluation pattern, and execution mode. Normalized by `intake.py`. Provide via `--intake-json` or `--intake-file`.
41
+
42
+
## Quality Dimensions
43
+
44
+
Named scoring axes (e.g., "clarity", "conciseness") with float weights that sum to 1.0. Used by the LLM judge for dimension-weighted scoring and by intake normalization.
45
+
46
+
## Hard Constraints
47
+
48
+
Boolean pass/fail conditions. If any constraint is violated, the LLM judge forces the score to 0.0 regardless of other dimensions.
49
+
50
+
## RED-GREEN-OBSERVER Cycle
51
+
52
+
An iterative optimization workflow orchestrated by `scripts/live_integration.py`:
53
+
54
+
-**GREEN:** Run gepa to optimize an artifact (proposer generates, evaluator scores)
55
+
-**RED:** Validate the result with multi-provider scoring (command + LLM judges)
56
+
-**OBSERVER:** Read the score matrix and decide: continue, adjust objective, or stop
57
+
58
+
## Score Baselines
59
+
60
+
Tracked in `scores.json`. The `score_check.py` script ensures artifacts don't regress below their baselines. Use `--update` to raise baselines after improvements.
61
+
62
+
## Spec File
63
+
64
+
A TOML file (`--spec-file`) that bundles optimization parameters (artifact path, evaluator, budget, objective) for repeatable runs. Loaded by `spec_loader.py`.
|`--run-dir <path>`| Directory to save run artifacts (auto-timestamped subdirectory) | -- |
207
+
|`--diff`| Show diff between seed and best candidate on stderr | -- |
202
208
|`--output, -o <file>`| Write best candidate to file | stdout |
203
209
204
210
If intake is provided, `execution_mode` is used to decide which evaluator source flag is required when neither `--evaluator-command` nor `--evaluator-url` is set. Explicit evaluator flags always win if both explicit flags and intake are supplied.
205
211
`--output` must be a file path (not an existing directory).
206
212
213
+
> **Note:** Always pass `--model` explicitly when using gepa — the default proposer model may be unavailable in your environment.
214
+
207
215
### explain
208
216
209
217
```bash
@@ -254,6 +262,34 @@ Normalize and validate an evaluator intake specification. Outputs canonical JSON
0 commit comments