A small function.
A better program.
The evaluator is your specification. It tells the search which candidates deserve another generation.
1. Install and sign in
Python 3.11 or later.
pip install --pre easyevolve
easyevolve loginPaste your invite token when prompted. The SDK checks it against the API, then stores it at ~/.config/easyevolve/credentials.json with owner-only file permissions. You can also set EASYEVOLVE_TOKEN. Run easyevolve balance to see your remaining credit.
Invite-only beta: you need an invite token from the EasyEvolve team. The API, pricing, and limits may change during the beta.
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.
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
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
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.
Beta credit
Each invite includes prepaid credit. Every run reserves its budget up front and returns what it did not use, so a run never spends more than you allow. Credit purchases are closed during the beta; contact us if you need more.
You can call balance(), rotate_token(), and revoke_token() directly. Use of the beta is subject to the Beta Terms.