chore: remove internal framework references
This commit is contained in:
parent
66912b4d4e
commit
2f7ff5a52e
1
LICENSE
1
LICENSE
@ -1,7 +1,6 @@
|
||||
Business Source License 1.1
|
||||
|
||||
Licensor: Salka Elmadani
|
||||
Licensed Work: organ-architecture (part of Inference-X ecosystem) (part of Inference-X ecosystem)
|
||||
Copyright (C) 2025-2026 Salka Elmadani — ALL RIGHTS RESERVED
|
||||
|
||||
Change Date: 2030-02-12
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
[](LICENSE)
|
||||
[](https://inference-x.com)
|
||||
|
||||
# Organ Architecture
|
||||
|
||||
**Decompose. Reassemble. Evolve.**
|
||||
|
||||
@ -15,7 +14,6 @@ Adapters (LoRA) = Personality
|
||||
|
||||
AI models are monoliths. 70 billion parameters locked in a single file that nobody can open, modify, or understand. Only three companies on Earth can build them. Everyone else rents access.
|
||||
|
||||
Organ Architecture breaks models into transplantable parts:
|
||||
|
||||
- **Skeleton** — The attention layers. How the model *thinks*. Shared across all configurations.
|
||||
- **Organs** — The feed-forward networks. What the model *knows*. Specialized, swappable, graftable.
|
||||
@ -66,7 +64,6 @@ python3 organ_extract.py --model /path/to/model.gguf --output ./organs/
|
||||
python3 organ_measure.py --organ ./organs/organ_layer_12.bin
|
||||
|
||||
# Graft an organ from model A into model B
|
||||
python3 organ_graft.py --source ./organs_A/ --target ./model_B.gguf --layers 12-18
|
||||
|
||||
# Assemble a custom model
|
||||
python3 organ_assemble.py --skeleton ./skeleton.bin --organs ./organs/ --output custom.gguf
|
||||
|
||||
@ -5,7 +5,6 @@
|
||||
|
||||
---
|
||||
|
||||
I'm an engineer from Morocco's Anti-Atlas.
|
||||
|
||||
I build AI infrastructure. Not products, not demos, not wrappers around someone else's API. Infrastructure — the kind that runs without permission, works without cloud, and belongs to anyone who needs it.
|
||||
|
||||
@ -40,7 +39,6 @@ Same model. Cleaner signal. Every unnecessary step removed.
|
||||
| Project | What it does | Status |
|
||||
|---------|-------------|--------|
|
||||
| **[inference-x](https://git.inference-x.com/elmadani/inference-x)** | Core engine — 305 KB, 19 hardware backends, 23 quant formats, fused kernels, adaptive precision | ✅ Live |
|
||||
| **[organ-architecture](https://git.inference-x.com/elmadani/organ-architecture)** | Neural surgery — extract quality-measure and graft layers between models. Build composite intelligence from the best parts of everything. | ✅ Live |
|
||||
| **forge** | Model construction pipeline — compile, quantize, sign, distribute. Build your own model variant from certified organs. | 🔨 Building |
|
||||
| **[echo-ix](https://git.inference-x.com/elmadani/echo-ix)** | Distributed relay — intelligent routing across local inference nodes | ✅ Live |
|
||||
| **store** | Anyone deploys a node. Anyone earns from their compute. The cooperative layer. 11 geological cratons. One network. | 📐 Designed |
|
||||
@ -49,11 +47,8 @@ The store is the endgame: a peer-to-peer inference network where anyone with a l
|
||||
|
||||
---
|
||||
|
||||
## The khettara
|
||||
|
||||
In the Moroccan desert, builders carved underground canals — *khettaras* — that deliver water from mountain aquifers to fields using only gravity. No pump, no electricity, no central authority. They've worked for a thousand years, maintained by the communities that depend on them.
|
||||
|
||||
Inference-X is a khettara for intelligence.
|
||||
|
||||
The intelligence already exists in the model weights. What I'm building is the canal — the shortest, cleanest path from those weights to the human who needs them.
|
||||
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
# Quality Analysis Report — Organ Architecture
|
||||
## CSCI — cross-scale coherence index
|
||||
|
||||
**Generated**: 2026-02-20 01:42 UTC
|
||||
@ -85,7 +84,6 @@ mass_z_measure.py — batch quality measure across 13 models
|
||||
kimi_z_stream.py — streaming quality measure for 1T (shard-by-shard, delete after)
|
||||
organ_graft.py — transplant organs between models
|
||||
organ_assemble.py — build composite model from best organs
|
||||
build_935.py — orchestrator
|
||||
```
|
||||
|
||||
## Build References
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Model 935 Assembler — Fixed organ header handling.
|
||||
Reads source GGUF, replaces tensor DATA (skipping organ bin headers).
|
||||
CSCI v1.0 — Cross-Scale Coherence Index
|
||||
"""
|
||||
@ -19,7 +18,6 @@ def read_organ_data_only(filepath):
|
||||
|
||||
def main():
|
||||
if len(sys.argv) < 4:
|
||||
print("Usage: assemble_935.py <source.gguf> <organs_dir> <output.gguf>")
|
||||
sys.exit(1)
|
||||
|
||||
source_gguf = sys.argv[1]
|
||||
@ -136,14 +134,12 @@ def main():
|
||||
source_size = os.path.getsize(source_gguf)
|
||||
|
||||
print(f"\n{'='*60}")
|
||||
print(f" MODEL 935 ASSEMBLED")
|
||||
print(f"{'='*60}")
|
||||
print(f" Source: {os.path.basename(source_gguf)} ({source_size/(1024**3):.2f} GB)")
|
||||
print(f" Output: {output_gguf} ({final_size/(1024**3):.2f} GB)")
|
||||
print(f" Replaced: {replaced} tensors from organs")
|
||||
print(f" Fallback: {fallback} tensors from source")
|
||||
print(f" Size match: {'YES' if abs(final_size - source_size) < 1024 else 'NO — DELTA=' + str(final_size - source_size)}")
|
||||
print(f" Signature: 935")
|
||||
print(f"{'='*60}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
@ -154,4 +150,3 @@ if __name__ == "__main__":
|
||||
# ─────────────────────────────────────────────────────────
|
||||
# SHA256: 4d774861a8b9f75f83fd8ff45e92bfa607d12a4f580481ff5f8b5882470fb043
|
||||
# SIG-ED25519: B0k22H4YJMtBYuUW7ugInkPJpqZfM7cDM9TyiPODpE+WgQ0aLdgT2PnKm94gWSYVY2xqTlsEeZvgH+NrWQmTBg==
|
||||
# VERIFY: python3 verify_authorship.py assemble_935.py
|
||||
|
||||
11
build_935.py
11
build_935.py
@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
MODEL 935 — Composite Model Assembly
|
||||
Skeleton: Qwen2.5-7B (purest thought, θ=54.6)
|
||||
Organs: DeepSeek-R1-Distill-7B (purest knowledge for raisonnement, θ=35.9)
|
||||
Embed: DeepSeek-R1-7B (R1 reasoning embeddings)
|
||||
@ -8,10 +7,7 @@ Embed: DeepSeek-R1-7B (R1 reasoning embeddings)
|
||||
CSCI v1.0 — Cross-Scale Coherence Index
|
||||
"""
|
||||
import sys, os, json, shutil, time
|
||||
sys.path.insert(0, "/root/organ-architecture")
|
||||
|
||||
ORGANS = "/root/organ-architecture/organs"
|
||||
OUTPUT = os.path.join(ORGANS, "model-935")
|
||||
|
||||
# Clean previous
|
||||
if os.path.exists(OUTPUT):
|
||||
@ -20,7 +16,6 @@ if os.path.exists(OUTPUT):
|
||||
# Step 1: Start with DeepSeek-R1-Distill-7B as base (full copy)
|
||||
# This gives us: qwen2 arch, embed=3584, 28 layers, R1 reasoning
|
||||
print("="*60)
|
||||
print(" MODEL 935 — ASSEMBLY")
|
||||
print(" CSCI — cross-scale coherence index, θ → 90°")
|
||||
print("="*60)
|
||||
|
||||
@ -60,7 +55,6 @@ print(f" R1 raisonnement chains preserved in FFN layers")
|
||||
|
||||
# Step 4: Update manifest
|
||||
manifest = json.load(open(os.path.join(OUTPUT, "manifest.json")))
|
||||
manifest["model"] = "MODEL-935-Fractal"
|
||||
manifest["graft"] = {
|
||||
"skeleton_donor": "Qwen2.5-7B-Instruct (θ=54.6, purest attention)",
|
||||
"organ_donor": "DeepSeek-R1-Distill-Qwen-7B (θ=35.9, reasoning FFN)",
|
||||
@ -70,20 +64,17 @@ manifest["graft"] = {
|
||||
"convergence": "ZI_UNIFIED_OPTIMAL: α=0.3, β=0.2, n_plateau=62",
|
||||
"entropie_zcom": 0.3251,
|
||||
"entropie_bias_removed": 0.6931,
|
||||
"signature": 935
|
||||
}
|
||||
|
||||
with open(os.path.join(OUTPUT, "manifest.json"), "w") as f:
|
||||
json.dump(manifest, f, indent=2)
|
||||
|
||||
print(f"\n[4/4] Manifest updated: MODEL-935-Fractal")
|
||||
|
||||
# Count final state
|
||||
total_files = sum(1 for _,_,files in os.walk(OUTPUT) for f in files if f.endswith('.bin'))
|
||||
total_size = sum(os.path.getsize(os.path.join(dp,f)) for dp,dn,fn in os.walk(OUTPUT) for f in fn) / (1024**3)
|
||||
|
||||
print(f"\n{'='*60}")
|
||||
print(f" MODEL 935 — COMPOSITE")
|
||||
print(f"{'='*60}")
|
||||
print(f" Architecture: qwen2")
|
||||
print(f" Embed: 3584 | Layers: 28 | Heads: 28")
|
||||
@ -94,7 +85,6 @@ print(f" Tensors: {total_files}")
|
||||
print(f" Size: {total_size:.2f} GB")
|
||||
print(f" Equation: CSCI — cross-scale coherence index")
|
||||
print(f" Convergence: lim(n→∞) Z(n) = i")
|
||||
print(f" Signature: 935")
|
||||
print(f"{'='*60}")
|
||||
# ╔══ SALKA ELMADANI AUTHORSHIP CERTIFICATE ══╗
|
||||
# © Salka Elmadani 2025-2026 — ALL RIGHTS RESERVED
|
||||
@ -102,4 +92,3 @@ print(f"{'='*60}")
|
||||
# ─────────────────────────────────────────────────────────
|
||||
# SHA256: c45f3019cd81199382cf5f379ef1c556f5f2c5fd81afc6679da83e614ac8c09f
|
||||
# SIG-ED25519: IRoSNw2yKK14fnt2JpFbukDpV/5R9YDSQylWVVjIOgYkFHBH71k0MFBV+I39cfjf8odTgzM3uPPRRMexR9KTDw==
|
||||
# VERIFY: python3 verify_authorship.py build_935.py
|
||||
|
||||
@ -1,14 +1,11 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
MODEL 935 v2 — Correct graft: only FFN organs, preserve attention+embed alignment
|
||||
Base: DeepSeek-R1-Distill-7B (R1 reasoning skeleton + embeddings intact)
|
||||
Graft: Qwen2.5-7B FFN organs only (knowledge)
|
||||
|
||||
CSCI v1.0 — Cross-Scale Coherence Index
|
||||
"""
|
||||
import os, json, shutil
|
||||
ORGANS = "/root/organ-architecture/organs"
|
||||
OUTPUT = os.path.join(ORGANS, "model-935-v2")
|
||||
|
||||
if os.path.exists(OUTPUT):
|
||||
shutil.rmtree(OUTPUT)
|
||||
@ -53,14 +50,12 @@ print(f" Skipped: {skipped}")
|
||||
|
||||
# Update manifest
|
||||
manifest = json.load(open(os.path.join(OUTPUT, "manifest.json")))
|
||||
manifest["model"] = "MODEL-935-v2"
|
||||
manifest["graft"] = {
|
||||
"base": "DeepSeek-R1-Distill-Qwen-7B (skeleton + embed + norms)",
|
||||
"ffn_donor": "Qwen2.5-7B-Instruct (FFN weights only: down/gate/up)",
|
||||
"method": "Selective organ graft — preserve attention↔embed alignment",
|
||||
"equation": "CSCI — cross-scale coherence index",
|
||||
"principle": "R1 reasoning + Qwen knowledge, zero alignment friction",
|
||||
"signature": 935
|
||||
}
|
||||
with open(os.path.join(OUTPUT, "manifest.json"), "w") as f:
|
||||
json.dump(manifest, f, indent=2)
|
||||
@ -68,14 +63,11 @@ with open(os.path.join(OUTPUT, "manifest.json"), "w") as f:
|
||||
total = sum(1 for _,_,f in os.walk(OUTPUT) for _ in f if _.endswith('.bin'))
|
||||
size = sum(os.path.getsize(os.path.join(dp,f)) for dp,_,fn in os.walk(OUTPUT) for f in fn)/(1024**3)
|
||||
|
||||
print(f"\n[3/3] MODEL-935-v2 assembled")
|
||||
print(f" Tensors: {total} | Size: {size:.2f} GB")
|
||||
print(f" Grafted FFN: {grafted} | Base preserved: {total - grafted}")
|
||||
print(f" Signature: 935")
|
||||
# ╔══ SALKA ELMADANI AUTHORSHIP CERTIFICATE ══╗
|
||||
# © Salka Elmadani 2025-2026 — ALL RIGHTS RESERVED
|
||||
# Licensed under Business Source License 1.1 — https://inference-x.com
|
||||
# ─────────────────────────────────────────────────────────
|
||||
# SHA256: 4d5c44e363508bc679263607b7ee3071cb63fc460a616e9bcebffc768843a86c
|
||||
# SIG-ED25519: MzrZnxCo+uq3q5srKgDO2w3gLhO4hgK2k+SIzRLrkjaGJ2Ao56mR9/Mst4Ub6qkZ0VpcXOv4Bq59gKPsJPkdCg==
|
||||
# VERIFY: python3 verify_authorship.py build_935_v2.py
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
MODEL 935 — Proper GGUF assembler
|
||||
Reads source GGUF header intact, replaces tensor data from organ bins
|
||||
(stripping the organ header that organ_extract added)
|
||||
|
||||
@ -8,7 +7,6 @@ CSCI v1.0 — Cross-Scale Coherence Index
|
||||
"""
|
||||
import struct, os, sys, json
|
||||
|
||||
def build_model_935(source_gguf, organs_dir, output_gguf):
|
||||
f = open(source_gguf, "rb")
|
||||
|
||||
# Read GGUF header
|
||||
@ -134,17 +132,11 @@ def build_model_935(source_gguf, organs_dir, output_gguf):
|
||||
print(f" Size: {final_size / (1024**3):.2f} GB (source: {source_size / (1024**3):.2f} GB)")
|
||||
print(f" From organs: {written_from_organ} | From source: {written_from_source}")
|
||||
print(f" Size match: {'✓' if abs(final_size - source_size) < 1024 else '✗ MISMATCH'}")
|
||||
print(f" Signature: 935")
|
||||
|
||||
# Build 935 v3: R1-Distill base + Qwen FFN organs (correctly stripped)
|
||||
print("="*60)
|
||||
print(" MODEL 935 v3 — Correct Assembly")
|
||||
print("="*60)
|
||||
|
||||
build_model_935(
|
||||
"/mnt/models/DeepSeek-R1-Distill-Qwen-7B-Q4_K_M.gguf",
|
||||
"/root/organ-architecture/organs/model-935-v2",
|
||||
"/mnt/models/model-935-v3.gguf"
|
||||
)
|
||||
# ╔══ SALKA ELMADANI AUTHORSHIP CERTIFICATE ══╗
|
||||
# © Salka Elmadani 2025-2026 — ALL RIGHTS RESERVED
|
||||
@ -152,4 +144,3 @@ build_model_935(
|
||||
# ─────────────────────────────────────────────────────────
|
||||
# SHA256: 00f06d16ab32dee1ef886e90080e905fc354be9f22f0e6ff515ea2bb31084bdf
|
||||
# SIG-ED25519: UhbWWFzRIzmMbCVNwXTG41I2sM/1QGd1nV4+x/XQ+BOw49fO9bd9ohWpLl5QOCGhRWCREYkhJCj55FhGhH5vDQ==
|
||||
# VERIFY: python3 verify_authorship.py build_935_v3.py
|
||||
|
||||
@ -13,7 +13,6 @@ REPO = "unsloth/Kimi-K2.5-GGUF"
|
||||
QUANT = "Q4_0"
|
||||
N_SHARDS = 13
|
||||
SHARD_DIR = "/mnt/data/kimi-k25/streaming"
|
||||
OUTPUT = "/mnt/data/organ-architecture/z_report_kimi_k25.json"
|
||||
LOG = "/tmp/kimi_z_stream.log"
|
||||
|
||||
os.makedirs(SHARD_DIR, exist_ok=True)
|
||||
|
||||
@ -6,9 +6,6 @@ CSCI v1.0 — Cross-Scale Coherence Index
|
||||
import subprocess, os, sys, json, time
|
||||
|
||||
MODELS_DIR = "/mnt/models"
|
||||
ORGANS_DIR = "/root/organ-architecture/organs"
|
||||
EXTRACT = "/root/organ-architecture/organ_extract.py"
|
||||
MEASURE = "/root/organ-architecture/organ_measure.py"
|
||||
|
||||
# Map GGUF filenames to organ directory names
|
||||
models = {
|
||||
@ -94,17 +91,13 @@ for r in results:
|
||||
|
||||
total_mb = sum(r.get("size_mb",0) for r in results)
|
||||
print(f"\n Total organs: {total_mb/1024:.1f} GB")
|
||||
print(f" Signature: 935")
|
||||
print(f"{'='*60}")
|
||||
|
||||
# Save results
|
||||
with open("/root/organ-architecture/dissection_report.json", "w") as f:
|
||||
json.dump(results, f, indent=2)
|
||||
print("Report: /root/organ-architecture/dissection_report.json")
|
||||
# ╔══ SALKA ELMADANI AUTHORSHIP CERTIFICATE ══╗
|
||||
# © Salka Elmadani 2025-2026 — ALL RIGHTS RESERVED
|
||||
# Licensed under Business Source License 1.1 — https://inference-x.com
|
||||
# ─────────────────────────────────────────────────────────
|
||||
# SHA256: f69a536f6cf905e845d77afe9beb9acca3c5e2b1e3d5974b7d2935aec60453b9
|
||||
# SIG-ED25519: XB8aA7wVzKOHkvMcZgE5YT3x8BUD/EwVTDRxEMSR7nmWYIT17XY+gC4AJ+y0B29l8MQGFDGk+buLoKxiagTFCA==
|
||||
# VERIFY: python3 verify_authorship.py mass_dissect.py
|
||||
|
||||
@ -5,10 +5,8 @@ Find the organs closest to theta=90 (pure signal)
|
||||
CSCI v1.0 — Cross-Scale Coherence Index
|
||||
"""
|
||||
import subprocess, os, json, sys
|
||||
sys.path.insert(0, "/root/organ-architecture")
|
||||
from organ_measure import measure_directory, compute_z_measure, read_organ_data_f32
|
||||
|
||||
ORGANS_DIR = "/root/organ-architecture/organs"
|
||||
|
||||
all_results = {}
|
||||
|
||||
@ -93,13 +91,10 @@ for organ_type in ['skeleton', 'organs', 'embed']:
|
||||
for c in candidates[:5]:
|
||||
print(f" theta={c[1]:5.1f} avg={c[3]:5.1f} {c[0]:30s} {c[2][:40]}")
|
||||
|
||||
print(f"\n Signature: 935")
|
||||
print(f"{'='*70}")
|
||||
|
||||
# Save full report
|
||||
with open("/root/organ-architecture/z_measure_report.json", "w") as f:
|
||||
json.dump(all_results, f, indent=2)
|
||||
print(f"\nReport: /root/organ-architecture/z_measure_report.json")
|
||||
# ╔══ SALKA ELMADANI AUTHORSHIP CERTIFICATE ══╗
|
||||
# © Salka Elmadani 2025-2026 — ALL RIGHTS RESERVED
|
||||
# Licensed under Business Source License 1.1 — https://inference-x.com
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Organ Architecture — organ_api.py
|
||||
API server for organ operations.
|
||||
|
||||
Endpoints:
|
||||
@ -14,7 +13,6 @@ Endpoints:
|
||||
GET /organs/:model — List organs for a model
|
||||
GET /compare/:a/:b — Compare two models for graft compatibility
|
||||
|
||||
Build v935
|
||||
"""
|
||||
|
||||
import json
|
||||
@ -29,18 +27,15 @@ from urllib.parse import urlparse, parse_qs
|
||||
# Import organ tools
|
||||
from organ_extract import extract_organs, GGUFReader, classify_tensor
|
||||
from organ_measure import measure_directory, measure_organ
|
||||
from organ_graft import load_manifest, graft_layers, parse_layers
|
||||
from organ_assemble import assemble_gguf
|
||||
|
||||
# ═══ CONFIG ═══
|
||||
PORT = int(os.environ.get('ORGAN_PORT', '7936'))
|
||||
MODEL_DIR = os.environ.get('MODEL_DIR', '/mnt/models')
|
||||
ORGAN_DIR = os.environ.get('ORGAN_DIR', '/mnt/data/organs')
|
||||
SIGNATURE = 935
|
||||
|
||||
|
||||
class OrganHandler(BaseHTTPRequestHandler):
|
||||
"""HTTP handler for Organ Architecture API."""
|
||||
|
||||
def log_message(self, format, *args):
|
||||
"""Minimal logging."""
|
||||
@ -50,7 +45,6 @@ class OrganHandler(BaseHTTPRequestHandler):
|
||||
self.send_response(status)
|
||||
self.send_header('Content-Type', 'application/json')
|
||||
self.send_header('Access-Control-Allow-Origin', '*')
|
||||
self.send_header('X-Powered-By', 'Organ-935')
|
||||
self.end_headers()
|
||||
self.wfile.write(json.dumps(data, indent=2, default=str).encode())
|
||||
|
||||
@ -77,7 +71,6 @@ class OrganHandler(BaseHTTPRequestHandler):
|
||||
if path == '/health' or path == '':
|
||||
self.send_json({
|
||||
'status': 'ok',
|
||||
'service': 'organ-architecture',
|
||||
'signature': SIGNATURE,
|
||||
'model_dir': MODEL_DIR,
|
||||
'organ_dir': ORGAN_DIR,
|
||||
@ -346,7 +339,6 @@ class OrganHandler(BaseHTTPRequestHandler):
|
||||
|
||||
parsed_layers = parse_layers(layers) if layers else None
|
||||
|
||||
manifest = graft_layers(
|
||||
str(source_path), str(target_path), output_path,
|
||||
parsed_layers, organ_type
|
||||
)
|
||||
@ -406,7 +398,6 @@ def main():
|
||||
Path(ORGAN_DIR).mkdir(parents=True, exist_ok=True)
|
||||
|
||||
server = HTTPServer(('0.0.0.0', PORT), OrganHandler)
|
||||
print(f"[ORGAN-API] Organ Architecture on port {PORT}")
|
||||
print(f"[ORGAN-API] Models: {MODEL_DIR}")
|
||||
print(f"[ORGAN-API] Organs: {ORGAN_DIR}")
|
||||
print(f"[ORGAN-API] Signature {SIGNATURE}")
|
||||
|
||||
@ -1,12 +1,10 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Organ Architecture — organ_assemble.py
|
||||
Assemble a GGUF model from extracted/grafted organs.
|
||||
|
||||
Takes a manifest + organ files → produces a working GGUF.
|
||||
The reverse of organ_extract.py.
|
||||
|
||||
Build v935
|
||||
"""
|
||||
|
||||
import struct
|
||||
@ -207,7 +205,6 @@ def assemble_gguf(organ_dir, output_path, verbose=False):
|
||||
print(f" Tensors: {n_tensors}")
|
||||
print(f" Size: {output_gb:.2f} GB ({output_mb:.0f} MB)")
|
||||
print(f" Output: {output_path}")
|
||||
print(f" Signature: 935")
|
||||
print(f"{'='*60}")
|
||||
|
||||
return output_path
|
||||
@ -215,7 +212,6 @@ def assemble_gguf(organ_dir, output_path, verbose=False):
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Organ Architecture — Assemble GGUF from organs',
|
||||
epilog='CSCI toolkit'
|
||||
)
|
||||
parser.add_argument('--dir', '-d', required=True, help='Organs directory (with manifest.json)')
|
||||
|
||||
@ -1,11 +1,9 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Organ Architecture — organ_extract.py
|
||||
Extract skeleton (attention) + organs (FFN) from GGUF models.
|
||||
|
||||
The scalpel that opens monoliths.
|
||||
|
||||
Build v935
|
||||
"""
|
||||
|
||||
import struct
|
||||
@ -275,7 +273,6 @@ def extract_organs(model_path, output_dir, verbose=False):
|
||||
'skeleton_count': 0,
|
||||
'organ_count': 0,
|
||||
},
|
||||
'signature': 935,
|
||||
}
|
||||
|
||||
# Process each tensor
|
||||
@ -377,7 +374,6 @@ def extract_organs(model_path, output_dir, verbose=False):
|
||||
print(f" Total : {total_mb:8.1f} MB")
|
||||
print(f" Output : {output_dir}")
|
||||
print(f" Manifest : {manifest_path}")
|
||||
print(f" Signature : 935")
|
||||
print(f"{'='*60}")
|
||||
|
||||
return manifest
|
||||
@ -387,7 +383,6 @@ def extract_organs(model_path, output_dir, verbose=False):
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Organ Architecture — Extract skeleton + organs from GGUF models',
|
||||
epilog='CSCI toolkit'
|
||||
)
|
||||
parser.add_argument('--model', '-m', required=True, help='Path to GGUF model file')
|
||||
|
||||
@ -1,12 +1,10 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Organ Architecture — organ_graft.py
|
||||
Transplant organs between models.
|
||||
|
||||
Take the math FFN from model A, the language FFN from model B,
|
||||
the attention skeleton from model C — assemble something new.
|
||||
|
||||
Build v935
|
||||
"""
|
||||
|
||||
import struct
|
||||
@ -40,9 +38,7 @@ def list_organs(organ_dir, organ_type=None):
|
||||
return sorted(organs, key=lambda o: (o['layer'], o['name']))
|
||||
|
||||
|
||||
def graft_layers(source_dir, target_dir, output_dir, layers=None, organ_type='organ'):
|
||||
"""
|
||||
Graft organ layers from source into target.
|
||||
|
||||
source_dir: extracted organs from donor model
|
||||
target_dir: extracted organs from recipient model
|
||||
@ -58,7 +54,6 @@ def graft_layers(source_dir, target_dir, output_dir, layers=None, organ_type='or
|
||||
|
||||
print(f"[GRAFT] Source (donor): {source_name}")
|
||||
print(f"[GRAFT] Target (recipient): {target_name}")
|
||||
print(f"[GRAFT] Grafting: {organ_type} layers {layers or 'ALL'}")
|
||||
|
||||
# Validate architecture compatibility
|
||||
if source_manifest['n_embed'] != target_manifest['n_embed']:
|
||||
@ -112,7 +107,6 @@ def graft_layers(source_dir, target_dir, output_dir, layers=None, organ_type='or
|
||||
shutil.copy2(source_file, target_file)
|
||||
grafted_count += 1
|
||||
grafted_bytes += source_entry['byte_size']
|
||||
print(f" [GRAFT] L{source_entry['layer']:3d} {source_entry['name'][:50]} → {target_entry['name'][:30]}")
|
||||
|
||||
# Update manifest
|
||||
grafted_manifest = load_manifest(output_dir)
|
||||
@ -138,7 +132,6 @@ def graft_layers(source_dir, target_dir, output_dir, layers=None, organ_type='or
|
||||
print(f" Grafted: {grafted_count} tensors ({grafted_mb:.1f} MB)")
|
||||
print(f" Result: {grafted_manifest['model']}")
|
||||
print(f" Output: {output_dir}")
|
||||
print(f" Signature: 935")
|
||||
print(f"{'='*60}")
|
||||
|
||||
return grafted_manifest
|
||||
@ -163,7 +156,6 @@ def parse_layers(layer_spec):
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Organ Architecture — Transplant organs between models',
|
||||
epilog='CSCI toolkit'
|
||||
)
|
||||
|
||||
@ -179,7 +171,6 @@ def main():
|
||||
graft_p.add_argument('--source', '-s', required=True, help='Source (donor) organs directory')
|
||||
graft_p.add_argument('--target', '-t', required=True, help='Target (recipient) organs directory')
|
||||
graft_p.add_argument('--output', '-o', required=True, help='Output directory for grafted model')
|
||||
graft_p.add_argument('--layers', '-l', help='Layer numbers to graft (e.g., "5-10" or "5,8,12")')
|
||||
graft_p.add_argument('--type', default='organ', help='Organ type to graft (default: organ/FFN)')
|
||||
|
||||
# Compare command
|
||||
@ -208,7 +199,6 @@ def main():
|
||||
|
||||
elif args.command == 'graft':
|
||||
layers = parse_layers(args.layers)
|
||||
graft_layers(args.source, args.target, args.output, layers, args.type)
|
||||
|
||||
elif args.command == 'compare':
|
||||
manifest_a = load_manifest(args.a)
|
||||
|
||||
@ -1,13 +1,11 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Organ Architecture — organ_measure.py
|
||||
Quality measure â organ signal vs noise.
|
||||
|
||||
CSCI — cross-scale coherence index
|
||||
θ → 0° : noise (organ adds confusion)
|
||||
θ → 90° : signal (organ adds knowledge)
|
||||
|
||||
Build v935
|
||||
"""
|
||||
|
||||
import struct
|
||||
@ -299,13 +297,11 @@ def print_summary(results, title=""):
|
||||
|
||||
print(f"\n {'═'*50}")
|
||||
print(f" GLOBAL: {len(results)} tensors | {total_size:.1f} MB | θ={avg_theta:.1f}° | signal={avg_signal:.3f}")
|
||||
print(f" Build v935")
|
||||
print(f"{'='*70}")
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Organ Architecture — quality measure organ',
|
||||
epilog='CSCI v1.0 — Cross-Scale Coherence Index'
|
||||
)
|
||||
parser.add_argument('--organ', '-o', help='Path to single organ .bin file')
|
||||
|
||||
@ -21,7 +21,6 @@ CSCI(s) = cross_scale_coherence(s, theta=90)
|
||||
When theta = 90, signal is maximally coherent (pure signal, minimal noise)
|
||||
The purified organ IS the signal, nothing else.
|
||||
|
||||
Build v935
|
||||
"""
|
||||
|
||||
import struct
|
||||
@ -294,7 +293,6 @@ def main():
|
||||
import argparse
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Organ Purifier — Remove noise, keep pure signal',
|
||||
epilog='CSCI — cross-scale coherence index, θ=90° — Build v935'
|
||||
)
|
||||
parser.add_argument('--input', '-i', required=True, help='Input organs directory')
|
||||
parser.add_argument('--output', '-o', required=True, help='Output pure organs directory')
|
||||
@ -325,7 +323,6 @@ def main():
|
||||
print(f" θ after: {result['avg_theta_after']:.1f}°")
|
||||
print(f" Avg improvement: {result['avg_improvement']:+.1f}°")
|
||||
print(f" Output: {result['output']}")
|
||||
print(f" Signature: 935")
|
||||
print(f"{'='*60}")
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,6 @@ Think fractal: the best model knows the laws of the universe
|
||||
then translates to human language, not the inverse.
|
||||
|
||||
CSCI(s) = cross_scale_coherence(s, theta=90), theta = 90
|
||||
Build v935
|
||||
"""
|
||||
|
||||
import struct, os, sys, json, math
|
||||
@ -330,7 +329,6 @@ def main():
|
||||
print(f" Δθ: {result['delta']:+.1f}°")
|
||||
print(f" Improved: {result['improved']}")
|
||||
print(f" Degraded: {result['degraded']}")
|
||||
print(f" Signature: 935")
|
||||
print(f"{'='*60}")
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@ -1,14 +1,10 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Model 935 Pipeline — Phase 1: Dissect all + Download Kimi K2.5
|
||||
CSCI v1.0 — Cross-Scale Coherence Index
|
||||
"""
|
||||
import subprocess, os, sys, json, time, glob
|
||||
|
||||
MODELS_DIR = "/mnt/models"
|
||||
ORGANS_DIR = "/mnt/data/organ-architecture/organs"
|
||||
EXTRACT = "/mnt/data/organ-architecture/organ_extract.py"
|
||||
MEASURE = "/mnt/data/organ-architecture/organ_measure.py"
|
||||
|
||||
os.makedirs(ORGANS_DIR, exist_ok=True)
|
||||
|
||||
@ -16,8 +12,6 @@ os.makedirs(ORGANS_DIR, exist_ok=True)
|
||||
models = {}
|
||||
for f in sorted(glob.glob(os.path.join(MODELS_DIR, "*.gguf"))):
|
||||
name = os.path.basename(f)
|
||||
# Skip chimeras and old 935 attempts
|
||||
if "chimera" in name.lower() or "935" in name.lower():
|
||||
continue
|
||||
# Clean name for directory
|
||||
clean = name.replace(".gguf", "").replace("-Q4_K_M", "").replace("-Q8_0", "")
|
||||
@ -64,7 +58,6 @@ print(f"\n{'='*60}")
|
||||
print(f"PHASE 2: QUALITY MEASURE ALL ORGANS")
|
||||
print(f"{'='*60}")
|
||||
|
||||
sys.path.insert(0, "/mnt/data/organ-architecture")
|
||||
from organ_measure import measure_directory
|
||||
|
||||
z_report = {}
|
||||
@ -109,7 +102,6 @@ for d in sorted(os.listdir(ORGANS_DIR)):
|
||||
z_report[d] = summary
|
||||
|
||||
# Save
|
||||
with open("/mnt/data/organ-architecture/z_report_complete.json", "w") as f:
|
||||
json.dump(z_report, f, indent=2)
|
||||
|
||||
# Print ranking
|
||||
@ -120,7 +112,6 @@ ranked = sorted(z_report.values(), key=lambda m: m['avg_theta'], reverse=True)
|
||||
for i, m in enumerate(ranked, 1):
|
||||
print(f" {i:2d}. θ={m['avg_theta']:5.1f}° signal={m['avg_signal']:.3f} {m['model']}")
|
||||
|
||||
print(f"\n Signature: 935")
|
||||
print(f"{'='*60}")
|
||||
# ╔══ SALKA ELMADANI AUTHORSHIP CERTIFICATE ══╗
|
||||
# © Salka Elmadani 2025-2026 — ALL RIGHTS RESERVED
|
||||
@ -128,4 +119,3 @@ print(f"{'='*60}")
|
||||
# ─────────────────────────────────────────────────────────
|
||||
# SHA256: 70a8957904cd4ee20dfd8fa42a0d8551cf8ae03eb2d0ec6fc9f4ed8f86995037
|
||||
# SIG-ED25519: ddMrNVlt0PpN5uHTbAnxLkphci22Xv0efiEyfUAoHVJxextDZsK69jVULKiXZDED1txsfGzrenMjJMaKe5g4DQ==
|
||||
# VERIFY: python3 verify_authorship.py pipeline_935.py
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
"""
|
||||
Quick chimera assembler: Copy source GGUF header/metadata intact,
|
||||
replace tensor data from organ directory.
|
||||
Build v935
|
||||
"""
|
||||
import struct, sys, os, json
|
||||
|
||||
@ -117,7 +116,6 @@ def main():
|
||||
print(f"\n Output: {output_gguf}")
|
||||
print(f" Size: {final_size / (1024**3):.2f} GB")
|
||||
print(f" From organs: {written}, From source: {fallback}, Total: {written+fallback}/{n_tensors}")
|
||||
print(f" Signature: 935")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
@ -149,7 +149,6 @@ def main():
|
||||
diff = final_size - source_size
|
||||
print(f" INTEGRITY: ✗ MISMATCH ({diff:+d} bytes)")
|
||||
|
||||
print(f" Signature: 935")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
@ -70,7 +70,6 @@
|
||||
},
|
||||
"gemma-2-9b": {
|
||||
"model": "gemma-2-9b",
|
||||
"avg_theta": 44.935344827586206,
|
||||
"avg_signal": 0.6240438819131022,
|
||||
"total_tensors": 464,
|
||||
"groups": {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user