File size: 2,405 Bytes
0e86f35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# πŸš€ ChiasmBridge β€” Step-by-Step Setup & User Guide

Welcome to the **ChiasmBridge** setup guide. This document guides you through configuring `libchiasm.so` to bridge disparate feature vectors across ANY dimension boundary ($N \iff M$) and ANY modality (Vision, Audio/Speech, Haptics, and LLMs).

---

## πŸ“‹ Prerequisites & Installation

1. **System Requirements:** Linux OS with NVIDIA GPU (Ampere or newer recommended) and CUDA drivers installed.
2. **Installation via Pip:**
   ```bash
   git clone https://github.com/MongooseReborn/chiasm-bridge.git
   cd chiasm-bridge
   pip install .
   ```

---

## πŸ› οΈ Step 1: Basic Universal Usage (`chiasm`)

ChiasmBridge provides a lightweight Python package (`chiasm`) that interfaces natively with compiled CUDA shared library `libchiasm.so`.

```python
import torch
from chiasm import ChiasmBridge, ChiasmConfig

# 1. Define dynamic N -> M configuration (e.g. 3584 Vision -> 5120 LLM, 1024 Audio -> 4096 LLM)
config = ChiasmConfig(source_dim=3584, target_dim=5120)
bridge = ChiasmBridge(config)

# 2. Forward Projection (N -> M): Sensory Perception -> LLM Space
raw_sensory_tokens = torch.randn(1, 64, 3584)       # [batch, seq_len, 3584]
translated_tokens = bridge.project_forward(raw_sensory_tokens)  # [batch, seq_len, 5120]

print("Forward Projected Shape:", translated_tokens.shape)  # torch.Size([1, 64, 5120])

# 3. Inverse Projection (M -> N): LLM Space -> Sensory Reconstruction
reconstructed_sensory = bridge.project_inverse(translated_tokens)
print("Inverse Reconstructed Shape:", reconstructed_sensory.shape)  # torch.Size([1, 64, 3584])
```

---

## πŸ’Ύ Step 2: Directory Structure

```text
chiasm-bridge/
β”œβ”€β”€ bin/
β”‚   └── libchiasm.so          # Pre-compiled CUDA Binary Shared Library (Stripped)
β”œβ”€β”€ chiasm/
β”‚   β”œβ”€β”€ __init__.py           # Package Exports
β”‚   └── sam_bridge.py         # Bi-Directional Modular Neural Adapter
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ WHITE_PAPER.md        # Technical Architecture Overview
β”‚   β”œβ”€β”€ SETUP_GUIDE.md        # Step-by-Step Setup Guide
β”‚   β”œβ”€β”€ Whitepaper.html       # Web-formatted Whitepaper
β”‚   └── test_modular_chiasm.py # Universal Modular Test Suite
β”œβ”€β”€ README.md
└── setup.py                  # Pip Package Installer
```

---

*ChiasmBridge β€” Mongoose & Kalos Engine Architecture Team @ BlackForest Studio (2026).*