Python binding for Local Coherence — a CPU-native runtime for deterministic local-propagation inference.
Wraps liblc.so / liblc.dll via ctypes. No PyTorch, no ONNX, no GPU.
git clone https://github.com/bracoTuxbr/lcruntime-python cd lcruntime-python pip install -e .
You also need the compiled liblc.so (Linux) or liblc.dll (Windows) from the
main repo. Point at it via env var:
export LC_LIB=/path/to/liblc.so(pip-installable wheel with bundled native lib is on the roadmap.)
import lcruntime as lc import numpy as np t = lc.Tissue1D(1024) t.set_kernel(lc.KERNEL_CANONICAL) t.set_sig_delta(4) t.inject(512, 1, 30000) t.step(100) field = t.get_field() print(f"peak={field.max()} active={int((field > 0).sum())}")
t = lc.Tissue1D(n_cells) t = lc.Tissue2D(rows, cols) t.set_kernel(lc.KERNEL_CANONICAL | lc.KERNEL_SIMPLE_AVG | lc.KERNEL_EMA) t.set_sig_delta(n) # 1 = bit-exact mode, 4 = golden default t.set_dirty_enabled(True) # enable/disable freeze t.inject(pos, count, magnitude) t.step(n_generations) field = t.get_field() # numpy view (uint16) t.close()
✓ You want to integrate LC into a Python pipeline (audio, time-series, network telemetry) ✓ You need bit-exact reproducibility across machines ✓ Your deployment target is CPU-only / sub-watt edge
✗ You need a pre-trained model. LC is not a model — it's a runtime. ✗ You need state-of-the-art accuracy on a standard ML benchmark. LC trades accuracy for determinism + speed in specific niches.
See the main repo for the paradigm explanation, the paper, and an honest evaluation of where LC wins and loses.
Apache 2.0 — see LICENSE.