Ruthless Efficiency
"Our chief weapons are Ruthless Efficiency! …and warm-start caching."
A general optimisation/search substrate: a pure hexagonal core + pluggable search strategies
(random built-in; evolve, optuna via extras) + pluggable compute backends.
Status
0.x — ports are still being validated against real consumers; the API may change until 1.0.
Prerequisites
- Python ≥ 3.10
pip(oruvfor development — see CONTRIBUTING.md)
Install
pip install ruthless-efficiency— core + random strategypip install "ruthless-efficiency[optuna]"— + Optuna strategy (resumable Bayesian/sampler calibration)pip install "ruthless-efficiency[evolve]"— + evolve strategy (our orchestration over OpenEvolve)pip install "ruthless-efficiency[backends]"— + SSH / HF-Jobs / Docker compute backends
Quick start
An Objective is the only thing you must implement: any class with an evaluate(candidate) method
that returns a dict[str, float] of metrics satisfies the Objective protocol (duck-typed — no base
class to inherit). Hand it to a strategy with a backend:
from ruthless import Candidate, InProcessBackend, RandomConfig, RandomSearchStrategy
class Quadratic:
def evaluate(self, candidate: Candidate) -> dict[str, float]:
return {"loss": (candidate.params["x"] - 3.0) ** 2}
cfg = RandomConfig.model_validate(
{
"kind": "random",
"metric": "loss",
"direction": "minimize",
"n_trials": 200,
"param_space": {"x": {"kind": "float", "lo": -10.0, "hi": 10.0}},
}
)
result = RandomSearchStrategy(cfg, seed=42).run(Quadratic(), backend=InProcessBackend())
print(result.best.candidate.params, result.best.metrics)
Expected output (search converges on x = 3, where loss is minimised; exact for seed 42):
{'x': 2.9969320310963994} {'loss': 9.412433193460362e-06}
Or drive it from a YAML config via the CLI:
ruthless --config search.yaml --objective my_package.objectives:my_objective
Architecture
A pure hexagonal core (ruthless/) defines the ports (Objective, SearchStrategy,
ComputeBackend) and value types; strategies and backends depend on the core, never the reverse
(enforced by import-linter). For contributor-level detail see CONTRIBUTING.md.
To explore the C4 diagrams (System Context, Containers, and per-container Components), download
docs/c4/architecture.html and open it in a browser — GitHub does not
render HTML files inline.
Learn more
- CHANGELOG.md — versioned history of what changed
- Strategies:
RandomSearchStrategy(core),OptunaStrategy([optuna]),EvolveStrategy([evolve]) - Compute backends (
[backends]): build one withruthless.backends.create_backend(...)
Contributing & community
- CONTRIBUTING.md — dev setup and the local quality gate (mirrors CI).
- CODE_OF_CONDUCT.md — Contributor Covenant.
- SECURITY.md — how to report a vulnerability and the security surface.
- NOTICE — third-party licenses and methodological references.
License
MIT © 2026 Karsten S. Nielsen
Metadata
Release files for ruthless-efficiency 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ruthless_efficiency-0.6.0.tar.gz | 899.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ruthless_efficiency-0.6.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 971.3 kB
Release files / ruthless_efficiency-0.6.0.tar.gz
| Download URL | ruthless_efficiency-0.6.0.tar.gz |
|---|---|
| Size | 899.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
19253396be5453f7e7b14713c6db05267989f74eb3863725c585e367e44cd48d
|
|
BLAKE2b-256 checksum How to use checksums |
d00f0639ef7f0bb34879299258e0cbd55b3390f7181acd17d2fb1d2b3cde3b77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency logRelease files / ruthless_efficiency-0.6.0-py3-none-any.whl
| Download URL | ruthless_efficiency-0.6.0-py3-none-any.whl |
|---|---|
| Size | 72.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2461d62c682f0bb336d9f6a94a6f5bc4e5f92c02d6889ed0742a926e2369a724
|
|
BLAKE2b-256 checksum How to use checksums |
8c449b8109e1254a0e020eeee8de7272b9805976171c0c529c6677439987346e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency log