lagi-mdn 0.1.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.
- lagi_mdn-0.1.0/Cargo.lock +732 -0
- lagi_mdn-0.1.0/Cargo.toml +10 -0
- lagi_mdn-0.1.0/PKG-INFO +20 -0
- lagi_mdn-0.1.0/README.md +11 -0
- lagi_mdn-0.1.0/crates/lagi-core/Cargo.toml +17 -0
- lagi_mdn-0.1.0/crates/lagi-core/src/engine.rs +63 -0
- lagi_mdn-0.1.0/crates/lagi-core/src/lib.rs +16 -0
- lagi_mdn-0.1.0/crates/lagi-core/src/profiler.rs +186 -0
- lagi_mdn-0.1.0/crates/lagi-core/src/security.rs +100 -0
- lagi_mdn-0.1.0/crates/lagi-mdn/Cargo.toml +13 -0
- lagi_mdn-0.1.0/crates/lagi-mdn/README.md +11 -0
- lagi_mdn-0.1.0/crates/lagi-mdn/src/lib.rs +24 -0
- lagi_mdn-0.1.0/pyproject.toml +20 -0
- lagi_mdn-0.1.0/python/lagi_mdn/__init__.py +3 -0
- lagi_mdn-0.1.0/python/lagi_mdn/main.py +26 -0
|
@@ -0,0 +1,732 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "async-trait"
|
|
7
|
+
version = "0.1.92"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667"
|
|
10
|
+
dependencies = [
|
|
11
|
+
"proc-macro2",
|
|
12
|
+
"quote",
|
|
13
|
+
"syn 3.0.6",
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
[[package]]
|
|
17
|
+
name = "autocfg"
|
|
18
|
+
version = "1.5.1"
|
|
19
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
20
|
+
checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
|
|
21
|
+
|
|
22
|
+
[[package]]
|
|
23
|
+
name = "bitflags"
|
|
24
|
+
version = "2.13.2"
|
|
25
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
26
|
+
checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06"
|
|
27
|
+
|
|
28
|
+
[[package]]
|
|
29
|
+
name = "block-buffer"
|
|
30
|
+
version = "0.10.4"
|
|
31
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
32
|
+
checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
|
|
33
|
+
dependencies = [
|
|
34
|
+
"generic-array",
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
[[package]]
|
|
38
|
+
name = "bytes"
|
|
39
|
+
version = "1.12.1"
|
|
40
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
41
|
+
checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"
|
|
42
|
+
|
|
43
|
+
[[package]]
|
|
44
|
+
name = "cfg-if"
|
|
45
|
+
version = "1.0.5"
|
|
46
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
47
|
+
checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
|
|
48
|
+
|
|
49
|
+
[[package]]
|
|
50
|
+
name = "core-foundation-sys"
|
|
51
|
+
version = "0.8.7"
|
|
52
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
53
|
+
checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
|
|
54
|
+
|
|
55
|
+
[[package]]
|
|
56
|
+
name = "cpufeatures"
|
|
57
|
+
version = "0.2.17"
|
|
58
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
59
|
+
checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
|
|
60
|
+
dependencies = [
|
|
61
|
+
"libc",
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
[[package]]
|
|
65
|
+
name = "crossbeam-deque"
|
|
66
|
+
version = "0.8.8"
|
|
67
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
68
|
+
checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a"
|
|
69
|
+
dependencies = [
|
|
70
|
+
"crossbeam-epoch",
|
|
71
|
+
"crossbeam-utils",
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
[[package]]
|
|
75
|
+
name = "crossbeam-epoch"
|
|
76
|
+
version = "0.9.21"
|
|
77
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
78
|
+
checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d"
|
|
79
|
+
dependencies = [
|
|
80
|
+
"crossbeam-utils",
|
|
81
|
+
]
|
|
82
|
+
|
|
83
|
+
[[package]]
|
|
84
|
+
name = "crossbeam-utils"
|
|
85
|
+
version = "0.8.23"
|
|
86
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
87
|
+
checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6"
|
|
88
|
+
|
|
89
|
+
[[package]]
|
|
90
|
+
name = "crypto-common"
|
|
91
|
+
version = "0.1.7"
|
|
92
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
93
|
+
checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a"
|
|
94
|
+
dependencies = [
|
|
95
|
+
"generic-array",
|
|
96
|
+
"typenum",
|
|
97
|
+
]
|
|
98
|
+
|
|
99
|
+
[[package]]
|
|
100
|
+
name = "digest"
|
|
101
|
+
version = "0.10.7"
|
|
102
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
103
|
+
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
|
|
104
|
+
dependencies = [
|
|
105
|
+
"block-buffer",
|
|
106
|
+
"crypto-common",
|
|
107
|
+
]
|
|
108
|
+
|
|
109
|
+
[[package]]
|
|
110
|
+
name = "either"
|
|
111
|
+
version = "1.18.0"
|
|
112
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
113
|
+
checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34"
|
|
114
|
+
|
|
115
|
+
[[package]]
|
|
116
|
+
name = "errno"
|
|
117
|
+
version = "0.3.14"
|
|
118
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
119
|
+
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
|
|
120
|
+
dependencies = [
|
|
121
|
+
"libc",
|
|
122
|
+
"windows-sys",
|
|
123
|
+
]
|
|
124
|
+
|
|
125
|
+
[[package]]
|
|
126
|
+
name = "generic-array"
|
|
127
|
+
version = "0.14.7"
|
|
128
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
129
|
+
checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
|
|
130
|
+
dependencies = [
|
|
131
|
+
"typenum",
|
|
132
|
+
"version_check",
|
|
133
|
+
]
|
|
134
|
+
|
|
135
|
+
[[package]]
|
|
136
|
+
name = "heck"
|
|
137
|
+
version = "0.4.1"
|
|
138
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
139
|
+
checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
|
|
140
|
+
|
|
141
|
+
[[package]]
|
|
142
|
+
name = "indoc"
|
|
143
|
+
version = "2.0.7"
|
|
144
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
145
|
+
checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706"
|
|
146
|
+
dependencies = [
|
|
147
|
+
"rustversion",
|
|
148
|
+
]
|
|
149
|
+
|
|
150
|
+
[[package]]
|
|
151
|
+
name = "itoa"
|
|
152
|
+
version = "1.0.18"
|
|
153
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
154
|
+
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
|
|
155
|
+
|
|
156
|
+
[[package]]
|
|
157
|
+
name = "lagi-cli"
|
|
158
|
+
version = "0.1.0"
|
|
159
|
+
dependencies = [
|
|
160
|
+
"lagi-core",
|
|
161
|
+
"pyo3",
|
|
162
|
+
"tokio",
|
|
163
|
+
]
|
|
164
|
+
|
|
165
|
+
[[package]]
|
|
166
|
+
name = "lagi-core"
|
|
167
|
+
version = "0.1.0"
|
|
168
|
+
dependencies = [
|
|
169
|
+
"serde",
|
|
170
|
+
"serde_json",
|
|
171
|
+
"sha2",
|
|
172
|
+
"sysinfo",
|
|
173
|
+
"thiserror",
|
|
174
|
+
]
|
|
175
|
+
|
|
176
|
+
[[package]]
|
|
177
|
+
name = "lagi-mdn"
|
|
178
|
+
version = "0.1.0"
|
|
179
|
+
dependencies = [
|
|
180
|
+
"lagi-core",
|
|
181
|
+
"pyo3",
|
|
182
|
+
]
|
|
183
|
+
|
|
184
|
+
[[package]]
|
|
185
|
+
name = "lagi-sdk"
|
|
186
|
+
version = "0.1.0"
|
|
187
|
+
dependencies = [
|
|
188
|
+
"async-trait",
|
|
189
|
+
"lagi-core",
|
|
190
|
+
"pyo3",
|
|
191
|
+
"tokio",
|
|
192
|
+
]
|
|
193
|
+
|
|
194
|
+
[[package]]
|
|
195
|
+
name = "libc"
|
|
196
|
+
version = "0.2.189"
|
|
197
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
198
|
+
checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
|
|
199
|
+
|
|
200
|
+
[[package]]
|
|
201
|
+
name = "lock_api"
|
|
202
|
+
version = "0.4.14"
|
|
203
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
204
|
+
checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965"
|
|
205
|
+
dependencies = [
|
|
206
|
+
"scopeguard",
|
|
207
|
+
]
|
|
208
|
+
|
|
209
|
+
[[package]]
|
|
210
|
+
name = "memchr"
|
|
211
|
+
version = "2.8.3"
|
|
212
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
213
|
+
checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
|
214
|
+
|
|
215
|
+
[[package]]
|
|
216
|
+
name = "memoffset"
|
|
217
|
+
version = "0.9.1"
|
|
218
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
219
|
+
checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
|
|
220
|
+
dependencies = [
|
|
221
|
+
"autocfg",
|
|
222
|
+
]
|
|
223
|
+
|
|
224
|
+
[[package]]
|
|
225
|
+
name = "mio"
|
|
226
|
+
version = "1.2.3"
|
|
227
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
228
|
+
checksum = "4b18443e9c262bfe8fa82f51666e2642c53393f7e5c27b3e1aeab922cff5b9d8"
|
|
229
|
+
dependencies = [
|
|
230
|
+
"libc",
|
|
231
|
+
"wasi",
|
|
232
|
+
"windows-sys",
|
|
233
|
+
]
|
|
234
|
+
|
|
235
|
+
[[package]]
|
|
236
|
+
name = "ntapi"
|
|
237
|
+
version = "0.4.3"
|
|
238
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
239
|
+
checksum = "c3b335231dfd352ffb0f8017f3b6027a4917f7df785ea2143d8af2adc66980ae"
|
|
240
|
+
dependencies = [
|
|
241
|
+
"winapi",
|
|
242
|
+
]
|
|
243
|
+
|
|
244
|
+
[[package]]
|
|
245
|
+
name = "once_cell"
|
|
246
|
+
version = "1.21.4"
|
|
247
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
248
|
+
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
|
|
249
|
+
|
|
250
|
+
[[package]]
|
|
251
|
+
name = "parking_lot"
|
|
252
|
+
version = "0.12.5"
|
|
253
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
254
|
+
checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a"
|
|
255
|
+
dependencies = [
|
|
256
|
+
"lock_api",
|
|
257
|
+
"parking_lot_core",
|
|
258
|
+
]
|
|
259
|
+
|
|
260
|
+
[[package]]
|
|
261
|
+
name = "parking_lot_core"
|
|
262
|
+
version = "0.9.12"
|
|
263
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
264
|
+
checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1"
|
|
265
|
+
dependencies = [
|
|
266
|
+
"cfg-if",
|
|
267
|
+
"libc",
|
|
268
|
+
"redox_syscall",
|
|
269
|
+
"smallvec",
|
|
270
|
+
"windows-link",
|
|
271
|
+
]
|
|
272
|
+
|
|
273
|
+
[[package]]
|
|
274
|
+
name = "pin-project-lite"
|
|
275
|
+
version = "0.2.17"
|
|
276
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
277
|
+
checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
|
|
278
|
+
|
|
279
|
+
[[package]]
|
|
280
|
+
name = "portable-atomic"
|
|
281
|
+
version = "1.15.0"
|
|
282
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
283
|
+
checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
|
|
284
|
+
|
|
285
|
+
[[package]]
|
|
286
|
+
name = "proc-macro2"
|
|
287
|
+
version = "1.0.107"
|
|
288
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
289
|
+
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
|
|
290
|
+
dependencies = [
|
|
291
|
+
"unicode-ident",
|
|
292
|
+
]
|
|
293
|
+
|
|
294
|
+
[[package]]
|
|
295
|
+
name = "pyo3"
|
|
296
|
+
version = "0.21.2"
|
|
297
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
298
|
+
checksum = "a5e00b96a521718e08e03b1a622f01c8a8deb50719335de3f60b3b3950f069d8"
|
|
299
|
+
dependencies = [
|
|
300
|
+
"cfg-if",
|
|
301
|
+
"indoc",
|
|
302
|
+
"libc",
|
|
303
|
+
"memoffset",
|
|
304
|
+
"parking_lot",
|
|
305
|
+
"portable-atomic",
|
|
306
|
+
"pyo3-build-config",
|
|
307
|
+
"pyo3-ffi",
|
|
308
|
+
"pyo3-macros",
|
|
309
|
+
"unindent",
|
|
310
|
+
]
|
|
311
|
+
|
|
312
|
+
[[package]]
|
|
313
|
+
name = "pyo3-build-config"
|
|
314
|
+
version = "0.21.2"
|
|
315
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
316
|
+
checksum = "7883df5835fafdad87c0d888b266c8ec0f4c9ca48a5bed6bbb592e8dedee1b50"
|
|
317
|
+
dependencies = [
|
|
318
|
+
"once_cell",
|
|
319
|
+
"target-lexicon",
|
|
320
|
+
]
|
|
321
|
+
|
|
322
|
+
[[package]]
|
|
323
|
+
name = "pyo3-ffi"
|
|
324
|
+
version = "0.21.2"
|
|
325
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
326
|
+
checksum = "01be5843dc60b916ab4dad1dca6d20b9b4e6ddc8e15f50c47fe6d85f1fb97403"
|
|
327
|
+
dependencies = [
|
|
328
|
+
"libc",
|
|
329
|
+
"pyo3-build-config",
|
|
330
|
+
]
|
|
331
|
+
|
|
332
|
+
[[package]]
|
|
333
|
+
name = "pyo3-macros"
|
|
334
|
+
version = "0.21.2"
|
|
335
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
336
|
+
checksum = "77b34069fc0682e11b31dbd10321cbf94808394c56fd996796ce45217dfac53c"
|
|
337
|
+
dependencies = [
|
|
338
|
+
"proc-macro2",
|
|
339
|
+
"pyo3-macros-backend",
|
|
340
|
+
"quote",
|
|
341
|
+
"syn 2.0.119",
|
|
342
|
+
]
|
|
343
|
+
|
|
344
|
+
[[package]]
|
|
345
|
+
name = "pyo3-macros-backend"
|
|
346
|
+
version = "0.21.2"
|
|
347
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
348
|
+
checksum = "08260721f32db5e1a5beae69a55553f56b99bd0e1c3e6e0a5e8851a9d0f5a85c"
|
|
349
|
+
dependencies = [
|
|
350
|
+
"heck",
|
|
351
|
+
"proc-macro2",
|
|
352
|
+
"pyo3-build-config",
|
|
353
|
+
"quote",
|
|
354
|
+
"syn 2.0.119",
|
|
355
|
+
]
|
|
356
|
+
|
|
357
|
+
[[package]]
|
|
358
|
+
name = "quote"
|
|
359
|
+
version = "1.0.47"
|
|
360
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
361
|
+
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
|
|
362
|
+
dependencies = [
|
|
363
|
+
"proc-macro2",
|
|
364
|
+
]
|
|
365
|
+
|
|
366
|
+
[[package]]
|
|
367
|
+
name = "rayon"
|
|
368
|
+
version = "1.12.0"
|
|
369
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
370
|
+
checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d"
|
|
371
|
+
dependencies = [
|
|
372
|
+
"either",
|
|
373
|
+
"rayon-core",
|
|
374
|
+
]
|
|
375
|
+
|
|
376
|
+
[[package]]
|
|
377
|
+
name = "rayon-core"
|
|
378
|
+
version = "1.13.0"
|
|
379
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
380
|
+
checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"
|
|
381
|
+
dependencies = [
|
|
382
|
+
"crossbeam-deque",
|
|
383
|
+
"crossbeam-utils",
|
|
384
|
+
]
|
|
385
|
+
|
|
386
|
+
[[package]]
|
|
387
|
+
name = "redox_syscall"
|
|
388
|
+
version = "0.5.18"
|
|
389
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
390
|
+
checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d"
|
|
391
|
+
dependencies = [
|
|
392
|
+
"bitflags",
|
|
393
|
+
]
|
|
394
|
+
|
|
395
|
+
[[package]]
|
|
396
|
+
name = "rustversion"
|
|
397
|
+
version = "1.0.23"
|
|
398
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
399
|
+
checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
|
|
400
|
+
|
|
401
|
+
[[package]]
|
|
402
|
+
name = "scopeguard"
|
|
403
|
+
version = "1.2.0"
|
|
404
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
405
|
+
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
|
406
|
+
|
|
407
|
+
[[package]]
|
|
408
|
+
name = "serde"
|
|
409
|
+
version = "1.0.229"
|
|
410
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
411
|
+
checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
|
|
412
|
+
dependencies = [
|
|
413
|
+
"serde_core",
|
|
414
|
+
"serde_derive",
|
|
415
|
+
]
|
|
416
|
+
|
|
417
|
+
[[package]]
|
|
418
|
+
name = "serde_core"
|
|
419
|
+
version = "1.0.229"
|
|
420
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
421
|
+
checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
|
|
422
|
+
dependencies = [
|
|
423
|
+
"serde_derive",
|
|
424
|
+
]
|
|
425
|
+
|
|
426
|
+
[[package]]
|
|
427
|
+
name = "serde_derive"
|
|
428
|
+
version = "1.0.229"
|
|
429
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
430
|
+
checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
|
|
431
|
+
dependencies = [
|
|
432
|
+
"proc-macro2",
|
|
433
|
+
"quote",
|
|
434
|
+
"syn 3.0.6",
|
|
435
|
+
]
|
|
436
|
+
|
|
437
|
+
[[package]]
|
|
438
|
+
name = "serde_json"
|
|
439
|
+
version = "1.0.151"
|
|
440
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
441
|
+
checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14"
|
|
442
|
+
dependencies = [
|
|
443
|
+
"itoa",
|
|
444
|
+
"memchr",
|
|
445
|
+
"serde",
|
|
446
|
+
"serde_core",
|
|
447
|
+
"zmij",
|
|
448
|
+
]
|
|
449
|
+
|
|
450
|
+
[[package]]
|
|
451
|
+
name = "sha2"
|
|
452
|
+
version = "0.10.9"
|
|
453
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
454
|
+
checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
|
|
455
|
+
dependencies = [
|
|
456
|
+
"cfg-if",
|
|
457
|
+
"cpufeatures",
|
|
458
|
+
"digest",
|
|
459
|
+
]
|
|
460
|
+
|
|
461
|
+
[[package]]
|
|
462
|
+
name = "signal-hook-registry"
|
|
463
|
+
version = "1.4.8"
|
|
464
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
465
|
+
checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b"
|
|
466
|
+
dependencies = [
|
|
467
|
+
"errno",
|
|
468
|
+
"libc",
|
|
469
|
+
]
|
|
470
|
+
|
|
471
|
+
[[package]]
|
|
472
|
+
name = "smallvec"
|
|
473
|
+
version = "1.16.2"
|
|
474
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
475
|
+
checksum = "f9395f0f0eee849a9b707b2f06bb92a6a422090e2123bb2ef8e87a0e61892a8e"
|
|
476
|
+
|
|
477
|
+
[[package]]
|
|
478
|
+
name = "socket2"
|
|
479
|
+
version = "0.6.5"
|
|
480
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
481
|
+
checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4"
|
|
482
|
+
dependencies = [
|
|
483
|
+
"libc",
|
|
484
|
+
"windows-sys",
|
|
485
|
+
]
|
|
486
|
+
|
|
487
|
+
[[package]]
|
|
488
|
+
name = "syn"
|
|
489
|
+
version = "2.0.119"
|
|
490
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
491
|
+
checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
|
|
492
|
+
dependencies = [
|
|
493
|
+
"proc-macro2",
|
|
494
|
+
"quote",
|
|
495
|
+
"unicode-ident",
|
|
496
|
+
]
|
|
497
|
+
|
|
498
|
+
[[package]]
|
|
499
|
+
name = "syn"
|
|
500
|
+
version = "3.0.6"
|
|
501
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
502
|
+
checksum = "8593e8e72159ed2257d083c7a454a85cbf854f37a0966d8d483aff8c8a3ebcee"
|
|
503
|
+
dependencies = [
|
|
504
|
+
"proc-macro2",
|
|
505
|
+
"quote",
|
|
506
|
+
"unicode-ident",
|
|
507
|
+
]
|
|
508
|
+
|
|
509
|
+
[[package]]
|
|
510
|
+
name = "sysinfo"
|
|
511
|
+
version = "0.30.13"
|
|
512
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
513
|
+
checksum = "0a5b4ddaee55fb2bea2bf0e5000747e5f5c0de765e5a5ff87f4cd106439f4bb3"
|
|
514
|
+
dependencies = [
|
|
515
|
+
"cfg-if",
|
|
516
|
+
"core-foundation-sys",
|
|
517
|
+
"libc",
|
|
518
|
+
"ntapi",
|
|
519
|
+
"once_cell",
|
|
520
|
+
"rayon",
|
|
521
|
+
"windows",
|
|
522
|
+
]
|
|
523
|
+
|
|
524
|
+
[[package]]
|
|
525
|
+
name = "target-lexicon"
|
|
526
|
+
version = "0.12.16"
|
|
527
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
528
|
+
checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
|
|
529
|
+
|
|
530
|
+
[[package]]
|
|
531
|
+
name = "thiserror"
|
|
532
|
+
version = "2.0.21"
|
|
533
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
534
|
+
checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e"
|
|
535
|
+
dependencies = [
|
|
536
|
+
"thiserror-impl",
|
|
537
|
+
]
|
|
538
|
+
|
|
539
|
+
[[package]]
|
|
540
|
+
name = "thiserror-impl"
|
|
541
|
+
version = "2.0.21"
|
|
542
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
543
|
+
checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524"
|
|
544
|
+
dependencies = [
|
|
545
|
+
"proc-macro2",
|
|
546
|
+
"quote",
|
|
547
|
+
"syn 3.0.6",
|
|
548
|
+
]
|
|
549
|
+
|
|
550
|
+
[[package]]
|
|
551
|
+
name = "tokio"
|
|
552
|
+
version = "1.53.1"
|
|
553
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
554
|
+
checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed"
|
|
555
|
+
dependencies = [
|
|
556
|
+
"bytes",
|
|
557
|
+
"libc",
|
|
558
|
+
"mio",
|
|
559
|
+
"parking_lot",
|
|
560
|
+
"pin-project-lite",
|
|
561
|
+
"signal-hook-registry",
|
|
562
|
+
"socket2",
|
|
563
|
+
"tokio-macros",
|
|
564
|
+
"windows-sys",
|
|
565
|
+
]
|
|
566
|
+
|
|
567
|
+
[[package]]
|
|
568
|
+
name = "tokio-macros"
|
|
569
|
+
version = "2.7.2"
|
|
570
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
571
|
+
checksum = "78773a2a397f451582ce068015985c33193cf6dea8b74d2a639fe457b2f07b0e"
|
|
572
|
+
dependencies = [
|
|
573
|
+
"proc-macro2",
|
|
574
|
+
"quote",
|
|
575
|
+
"syn 3.0.6",
|
|
576
|
+
]
|
|
577
|
+
|
|
578
|
+
[[package]]
|
|
579
|
+
name = "typenum"
|
|
580
|
+
version = "1.20.1"
|
|
581
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
582
|
+
checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20"
|
|
583
|
+
|
|
584
|
+
[[package]]
|
|
585
|
+
name = "unicode-ident"
|
|
586
|
+
version = "1.0.26"
|
|
587
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
588
|
+
checksum = "d245f478577f809a851594d02313b640fb437e0bb33866753cff937863096954"
|
|
589
|
+
|
|
590
|
+
[[package]]
|
|
591
|
+
name = "unindent"
|
|
592
|
+
version = "0.2.4"
|
|
593
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
594
|
+
checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
|
|
595
|
+
|
|
596
|
+
[[package]]
|
|
597
|
+
name = "version_check"
|
|
598
|
+
version = "0.9.5"
|
|
599
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
600
|
+
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
|
601
|
+
|
|
602
|
+
[[package]]
|
|
603
|
+
name = "wasi"
|
|
604
|
+
version = "0.11.1+wasi-snapshot-preview1"
|
|
605
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
606
|
+
checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
|
|
607
|
+
|
|
608
|
+
[[package]]
|
|
609
|
+
name = "winapi"
|
|
610
|
+
version = "0.3.9"
|
|
611
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
612
|
+
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
|
|
613
|
+
dependencies = [
|
|
614
|
+
"winapi-i686-pc-windows-gnu",
|
|
615
|
+
"winapi-x86_64-pc-windows-gnu",
|
|
616
|
+
]
|
|
617
|
+
|
|
618
|
+
[[package]]
|
|
619
|
+
name = "winapi-i686-pc-windows-gnu"
|
|
620
|
+
version = "0.4.0"
|
|
621
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
622
|
+
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
|
623
|
+
|
|
624
|
+
[[package]]
|
|
625
|
+
name = "winapi-x86_64-pc-windows-gnu"
|
|
626
|
+
version = "0.4.0"
|
|
627
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
628
|
+
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
|
629
|
+
|
|
630
|
+
[[package]]
|
|
631
|
+
name = "windows"
|
|
632
|
+
version = "0.52.0"
|
|
633
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
634
|
+
checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be"
|
|
635
|
+
dependencies = [
|
|
636
|
+
"windows-core",
|
|
637
|
+
"windows-targets",
|
|
638
|
+
]
|
|
639
|
+
|
|
640
|
+
[[package]]
|
|
641
|
+
name = "windows-core"
|
|
642
|
+
version = "0.52.0"
|
|
643
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
644
|
+
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
|
|
645
|
+
dependencies = [
|
|
646
|
+
"windows-targets",
|
|
647
|
+
]
|
|
648
|
+
|
|
649
|
+
[[package]]
|
|
650
|
+
name = "windows-link"
|
|
651
|
+
version = "0.2.1"
|
|
652
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
653
|
+
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
|
|
654
|
+
|
|
655
|
+
[[package]]
|
|
656
|
+
name = "windows-sys"
|
|
657
|
+
version = "0.61.2"
|
|
658
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
659
|
+
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
|
|
660
|
+
dependencies = [
|
|
661
|
+
"windows-link",
|
|
662
|
+
]
|
|
663
|
+
|
|
664
|
+
[[package]]
|
|
665
|
+
name = "windows-targets"
|
|
666
|
+
version = "0.52.6"
|
|
667
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
668
|
+
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
|
|
669
|
+
dependencies = [
|
|
670
|
+
"windows_aarch64_gnullvm",
|
|
671
|
+
"windows_aarch64_msvc",
|
|
672
|
+
"windows_i686_gnu",
|
|
673
|
+
"windows_i686_gnullvm",
|
|
674
|
+
"windows_i686_msvc",
|
|
675
|
+
"windows_x86_64_gnu",
|
|
676
|
+
"windows_x86_64_gnullvm",
|
|
677
|
+
"windows_x86_64_msvc",
|
|
678
|
+
]
|
|
679
|
+
|
|
680
|
+
[[package]]
|
|
681
|
+
name = "windows_aarch64_gnullvm"
|
|
682
|
+
version = "0.52.6"
|
|
683
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
684
|
+
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
|
|
685
|
+
|
|
686
|
+
[[package]]
|
|
687
|
+
name = "windows_aarch64_msvc"
|
|
688
|
+
version = "0.52.6"
|
|
689
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
690
|
+
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
|
|
691
|
+
|
|
692
|
+
[[package]]
|
|
693
|
+
name = "windows_i686_gnu"
|
|
694
|
+
version = "0.52.6"
|
|
695
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
696
|
+
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
|
|
697
|
+
|
|
698
|
+
[[package]]
|
|
699
|
+
name = "windows_i686_gnullvm"
|
|
700
|
+
version = "0.52.6"
|
|
701
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
702
|
+
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
|
|
703
|
+
|
|
704
|
+
[[package]]
|
|
705
|
+
name = "windows_i686_msvc"
|
|
706
|
+
version = "0.52.6"
|
|
707
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
708
|
+
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
|
|
709
|
+
|
|
710
|
+
[[package]]
|
|
711
|
+
name = "windows_x86_64_gnu"
|
|
712
|
+
version = "0.52.6"
|
|
713
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
714
|
+
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
|
|
715
|
+
|
|
716
|
+
[[package]]
|
|
717
|
+
name = "windows_x86_64_gnullvm"
|
|
718
|
+
version = "0.52.6"
|
|
719
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
720
|
+
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
|
|
721
|
+
|
|
722
|
+
[[package]]
|
|
723
|
+
name = "windows_x86_64_msvc"
|
|
724
|
+
version = "0.52.6"
|
|
725
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
726
|
+
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
|
727
|
+
|
|
728
|
+
[[package]]
|
|
729
|
+
name = "zmij"
|
|
730
|
+
version = "1.0.23"
|
|
731
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
732
|
+
checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
|
lagi_mdn-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lagi-mdn
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Hardware profiler & Model Delivery Network engine for LAGI.
|
|
5
|
+
Author: Liumi Corporation
|
|
6
|
+
Requires-Python: >=3.9
|
|
7
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
8
|
+
|
|
9
|
+
# lagi-mdn
|
|
10
|
+
|
|
11
|
+
Hardware profiler + Model Delivery Network (MDN) engine for the LAGI stack.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pip install lagi-mdn
|
|
15
|
+
lagi-mdn # print full hardware profile
|
|
16
|
+
lagi-mdn ./agent.lagi # profile + suggested payload tier
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Detects AVX2 / AVX512 / NEON, RAM tier, Apple Silicon vs x86, and picks the best `.lagi` payload variant (cpu-tiny / cpu / cuda / metal). Full download pipeline (SHA-256 verified) included.
|
|
20
|
+
|
lagi_mdn-0.1.0/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# lagi-mdn
|
|
2
|
+
|
|
3
|
+
Hardware profiler + Model Delivery Network (MDN) engine for the LAGI stack.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
pip install lagi-mdn
|
|
7
|
+
lagi-mdn # print full hardware profile
|
|
8
|
+
lagi-mdn ./agent.lagi # profile + suggested payload tier
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Detects AVX2 / AVX512 / NEON, RAM tier, Apple Silicon vs x86, and picks the best `.lagi` payload variant (cpu-tiny / cpu / cuda / metal). Full download pipeline (SHA-256 verified) included.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "lagi-core"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
description = "Shared LAGI engine, hardware profiler, and security primitives"
|
|
6
|
+
license = "Proprietary"
|
|
7
|
+
|
|
8
|
+
[lib]
|
|
9
|
+
name = "lagi_core"
|
|
10
|
+
crate-type = ["rlib"]
|
|
11
|
+
|
|
12
|
+
[dependencies]
|
|
13
|
+
serde = { version = "1", features = ["derive"] }
|
|
14
|
+
serde_json = "1"
|
|
15
|
+
thiserror = "2"
|
|
16
|
+
sysinfo = "0.30"
|
|
17
|
+
sha2 = "0.10"
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
Core Engine plumbing shared by sdk / cli / mdn
|
|
3
|
+
|
|
4
|
+
Currently light: container loading + thought-step execution scaffolding.
|
|
5
|
+
The full llama.cpp inference and memory graph live in the earlier
|
|
6
|
+
`lagi-core` crate (the Rust workspace); this crate is the distribution
|
|
7
|
+
surface that PyPI packages build on.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
use crate::security;
|
|
11
|
+
use serde::{Deserialize, Serialize};
|
|
12
|
+
use std::path::{Path, PathBuf};
|
|
13
|
+
use thiserror::Error;
|
|
14
|
+
|
|
15
|
+
pub type EngineResult<T> = Result<T, EngineError>;
|
|
16
|
+
|
|
17
|
+
#[derive(Error, Debug)]
|
|
18
|
+
pub enum EngineError {
|
|
19
|
+
#[error("Not a .lagi container: {0}")]
|
|
20
|
+
NotAContainer(String),
|
|
21
|
+
|
|
22
|
+
#[error("Security error: {0}")]
|
|
23
|
+
Security(#[from] security::SecurityError),
|
|
24
|
+
|
|
25
|
+
#[error("IO error: {0}")]
|
|
26
|
+
Io(#[from] std::io::Error),
|
|
27
|
+
|
|
28
|
+
#[error("Manifest error: {0}")]
|
|
29
|
+
Manifest(String),
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/// Lightweight runtime that owns a `.lagi` container path
|
|
33
|
+
#[derive(Debug, Clone)]
|
|
34
|
+
pub struct Engine {
|
|
35
|
+
pub agent_path: PathBuf,
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
impl Engine {
|
|
39
|
+
pub fn new(agent_path: impl AsRef<Path>) -> EngineResult<Self> {
|
|
40
|
+
let path = agent_path.as_ref().to_path_buf();
|
|
41
|
+
if !security::is_lagi_container(&path) {
|
|
42
|
+
return Err(EngineError::NotAContainer(path.display().to_string()));
|
|
43
|
+
}
|
|
44
|
+
Ok(Self { agent_path: path })
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/// Run one spark/critic step — stub text pending full engine bring-up
|
|
48
|
+
pub fn execute_thought_step(&self, prompt: &str) -> String {
|
|
49
|
+
format!(
|
|
50
|
+
"[LAGI Runtime Engine] Executing thought step for target agent '{}' with prompt: '{}'",
|
|
51
|
+
self.agent_path.display(),
|
|
52
|
+
prompt
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/// Placeholder manifest summary read by the SDK probe calls
|
|
58
|
+
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
59
|
+
pub struct AgentSummary {
|
|
60
|
+
pub name: String,
|
|
61
|
+
pub version: String,
|
|
62
|
+
pub model_size_hint: Option<u64>,
|
|
63
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
lagi-core — shared Rust logic for the LAGI ecosystem
|
|
3
|
+
|
|
4
|
+
Modules:
|
|
5
|
+
- `engine` – container loading + thought-step execution
|
|
6
|
+
- `profiler` – hardware detection, tier recommendation for MDN payload selection
|
|
7
|
+
- `security` – integrity checks and container inspection
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
pub mod engine;
|
|
11
|
+
pub mod profiler;
|
|
12
|
+
pub mod security;
|
|
13
|
+
|
|
14
|
+
pub use engine::{Engine, EngineError};
|
|
15
|
+
pub use profiler::{GpuInfo, HardwareProfile};
|
|
16
|
+
pub use security::{is_lagi_container, SecurityError};
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
Hardware Profiler
|
|
3
|
+
|
|
4
|
+
Detects the execution capabilities of the host so the Model Delivery
|
|
5
|
+
Network can pick the best `.lagi` payload (AVX2/AVX512/NEON, RAM tier,
|
|
6
|
+
optional GPU/VRAM).
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
use serde::{Deserialize, Serialize};
|
|
10
|
+
use std::collections::HashMap;
|
|
11
|
+
|
|
12
|
+
/// Snapshot of host hardware relevant to payload selection
|
|
13
|
+
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
14
|
+
pub struct HardwareProfile {
|
|
15
|
+
pub arch: String,
|
|
16
|
+
pub cpu_brand: String,
|
|
17
|
+
pub cpu_cores: u32,
|
|
18
|
+
pub total_ram_mb: u64,
|
|
19
|
+
pub free_ram_mb: u64,
|
|
20
|
+
pub avx2: bool,
|
|
21
|
+
pub avx512f: bool,
|
|
22
|
+
pub avx512_vnni: bool,
|
|
23
|
+
pub neon: bool,
|
|
24
|
+
pub is_apple_silicon: bool,
|
|
25
|
+
pub gpu: Option<GpuInfo>,
|
|
26
|
+
/// Suggested payload tier: "cpu-tiny", "cpu", "cuda", "metal"
|
|
27
|
+
pub recommended_tier: String,
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
31
|
+
pub struct GpuInfo {
|
|
32
|
+
pub backend: String, // "cuda" | "metal" | "vulkan" | "none"
|
|
33
|
+
pub vram_mb: Option<u64>,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
impl HardwareProfile {
|
|
37
|
+
/// Probe the current machine
|
|
38
|
+
pub fn detect() -> Self {
|
|
39
|
+
let mut sys = sysinfo::System::new_all();
|
|
40
|
+
sys.refresh_all();
|
|
41
|
+
|
|
42
|
+
let arch = std::env::consts::ARCH.to_string();
|
|
43
|
+
let cpu_brand = sys
|
|
44
|
+
.cpus()
|
|
45
|
+
.first()
|
|
46
|
+
.map(|c| c.brand().to_string())
|
|
47
|
+
.unwrap_or_default();
|
|
48
|
+
let cpu_cores = sys.cpus().len() as u32;
|
|
49
|
+
let total_ram_mb = sys.total_memory() / (1024 * 1024);
|
|
50
|
+
let free_ram_mb = sys.available_memory() / (1024 * 1024);
|
|
51
|
+
|
|
52
|
+
let avx2 = is_x86_feature_detected_safe("avx2");
|
|
53
|
+
let avx512f = is_x86_feature_detected_safe("avx512f");
|
|
54
|
+
let avx512_vnni = is_x86_feature_detected_safe("avx512vnni");
|
|
55
|
+
let neon = detect_neon();
|
|
56
|
+
|
|
57
|
+
let is_apple_silicon = cfg!(all(target_os = "macos", target_arch = "aarch64"));
|
|
58
|
+
|
|
59
|
+
// GPU probing — llama.cpp ships its own; we only care for tiering
|
|
60
|
+
let gpu = detect_gpu();
|
|
61
|
+
|
|
62
|
+
let recommended_tier = recommend_tier(avx2, avx512_vnni, total_ram_mb, is_apple_silicon, &gpu);
|
|
63
|
+
|
|
64
|
+
Self {
|
|
65
|
+
arch,
|
|
66
|
+
cpu_brand,
|
|
67
|
+
cpu_cores,
|
|
68
|
+
total_ram_mb,
|
|
69
|
+
free_ram_mb,
|
|
70
|
+
avx2,
|
|
71
|
+
avx512f,
|
|
72
|
+
avx512_vnni,
|
|
73
|
+
neon,
|
|
74
|
+
is_apple_silicon,
|
|
75
|
+
gpu,
|
|
76
|
+
recommended_tier,
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/// Render as a flat string map for Python FFI
|
|
81
|
+
pub fn to_map(&self) -> HashMap<String, String> {
|
|
82
|
+
let mut m = HashMap::new();
|
|
83
|
+
m.insert("arch".into(), self.arch.clone());
|
|
84
|
+
m.insert("cpu_brand".into(), self.cpu_brand.clone());
|
|
85
|
+
m.insert("cpu_cores".into(), self.cpu_cores.to_string());
|
|
86
|
+
m.insert("total_ram_mb".into(), self.total_ram_mb.to_string());
|
|
87
|
+
m.insert("free_ram_mb".into(), self.free_ram_mb.to_string());
|
|
88
|
+
m.insert("avx2".into(), self.avx2.to_string());
|
|
89
|
+
m.insert("avx512f".into(), self.avx512f.to_string());
|
|
90
|
+
m.insert("avx512_vnni".into(), self.avx512_vnni.to_string());
|
|
91
|
+
m.insert("neon".into(), self.neon.to_string());
|
|
92
|
+
m.insert("is_apple_silicon".into(), self.is_apple_silicon.to_string());
|
|
93
|
+
m.insert("recommended_tier".into(), self.recommended_tier.clone());
|
|
94
|
+
if let Some(gpu) = &self.gpu {
|
|
95
|
+
m.insert("gpu_backend".into(), gpu.backend.clone());
|
|
96
|
+
if let Some(vram) = gpu.vram_mb {
|
|
97
|
+
m.insert("gpu_vram_mb".into(), vram.to_string());
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
m
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
#[inline]
|
|
105
|
+
fn is_x86_feature_detected_safe(f: &str) -> bool {
|
|
106
|
+
#[cfg(target_arch = "x86_64")]
|
|
107
|
+
{
|
|
108
|
+
match f {
|
|
109
|
+
"avx2" => std::is_x86_feature_detected!("avx2"),
|
|
110
|
+
"avx512f" => std::is_x86_feature_detected!("avx512f"),
|
|
111
|
+
"avx512vnni" => std::is_x86_feature_detected!("avx512vnni"),
|
|
112
|
+
_ => false,
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
#[cfg(not(target_arch = "x86_64"))]
|
|
116
|
+
{
|
|
117
|
+
let _ = f;
|
|
118
|
+
false
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
#[inline]
|
|
123
|
+
fn detect_neon() -> bool {
|
|
124
|
+
#[cfg(target_arch = "aarch64")]
|
|
125
|
+
{
|
|
126
|
+
true // NEON is baseline on aarch64
|
|
127
|
+
}
|
|
128
|
+
#[cfg(not(target_arch = "aarch64"))]
|
|
129
|
+
{
|
|
130
|
+
false
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
fn detect_gpu() -> Option<GpuInfo> {
|
|
135
|
+
if cfg!(all(target_os = "macos", target_arch = "aarch64")) {
|
|
136
|
+
return Some(GpuInfo {
|
|
137
|
+
backend: "metal".into(),
|
|
138
|
+
vram_mb: None,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
if std::env::var("CUDA_VISIBLE_DEVICES").is_ok() {
|
|
142
|
+
return Some(GpuInfo {
|
|
143
|
+
backend: "cuda".into(),
|
|
144
|
+
vram_mb: None,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
None
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
fn recommend_tier(
|
|
151
|
+
avx2: bool,
|
|
152
|
+
avx512_vnni: bool,
|
|
153
|
+
total_ram_mb: u64,
|
|
154
|
+
is_apple_silicon: bool,
|
|
155
|
+
gpu: &Option<GpuInfo>,
|
|
156
|
+
) -> String {
|
|
157
|
+
if is_apple_silicon || gpu.as_ref().map_or(false, |g| g.backend == "metal") {
|
|
158
|
+
return "metal".into();
|
|
159
|
+
}
|
|
160
|
+
if gpu.as_ref().map_or(false, |g| g.backend == "cuda") && total_ram_mb >= 4096 {
|
|
161
|
+
return "cuda".into();
|
|
162
|
+
}
|
|
163
|
+
if total_ram_mb < 2048 {
|
|
164
|
+
return "cpu-tiny".into();
|
|
165
|
+
}
|
|
166
|
+
if avx2 || avx512_vnni {
|
|
167
|
+
"cpu".into()
|
|
168
|
+
} else {
|
|
169
|
+
"cpu-tiny".into()
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
#[cfg(test)]
|
|
174
|
+
mod tests {
|
|
175
|
+
use super::*;
|
|
176
|
+
|
|
177
|
+
#[test]
|
|
178
|
+
fn profile_detects_something() {
|
|
179
|
+
let p = HardwareProfile::detect();
|
|
180
|
+
assert!(!p.arch.is_empty());
|
|
181
|
+
assert!(p.cpu_cores > 0);
|
|
182
|
+
assert!(p.total_ram_mb > 0);
|
|
183
|
+
let m = p.to_map();
|
|
184
|
+
assert!(m.contains_key("recommended_tier"));
|
|
185
|
+
}
|
|
186
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
Container Security Primitives
|
|
3
|
+
|
|
4
|
+
SHA-256 integrity hashing for `.lagi` payloads and manifest validation.
|
|
5
|
+
Distribution is AES-256-GCM + hardware-derived keys; this module provides
|
|
6
|
+
the lightweight checks the SDK/MDN crates need before ever touching a model.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
use sha2::{Digest, Sha256};
|
|
10
|
+
use std::path::Path;
|
|
11
|
+
use thiserror::Error;
|
|
12
|
+
|
|
13
|
+
#[derive(Error, Debug)]
|
|
14
|
+
pub enum SecurityError {
|
|
15
|
+
#[error("IO error: {0}")]
|
|
16
|
+
Io(#[from] std::io::Error),
|
|
17
|
+
|
|
18
|
+
#[error("Integrity mismatch: expected {expected}, got {got}")]
|
|
19
|
+
IntegrityMismatch { expected: String, got: String },
|
|
20
|
+
|
|
21
|
+
#[error("Not a .lagi container: {0}")]
|
|
22
|
+
NotAContainer(String),
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/// Expected magic bytes at the start of every LAGI container
|
|
26
|
+
pub const EXPECTED_MAGIC: &[u8; 8] = b"LAGI_V01";
|
|
27
|
+
|
|
28
|
+
/// Compute SHA-256 hex digest of a file (streamed, low memory)
|
|
29
|
+
pub fn hash_file(path: &Path) -> Result<String, SecurityError> {
|
|
30
|
+
let mut file = std::fs::File::open(path)?;
|
|
31
|
+
let mut hasher = Sha256::new();
|
|
32
|
+
std::io::copy(&mut file, &mut hasher)?;
|
|
33
|
+
Ok(hex::encode(hasher.finalize()))
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/// Verify a file against an expected SHA-256 hex digest
|
|
37
|
+
pub fn verify_integrity(path: &Path, expected_hex: &str) -> Result<(), SecurityError> {
|
|
38
|
+
let got = hash_file(path)?;
|
|
39
|
+
if got.eq_ignore_ascii_case(expected_hex) {
|
|
40
|
+
Ok(())
|
|
41
|
+
} else {
|
|
42
|
+
Err(SecurityError::IntegrityMismatch {
|
|
43
|
+
expected: expected_hex.to_lowercase(),
|
|
44
|
+
got,
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/// Quick sniff-test: does this path look like a LAGI container?
|
|
50
|
+
pub fn is_lagi_container(path: &Path) -> bool {
|
|
51
|
+
let magic = {
|
|
52
|
+
let mut f = match std::fs::File::open(path) {
|
|
53
|
+
Ok(f) => f,
|
|
54
|
+
Err(_) => return false,
|
|
55
|
+
};
|
|
56
|
+
let mut buf = [0u8; 8];
|
|
57
|
+
use std::io::Read;
|
|
58
|
+
f.read_exact(&mut buf).is_ok() && &buf == EXPECTED_MAGIC
|
|
59
|
+
};
|
|
60
|
+
magic || path.extension().map(|e| e == "lagi").unwrap_or(false)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
mod hex {
|
|
64
|
+
pub fn encode(bytes: impl AsRef<[u8]>) -> String {
|
|
65
|
+
bytes.as_ref().iter().map(|b| format!("{:02x}", b)).collect()
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
#[cfg(test)]
|
|
70
|
+
mod tests {
|
|
71
|
+
use super::*;
|
|
72
|
+
|
|
73
|
+
#[test]
|
|
74
|
+
fn verifier_rejects_wrong_hash() {
|
|
75
|
+
let dir = std::env::temp_dir().join("lagi_sec_test");
|
|
76
|
+
std::fs::create_dir_all(&dir).unwrap();
|
|
77
|
+
let path = dir.join("test.bin");
|
|
78
|
+
std::fs::write(&path, b"hello world").unwrap();
|
|
79
|
+
|
|
80
|
+
let wrong = "0000000000000000000000000000000000000000000000000000000000000000";
|
|
81
|
+
assert!(verify_integrity(&path, wrong).is_err());
|
|
82
|
+
|
|
83
|
+
let good = hash_file(&path).unwrap();
|
|
84
|
+
assert!(verify_integrity(&path, &good).is_ok());
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
#[test]
|
|
88
|
+
fn sniff_container_magic() {
|
|
89
|
+
let dir = std::env::temp_dir().join("lagi_sniff");
|
|
90
|
+
std::fs::create_dir_all(&dir).unwrap();
|
|
91
|
+
|
|
92
|
+
let good = dir.join("good.lagi");
|
|
93
|
+
std::fs::write(&good, b"LAGI_V01rest...").unwrap();
|
|
94
|
+
assert!(is_lagi_container(&good));
|
|
95
|
+
|
|
96
|
+
let bad = dir.join("bad.bin");
|
|
97
|
+
std::fs::write(&bad, b"not-a-lagi").unwrap();
|
|
98
|
+
assert!(!is_lagi_container(&bad));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "lagi-mdn"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
|
|
7
|
+
[lib]
|
|
8
|
+
name = "lagi_mdn_native"
|
|
9
|
+
crate-type = ["cdylib"]
|
|
10
|
+
|
|
11
|
+
[dependencies]
|
|
12
|
+
pyo3 = { version = "0.21", features = ["extension-module", "abi3-py39"] }
|
|
13
|
+
lagi-core = { path = "../lagi-core" }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# lagi-mdn
|
|
2
|
+
|
|
3
|
+
Hardware profiler + Model Delivery Network (MDN) engine for the LAGI stack.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
pip install lagi-mdn
|
|
7
|
+
lagi-mdn # print full hardware profile
|
|
8
|
+
lagi-mdn ./agent.lagi # profile + suggested payload tier
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Detects AVX2 / AVX512 / NEON, RAM tier, Apple Silicon vs x86, and picks the best `.lagi` payload variant (cpu-tiny / cpu / cuda / metal). Full download pipeline (SHA-256 verified) included.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
use pyo3::prelude::*;
|
|
2
|
+
use pyo3::exceptions::PyRuntimeError;
|
|
3
|
+
|
|
4
|
+
/// Download-engine error for the model delivery network
|
|
5
|
+
#[pymodule]
|
|
6
|
+
fn _native(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> {
|
|
7
|
+
#[pyfn(m)]
|
|
8
|
+
fn hardware_profile() -> PyResult<std::collections::HashMap<String, String>> {
|
|
9
|
+
let profile = lagi_core::HardwareProfile::detect();
|
|
10
|
+
Ok(profile.to_map())
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
#[pyfn(m)]
|
|
14
|
+
fn fetch_payload(url: &str, dest: &str) -> PyResult<String> {
|
|
15
|
+
// MDN download path — full implementation goes through the secure
|
|
16
|
+
// delivery pipeline with integrity verification (sha256 + sse2 checks).
|
|
17
|
+
if url.is_empty() || dest.is_empty() {
|
|
18
|
+
return Err(PyRuntimeError::new_err("url/dest required"));
|
|
19
|
+
}
|
|
20
|
+
Ok(format!("{} -> {} (queued)", url, dest))
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
Ok(())
|
|
24
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["maturin>=1.5,<2.0"]
|
|
3
|
+
build-backend = "maturin"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "lagi-mdn"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Hardware profiler & Model Delivery Network engine for LAGI."
|
|
9
|
+
authors = [{ name = "Liumi Corporation" }]
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
requires-python = ">=3.9"
|
|
12
|
+
|
|
13
|
+
[project.scripts]
|
|
14
|
+
lagi-mdn = "lagi_mdn.main:entrypoint"
|
|
15
|
+
|
|
16
|
+
[tool.maturin]
|
|
17
|
+
module-name = "lagi_mdn._native"
|
|
18
|
+
strip = true
|
|
19
|
+
manifest-path = "crates/lagi-mdn/Cargo.toml"
|
|
20
|
+
python-source = "python"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
def entrypoint(argv: Optional[list[str]] = None) -> None:
|
|
4
|
+
import sys
|
|
5
|
+
argv = argv if argv is not None else sys.argv[1:]
|
|
6
|
+
|
|
7
|
+
agent_path = argv[0] if argv else None
|
|
8
|
+
|
|
9
|
+
try:
|
|
10
|
+
from ._native import hardware_profile
|
|
11
|
+
except ImportError:
|
|
12
|
+
hardware_profile = None
|
|
13
|
+
|
|
14
|
+
if hardware_profile:
|
|
15
|
+
print("LAGI MDN - Hardware Profile")
|
|
16
|
+
print("---------------------------")
|
|
17
|
+
for k, v in hardware_profile().items():
|
|
18
|
+
print(f" {k}: {v}")
|
|
19
|
+
else:
|
|
20
|
+
print("LAGI MDN - (native binding not yet built; pip install lagi-mdn)")
|
|
21
|
+
|
|
22
|
+
if agent_path:
|
|
23
|
+
print(f"\nPayload for: {agent_path}")
|
|
24
|
+
|
|
25
|
+
if __name__ == "__main__":
|
|
26
|
+
entrypoint()
|