mnemos-embedkit 0.1.0a1__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.
- mnemos_embedkit-0.1.0a1/.github/workflows/publish.yml +42 -0
- mnemos_embedkit-0.1.0a1/.gitignore +45 -0
- mnemos_embedkit-0.1.0a1/.gitlab-ci.yml +18 -0
- mnemos_embedkit-0.1.0a1/LICENSE +17 -0
- mnemos_embedkit-0.1.0a1/PKG-INFO +200 -0
- mnemos_embedkit-0.1.0a1/README.md +112 -0
- mnemos_embedkit-0.1.0a1/benches/results.md +243 -0
- mnemos_embedkit-0.1.0a1/benches/scripts/cix_inprocess_bench.py +135 -0
- mnemos_embedkit-0.1.0a1/benches/scripts/cix_npu_bench.py +217 -0
- mnemos_embedkit-0.1.0a1/docs/CIX-SKY1-NPU-STANDALONE-SETUP.md +157 -0
- mnemos_embedkit-0.1.0a1/docs/CODEX-ADAPTER-HANDOFF.md +211 -0
- mnemos_embedkit-0.1.0a1/docs/DESIGN.md +395 -0
- mnemos_embedkit-0.1.0a1/pyproject.toml +96 -0
- mnemos_embedkit-0.1.0a1/src/embedkit/__init__.py +16 -0
- mnemos_embedkit-0.1.0a1/src/embedkit/adapters/__init__.py +51 -0
- mnemos_embedkit-0.1.0a1/src/embedkit/adapters/base.py +70 -0
- mnemos_embedkit-0.1.0a1/src/embedkit/adapters/cpu_llamacpp.py +107 -0
- mnemos_embedkit-0.1.0a1/src/embedkit/adapters/gpu_apple_mlx.py +257 -0
- mnemos_embedkit-0.1.0a1/src/embedkit/adapters/gpu_nvidia_cuda.py +171 -0
- mnemos_embedkit-0.1.0a1/src/embedkit/adapters/npu_cix_zhouyi.py +356 -0
- mnemos_embedkit-0.1.0a1/src/embedkit/engine.py +120 -0
- mnemos_embedkit-0.1.0a1/src/embedkit/models/__init__.py +4 -0
- mnemos_embedkit-0.1.0a1/src/embedkit/models/registry.py +73 -0
- mnemos_embedkit-0.1.0a1/src/embedkit/pick.py +34 -0
- mnemos_embedkit-0.1.0a1/src/embedkit/shims/__init__.py +0 -0
- mnemos_embedkit-0.1.0a1/tests/__init__.py +0 -0
- mnemos_embedkit-0.1.0a1/tests/test_cpu_llamacpp.py +58 -0
- mnemos_embedkit-0.1.0a1/tests/test_gpu_apple_mlx.py +52 -0
- mnemos_embedkit-0.1.0a1/tests/test_gpu_nvidia_cuda.py +68 -0
- mnemos_embedkit-0.1.0a1/tests/test_npu_cix_zhouyi.py +66 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Publish mnemos-embedkit to PyPI via Trusted Publishing (OIDC — no API token).
|
|
2
|
+
# PyPI pending-publisher must be configured as:
|
|
3
|
+
# owner: ncz-os | repo: mnemos-embedkit | workflow: publish.yml | environment: pypi
|
|
4
|
+
name: publish
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
release:
|
|
8
|
+
types: [published]
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
permissions: {}
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
build:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
- uses: actions/setup-python@v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: "3.12"
|
|
21
|
+
- name: Build sdist + wheel
|
|
22
|
+
run: |
|
|
23
|
+
python -m pip install --upgrade build twine
|
|
24
|
+
python -m build
|
|
25
|
+
python -m twine check dist/*
|
|
26
|
+
- uses: actions/upload-artifact@v4
|
|
27
|
+
with:
|
|
28
|
+
name: dist
|
|
29
|
+
path: dist/
|
|
30
|
+
|
|
31
|
+
publish:
|
|
32
|
+
needs: build
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
environment: pypi
|
|
35
|
+
permissions:
|
|
36
|
+
id-token: write # OIDC token for PyPI Trusted Publishing
|
|
37
|
+
steps:
|
|
38
|
+
- uses: actions/download-artifact@v4
|
|
39
|
+
with:
|
|
40
|
+
name: dist
|
|
41
|
+
path: dist/
|
|
42
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Build artifacts
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
*.egg-info/
|
|
7
|
+
build/
|
|
8
|
+
dist/
|
|
9
|
+
.eggs/
|
|
10
|
+
*.whl
|
|
11
|
+
|
|
12
|
+
# Environments
|
|
13
|
+
.venv/
|
|
14
|
+
venv/
|
|
15
|
+
.env
|
|
16
|
+
|
|
17
|
+
# Bench artifacts (raw JSONL kept out of git; summaries land in benches/results.md)
|
|
18
|
+
benches/results/*.jsonl
|
|
19
|
+
benches/results/*.log
|
|
20
|
+
benches/corpora/*.json
|
|
21
|
+
|
|
22
|
+
# Models — never commit
|
|
23
|
+
*.gguf
|
|
24
|
+
*.cix
|
|
25
|
+
*.onnx
|
|
26
|
+
*.safetensors
|
|
27
|
+
*.rknn
|
|
28
|
+
*.xdna
|
|
29
|
+
benches/models/
|
|
30
|
+
|
|
31
|
+
# Tooling
|
|
32
|
+
.pytest_cache/
|
|
33
|
+
.ruff_cache/
|
|
34
|
+
.mypy_cache/
|
|
35
|
+
.coverage
|
|
36
|
+
htmlcov/
|
|
37
|
+
|
|
38
|
+
# OS
|
|
39
|
+
.DS_Store
|
|
40
|
+
Thumbs.db
|
|
41
|
+
|
|
42
|
+
# IDE
|
|
43
|
+
.vscode/
|
|
44
|
+
.idea/
|
|
45
|
+
*.swp
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# GitLab CI — Python "real errors" gate (ruff, high-signal rules only).
|
|
2
|
+
# GitLab SaaS shared runners (free OSS minutes), no fleet CPU. Catches syntax
|
|
3
|
+
# errors + undefined names (E9,F63,F7,F82); stylistic/style-of-imports rules
|
|
4
|
+
# (E402/E501, unused imports) are intentionally NOT gated here — tighten per repo
|
|
5
|
+
# later. Buildkite (ncz-os, hosted) owns heavy/native builds + release artifacts.
|
|
6
|
+
stages:
|
|
7
|
+
- check
|
|
8
|
+
|
|
9
|
+
ruff:
|
|
10
|
+
stage: check
|
|
11
|
+
image: python:3.12-slim
|
|
12
|
+
before_script:
|
|
13
|
+
- pip install --quiet ruff
|
|
14
|
+
script:
|
|
15
|
+
- ruff check --select E9,F63,F7,F82 --output-format=concise .
|
|
16
|
+
rules:
|
|
17
|
+
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
|
18
|
+
- if: '$CI_PIPELINE_SOURCE == "push"'
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2026 Jason Perlow
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License.
|
|
9
|
+
You may obtain a copy of the License at
|
|
10
|
+
|
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
See the License for the specific language governing permissions and
|
|
17
|
+
limitations under the License.
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mnemos-embedkit
|
|
3
|
+
Version: 0.1.0a1
|
|
4
|
+
Summary: Open embedding devkit — same API across NPU / GPU / CPU silicon (Cix, NVIDIA, AMD, Intel, Apple, Rockchip, MediaTek)
|
|
5
|
+
Project-URL: Homepage, https://github.com/ncz-os/mnemos-embedkit
|
|
6
|
+
Project-URL: Repository, https://github.com/ncz-os/mnemos-embedkit
|
|
7
|
+
Project-URL: Issues, https://github.com/ncz-os/mnemos-embedkit/issues
|
|
8
|
+
Author-email: Jason Perlow <jperlow@gmail.com>
|
|
9
|
+
License-Expression: Apache-2.0
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
12
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
|
+
Classifier: Operating System :: MacOS
|
|
14
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
15
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
20
|
+
Requires-Python: >=3.11
|
|
21
|
+
Requires-Dist: numpy>=1.26
|
|
22
|
+
Requires-Dist: transformers>=4.40
|
|
23
|
+
Provides-Extra: all
|
|
24
|
+
Requires-Dist: llama-cpp-python>=0.3; extra == 'all'
|
|
25
|
+
Requires-Dist: mlx-lm>=0.18; extra == 'all'
|
|
26
|
+
Requires-Dist: mlx>=0.19; extra == 'all'
|
|
27
|
+
Requires-Dist: onnxruntime-gpu>=1.18; extra == 'all'
|
|
28
|
+
Requires-Dist: onnxruntime-rocm>=1.18; extra == 'all'
|
|
29
|
+
Requires-Dist: onnxruntime-vitisai>=1.18; extra == 'all'
|
|
30
|
+
Requires-Dist: openvino>=2026.0; extra == 'all'
|
|
31
|
+
Requires-Dist: rknn-toolkit2>=2.0; extra == 'all'
|
|
32
|
+
Requires-Dist: sentence-transformers>=3.0; extra == 'all'
|
|
33
|
+
Provides-Extra: all-apple
|
|
34
|
+
Requires-Dist: llama-cpp-python>=0.3; extra == 'all-apple'
|
|
35
|
+
Requires-Dist: mlx-lm>=0.18; extra == 'all-apple'
|
|
36
|
+
Requires-Dist: mlx>=0.19; extra == 'all-apple'
|
|
37
|
+
Requires-Dist: sentence-transformers>=3.0; extra == 'all-apple'
|
|
38
|
+
Provides-Extra: all-arm-cix
|
|
39
|
+
Requires-Dist: llama-cpp-python>=0.3; extra == 'all-arm-cix'
|
|
40
|
+
Provides-Extra: all-arm-rockchip
|
|
41
|
+
Requires-Dist: llama-cpp-python>=0.3; extra == 'all-arm-rockchip'
|
|
42
|
+
Requires-Dist: rknn-toolkit2>=2.0; extra == 'all-arm-rockchip'
|
|
43
|
+
Provides-Extra: all-cpu
|
|
44
|
+
Requires-Dist: llama-cpp-python>=0.3; extra == 'all-cpu'
|
|
45
|
+
Requires-Dist: sentence-transformers>=3.0; extra == 'all-cpu'
|
|
46
|
+
Provides-Extra: all-x86-cuda
|
|
47
|
+
Requires-Dist: llama-cpp-python>=0.3; extra == 'all-x86-cuda'
|
|
48
|
+
Requires-Dist: onnxruntime-gpu>=1.18; extra == 'all-x86-cuda'
|
|
49
|
+
Provides-Extra: all-x86-intel
|
|
50
|
+
Requires-Dist: llama-cpp-python>=0.3; extra == 'all-x86-intel'
|
|
51
|
+
Requires-Dist: openvino>=2026.0; extra == 'all-x86-intel'
|
|
52
|
+
Provides-Extra: all-x86-rocm
|
|
53
|
+
Requires-Dist: llama-cpp-python>=0.3; extra == 'all-x86-rocm'
|
|
54
|
+
Requires-Dist: onnxruntime-rocm>=1.18; extra == 'all-x86-rocm'
|
|
55
|
+
Requires-Dist: onnxruntime-vitisai>=1.18; extra == 'all-x86-rocm'
|
|
56
|
+
Provides-Extra: cpu-llamacpp
|
|
57
|
+
Requires-Dist: llama-cpp-python>=0.3; extra == 'cpu-llamacpp'
|
|
58
|
+
Provides-Extra: cpu-sbert
|
|
59
|
+
Requires-Dist: sentence-transformers>=3.0; extra == 'cpu-sbert'
|
|
60
|
+
Provides-Extra: dev
|
|
61
|
+
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
62
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
63
|
+
Requires-Dist: ruff>=0.6; extra == 'dev'
|
|
64
|
+
Provides-Extra: gpu-amd-rocm
|
|
65
|
+
Requires-Dist: onnxruntime-rocm>=1.18; extra == 'gpu-amd-rocm'
|
|
66
|
+
Provides-Extra: gpu-apple-mlx
|
|
67
|
+
Requires-Dist: mlx-lm>=0.18; extra == 'gpu-apple-mlx'
|
|
68
|
+
Requires-Dist: mlx>=0.19; extra == 'gpu-apple-mlx'
|
|
69
|
+
Provides-Extra: gpu-intel-igpu
|
|
70
|
+
Requires-Dist: openvino>=2026.0; extra == 'gpu-intel-igpu'
|
|
71
|
+
Provides-Extra: gpu-nvidia-cuda
|
|
72
|
+
Requires-Dist: onnxruntime-gpu>=1.18; extra == 'gpu-nvidia-cuda'
|
|
73
|
+
Provides-Extra: gpu-nvidia-trt
|
|
74
|
+
Requires-Dist: onnxruntime-gpu>=1.18; extra == 'gpu-nvidia-trt'
|
|
75
|
+
Requires-Dist: tensorrt>=10.0; extra == 'gpu-nvidia-trt'
|
|
76
|
+
Provides-Extra: gpu-vulkan
|
|
77
|
+
Requires-Dist: llama-cpp-python>=0.3; extra == 'gpu-vulkan'
|
|
78
|
+
Provides-Extra: npu-amd-xdna
|
|
79
|
+
Requires-Dist: onnxruntime-vitisai>=1.18; extra == 'npu-amd-xdna'
|
|
80
|
+
Provides-Extra: npu-cix
|
|
81
|
+
Provides-Extra: npu-intel
|
|
82
|
+
Requires-Dist: openvino>=2026.0; extra == 'npu-intel'
|
|
83
|
+
Provides-Extra: npu-mediatek-apu
|
|
84
|
+
Requires-Dist: mtk-genio-apu>=0.1; extra == 'npu-mediatek-apu'
|
|
85
|
+
Provides-Extra: npu-rockchip
|
|
86
|
+
Requires-Dist: rknn-toolkit2>=2.0; extra == 'npu-rockchip'
|
|
87
|
+
Description-Content-Type: text/markdown
|
|
88
|
+
|
|
89
|
+
> # 📍 Moved to GitLab
|
|
90
|
+
> **The canonical, authoritative home of this project is GitLab — always:**
|
|
91
|
+
> ## 👉 https://gitlab.com/ncz-os/mnemos-embedkit
|
|
92
|
+
>
|
|
93
|
+
> This GitHub repository is a **frozen, read-only mirror**. All development, issues, and releases happen on GitLab. Please open issues and merge requests there. The full history of this stub is preserved on GitLab.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
# mnemos-embedkit
|
|
98
|
+
|
|
99
|
+
> Open embedding devkit. Same API, every silicon.
|
|
100
|
+
|
|
101
|
+
`embedkit` lets you embed text once and run it on whatever hardware your box has — Cix Sky1 NPU, Apple Silicon Metal/MLX, NVIDIA CUDA/TensorRT, AMD ROCm/XDNA, Intel iGPU/NPU via OpenVINO, MediaTek APU, Rockchip RKNN, or just the CPU. The kit detects what's installed and picks the fastest adapter at runtime. **No vendor preference.**
|
|
102
|
+
|
|
103
|
+
## Quick start
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
import embedkit
|
|
107
|
+
|
|
108
|
+
eng = embedkit.Engine.auto() # picks the fastest adapter on this host
|
|
109
|
+
vec = eng.embed("Hello world") # -> List[float]
|
|
110
|
+
vecs = eng.embed_batch(["a", "b", "c"]) # -> List[List[float]]
|
|
111
|
+
|
|
112
|
+
eng.info()
|
|
113
|
+
# {"adapter": "cix-npu", "model": "bge-small-zh-v1.5_256.cix",
|
|
114
|
+
# "embed_dim": 512, "max_tokens": 256, "throughput_baseline": 55.0}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Explicit adapter pick:
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
eng = embedkit.Engine(adapter="cix-npu", model="bge-small-zh-v1.5")
|
|
121
|
+
eng = embedkit.Engine(adapter="nvidia-cuda", model="nomic-embed-text-v1.5")
|
|
122
|
+
eng = embedkit.Engine(adapter="amd-rocm", model="bge-large-en-v1.5")
|
|
123
|
+
eng = embedkit.Engine(adapter="apple-mlx", model="mxbai-embed-large-v1")
|
|
124
|
+
eng = embedkit.Engine(adapter="cpu-llamacpp", model="bge-small-zh-v1.5")
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## What the kit is
|
|
128
|
+
|
|
129
|
+
A pure-Python adapter layer over vendor-specific embedding runtimes, plus a uniform `Engine.embed*` API and a canonical bench harness. **The kit does not bundle drivers or kernel modules.** It detects what the host OS already provides and binds to it:
|
|
130
|
+
|
|
131
|
+
| Host has | Kit picks via |
|
|
132
|
+
|---|---|
|
|
133
|
+
| `cix-noe-umd 2.0.2` + `libnoe` (NCZ Magnetar / cixtech apt) | `npu-cix` adapter |
|
|
134
|
+
| `onnxruntime-gpu` (CUDA driver from Linux distro) | `nvidia-cuda` adapter |
|
|
135
|
+
| `tensorrt` python (NVIDIA tar/apt) | `nvidia-trt` adapter |
|
|
136
|
+
| `onnxruntime-rocm` (AMD ROCm dkms) | `amd-rocm` adapter |
|
|
137
|
+
| `onnxruntime-vitisai` (XDNA driver) | `amd-xdna` adapter |
|
|
138
|
+
| `openvino` (Intel CPU/iGPU/NPU) | `intel-igpu` / `intel-npu` adapter |
|
|
139
|
+
| `mlx` (Apple Silicon, macOS only) | `apple-mlx` adapter |
|
|
140
|
+
| llama-cpp-python with Metal | `cpu-llamacpp` adapter (auto-detects Metal at runtime) |
|
|
141
|
+
| llama-cpp-python with `-DGGML_VULKAN=1` | `gpu-vulkan` adapter |
|
|
142
|
+
| `rknn-toolkit2` (Rockchip RK3588 / RK3576) | `rockchip-rknn` adapter |
|
|
143
|
+
| `mtk-genio-apu` (MediaTek Genio) | `mediatek-apu` adapter |
|
|
144
|
+
| nothing else | `cpu-llamacpp` (CPU baseline, ships GGUF) |
|
|
145
|
+
|
|
146
|
+
## Install
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
# Pick the form-factor bundle that matches your host:
|
|
150
|
+
pip install embedkit[all-cpu] # baseline, CPU only
|
|
151
|
+
pip install embedkit[all-x86-cuda] # CPU + NVIDIA CUDA
|
|
152
|
+
pip install embedkit[all-x86-rocm] # CPU + AMD ROCm + XDNA
|
|
153
|
+
pip install embedkit[all-x86-intel] # CPU + Intel iGPU + NPU via OpenVINO
|
|
154
|
+
pip install embedkit[all-arm-cix] # CPU + Cix NPU + Mali Vulkan
|
|
155
|
+
pip install embedkit[all-arm-rockchip] # CPU + Rockchip RKNN + Mali Vulkan
|
|
156
|
+
pip install embedkit[all-apple] # CPU + Apple MLX + Metal
|
|
157
|
+
pip install embedkit[all] # everything
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
The kit pulls vendor *python bindings* from PyPI. Vendor *drivers* are managed by your OS package manager (cix-noe-umd via apt, nvidia-driver via ubuntu-drivers, rocm-dkms via amdgpu-install, intel-npu-driver via apt, etc.).
|
|
161
|
+
|
|
162
|
+
## Reference bench
|
|
163
|
+
|
|
164
|
+
The canonical multi-platform bench is in `benches/`. Run on your host:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
embedkit-bench --corpus benches/corpora/mnemos-8038.json --engines auto
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
See `benches/results.md` for the cross-platform numbers we have today (Cix Sky1 NPU, Apple Silicon Metal, NVIDIA CUDA, x86 + ARM CPU, Pi 5, Pi 4).
|
|
171
|
+
|
|
172
|
+
## Reference implementation consumer
|
|
173
|
+
|
|
174
|
+
`ncz-os/mnemos` (the canonical MNEMOS memory layer) is the reference embedkit consumer. The plan is to migrate MNEMOS's embedding helper to call `embedkit.Engine(...)` directly. See `docs/mnemos-integration.md`.
|
|
175
|
+
|
|
176
|
+
## License
|
|
177
|
+
|
|
178
|
+
Apache-2.0.
|
|
179
|
+
|
|
180
|
+
## Status
|
|
181
|
+
|
|
182
|
+
**Bootstrap.** Design + cross-platform bench data exist. Adapter implementations are queued (Codex handoff prompt at `docs/CODEX-ADAPTER-HANDOFF.md`).
|
|
183
|
+
|
|
184
|
+
See `docs/DESIGN.md` for the full architecture.
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
## Build infrastructure & partners
|
|
188
|
+
|
|
189
|
+
Continuous integration and package distribution for this project are generously
|
|
190
|
+
supported by our open-source infrastructure partners:
|
|
191
|
+
|
|
192
|
+
- **[GitLab](https://gitlab.com/)** — canonical source hosting and CI pipelines
|
|
193
|
+
(format / lint / test gates), via the
|
|
194
|
+
[GitLab for Open Source](https://about.gitlab.com/solutions/open-source/) program.
|
|
195
|
+
- **[Buildkite](https://buildkite.com/)** — CI/CD orchestration with hosted macOS
|
|
196
|
+
and Linux agents, and our APT package registry host
|
|
197
|
+
(`packages.buildkite.com/ncz-os/ncz`), via the
|
|
198
|
+
[Buildkite Open Source](https://buildkite.com/pricing) program.
|
|
199
|
+
|
|
200
|
+
Thank you to both for backing open-source software.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
> # 📍 Moved to GitLab
|
|
2
|
+
> **The canonical, authoritative home of this project is GitLab — always:**
|
|
3
|
+
> ## 👉 https://gitlab.com/ncz-os/mnemos-embedkit
|
|
4
|
+
>
|
|
5
|
+
> This GitHub repository is a **frozen, read-only mirror**. All development, issues, and releases happen on GitLab. Please open issues and merge requests there. The full history of this stub is preserved on GitLab.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# mnemos-embedkit
|
|
10
|
+
|
|
11
|
+
> Open embedding devkit. Same API, every silicon.
|
|
12
|
+
|
|
13
|
+
`embedkit` lets you embed text once and run it on whatever hardware your box has — Cix Sky1 NPU, Apple Silicon Metal/MLX, NVIDIA CUDA/TensorRT, AMD ROCm/XDNA, Intel iGPU/NPU via OpenVINO, MediaTek APU, Rockchip RKNN, or just the CPU. The kit detects what's installed and picks the fastest adapter at runtime. **No vendor preference.**
|
|
14
|
+
|
|
15
|
+
## Quick start
|
|
16
|
+
|
|
17
|
+
```python
|
|
18
|
+
import embedkit
|
|
19
|
+
|
|
20
|
+
eng = embedkit.Engine.auto() # picks the fastest adapter on this host
|
|
21
|
+
vec = eng.embed("Hello world") # -> List[float]
|
|
22
|
+
vecs = eng.embed_batch(["a", "b", "c"]) # -> List[List[float]]
|
|
23
|
+
|
|
24
|
+
eng.info()
|
|
25
|
+
# {"adapter": "cix-npu", "model": "bge-small-zh-v1.5_256.cix",
|
|
26
|
+
# "embed_dim": 512, "max_tokens": 256, "throughput_baseline": 55.0}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Explicit adapter pick:
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
eng = embedkit.Engine(adapter="cix-npu", model="bge-small-zh-v1.5")
|
|
33
|
+
eng = embedkit.Engine(adapter="nvidia-cuda", model="nomic-embed-text-v1.5")
|
|
34
|
+
eng = embedkit.Engine(adapter="amd-rocm", model="bge-large-en-v1.5")
|
|
35
|
+
eng = embedkit.Engine(adapter="apple-mlx", model="mxbai-embed-large-v1")
|
|
36
|
+
eng = embedkit.Engine(adapter="cpu-llamacpp", model="bge-small-zh-v1.5")
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## What the kit is
|
|
40
|
+
|
|
41
|
+
A pure-Python adapter layer over vendor-specific embedding runtimes, plus a uniform `Engine.embed*` API and a canonical bench harness. **The kit does not bundle drivers or kernel modules.** It detects what the host OS already provides and binds to it:
|
|
42
|
+
|
|
43
|
+
| Host has | Kit picks via |
|
|
44
|
+
|---|---|
|
|
45
|
+
| `cix-noe-umd 2.0.2` + `libnoe` (NCZ Magnetar / cixtech apt) | `npu-cix` adapter |
|
|
46
|
+
| `onnxruntime-gpu` (CUDA driver from Linux distro) | `nvidia-cuda` adapter |
|
|
47
|
+
| `tensorrt` python (NVIDIA tar/apt) | `nvidia-trt` adapter |
|
|
48
|
+
| `onnxruntime-rocm` (AMD ROCm dkms) | `amd-rocm` adapter |
|
|
49
|
+
| `onnxruntime-vitisai` (XDNA driver) | `amd-xdna` adapter |
|
|
50
|
+
| `openvino` (Intel CPU/iGPU/NPU) | `intel-igpu` / `intel-npu` adapter |
|
|
51
|
+
| `mlx` (Apple Silicon, macOS only) | `apple-mlx` adapter |
|
|
52
|
+
| llama-cpp-python with Metal | `cpu-llamacpp` adapter (auto-detects Metal at runtime) |
|
|
53
|
+
| llama-cpp-python with `-DGGML_VULKAN=1` | `gpu-vulkan` adapter |
|
|
54
|
+
| `rknn-toolkit2` (Rockchip RK3588 / RK3576) | `rockchip-rknn` adapter |
|
|
55
|
+
| `mtk-genio-apu` (MediaTek Genio) | `mediatek-apu` adapter |
|
|
56
|
+
| nothing else | `cpu-llamacpp` (CPU baseline, ships GGUF) |
|
|
57
|
+
|
|
58
|
+
## Install
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# Pick the form-factor bundle that matches your host:
|
|
62
|
+
pip install embedkit[all-cpu] # baseline, CPU only
|
|
63
|
+
pip install embedkit[all-x86-cuda] # CPU + NVIDIA CUDA
|
|
64
|
+
pip install embedkit[all-x86-rocm] # CPU + AMD ROCm + XDNA
|
|
65
|
+
pip install embedkit[all-x86-intel] # CPU + Intel iGPU + NPU via OpenVINO
|
|
66
|
+
pip install embedkit[all-arm-cix] # CPU + Cix NPU + Mali Vulkan
|
|
67
|
+
pip install embedkit[all-arm-rockchip] # CPU + Rockchip RKNN + Mali Vulkan
|
|
68
|
+
pip install embedkit[all-apple] # CPU + Apple MLX + Metal
|
|
69
|
+
pip install embedkit[all] # everything
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The kit pulls vendor *python bindings* from PyPI. Vendor *drivers* are managed by your OS package manager (cix-noe-umd via apt, nvidia-driver via ubuntu-drivers, rocm-dkms via amdgpu-install, intel-npu-driver via apt, etc.).
|
|
73
|
+
|
|
74
|
+
## Reference bench
|
|
75
|
+
|
|
76
|
+
The canonical multi-platform bench is in `benches/`. Run on your host:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
embedkit-bench --corpus benches/corpora/mnemos-8038.json --engines auto
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
See `benches/results.md` for the cross-platform numbers we have today (Cix Sky1 NPU, Apple Silicon Metal, NVIDIA CUDA, x86 + ARM CPU, Pi 5, Pi 4).
|
|
83
|
+
|
|
84
|
+
## Reference implementation consumer
|
|
85
|
+
|
|
86
|
+
`ncz-os/mnemos` (the canonical MNEMOS memory layer) is the reference embedkit consumer. The plan is to migrate MNEMOS's embedding helper to call `embedkit.Engine(...)` directly. See `docs/mnemos-integration.md`.
|
|
87
|
+
|
|
88
|
+
## License
|
|
89
|
+
|
|
90
|
+
Apache-2.0.
|
|
91
|
+
|
|
92
|
+
## Status
|
|
93
|
+
|
|
94
|
+
**Bootstrap.** Design + cross-platform bench data exist. Adapter implementations are queued (Codex handoff prompt at `docs/CODEX-ADAPTER-HANDOFF.md`).
|
|
95
|
+
|
|
96
|
+
See `docs/DESIGN.md` for the full architecture.
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
## Build infrastructure & partners
|
|
100
|
+
|
|
101
|
+
Continuous integration and package distribution for this project are generously
|
|
102
|
+
supported by our open-source infrastructure partners:
|
|
103
|
+
|
|
104
|
+
- **[GitLab](https://gitlab.com/)** — canonical source hosting and CI pipelines
|
|
105
|
+
(format / lint / test gates), via the
|
|
106
|
+
[GitLab for Open Source](https://about.gitlab.com/solutions/open-source/) program.
|
|
107
|
+
- **[Buildkite](https://buildkite.com/)** — CI/CD orchestration with hosted macOS
|
|
108
|
+
and Linux agents, and our APT package registry host
|
|
109
|
+
(`packages.buildkite.com/ncz-os/ncz`), via the
|
|
110
|
+
[Buildkite Open Source](https://buildkite.com/pricing) program.
|
|
111
|
+
|
|
112
|
+
Thank you to both for backing open-source software.
|