delphi-code 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.
- delphi_code-0.1.0/LICENSE +201 -0
- delphi_code-0.1.0/PKG-INFO +234 -0
- delphi_code-0.1.0/README.md +205 -0
- delphi_code-0.1.0/THIRD_PARTY_NOTICES.md +18 -0
- delphi_code-0.1.0/delphi_code/__init__.py +22 -0
- delphi_code-0.1.0/delphi_code/__main__.py +3 -0
- delphi_code-0.1.0/delphi_code/cli.py +282 -0
- delphi_code-0.1.0/delphi_code/download.py +26 -0
- delphi_code-0.1.0/delphi_code/files.py +64 -0
- delphi_code-0.1.0/delphi_code/indexing.py +78 -0
- delphi_code-0.1.0/delphi_code/model.py +64 -0
- delphi_code-0.1.0/delphi_code/model_provenance.json +20 -0
- delphi_code-0.1.0/delphi_code/paths.py +18 -0
- delphi_code-0.1.0/delphi_code/setup.py +93 -0
- delphi_code-0.1.0/delphi_code.egg-info/PKG-INFO +234 -0
- delphi_code-0.1.0/delphi_code.egg-info/SOURCES.txt +25 -0
- delphi_code-0.1.0/delphi_code.egg-info/dependency_links.txt +1 -0
- delphi_code-0.1.0/delphi_code.egg-info/entry_points.txt +2 -0
- delphi_code-0.1.0/delphi_code.egg-info/requires.txt +6 -0
- delphi_code-0.1.0/delphi_code.egg-info/top_level.txt +1 -0
- delphi_code-0.1.0/pyproject.toml +45 -0
- delphi_code-0.1.0/setup.cfg +4 -0
- delphi_code-0.1.0/tests/test_cross_project.py +91 -0
- delphi_code-0.1.0/tests/test_index_directory.py +36 -0
- delphi_code-0.1.0/tests/test_model_defaults.py +20 -0
- delphi_code-0.1.0/tests/test_project_names.py +54 -0
- delphi_code-0.1.0/tests/test_setup.py +110 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: delphi-code
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Offline local code search for agents
|
|
5
|
+
Author: Mark Dorofeev
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Repository, https://github.com/DorofeevMark/delphi-code
|
|
8
|
+
Project-URL: Issues, https://github.com/DorofeevMark/delphi-code/issues
|
|
9
|
+
Keywords: code-search,semantic-search,embeddings,offline,cli,agents
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Operating System :: MacOS
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Topic :: Software Development
|
|
17
|
+
Classifier: Topic :: Text Processing :: Indexing
|
|
18
|
+
Requires-Python: >=3.12
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
License-File: THIRD_PARTY_NOTICES.md
|
|
22
|
+
Requires-Dist: cocoindex==1.0.24
|
|
23
|
+
Requires-Dist: sqlite-vec==0.1.9
|
|
24
|
+
Requires-Dist: sentence-transformers==6.1.0
|
|
25
|
+
Requires-Dist: numpy==2.5.3
|
|
26
|
+
Requires-Dist: pathspec==0.12.1
|
|
27
|
+
Requires-Dist: certifi
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
|
|
30
|
+
# Delphi Code
|
|
31
|
+
|
|
32
|
+
Offline semantic code search for agents. Delphi Code is a small Python CLI that indexes local source trees with a local embedding model and answers natural-language queries with JSON. It runs one command at a time, with no daemon, server, account, cloud embedding provider, or runtime downloads.
|
|
33
|
+
|
|
34
|
+
## Quick start
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
uv tool install --python 3.12 --managed-python delphi-code
|
|
38
|
+
delphi-code setup
|
|
39
|
+
delphi-code index -p /absolute/path/to/project
|
|
40
|
+
delphi-code search 'where are user passwords checked?'
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`setup` downloads and verifies the pinned embedding model once. After that, every command runs fully offline. Without `-p`, `search` looks through every indexed project.
|
|
44
|
+
|
|
45
|
+
## Requirements
|
|
46
|
+
|
|
47
|
+
- macOS 14 or later on arm64 (the tested target). Linux has not yet been verified; Windows is not supported by the current file locking implementation.
|
|
48
|
+
- CPython 3.12 with SQLite loadable extensions. Some python.org macOS builds disable that feature; `--managed-python` makes uv use its own Python build, which supports it. `doctor` reports this explicitly.
|
|
49
|
+
- CPU inference; no GPU is needed.
|
|
50
|
+
|
|
51
|
+
## Installation
|
|
52
|
+
|
|
53
|
+
From PyPI, as in the quick start:
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
uv tool install --python 3.12 --managed-python delphi-code
|
|
57
|
+
delphi-code setup
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
From a checkout, with uv:
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
uv tool install --python 3.12 --managed-python /absolute/path/to/delphi-code
|
|
64
|
+
delphi-code setup
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
From a checkout, with the pinned dependency versions and a Python 3.12 build that supports SQLite extensions:
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
python3.12 -m venv .venv
|
|
71
|
+
.venv/bin/python -m pip install -r requirements-lock.txt
|
|
72
|
+
.venv/bin/python -m pip install --no-deps --no-build-isolation .
|
|
73
|
+
.venv/bin/delphi-code setup
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
`requirements-lock.txt` records the tested macOS environment, not a cross-platform lock.
|
|
77
|
+
|
|
78
|
+
### Model setup
|
|
79
|
+
|
|
80
|
+
`setup` downloads the pinned [all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) revision in a separate process. It validates every file against bundled SHA-256 hashes and runs local embedding, SQLite, and native-storage diagnostics before moving the model into place.
|
|
81
|
+
|
|
82
|
+
- Running `setup` again verifies and reuses valid assets.
|
|
83
|
+
- Concurrent setup for the same destination fails clearly.
|
|
84
|
+
- Failed downloads or diagnostics never leave a partial model behind; invalid existing models are preserved with recovery instructions.
|
|
85
|
+
- `setup --model /absolute/path` or `DELPHI_CODE_MODEL` selects a different destination.
|
|
86
|
+
|
|
87
|
+
For an offline installation, install dependencies from a wheelhouse prepared for the target platform, then import a complete prepared MiniLM directory, including its license and model card:
|
|
88
|
+
|
|
89
|
+
```sh
|
|
90
|
+
delphi-code setup --from /absolute/path/to/all-MiniLM-L6-v2
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
`setup` provisions the pinned MiniLM model only. Other models can be used at runtime through `--model` or `DELPHI_CODE_MODEL` (see Models below). `index`, `search`, `status`, and `doctor` never download anything.
|
|
94
|
+
|
|
95
|
+
## Commands
|
|
96
|
+
|
|
97
|
+
```sh
|
|
98
|
+
delphi-code doctor -p /path/to/project
|
|
99
|
+
delphi-code index -p /path/to/project
|
|
100
|
+
delphi-code search -p /path/to/project 'where are user passwords checked?'
|
|
101
|
+
delphi-code search -p /path/to/project 'parse configuration' --language python --path 'src/*' --limit 5
|
|
102
|
+
delphi-code status -p /path/to/project
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
- **`index`** builds or incrementally updates a project's index.
|
|
106
|
+
- **`search`** runs a natural-language query. Without `-p`, it searches every stored index.
|
|
107
|
+
- **`status`** reports stored index state. It needs no model and does not rescan source files to detect staleness.
|
|
108
|
+
- **`doctor`** checks the model, SQLite extensions, and native storage, then runs a real local embedding and vector distance calculation.
|
|
109
|
+
- **`setup`** provisions the model (see above).
|
|
110
|
+
|
|
111
|
+
`python -m delphi_code` works as an alternative to the `delphi-code` executable.
|
|
112
|
+
|
|
113
|
+
### Selecting a project
|
|
114
|
+
|
|
115
|
+
- `--project` / `-p` accepts a path, resolved relative to the current working directory. The project root is explicit; it is not inferred from Git.
|
|
116
|
+
- After a project has been indexed once, its folder name works too, for example `delphi-code search -p myapp 'parse config'`. A bare name selects the uniquely matching indexed project; duplicate names produce an error listing their paths. Use `./name` or an absolute path to select a directory explicitly.
|
|
117
|
+
- Without `--project`, `search` searches all stored indexes; other commands use the current directory.
|
|
118
|
+
|
|
119
|
+
### Searching across projects
|
|
120
|
+
|
|
121
|
+
Cross-project search returns a single globally ranked list, with the full `project` path on each result. The query is embedded once, `--limit` applies to the combined list, and path/language filters apply within every index. All indexes must be readable, complete, and built with the selected model: a busy, broken, or incompatible index produces an error rather than silently partial results. Use `-p` to narrow the search when needed.
|
|
122
|
+
|
|
123
|
+
## Output
|
|
124
|
+
|
|
125
|
+
Each command writes one JSON object to stdout with `schema_version`, `ok`, `command`, and either `data` or `error`. Progress and library diagnostics go to stderr; argument help is plain text.
|
|
126
|
+
|
|
127
|
+
```json
|
|
128
|
+
{
|
|
129
|
+
"command": "search",
|
|
130
|
+
"ok": true,
|
|
131
|
+
"schema_version": 1,
|
|
132
|
+
"data": {
|
|
133
|
+
"project": "/Users/me/src/delphi-code",
|
|
134
|
+
"index_directory": "/Users/me/Library/Application Support/delphi-code/indexes/3a3565ee…",
|
|
135
|
+
"query": "where is the model checksum verified?",
|
|
136
|
+
"results": [
|
|
137
|
+
{
|
|
138
|
+
"path": "delphi_code/setup.py",
|
|
139
|
+
"language": "python",
|
|
140
|
+
"start_line": 17,
|
|
141
|
+
"end_line": 31,
|
|
142
|
+
"distance": 1.1042553186416626,
|
|
143
|
+
"score": 0.3903100956258001,
|
|
144
|
+
"text": "def verify_assets(root):\n manifest = json.loads(…"
|
|
145
|
+
}
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Search results contain project-relative paths, language, inclusive 1-based line ranges, the original chunk text, Euclidean distance, and cosine similarity score. Lower distance and higher score mean closer matches; scores are not probabilities. Equal distances use stable path/line/id ordering.
|
|
152
|
+
|
|
153
|
+
| Exit code | Meaning |
|
|
154
|
+
|---|---|
|
|
155
|
+
| 0 | Success, including a search with no matches |
|
|
156
|
+
| 2 | Invalid arguments or project |
|
|
157
|
+
| 3 | Missing or incompatible model or runtime assets |
|
|
158
|
+
| 4 | Missing, incomplete, or incompatible index |
|
|
159
|
+
| 5 | Busy index or operational failure |
|
|
160
|
+
|
|
161
|
+
## Indexing and filters
|
|
162
|
+
|
|
163
|
+
### What gets indexed
|
|
164
|
+
|
|
165
|
+
- Nested `.gitignore` and `.delphi-codeignore` files apply with Git-style patterns and negation; an ignored parent directory is not traversed. `.delphi-codeignore` follows `.gitignore` within each directory.
|
|
166
|
+
- Repeated `--ignore` patterns add another exclusion layer.
|
|
167
|
+
- Git's global ignore file and `.git/info/exclude` are not read.
|
|
168
|
+
- Built-in exclusions: `.git`, `.delphi-code`, `.venv`, `venv`, `node_modules`, `__pycache__`, `.models`, and the selected model directory.
|
|
169
|
+
- Symlinks, binary or non-UTF-8 files, blank files, and files over `--max-bytes` (default 1 MiB) are skipped.
|
|
170
|
+
- Unknown languages are indexed as `text`.
|
|
171
|
+
|
|
172
|
+
### Filters
|
|
173
|
+
|
|
174
|
+
Repeated `--path` globs are alternatives over project-relative POSIX paths (`*` can match `/`). Repeated `--language` values are alternatives using CocoIndex language names such as `python`, `rust`, and `typescript`. Path and language filters combine with AND.
|
|
175
|
+
|
|
176
|
+
- On `index`, filters define the entire indexed set for that run, and previously indexed files outside it are removed. Running `index` without filters returns to the full selection.
|
|
177
|
+
- On `search`, filters restrict results before ranking, so a matching result cannot be lost behind unfiltered top-k candidates.
|
|
178
|
+
|
|
179
|
+
### Incremental updates
|
|
180
|
+
|
|
181
|
+
CocoIndex memoizes each file's content-dependent work and maintains the exported SQLite vec0 rows. Changed contents are detected even when timestamps are unchanged, and deleted or newly excluded files have their rows removed. Every candidate file is read on each `index` run, but unchanged files skip chunking and embedding. The selected file contents are held in memory during indexing.
|
|
182
|
+
|
|
183
|
+
### Chunking and search
|
|
184
|
+
|
|
185
|
+
The code splitter targets 900-byte chunks with overlap. Embeddings are normalized SentenceTransformers outputs computed on the CPU, with the same model configuration for indexing and queries. The model's token limit can truncate long chunks.
|
|
186
|
+
|
|
187
|
+
Search is an exact sqlite-vec distance scan over the filtered rows, not an approximate-nearest-neighbor index. That keeps results exact and suits small codebases.
|
|
188
|
+
|
|
189
|
+
## Models
|
|
190
|
+
|
|
191
|
+
The default model is MiniLM: a small, general-purpose model that keeps the tool fast and light, not one tuned for code retrieval. Any local SentenceTransformers model can be used through `--model /absolute/local/model` or `DELPHI_CODE_MODEL`, provided that it:
|
|
192
|
+
|
|
193
|
+
- uses only Transformer, Pooling, Normalize, and Dense modules;
|
|
194
|
+
- stores its weights as safetensors (pickle weights and custom model code are not supported);
|
|
195
|
+
- is trusted and stays unchanged while a command runs.
|
|
196
|
+
|
|
197
|
+
Models with asymmetric query/document instructions are not specially configured. Each index records a hash of the full model assets, so searching an index with different weights or configuration fails with a clear error instead of returning wrong results.
|
|
198
|
+
|
|
199
|
+
## Storage
|
|
200
|
+
|
|
201
|
+
Models and indexes live outside the installation, so reinstalling or upgrading leaves them intact:
|
|
202
|
+
|
|
203
|
+
- macOS: `~/Library/Application Support/delphi-code/`
|
|
204
|
+
- Linux: `$XDG_DATA_HOME/delphi-code/`, or `~/.local/share/delphi-code/`
|
|
205
|
+
|
|
206
|
+
The default model is under `models/all-MiniLM-L6-v2/` and indexes are under `indexes/`. `DELPHI_CODE_INDEX_ROOT` overrides the index location.
|
|
207
|
+
|
|
208
|
+
Each project has one index at `indexes/<sha256 of the resolved project path>/`, independent of the working directory. It holds CocoIndex's incremental state, the SQLite vector table, and a manifest recording the project path; command output includes this `index_directory`.
|
|
209
|
+
|
|
210
|
+
- A file lock prevents reads during updates and concurrent writers.
|
|
211
|
+
- An interrupted or failed update leaves the index marked `ready: false`, and search refuses it until indexing succeeds. There is no fallback to a last good snapshot.
|
|
212
|
+
- Moving a project changes its index identity.
|
|
213
|
+
- To switch model assets or rebuild incompatible state, move that `index_directory` aside and run `index` again.
|
|
214
|
+
|
|
215
|
+
## Offline guarantees
|
|
216
|
+
|
|
217
|
+
Before any third-party import, the CLI disables CocoIndex usage tracking and Hugging Face telemetry, and sets the Hub and Transformers offline flags. Models load only from an existing local directory with `local_files_only=True`, `trust_remote_code=False`, and safetensors weights.
|
|
218
|
+
|
|
219
|
+
A Python audit hook also rejects Internet socket operations and DNS lookups. This is defense in depth, not OS isolation: it does not cover native extensions. For an OS-level boundary on macOS, run commands under a sandbox that denies networking:
|
|
220
|
+
|
|
221
|
+
```sh
|
|
222
|
+
/usr/bin/sandbox-exec -p '(version 1)(allow default)(deny network*)' \
|
|
223
|
+
delphi-code index -p /path/to/project
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Delphi Code needs read access to source and model files, write access to its user index directory, threads, SQLite extensions, and CocoIndex's LMDB memory maps. It needs no network access. Some stricter sandboxes deny CocoIndex's native storage initialization with `EPERM`; `doctor` probes for this and reports `sandbox_storage_denied`. The application never escalates its own permissions. `doctor` reports the Python guard only; it does not claim that an external OS sandbox is active.
|
|
227
|
+
|
|
228
|
+
## Development
|
|
229
|
+
|
|
230
|
+
See [CONTRIBUTING.md](https://github.com/DorofeevMark/delphi-code/blob/main/CONTRIBUTING.md) for running the tests and publishing releases.
|
|
231
|
+
|
|
232
|
+
## License
|
|
233
|
+
|
|
234
|
+
Apache-2.0. See [THIRD_PARTY_NOTICES.md](https://github.com/DorofeevMark/delphi-code/blob/main/THIRD_PARTY_NOTICES.md) for dependency and model provenance and redistribution notes. The package does not bundle dependencies or model weights; the model's asset hashes are recorded in [MODEL_PROVENANCE.json](https://github.com/DorofeevMark/delphi-code/blob/main/MODEL_PROVENANCE.json).
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# Delphi Code
|
|
2
|
+
|
|
3
|
+
Offline semantic code search for agents. Delphi Code is a small Python CLI that indexes local source trees with a local embedding model and answers natural-language queries with JSON. It runs one command at a time, with no daemon, server, account, cloud embedding provider, or runtime downloads.
|
|
4
|
+
|
|
5
|
+
## Quick start
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
uv tool install --python 3.12 --managed-python delphi-code
|
|
9
|
+
delphi-code setup
|
|
10
|
+
delphi-code index -p /absolute/path/to/project
|
|
11
|
+
delphi-code search 'where are user passwords checked?'
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
`setup` downloads and verifies the pinned embedding model once. After that, every command runs fully offline. Without `-p`, `search` looks through every indexed project.
|
|
15
|
+
|
|
16
|
+
## Requirements
|
|
17
|
+
|
|
18
|
+
- macOS 14 or later on arm64 (the tested target). Linux has not yet been verified; Windows is not supported by the current file locking implementation.
|
|
19
|
+
- CPython 3.12 with SQLite loadable extensions. Some python.org macOS builds disable that feature; `--managed-python` makes uv use its own Python build, which supports it. `doctor` reports this explicitly.
|
|
20
|
+
- CPU inference; no GPU is needed.
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
From PyPI, as in the quick start:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
uv tool install --python 3.12 --managed-python delphi-code
|
|
28
|
+
delphi-code setup
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
From a checkout, with uv:
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
uv tool install --python 3.12 --managed-python /absolute/path/to/delphi-code
|
|
35
|
+
delphi-code setup
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
From a checkout, with the pinned dependency versions and a Python 3.12 build that supports SQLite extensions:
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
python3.12 -m venv .venv
|
|
42
|
+
.venv/bin/python -m pip install -r requirements-lock.txt
|
|
43
|
+
.venv/bin/python -m pip install --no-deps --no-build-isolation .
|
|
44
|
+
.venv/bin/delphi-code setup
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
`requirements-lock.txt` records the tested macOS environment, not a cross-platform lock.
|
|
48
|
+
|
|
49
|
+
### Model setup
|
|
50
|
+
|
|
51
|
+
`setup` downloads the pinned [all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) revision in a separate process. It validates every file against bundled SHA-256 hashes and runs local embedding, SQLite, and native-storage diagnostics before moving the model into place.
|
|
52
|
+
|
|
53
|
+
- Running `setup` again verifies and reuses valid assets.
|
|
54
|
+
- Concurrent setup for the same destination fails clearly.
|
|
55
|
+
- Failed downloads or diagnostics never leave a partial model behind; invalid existing models are preserved with recovery instructions.
|
|
56
|
+
- `setup --model /absolute/path` or `DELPHI_CODE_MODEL` selects a different destination.
|
|
57
|
+
|
|
58
|
+
For an offline installation, install dependencies from a wheelhouse prepared for the target platform, then import a complete prepared MiniLM directory, including its license and model card:
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
delphi-code setup --from /absolute/path/to/all-MiniLM-L6-v2
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
`setup` provisions the pinned MiniLM model only. Other models can be used at runtime through `--model` or `DELPHI_CODE_MODEL` (see Models below). `index`, `search`, `status`, and `doctor` never download anything.
|
|
65
|
+
|
|
66
|
+
## Commands
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
delphi-code doctor -p /path/to/project
|
|
70
|
+
delphi-code index -p /path/to/project
|
|
71
|
+
delphi-code search -p /path/to/project 'where are user passwords checked?'
|
|
72
|
+
delphi-code search -p /path/to/project 'parse configuration' --language python --path 'src/*' --limit 5
|
|
73
|
+
delphi-code status -p /path/to/project
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
- **`index`** builds or incrementally updates a project's index.
|
|
77
|
+
- **`search`** runs a natural-language query. Without `-p`, it searches every stored index.
|
|
78
|
+
- **`status`** reports stored index state. It needs no model and does not rescan source files to detect staleness.
|
|
79
|
+
- **`doctor`** checks the model, SQLite extensions, and native storage, then runs a real local embedding and vector distance calculation.
|
|
80
|
+
- **`setup`** provisions the model (see above).
|
|
81
|
+
|
|
82
|
+
`python -m delphi_code` works as an alternative to the `delphi-code` executable.
|
|
83
|
+
|
|
84
|
+
### Selecting a project
|
|
85
|
+
|
|
86
|
+
- `--project` / `-p` accepts a path, resolved relative to the current working directory. The project root is explicit; it is not inferred from Git.
|
|
87
|
+
- After a project has been indexed once, its folder name works too, for example `delphi-code search -p myapp 'parse config'`. A bare name selects the uniquely matching indexed project; duplicate names produce an error listing their paths. Use `./name` or an absolute path to select a directory explicitly.
|
|
88
|
+
- Without `--project`, `search` searches all stored indexes; other commands use the current directory.
|
|
89
|
+
|
|
90
|
+
### Searching across projects
|
|
91
|
+
|
|
92
|
+
Cross-project search returns a single globally ranked list, with the full `project` path on each result. The query is embedded once, `--limit` applies to the combined list, and path/language filters apply within every index. All indexes must be readable, complete, and built with the selected model: a busy, broken, or incompatible index produces an error rather than silently partial results. Use `-p` to narrow the search when needed.
|
|
93
|
+
|
|
94
|
+
## Output
|
|
95
|
+
|
|
96
|
+
Each command writes one JSON object to stdout with `schema_version`, `ok`, `command`, and either `data` or `error`. Progress and library diagnostics go to stderr; argument help is plain text.
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"command": "search",
|
|
101
|
+
"ok": true,
|
|
102
|
+
"schema_version": 1,
|
|
103
|
+
"data": {
|
|
104
|
+
"project": "/Users/me/src/delphi-code",
|
|
105
|
+
"index_directory": "/Users/me/Library/Application Support/delphi-code/indexes/3a3565ee…",
|
|
106
|
+
"query": "where is the model checksum verified?",
|
|
107
|
+
"results": [
|
|
108
|
+
{
|
|
109
|
+
"path": "delphi_code/setup.py",
|
|
110
|
+
"language": "python",
|
|
111
|
+
"start_line": 17,
|
|
112
|
+
"end_line": 31,
|
|
113
|
+
"distance": 1.1042553186416626,
|
|
114
|
+
"score": 0.3903100956258001,
|
|
115
|
+
"text": "def verify_assets(root):\n manifest = json.loads(…"
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Search results contain project-relative paths, language, inclusive 1-based line ranges, the original chunk text, Euclidean distance, and cosine similarity score. Lower distance and higher score mean closer matches; scores are not probabilities. Equal distances use stable path/line/id ordering.
|
|
123
|
+
|
|
124
|
+
| Exit code | Meaning |
|
|
125
|
+
|---|---|
|
|
126
|
+
| 0 | Success, including a search with no matches |
|
|
127
|
+
| 2 | Invalid arguments or project |
|
|
128
|
+
| 3 | Missing or incompatible model or runtime assets |
|
|
129
|
+
| 4 | Missing, incomplete, or incompatible index |
|
|
130
|
+
| 5 | Busy index or operational failure |
|
|
131
|
+
|
|
132
|
+
## Indexing and filters
|
|
133
|
+
|
|
134
|
+
### What gets indexed
|
|
135
|
+
|
|
136
|
+
- Nested `.gitignore` and `.delphi-codeignore` files apply with Git-style patterns and negation; an ignored parent directory is not traversed. `.delphi-codeignore` follows `.gitignore` within each directory.
|
|
137
|
+
- Repeated `--ignore` patterns add another exclusion layer.
|
|
138
|
+
- Git's global ignore file and `.git/info/exclude` are not read.
|
|
139
|
+
- Built-in exclusions: `.git`, `.delphi-code`, `.venv`, `venv`, `node_modules`, `__pycache__`, `.models`, and the selected model directory.
|
|
140
|
+
- Symlinks, binary or non-UTF-8 files, blank files, and files over `--max-bytes` (default 1 MiB) are skipped.
|
|
141
|
+
- Unknown languages are indexed as `text`.
|
|
142
|
+
|
|
143
|
+
### Filters
|
|
144
|
+
|
|
145
|
+
Repeated `--path` globs are alternatives over project-relative POSIX paths (`*` can match `/`). Repeated `--language` values are alternatives using CocoIndex language names such as `python`, `rust`, and `typescript`. Path and language filters combine with AND.
|
|
146
|
+
|
|
147
|
+
- On `index`, filters define the entire indexed set for that run, and previously indexed files outside it are removed. Running `index` without filters returns to the full selection.
|
|
148
|
+
- On `search`, filters restrict results before ranking, so a matching result cannot be lost behind unfiltered top-k candidates.
|
|
149
|
+
|
|
150
|
+
### Incremental updates
|
|
151
|
+
|
|
152
|
+
CocoIndex memoizes each file's content-dependent work and maintains the exported SQLite vec0 rows. Changed contents are detected even when timestamps are unchanged, and deleted or newly excluded files have their rows removed. Every candidate file is read on each `index` run, but unchanged files skip chunking and embedding. The selected file contents are held in memory during indexing.
|
|
153
|
+
|
|
154
|
+
### Chunking and search
|
|
155
|
+
|
|
156
|
+
The code splitter targets 900-byte chunks with overlap. Embeddings are normalized SentenceTransformers outputs computed on the CPU, with the same model configuration for indexing and queries. The model's token limit can truncate long chunks.
|
|
157
|
+
|
|
158
|
+
Search is an exact sqlite-vec distance scan over the filtered rows, not an approximate-nearest-neighbor index. That keeps results exact and suits small codebases.
|
|
159
|
+
|
|
160
|
+
## Models
|
|
161
|
+
|
|
162
|
+
The default model is MiniLM: a small, general-purpose model that keeps the tool fast and light, not one tuned for code retrieval. Any local SentenceTransformers model can be used through `--model /absolute/local/model` or `DELPHI_CODE_MODEL`, provided that it:
|
|
163
|
+
|
|
164
|
+
- uses only Transformer, Pooling, Normalize, and Dense modules;
|
|
165
|
+
- stores its weights as safetensors (pickle weights and custom model code are not supported);
|
|
166
|
+
- is trusted and stays unchanged while a command runs.
|
|
167
|
+
|
|
168
|
+
Models with asymmetric query/document instructions are not specially configured. Each index records a hash of the full model assets, so searching an index with different weights or configuration fails with a clear error instead of returning wrong results.
|
|
169
|
+
|
|
170
|
+
## Storage
|
|
171
|
+
|
|
172
|
+
Models and indexes live outside the installation, so reinstalling or upgrading leaves them intact:
|
|
173
|
+
|
|
174
|
+
- macOS: `~/Library/Application Support/delphi-code/`
|
|
175
|
+
- Linux: `$XDG_DATA_HOME/delphi-code/`, or `~/.local/share/delphi-code/`
|
|
176
|
+
|
|
177
|
+
The default model is under `models/all-MiniLM-L6-v2/` and indexes are under `indexes/`. `DELPHI_CODE_INDEX_ROOT` overrides the index location.
|
|
178
|
+
|
|
179
|
+
Each project has one index at `indexes/<sha256 of the resolved project path>/`, independent of the working directory. It holds CocoIndex's incremental state, the SQLite vector table, and a manifest recording the project path; command output includes this `index_directory`.
|
|
180
|
+
|
|
181
|
+
- A file lock prevents reads during updates and concurrent writers.
|
|
182
|
+
- An interrupted or failed update leaves the index marked `ready: false`, and search refuses it until indexing succeeds. There is no fallback to a last good snapshot.
|
|
183
|
+
- Moving a project changes its index identity.
|
|
184
|
+
- To switch model assets or rebuild incompatible state, move that `index_directory` aside and run `index` again.
|
|
185
|
+
|
|
186
|
+
## Offline guarantees
|
|
187
|
+
|
|
188
|
+
Before any third-party import, the CLI disables CocoIndex usage tracking and Hugging Face telemetry, and sets the Hub and Transformers offline flags. Models load only from an existing local directory with `local_files_only=True`, `trust_remote_code=False`, and safetensors weights.
|
|
189
|
+
|
|
190
|
+
A Python audit hook also rejects Internet socket operations and DNS lookups. This is defense in depth, not OS isolation: it does not cover native extensions. For an OS-level boundary on macOS, run commands under a sandbox that denies networking:
|
|
191
|
+
|
|
192
|
+
```sh
|
|
193
|
+
/usr/bin/sandbox-exec -p '(version 1)(allow default)(deny network*)' \
|
|
194
|
+
delphi-code index -p /path/to/project
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Delphi Code needs read access to source and model files, write access to its user index directory, threads, SQLite extensions, and CocoIndex's LMDB memory maps. It needs no network access. Some stricter sandboxes deny CocoIndex's native storage initialization with `EPERM`; `doctor` probes for this and reports `sandbox_storage_denied`. The application never escalates its own permissions. `doctor` reports the Python guard only; it does not claim that an external OS sandbox is active.
|
|
198
|
+
|
|
199
|
+
## Development
|
|
200
|
+
|
|
201
|
+
See [CONTRIBUTING.md](https://github.com/DorofeevMark/delphi-code/blob/main/CONTRIBUTING.md) for running the tests and publishing releases.
|
|
202
|
+
|
|
203
|
+
## License
|
|
204
|
+
|
|
205
|
+
Apache-2.0. See [THIRD_PARTY_NOTICES.md](https://github.com/DorofeevMark/delphi-code/blob/main/THIRD_PARTY_NOTICES.md) for dependency and model provenance and redistribution notes. The package does not bundle dependencies or model weights; the model's asset hashes are recorded in [MODEL_PROVENANCE.json](https://github.com/DorofeevMark/delphi-code/blob/main/MODEL_PROVENANCE.json).
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Third-party notices and provenance
|
|
2
|
+
|
|
3
|
+
Delphi Code's original application code uses the repository's Apache-2.0 license. It was implemented independently after inspecting a local reference implementation's behavior and library integration; no reference source, documentation, or branding is included. Its Python package declares dependencies but does not bundle their code, a Python interpreter, or model weights. Dependencies and models retain their own licenses and notices in their separately installed distributions.
|
|
4
|
+
|
|
5
|
+
## Dependencies
|
|
6
|
+
|
|
7
|
+
The tested direct dependencies are CocoIndex 1.0.24 (Apache-2.0), sqlite-vec 0.1.9 (MIT or Apache-2.0), SentenceTransformers 6.1.0 (Apache-2.0), NumPy 2.5.3 (BSD and bundled component notices), and pathspec 0.12.1 (MPL-2.0). They were installed from PyPI without modification. Exact transitive dependency versions are recorded in `requirements-lock.txt`; this version freeze does not authenticate wheel contents.
|
|
8
|
+
|
|
9
|
+
For a release that bundles dependencies, collect their licenses and notices from the actual release environment with `scripts/collect_notices.py`. During online preparation, `scripts/prepare_notices.py` retrieves supplemental upstream license texts omitted from the tested wheels. Both write to `build/third_party/`. Review the collection against the release contents, include required native-library and interpreter notices, and meet applicable source-availability obligations. The generated collection is excluded from the application package and source repository.
|
|
10
|
+
|
|
11
|
+
## Test model
|
|
12
|
+
|
|
13
|
+
- Repository: [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2/tree/1110a243fdf4706b3f48f1d95db1a4f5529b4d41)
|
|
14
|
+
- Revision: `1110a243fdf4706b3f48f1d95db1a4f5529b4d41`
|
|
15
|
+
- Declared model license: Apache-2.0, as recorded in its upstream model card.
|
|
16
|
+
- Asset hashes: `MODEL_PROVENANCE.json`.
|
|
17
|
+
|
|
18
|
+
The provisioned model directory under `.models/` retains its upstream model card, Apache license text, and provenance manifest alongside the weights. The pinned repository has no separate LICENSE file, so `scripts/prepare_model.py` supplies the canonical Apache text alongside the model card's declaration. Preserve these records when distributing the model. Replacement models require their own provenance and license review.
|