Ruthless Efficiency — a general optimisation/search substrate (pluggable strategies + compute backends).
Project description
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 Core 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ruthless_efficiency-0.2.0.tar.gz.
File metadata
- Download URL: ruthless_efficiency-0.2.0.tar.gz
- Upload date:
- Size: 917.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59dd3067cc52ca617563ce4e37d7f1d8097ad573f7f49b186b0b69aa1c04f11e
|
|
| MD5 |
4a92a8a3a28116930c68b069b30ae1a6
|
|
| BLAKE2b-256 |
8702ba10083cd7c4e3d5da6da5c710c694bebaeddde4a2c4eaf56d875fcbe0ff
|
Provenance
The following attestation bundles were made for ruthless_efficiency-0.2.0.tar.gz:
Publisher:
publish.yml on karsten-s-nielsen/ruthless-efficiency
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ruthless_efficiency-0.2.0.tar.gz -
Subject digest:
59dd3067cc52ca617563ce4e37d7f1d8097ad573f7f49b186b0b69aa1c04f11e - Sigstore transparency entry: 1664608745
- Sigstore integration time:
-
Permalink:
karsten-s-nielsen/ruthless-efficiency@87ddeb4fb69e1578145c7a5bc7a0f9649769eb3d -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/karsten-s-nielsen
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@87ddeb4fb69e1578145c7a5bc7a0f9649769eb3d -
Trigger Event:
push
-
Statement type:
File details
Details for the file ruthless_efficiency-0.2.0-py3-none-any.whl.
File metadata
- Download URL: ruthless_efficiency-0.2.0-py3-none-any.whl
- Upload date:
- Size: 60.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6af4eda832861645152c1ef998b9ea565992e6baf788402d8668ee85fb79aaa1
|
|
| MD5 |
5d96f2b28d69ca52c2539ed27e938369
|
|
| BLAKE2b-256 |
0ab26505a7d2a76ab647921a28d62afc6f383ee87064e51ad74ac046bdfb30b4
|
Provenance
The following attestation bundles were made for ruthless_efficiency-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on karsten-s-nielsen/ruthless-efficiency
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ruthless_efficiency-0.2.0-py3-none-any.whl -
Subject digest:
6af4eda832861645152c1ef998b9ea565992e6baf788402d8668ee85fb79aaa1 - Sigstore transparency entry: 1664608907
- Sigstore integration time:
-
Permalink:
karsten-s-nielsen/ruthless-efficiency@87ddeb4fb69e1578145c7a5bc7a0f9649769eb3d -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/karsten-s-nielsen
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@87ddeb4fb69e1578145c7a5bc7a0f9649769eb3d -
Trigger Event:
push
-
Statement type: