GETTING STARTED

A small function.
A better program.

The evaluator is your specification. It tells the search which candidates deserve another generation.

1. Install

Python 3.11 or later.

Terminal
pip install easyevolve

There is no account to create. Your first run saves a card through Stripe Checkout and the SDK stores a device token at ~/.config/easyevolve/credentials.json with owner-only file permissions. You can also set EASYEVOLVE_TOKEN.

2. Define what to improve

Expose a synchronous evaluate(candidate_path: str) → dict. The required score is a finite number; higher is better. Use the Python standard library.

eval.py
import importlib.util

def evaluate(candidate_path: str) -> dict:
    spec = importlib.util.spec_from_file_location("candidate", candidate_path)
    candidate = importlib.util.module_from_spec(spec)
    spec.loader.exec_module(candidate)
    cases = [[], [1], [3, 1, 2], [5, -1, 5, 0], list(range(30, 0, -1))]
    passed = sum(candidate.solve(x.copy()) == sorted(x) for x in cases)
    return {"score": passed / len(cases)}

Describe the candidate’s function name and input/output contract in your evaluator. If it is hard to infer, add a task when creating the client.

3. Start an evolution

main.py
from easyevolve import EasyEvolve

with EasyEvolve(
    evaluator="eval.py",
    task="Implement solve(values), returning a sorted list"
) as client:
    result = client.run(iterations=100, level="low", budget=2.0)
    print(result.best_code)
    print(result.best_score)
    print(result.cost)

The service generates and evaluates the initial code before attempting mutations. The initial candidate is recorded as iteration 0. The requested iteration count is the number of subsequent attempts.

Reconnect, inspect, or cancel

Python
with EasyEvolve() as client:
    result = client.resume("your-job-id")
    # client.progress("your-job-id")
    # client.cancel("your-job-id")

A client timeout leaves the server job running. Cancellation takes effect before the next operation; an in-flight call finishes and its reserved cost is settled.

Results include status, best_code, best_score, initial_score, cost, and history. Budget exhaustion can return the best candidate found so far. A failed run raises EasyEvolveError with the result attached.

Paying

A run never spends more than its budget, and you pay only what it uses, at cost plus 10%. Without free credit, the first run opens Stripe Checkout once to save a card; nothing is charged then. Usage is billed to the card whenever it reaches $5, or monthly if smaller.

Terminal
easyevolve card      # save or replace your card
easyevolve balance   # free credit, unbilled usage, card status

Free credit, if you have any, is always used first.

You can call billing(), register_card(), rotate_token(), and revoke_token() directly. Use of the service is subject to the Terms and Privacy Policy.

Read the pricing contract →