algenta-networking

Networking and systems kernels. Compiled Mojo, loaded in-process.

15 modules · 156 functions · CPU

Get started

pip install kernels torch
from kernels import get_kernel

kernel = get_kernel(
    "thyn-ai/algenta-networking",
    version=1,
    backend="cpu",
    trust_remote_code=["thyn-ai/algenta-networking"],
)
kernel.net.url.url_encode("hello world")  # -> "hello%20world"  percent-encoded

backend="cpu" selects the CPU build. On a Mac the loader otherwise looks for a Metal build, which this family does not ship. trust_remote_code names the repositories you allow; Hugging Face's trusted publishers load without it.

Plain Python in, plain Python out. Lists, tuples, buffers and tensors are accepted wherever the contract expects a list; structured results are dictionaries. Some functions take a list and the number of elements to use from it, which may not exceed the list's length; multi-dimensional data is passed flattened, row-major, with its dimensions. Functions that update an argument do so in place, as help() says. Every call is checked against the published contract before it reaches native code. An invalid call raises KernelError with a stable code, never a crash.

Any function can also be called by name, with args as a list or a dict of parameter names:

kernel.execute("net.url", "query_build", [...])

What's inside

Module Functions What it does
compiler_theory 12 Compiler heuristics: LL(1) and LR conflict checks, AST metrics, register pressure, IPC
epigenetics 10 Epigenetics: CpG methylation index, Horvath-style clock age, histone ratios, accessibility
genetic 8 Genetic algorithm: tournament selection, uniform and one-point crossover, Gaussian mutation
kinetics 10 Chemical kinetics: reaction rates, Arrhenius, half-lives, activation energy, Michaelis-Menten
magnetism 10 Magnetism: Biot-Savart, solenoid and toroid fields, flux, inductance, cyclotron radius, Hall
memory_system 10 Memory sizing: pool fragmentation, slab waste, cache-line padding, training memory, NUMA
net.url 7 URL handling: parse and rebuild URLs, percent-encode and decode, parse and build query strings
network_analysis 11 Graph analytics: degree, density, PageRank, closeness, clustering coefficients, BFS, components
network_protocol 11 HTTP helpers: status reason phrases and classes, MIME types, content-type header, query strings
paleomagnetism 13 Paleomagnetism: paleolatitude from inclination, paleointensity, reversal rate, Koenigsberger
petri_net 13 Small Petri nets: transition enabling and firing, deadlock, place bounds, coverability, siphons
pharmacokinetics 12 Pharmacokinetics: one-compartment IV and oral curves, half-life, clearance, dosing, AUC
population_genetics 10 Population genetics: Hardy-Weinberg, drift, selection, effective size, Tajima's D, FST
social_network 9 Directed networks: in/out degree, reciprocity, independent cascade, label propagation, density
toxicokinetics 10 Toxicokinetics: internal dose, Cmax and Tmax, AUC, half-life, clearance, margin of exposure

kernel.CONTRACT holds every signature, including the length rules for list arguments; help(kernel.compiler_theory) documents each function.

Requirements

  • Apple silicon: macOS 15 or later for the CPU build.
  • Linux arm64 and x86-64, glibc 2.35 or later.
  • kernels 0.17 or later and PyTorch 2.5 to 2.14. PyTorch has to be installed: the loader picks the build for your PyTorch version. The kernel itself never imports it.

Windows is not supported.

Notes

Calls into one kernel instance run one at a time; use processes for parallelism. Runtime state does not survive fork(); start worker processes with spawn.

License

Algenta Community License 1.1 (LICENSE). Free for personal, research and open-source use, and for internal use at organizations with fewer than 50 employees and under $5M in annual revenue. Beyond that, a commercial license is required: https://algenta.ai/pricing.

Enforced in the compiled library, not just in this text: one concurrent native worker per device (ABI §9). A second process, family or thread waits its turn rather than running in parallel. That is the Community licence's worker floor made real; parallel execution comes with a commercial license.

Support

Generally Available on the platforms listed under Requirements. Within v1, functions are only added; removals or signature changes ship as v2. Platforms, accelerators and PyTorch releases not listed are not supported. Documentation: https://docs.algenta.ai (the kernels guide: https://docs.algenta.ai/guides/kernels-on-hugging-face). Community: https://discord.gg/w8NDsph9an or this repository's Community tab. Commercial licences and support: https://algenta.ai/pricing.

Downloads last month
2
algenta
mojo
cpu
other
Torch
2.14
OS
macoslinux
Arch
x86_64aarch64