Fruit-fly brain edge autonomy, in Python and zero-heap ANSI C99
Five open-source modules modelled on the adult Drosophila central nervous system, built for lossy radios, GPS-denied vehicles, micro-drones and low-cost microcontrollers.
Website · Products · Install · Repository layout · Development
Products
NeckLink is the brand; each product translates one subsystem of the fruit-fly nervous system into a standalone library. Every product has a Python package on PyPI and a zero-heap, zero-float ANSI C99 core for microcontrollers (hardware-tested on ESP32 and ESP8266EX; portable ANSI C99 for other targets), and each one is benchmarked against a strong classical baseline, including where the baseline still wins.
| Product | Fly circuit | What it does | Package |
|---|---|---|---|
NLTP (v1.6.0) |
Cervical connective | Loss-healing GF(2^8) Cauchy FEC file & priority-command transport with X25519 + PSK forward-secret ChaCha20-Poly1305 encryption, zero-dependency LZ4 compression, and a 4.76 KB MCU sensor profile over UDP (incl. 4G CGNAT traversal) or routerless ESP-NOW across ESP32 & ESP8266, in Python, C99, JS/TS (Node.js), Java 11+, and Arduino (248/248 cross-language checks + 100% SHA-256 @ 35% RF loss verified) |
pynltp |
NeckCompass (v1.1.0) |
Central complex (E-PG / CPU4) |
Ring-attractor compass that rejects 70°–150° magnetometer spikes as well as a 3σ-gated EKF (0.44° vs 0.41° RMSE), re-anchors after a 90° heading upset where the gated EKF stays stuck, and homes without GNSS (324 B RAM in C99) |
neckcompass |
NeckSight (v1.1.0) |
Optic lobe (T4/T5 + LPLC2) |
Glare-adapted motion detection and a four-quadrant looming reflex: 0.9988 AUROC on synthetic clutter vs 0.875 for compensated pyramidal Lucas-Kanade, gyro derotation so obstacles are still caught during fast turns, ~12,000 FPS at 32×32 in C99 (desktop) |
necksight |
NeckCord (v1.1.0) |
Ventral nerve cord (BANC / MANC) |
4-byte motor command frame, self-healing six-leg gait generator, and a fault-tolerant thruster allocator that isolates a failed thruster in ~42 ms (on par with pseudo-inverse + threshold FDI) and can return it to service (322 B in C99) |
neckcord |
NeckSense (v1.1.0) |
Antennal lobe & mushroom body | Concentration-invariant normalisation, multiplication-free FlyHash, one-shot novelty detection (0.994 AUROC in 4 KB) and one-shot classification, with Q16.16 C99 that is bit-identical to Python |
necksense |
Each product's README has its full benchmarks, its API and a "when not to use it" section. Each benchmark compares against the strongest simple classical baseline we could build: a gated EKF, threshold FDI, baseline-corrected k-NN, or compensated pyramidal optical flow. Where that baseline ties or wins, the README says so.
November 2026 release notes (
NLTP v1.6.0+v1.1.0organ suite):
- NLTP
1.6.0(pynltp, compression + MCU RAM & speed release): Adds zero-dependency standardLZ4raw block compression (--compress/-z,4.29×fewer wire bytes and3.32×faster delivery on real telemetry under25%tc netemloss with smart auto-bypass on incompressible payloads), a4,760 B(4.65 KB)-DNLTP_TX_ONLY=1C99/Arduino sensor RAM profile (15.0×smaller thanESP32default) +24.3 KBESP8266TX+RX profile, branchless 4×-unrolledGF(2^8)row-table coding (956 MB/s), and BDP clean-link inflight window capping (4.31×lower64 KBwarm clean-link latency:0.224 s -> 0.052 s).- NLTP
1.5.0(pynltp, forward secrecy & reflex parity): Upgrades encrypted 1-RTTHELLO/HELLO_ACKhandshakes to ephemeralX25519 + PSKPerfect Forward Secrecy (96 Bcontrol frames, backward-compatible with1.4.0peers via40 Blegacy fallback), expands anti-replay protection to a512-packet sliding bitmap (2.57×higher goodput under10%packet reordering), and brings full confirmed out-of-band reflex retries to C99 & Arduino; see the NLTP security model.- Confirmed reflex lane, ESP-NOW mesh & Organ Suite
1.1.0(neckcompass,necksight,neckcord,necksense): Live off-Wi-FiESP32(~7 Mbpstypical,17.75 Mbpsbest) + cross-chipESP8266EX(NodeMCU) 3-board mesh verification, alongside all four organ modules audited against strong classical baselines (NeckCompasssensor-noise re-anchoring,NeckSightgyro derotation + Python 3.9 support,NeckCordthruster recovery probing, andNeckSense2%-sparse novelty codes).
Install
pip install --upgrade necklink
# or install individual modules:
pip install --upgrade pynltp neckcompass necksight neckcord necksense
Every package supports Python 3.9+ and depends only on NumPy (pynltp also uses cryptography). Each one's C99 core is self-contained inside csrc/ so you can copy it directly into firmware.
Run all five together
The necklink command ships with pynltp. With all five packages installed:
necklink products # List the installed NeckLink products and versions
necklink suite-demo --loss 0.15 # Closed-loop five-module reflex mission over encrypted, lossy UDP
from necklink import run_autonomous_reflex_demo
report = run_autonomous_reflex_demo(loss=0.15)
print(report)
Repository layout
necklink/
├── packages/
│ ├── nltp/ NLTP wire protocol (v1.6.0): Python, C99, JS/TS (Node.js), Java 11+, Arduino, ESP32/ESP8266
│ ├── neckcompass/ Central-complex compass and path integrator (v1.1.0)
│ ├── necksight/ Optic-lobe motion and looming reflex (v1.1.0)
│ ├── neckcord/ Ventral-nerve-cord motor codec and thruster allocator (v1.1.0)
│ └── necksense/ Antennal-lobe and mushroom-body odour engine (v1.1.0)
├── umbrella/ The `necklink` PyPI meta-package (v1.6.0) that installs all five
├── web/ Source of the website (deployed to the gh-pages branch)
└── assets/ NeckLink logo, brand banner and shared images
Every folder under packages/ is a self-contained project with its own pyproject.toml, tests, C99 core, benchmarks, README and licence, and is released to PyPI on its own. Python import names are import nltp, import neckcompass, import necksight, import neckcord, and import necksense.
Development
Work inside the package you are changing:
cd packages/neckcompass
pip install -e . pytest
python -m pytest # unit tests, plus every README example
make -C csrc clean all test # zero-heap C99 core and its self-tests
python scripts/benchmark_neckcompass.py # regenerates results/ and the chart (needs matplotlib)
CI (.github/workflows/packages-ci.yml) runs the following on Python 3.9 and 3.13 for NeckCompass, NeckCord, NeckSense, NeckSight and NLTP (including ASan/UBSan C99 + 4.76 KB NLTP_TX_ONLY checks, Node.js 20, Java 11+, and 248/248 4-language wire interop):
- builds each package's wheel and installs it;
- runs its CLI;
- runs its tests, including the README examples;
- builds the C core with
-Werrorand runs its self-tests.
NLTP also has JavaScript (packages/nltp/js), Java 11+ (packages/nltp/java) and ESP32/ESP8266 (packages/nltp/arduino, packages/nltp/esp32, packages/nltp/esp32_mesh) SDKs; see its README.
History
NeckCompass, NeckSight, NeckCord and NeckSense started in their own repositories and were merged here with their full commit history on 4 November 2026. The old repositories are archived and read-only.
License
Released under the MIT License. Copyright (c) 2026 Amandeep Singh Bains.
Metadata
Release files for necklink 1.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 | Provenance | Actions |
|---|---|---|---|---|
| necklink-1.6.0.tar.gz | 7.6 kB | Without provenance | Details for necklink-1.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| necklink-1.6.0-py3-none-any.whl | Python 3 | none | any | Details for necklink-1.6.0-py3-none-any.whl |
Total release size: 14.6 kB
Release files / necklink-1.6.0.tar.gz
| Download URL | necklink-1.6.0.tar.gz |
|---|---|
| Size | 7.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b24e101ce6ec529737070e8bf534abfc29852ee1d4388983f5f116dc2afcc15e
|
|
BLAKE2b-256 checksum How to use checksums |
713cd709304ffcfc6b65ac4f979449312fbbc4411126c25010f541ec7e5c72d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Release files / necklink-1.6.0-py3-none-any.whl
| Download URL | necklink-1.6.0-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fbde116e1d934b879d4c59da3e840e48282da9a882df21c165b678575f82c3ad
|
|
BLAKE2b-256 checksum How to use checksums |
9f3b7085563242e4fa19099369fdf122740487e0cdaa1855ce9b1eaaf9150c41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Security for necklink 1.6.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.