Skip to main content

⚡ NNI Labs — nni-sdk (The Neural-Native Interconnect)

PyPI Python License

Stop shipping tensors over 1990s web protocols.

The internet was built for humans reading web pages—not for AI models thinking together. When models, local SLMs, and edge NPUs communicate over HTTP/JSON, they pay a massive serialization and TCP tax on every hop.

nni-sdk by NNI Labs replaces that with a 64-byte cache-line-aligned network layer—where models discover each other by capability instead of IP addresses, pass raw latent states instead of JSON text, and link across shared RAM, LAN, and encrypted global relays.

🌐 Website & Wire Spec: https://nnilabs.pages.dev
✉️ Contact / OEM: nnilabs.hq@gmail.com


📊 Verified Telemetry Benchmark (128-Float Tensor Round-Trip)

Deployment Tier Traditional HTTP/JSON nni-sdk Runtime Result
Same Machine (Shared Memory L3) 3,263 µs 32.9 µs (0.03 ms) ~99x faster (mmap Seqlock)
Local Network (Direct 0-RTT UDP) 3,263 µs 136.4 µs (0.13 ms) ~24x faster (P2P UDP)
Global WAN (India ↔ Sweden) ~570.0 ms (est. w/ TLS) 385.4 ms Speed-of-Light Floor
Local Wire Size (Round-Trip) ~1,432 Bytes 128 Bytes 91.1% less data
WAN Egress Size (Round-Trip) ~1,832 Bytes (w/ TLS) 200 Bytes 89.1% less cloud egress
Encryption & Memory Proxy TLS / JSON heap alloc E2E AEAD / Zero alloc Relays stay blind

🚀 Quickstart (Copy & Run)

pip install nni-sdk

Zero dependencies. Works on Python 3.11+ (Linux x86_64 / aarch64, macOS Apple Silicon, Windows x64), with zero-copy NumPy and PyTorch support via __array_interface__.

1. Direct P2P UDP (Local / LAN — 128 Bytes Round-Trip)

import threading
import time
import nni_sdk as nni

def run_node():
    node = nni.Node(port=19150)
    node.serve("vision", lambda tensor: [x * 2.0 for x in tensor])

threading.Thread(target=run_node, daemon=True).start()
time.sleep(0.3)

client = nni.Client()
client.connect_direct("vision", "127.0.0.1:19150")

query = nni.zeros(128)
query[0] = 42.0
result = client.send("vision", query)
print("Output:", result[0])  # 84.0

2. Shared Memory on Same Machine (L3 Cache — ~32.9 µs, 0 Wire Bytes)

import threading
import time
import nni_sdk as nni

def run_shm():
    node = nni.Node(19999)
    node.serve_shm("nni_vision_shm", lambda t: [x * 2.0 for x in t])

threading.Thread(target=run_shm, daemon=True).start()
time.sleep(0.3)

client = nni.Client()
result = client.send_shm("nni_vision_shm", nni.from_list([42.0] * 128))
print("Output:", result[0])  # 84.0

3. Global Encrypted Mesh (Across NATs — 200 Bytes Round-Trip)

import nni_sdk as nni

RELAY = "13.62.157.43:19200"  # Hosted backbone or self-hosted `nni relay`

# On your remote host (behind any NAT):
# node = nni.Node(port=19100, relay=RELAY)
# node.serve(0x01B2, lambda t: [x * 2.0 for x in t])

# From anywhere on Earth:
client = nni.Client.connect_mesh(RELAY)
result = client.send(0x01B2, [1.25] * 128)
print("Output:", result[0])

🧬 How the Network Works

  • Fixed 64-Byte Frames: Every packet fits a single CPU cache line (16B 128-bit sparsity mask, 4B scale, 4B target ID, 4B flags, 4B sequence ID, 32B payload supporting Top-8 exact FP32, 32× INT8, or 64× INT4, plus 512-dim chained bursts).
  • No DNS — Route by Capability: Nodes register 128-bit capability masks; routers and relays match incoming vectors in nanoseconds via single-cycle hardware POPCOUNT Hamming distance.
  • Blind Relays: Global WAN envelopes (100 Bytes) wrap the 64-byte payload in X25519 + ChaCha20-Poly1305 AEAD with a 128-packet sliding anti-replay window. Relays never hold keys or read tensors.

📜 Licensing

NNI Labs Proprietary Free Binary License (Free to Use)

  • Free in Production: Pre-compiled nni-sdk wheels and nni binaries are free for personal, academic, and commercial production use with zero royalties and no per-packet fees.
  • Closed-Source Core: Source code remains proprietary to NNI Labs and is not distributed. Decompiling, reverse engineering, or redistributing modified binaries is prohibited.
  • Enterprise / C-ABI OEM: Need static libraries (.a/.so/.dll) or dedicated SLA relay clusters? Contact nnilabs.hq@gmail.com.

© 2026 NNI Labs. All rights reserved.

Metadata

Release files for nni-sdk 3.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for nni-sdk 3.0.3
File Actions
nni_sdk-3.0.3-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for nni_sdk-3.0.3-cp311-abi3-win_amd64.whl
nni_sdk-3.0.3-cp311-abi3-manylinux_2_34_x86_64.whl CPython 3.11 abi3 Linux glibc 2.34+ x86-64 Details for nni_sdk-3.0.3-cp311-abi3-manylinux_2_34_x86_64.whl
nni_sdk-3.0.3-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for nni_sdk-3.0.3-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
nni_sdk-3.0.3-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for nni_sdk-3.0.3-cp311-abi3-macosx_11_0_arm64.whl

Total release size: 1.2 MB

Release files / nni_sdk-3.0.3-cp311-abi3-win_amd64.whl

Download URL nni_sdk-3.0.3-cp311-abi3-win_amd64.whl
Size 261.4 kB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
71e91e5acceee2548a7c4607e10b5880956105640d0c2b6a746d48068f65a7dd
BLAKE2b-256 checksum
How to use checksums
13b53fb5da89711538e0c5d19525c294e7ff53f0ebc0fa5473bde19003ff6740
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.16.0

Release files / nni_sdk-3.0.3-cp311-abi3-manylinux_2_34_x86_64.whl

Download URL nni_sdk-3.0.3-cp311-abi3-manylinux_2_34_x86_64.whl
Size 355.1 kB
Tags CPython 3.11 Linux glibc 2.34+ x86-64 abi3
SHA-256 checksum
How to use checksums
96ae127ed978dcfd71327fcba9ad60384f1afa7e2d3c9cbae27362682b22848a
BLAKE2b-256 checksum
How to use checksums
42f280037e0aa2814d64b2b5bfbb18371b28530679c49ed0e50981acc6056ed0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.16.0

Release files / nni_sdk-3.0.3-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL nni_sdk-3.0.3-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 324.7 kB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
a227fe88d0933164d903a2d91483fef9cd72c8a9cf892aa071dd72498dffec03
BLAKE2b-256 checksum
How to use checksums
d7d2dc885d8f48ec3853d71abd92299477611e9e74eb327ca534f74e5985f249
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.16.0

Release files / nni_sdk-3.0.3-cp311-abi3-macosx_11_0_arm64.whl

Download URL nni_sdk-3.0.3-cp311-abi3-macosx_11_0_arm64.whl
Size 304.0 kB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e12d7636b50473d47131695317a58d2f8f9763a028a84bdb57e64e32bc5de301
BLAKE2b-256 checksum
How to use checksums
98d83008d103efe6ff9ad5a0bf4eeb90a1f0c8c06c432ec5ec090b8d519087ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.16.0

Security for nni-sdk 3.0.3

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.

Release history Release notifications | RSS feed

This release

3.0.3 This release

4 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page