Skip to main content
SkyDiscover can optimize any task where you can write a scoring function. All you need is an evaluator—a seed program is optional.

Minimum Requirements

Only 1 file is required:

evaluator.py

A Python function that scores whatever the LLM produces
Optional files:

initial_program.py

Seed solution to evolve from

config.yaml

System prompt and search settings

Evaluator

The evaluator is a Python function that receives a file path and returns a metrics dictionary.

Function Signature

evaluator.py
Return on failure, don’t raise:

Complete Example: Math Optimization

Here’s a real evaluator from the Heilbronn triangle benchmark:
benchmarks/math/heilbronn_triangle/evaluator.py

Key Points

Use importlib to load the generated program:
SkyDiscover uses combined_score to guide search. It should be:
  • 0.0 for complete failure
  • 1.0 for meeting the target
  • > 1.0 for exceeding the target
If you have multiple metrics, combine them:
Raising exceptions will crash the discovery loop. Instead:
Extra metrics are logged but don’t affect search:

Seed Program

The seed program is the starting solution. Mark the region for the LLM to evolve with EVOLVE-BLOCK markers.

Code Tasks

For code optimization, use initial_program.py:
initial_program.py
Everything between # EVOLVE-BLOCK-START and # EVOLVE-BLOCK-END can be mutated by the LLM. Code outside these markers is preserved.

Prompt Tasks

For prompt optimization, use a plain text file:
initial_prompt.txt
No markers needed—the entire file is mutable. Set language: text in config:
config.yaml

Configuration

Create config.yaml to set the system prompt and search parameters:
config.yaml
If you don’t provide config.yaml, SkyDiscover uses default settings with a generic system prompt.

Directory Structure

Organize your benchmark like this:
Simple examples to copy:

Running Your Benchmark

With seed program:

Without seed program (from scratch):

Start with -i 10 to test your evaluator, then increase to -i 100 or -i 1000 for real runs.

Advanced: Docker Evaluation

For sandboxed execution, use Docker in your evaluator:
See benchmarks/frontier-cs-eval/ for a complete Docker judge example.

Benchmark Types

SkyDiscover includes ~200 tasks across multiple domains:

Next Steps

Custom Algorithms

Implement your own search strategies

Context Builders

Customize prompt generation