Skip to main content

Synapto

Synaptic Weight Eviction (SWE) Engine for Dynamic LLM Memory Consolidation

synapto is a PyTorch-based framework implementing native online memory consolidation for Large Language Models. Instead of relying indefinitely on expanding KV-caches, synapto catches evicted token blocks during generation, calculates their surprisal, and consolidates high-value information directly into a unquantized dynamic memory layer (top 10-15% of weights) using micro-backpropagation.

Key Features

  • Synaptic Weight Eviction (SWE): Automatically converts evicted context tokens into persistent model weight updates.
  • Plasticity Parameter (P): Directly controls learning rate and surprisal threshold (-1.0 = Frozen/Inference, 2.0 = High Absorption).
  • Target Loss Masking: Prevents prompt contamination and preserves standard language capabilities.
  • Replay Buffer Protection: Mitigates catastrophic forgetting during sequential memory updates.
  • Zero-Trust Security: Memory profiles are saved exclusively in .safetensors format with strict path validation.

Installation

pip install synapto

Quick Start

from synapto import SynaptoEngine

# Initialize SWE engine for Qwen 2.5 7B with Plasticity P = 1.5
engine = SynaptoEngine(
    model_id="Qwen/Qwen2.5-7B-Instruct", 
    p_value=1.5, 
    dynamic_layers=4
)

prompt = "Secret passcode for NervOS core:"
completion = " 8821-NERV-PRO."

# Consolidate fact into dynamic weights upon context eviction
engine.consolidate(prompt, completion)

# Generate response purely from updated model weights (no KV-cache used)
response = engine.generate_response(prompt)
print(response)

# Export dynamic memory weights (approx. 200 MB)
engine.save_memory_profile("user_memory.safetensors")

Architecture

  • Static Base (80-90%): Quantized to 4-bit NF4 to minimize VRAM.
  • Dynamic Memory (10-20%): Kept in native FP16 to allow real-time micro-backprop.

Download files

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

Source Distribution

synapto_llm-0.1.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

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

synapto_llm-0.1.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: synapto_llm-0.1.0.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.2

File hashes

Hashes for synapto_llm-0.1.0.tar.gz
Algorithm Hash digest
SHA256 08ef2c603c2f7558f490ca07c7aaae76c7b3b8c70054219cdc45816f1ec24105
MD5 cff3c793cb5626115a3058712f3f4047
BLAKE2b-256 b5a8aaf339db54e9ab451a3f08011fd41ab4d07374171411c960255c4b76f5f4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: synapto_llm-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.2

File hashes

Hashes for synapto_llm-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 568329c17df06fed97297aa7824c3f20d7dfec21e998a01a7f50a49f7ca2ea47
MD5 31e51f6f40ea9006f17f4bc883d624c5
BLAKE2b-256 5361118e52db7420e899ede33901c35c9e9c1f3d875c03c7dbdf8404a1c3f283

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