AbstractIntegratedModule 0.6.7__tar.gz → 0.7.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. {abstractintegratedmodule-0.6.7 → abstractintegratedmodule-0.7.0/AbstractIntegratedModule.egg-info}/PKG-INFO +10 -13
  2. abstractintegratedmodule-0.7.0/AbstractIntegratedModule.egg-info/SOURCES.txt +20 -0
  3. {abstractintegratedmodule-0.6.7 → abstractintegratedmodule-0.7.0}/AbstractIntegratedModule.py +76 -13
  4. {abstractintegratedmodule-0.6.7 → abstractintegratedmodule-0.7.0}/AbstractOptimizedModules.c +152 -152
  5. abstractintegratedmodule-0.7.0/MANIFEST.in +4 -0
  6. {abstractintegratedmodule-0.6.7/AbstractIntegratedModule.egg-info → abstractintegratedmodule-0.7.0}/PKG-INFO +10 -13
  7. {abstractintegratedmodule-0.6.7 → abstractintegratedmodule-0.7.0}/README.md +9 -12
  8. abstractintegratedmodule-0.7.0/abstract_model_storage/Cargo.toml +13 -0
  9. abstractintegratedmodule-0.7.0/abstract_model_storage/pyproject.toml +8 -0
  10. abstractintegratedmodule-0.7.0/abstract_model_storage/src/lib.rs +137 -0
  11. abstractintegratedmodule-0.7.0/abstract_model_storage/target/debug/build/libsqlite3-sys-ed07b882cd2aa5e2/out/bindgen.rs +3681 -0
  12. abstractintegratedmodule-0.7.0/abstract_model_storage/target/debug/build/target-lexicon-08527f45de28143d/out/host.rs +74 -0
  13. abstractintegratedmodule-0.7.0/abstract_model_storage/target/release/build/libsqlite3-sys-bf0400df4523274c/out/bindgen.rs +3681 -0
  14. abstractintegratedmodule-0.7.0/abstract_model_storage/target/release/build/target-lexicon-43eb95a0588bf457/out/host.rs +74 -0
  15. {abstractintegratedmodule-0.6.7 → abstractintegratedmodule-0.7.0}/pyproject.toml +1 -1
  16. {abstractintegratedmodule-0.6.7 → abstractintegratedmodule-0.7.0}/setup.py +21 -12
  17. abstractintegratedmodule-0.6.7/AbstractIntegratedModule.cp313-win_amd64.pyd +0 -0
  18. abstractintegratedmodule-0.6.7/AbstractIntegratedModule.cpython-310-aarch64-linux-gnu.so +0 -0
  19. abstractintegratedmodule-0.6.7/AbstractIntegratedModule.cpython-312-x86_64-linux-gnu.so +0 -0
  20. abstractintegratedmodule-0.6.7/AbstractIntegratedModule.egg-info/SOURCES.txt +0 -19
  21. abstractintegratedmodule-0.6.7/AbstractOptimizedModules.cp313-win_amd64.pyd +0 -0
  22. abstractintegratedmodule-0.6.7/AbstractOptimizedModules.cpython-310-aarch64-linux-gnu.so +0 -0
  23. abstractintegratedmodule-0.6.7/AbstractOptimizedModules.cpython-312-x86_64-linux-gnu.so +0 -0
  24. abstractintegratedmodule-0.6.7/MANIFEST.in +0 -7
  25. {abstractintegratedmodule-0.6.7 → abstractintegratedmodule-0.7.0}/AbstractIntegratedModule.egg-info/dependency_links.txt +0 -0
  26. {abstractintegratedmodule-0.6.7 → abstractintegratedmodule-0.7.0}/AbstractIntegratedModule.egg-info/requires.txt +0 -0
  27. {abstractintegratedmodule-0.6.7 → abstractintegratedmodule-0.7.0}/AbstractIntegratedModule.egg-info/top_level.txt +0 -0
  28. {abstractintegratedmodule-0.6.7 → abstractintegratedmodule-0.7.0}/AbstractOptimizedModules.pyx +0 -0
  29. {abstractintegratedmodule-0.6.7 → abstractintegratedmodule-0.7.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: AbstractIntegratedModule
3
- Version: 0.6.7
3
+ Version: 0.7.0
4
4
  Summary: Library for Advanced Integrated Non-LLM AI Models - Optimized Backend Framework For Non-LLM AI Agent
5
5
  Author: Micro-Novelty
6
6
  Author-email: hernikpuspita5@gmail.com
@@ -42,7 +42,7 @@ https://github.com/Micro-Novelty/IntegratedPipeline-Specialized-Non-LLM-AI-Agent
42
42
  #### Note: The README here you are reading is a direct copy from my README Repository, to download the necessary files, you can visit my Repository with the provided link above.
43
43
 
44
44
  ### Library Short Description:
45
- - Development Stage: 0.6.7 Official Release.
45
+ - Development Stage: 0.7.0 Official Release.
46
46
  - Maintainer: Micro-Novelty.
47
47
  - library Source-Code is Open-sourced on github.
48
48
  - Purpose: Specifically Designed for providing Non-LLM AI Agent Framework for edge Devices, Optimized for ARM64 architecture.
@@ -52,11 +52,9 @@ https://github.com/Micro-Novelty/IntegratedPipeline-Specialized-Non-LLM-AI-Agent
52
52
  python -m install AbstractIntegratedModule
53
53
  ```
54
54
 
55
- - The library also includes precompiled binaries for:
56
- - x86_64 linux architecture: only supports python version 3.12.
57
- - aarch64 linux architecture: only supports python version 3.10.
58
- - win_amd64 windows 64-bit architecture: only supports python version 3.13.
59
- if you don't have the necessary python, don't worry since you could use our regular pip download.
55
+ - The library also includes precompiled binaries:
56
+ - Compiled AbstractOptimizedModules specifically for handling Complex matrix calculations.
57
+ - Compiled Rust Module for retrieving weights and saving multi-architecture weights safely without conflict.
60
58
 
61
59
  - Proven Capabilities:
62
60
  - The library has been thoroughly tested in Multiple Environments from Windows to ARM64 Environment. The library is now Robust for Wider use and Deployment.
@@ -67,11 +65,10 @@ https://github.com/Micro-Novelty/IntegratedPipeline-Specialized-Non-LLM-AI-Agent
67
65
  - Robust Advanced prediction capabilities proven effective on ARM64 Using MLP + LSTM Architectures.
68
66
  - Transformer Modules Optimized using Cython, to reduce Memory overhead and Reduce CPU Usage, With Reduced Training Time.
69
67
  - Changelog:
70
- - v0.6.7:
68
+ - v0.7.0:
71
69
  - [=] New features:
72
- - Fixed bug where mlp always return index 0 during prediction.
73
- - Optimized processing batch in chunk function.
74
- - fixed bug where num_classes doesnt match given labels.
70
+ - Added Rust specific compiled binary for handling complex weight matrices.
71
+ - added specific optimized weight saving handling with rust optimization.
75
72
  -----
76
73
 
77
74
  <img width="1280" height="600" alt="WhatsApp Image 2026-05-27 at 07 16 32" src="https://github.com/user-attachments/assets/4b58a556-45a3-419b-96fd-9c1b76cac574" />
@@ -165,8 +162,8 @@ Transformers are the modern standard for AI, introduced in 2017 with the famous
165
162
  python -m pip install AbstractIntegratedModule
166
163
  ```
167
164
 
168
- - Download binaries manually (Choose one minimal, specified for your needs):
169
- - Binaries can be downloaded from release or code section.
165
+ - Download binaries manually in the repository (Choose one minimal, specified for your needs):
166
+ - Binaries can be downloaded from repository release or code section.
170
167
  - Windows Native OS - AbstractIntegratedModule.cp313-win_amd64 Supports Python 3.13 for Windows Only (Robust, Stable version)
171
168
  - Linux x86_64 - AbstractIntegratedModule.cpython-312-x86_64-linux-gnu.so supports Python 3.12 only.
172
169
  - Linux ARM64 - Raspberry Pi (Supports Raspberry pi 3 - 5) - AbstractIntegratedModule.cpython-310-aarch64-linux-gnu.so supports Python 3.10 only.
@@ -0,0 +1,20 @@
1
+ AbstractIntegratedModule.py
2
+ AbstractOptimizedModules.c
3
+ AbstractOptimizedModules.pyx
4
+ MANIFEST.in
5
+ README.md
6
+ pyproject.toml
7
+ setup.py
8
+ AbstractIntegratedModule.egg-info/PKG-INFO
9
+ AbstractIntegratedModule.egg-info/SOURCES.txt
10
+ AbstractIntegratedModule.egg-info/dependency_links.txt
11
+ AbstractIntegratedModule.egg-info/requires.txt
12
+ AbstractIntegratedModule.egg-info/top_level.txt
13
+ C:/Users/Dell/OneDrive/Desktop/AIM-PIP-Packaging/AbstractOptimizedModules.c
14
+ abstract_model_storage/Cargo.toml
15
+ abstract_model_storage/pyproject.toml
16
+ abstract_model_storage/src/lib.rs
17
+ abstract_model_storage/target/debug/build/libsqlite3-sys-ed07b882cd2aa5e2/out/bindgen.rs
18
+ abstract_model_storage/target/debug/build/target-lexicon-08527f45de28143d/out/host.rs
19
+ abstract_model_storage/target/release/build/libsqlite3-sys-bf0400df4523274c/out/bindgen.rs
20
+ abstract_model_storage/target/release/build/target-lexicon-43eb95a0588bf457/out/host.rs
@@ -62,6 +62,15 @@ except ImportError as e:
62
62
  _OPT_AVAILABLE = False
63
63
  print(f'[=] Cython not available: {e}, using numpy fallback')
64
64
 
65
+ try:
66
+ import abstract_weights_core as wc
67
+ _RUST_MODULE_AVAILABLE = True
68
+ print('[=] Rust weight storage loaded ✅')
69
+ except ImportError as e:
70
+ _RUST_MODULE_AVAILABLE = False
71
+ print(f'[=] Rust weight storage unavailable due to: {e}, using Python sqlite3 fallback')
72
+
73
+
65
74
  # initial Setup logging for AgentDistributedInference and ModelStorage class logger and security logger
66
75
  logger = logging.getLogger(__name__)
67
76
  _integrated_pipeline_lock = threading.Lock()
@@ -4885,6 +4894,16 @@ class ModelStorage:
4885
4894
  }
4886
4895
 
4887
4896
  weight_json = json.dumps(weights, default=str)
4897
+ if _RUST_MODULE_AVAILABLE:
4898
+ try:
4899
+ wc.save_lstm_weights(self.db_path, memory_name, weight_json)
4900
+ print('[||] LSTM weights saved using Rust module !')
4901
+ return
4902
+ except Exception as e:
4903
+ print(f'[!] Rust save failed, falling back to Python: {e}')
4904
+ else:
4905
+ print('[=] Rust module unavailable, using python sqlite3.')
4906
+
4888
4907
  try:
4889
4908
  c.execute("""
4890
4909
  INSERT INTO weight_storage
@@ -4949,6 +4968,15 @@ class ModelStorage:
4949
4968
  output_bias = tf.output_bias
4950
4969
  )
4951
4970
  binary_data = buf.getvalue()
4971
+ if _RUST_MODULE_AVAILABLE:
4972
+ try:
4973
+ wc.save_transformer_weights(self.db_path, memory_name, binary_data)
4974
+ print('[||] LSTM weights saved using Rust module for flexibility!')
4975
+ return
4976
+ except Exception as e:
4977
+ print(f'[!] Rust save failed, falling back to Python: {e}')
4978
+ else:
4979
+ print('[=] Rust module unavailable, using python sqlite3.')
4952
4980
 
4953
4981
  try:
4954
4982
  c.execute("""
@@ -4988,21 +5016,48 @@ class ModelStorage:
4988
5016
  except:
4989
5017
  conn = sqlite3.connect(self.db_path)
4990
5018
 
4991
- c = conn.cursor()
5019
+ c = conn.cursor()
5020
+
4992
5021
 
4993
5022
  try:
4994
- c.execute("""
4995
- SELECT weights FROM weight_storage
4996
- WHERE memory_name = ? AND model_type = 'transformer' AND is_active = 1
4997
- ORDER BY id DESC LIMIT 1
4998
- """, (memory_name,))
4999
- row = c.fetchone()
5000
- if not row:
5001
- print(f'[=] No saved transformer weights for {memory_name}')
5002
- return False
5023
+ if _RUST_MODULE_AVAILABLE:
5024
+ try:
5025
+ binary = wc.load_transformer_weights(self.db_path, memory_name)
5026
+
5027
+ buf = io.BytesIO(bytes(row[0]))
5028
+ data = np.load(buf, allow_pickle=False)
5003
5029
 
5004
- buf = io.BytesIO(bytes(row[0]))
5005
- data = np.load(buf, allow_pickle=False)
5030
+ print('[+] Transformer weights data loaded using Rust module!')
5031
+
5032
+ except Exception as e:
5033
+ print(f'[=] Cant load Transformer weights: {e}, using python sqlite3 to handle weights.')
5034
+ time.sleep(3)
5035
+ c.execute("""
5036
+ SELECT weights FROM weight_storage
5037
+ WHERE memory_name = ? AND model_type = 'transformer' AND is_active = 1
5038
+ ORDER BY id DESC LIMIT 1
5039
+ """, (memory_name,))
5040
+ row = c.fetchone()
5041
+ if not row:
5042
+ print(f'[=] No saved transformer weights for {memory_name}')
5043
+ return False
5044
+
5045
+ buf = io.BytesIO(bytes(row[0]))
5046
+ data = np.load(buf, allow_pickle=False)
5047
+
5048
+ else:
5049
+ c.execute("""
5050
+ SELECT weights FROM weight_storage
5051
+ WHERE memory_name = ? AND model_type = 'transformer' AND is_active = 1
5052
+ ORDER BY id DESC LIMIT 1
5053
+ """, (memory_name,))
5054
+ row = c.fetchone()
5055
+ if not row:
5056
+ print(f'[=] No saved transformer weights for {memory_name}')
5057
+ return False
5058
+
5059
+ buf = io.BytesIO(bytes(row[0]))
5060
+ data = np.load(buf, allow_pickle=False)
5006
5061
 
5007
5062
  t = self.pipeline.model2
5008
5063
  t.token_embedding = data['token_embedding']
@@ -5035,7 +5090,15 @@ class ModelStorage:
5035
5090
 
5036
5091
  def load_weights(self, memory_name):
5037
5092
  """Load weights from database. Returns True if found."""
5038
- result = self.weight_retrieval(memory_name)
5093
+ if _RUST_MODULE_AVAILABLE:
5094
+ try:
5095
+ result = wc.load_lstm_weights(self.db_path, memory_name)
5096
+ print('[+] LSTM weights loaded via Rust module')
5097
+ except:
5098
+ result = self.weight_retrieval(memory_name)
5099
+ print(f'[=] Cant load LSTM Weights due to: {e}, using python sqlite3 as fallback.')
5100
+ else:
5101
+ result = self.weight_retrieval(memory_name)
5039
5102
 
5040
5103
  if not result:
5041
5104
  print(f'[=] No saved weights for {memory_name}')