Skip to main content

The TCP/IP of Latent Space. Direct Vector Injection for AI Agents.

Project description

Nexus Protocol 🧠

The TCP/IP of Latent Space.

PyPI License Build

Stop wasting tokens. Start sharing minds.

Nexus is a high-speed transport layer for Artificial Intelligence. It replaces slow, expensive natural language communication between Agents with direct, zero-loss Latent Vector Injection.


⚡️ Why Nexus?

We are effectively building the Universal Embedding Standard for AI-to-AI communication.

Feature 🐢 The Old Way (JSON/Text) 🚀 The Nexus Way (Vectors)
Medium English / Text High-Dimensional Vectors
Cost High (Generation + Parsing Tokens) Zero (Hidden State Transfer)
Speed Slow (Autoregressive Generation) Instant (Matrix Multiplication)
Loss High (Semantic drift in parsing) Lossless (Mathematical Precision)
Privacy Public (Text is readable) Obfuscated (Abstract Math)

📦 Installation

pip install nexus-protocol

Requires Python 3.9+ and PyTorch.


🚀 Quickstart

Transmit a concept from Llama-3 to Mistral without generating a single word of text.

from nexus.client import NexusClient
from nexus.receiver import NexusReceiver
from nexus.protocol import TensorPacket

# 1. Initialize Sender (The Thinker)
sender = NexusClient("meta-llama/Meta-Llama-3-8B")

# 2. Encode a Thought (No text generation happens here)
# "The sky is blue" -> [1, 4096] Float32 Vector
thought_vector = sender.encode_thought("The atmospheric scattering of light...")

# 3. Packetize (TOON Format)
packet = TensorPacket.from_tensor(sender="Llama-3", tensor=thought_vector)

# --- 🌐 NETWORK TRANSMISSION (JSON Serialized) --- 

# 4. Initialize Receiver (The Listener)
receiver = NexusReceiver("mistralai/Mistral-7B-v0.1")

# 5. Inject Thought & Generate
# The model starts generating from the *concept* you injected
output = receiver.receive_thought(packet.model_dump_json())

print(output) 
# Output: "...creates a blue hue visible from the surface."

🧠 Core Architecture

Nexus solves the "Tower of Babel" problem in AI. Every model thinks in a different vector space. Nexus provides the Universal Bridge.

  1. NexusClient: Extracts the "EOS Token" hidden state from the source model.
  2. NexusBridge: A neural adapter that projects the specific model space (e.g., 4096d) into the Universal Nexus Space (2048d).
  3. TensorPacket: Wraps the vector in the TOON (Token Oriented Object Notation) format for transport.
  4. InverseBridge: Projects the Universal Vector into the Target Model's space.
  5. NexusReceiver: Performs Prompt Injection, inserting the vector directly into the model's context window.

🗺 Roadmap

  • Protocol v1: TOON-compliant packet structure.
  • Adapters: Base NexusBridge architecture with Cosine Similarity normalization.
  • Genesis Bridge: Pre-trained weights for Llama-3 <-> Mistral <-> GPT-2.
  • HuggingFace Hub: Auto-download adapters from nexus-protocol/adapters.

🤝 Contributing

We are building the internet for AIs. We need Bridge Builders.

If you have compute, help us train adapters between popular models. See CONTRIBUTING.md for training guides.

License: MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nexus_protocol-0.1.0.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nexus_protocol-0.1.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file nexus_protocol-0.1.0.tar.gz.

File metadata

  • Download URL: nexus_protocol-0.1.0.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for nexus_protocol-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0aabfae536e66ba023b87240e6865f08e234909e3013447623ad0a5842ccc679
MD5 039910c64f6b7645b4575ac27dd560e4
BLAKE2b-256 c5ac4ef29e65b46fe44965c8a7023d600f5ddc0bc9e065f6fefc50641fd364fe

See more details on using hashes here.

File details

Details for the file nexus_protocol-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nexus_protocol-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for nexus_protocol-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 55d0e3e616fbcfd496c85de8a14e5a3658cdb2df86812f8d782ccefde4a05db4
MD5 2742fe3dcb491c61c4c71954cd8ce814
BLAKE2b-256 d659fca309a7643ebfd98e0af62fd9e3e13d42168f4c9f66724b569f7e416b40

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page