Commit ·
7b874e7
0
Parent(s):
Duplicate from Cactus-Compute/needle2
Browse filesCo-authored-by: Henry Ndubuaku <hmunachii@users.noreply.huggingface.co>
This view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +88 -0
- LICENSE +202 -0
- README.md +309 -0
- android-arm64/libneedle.a +3 -0
- android-arm64/needle +3 -0
- android-arm64/needle.h +35 -0
- android-armv7/libneedle.a +3 -0
- android-armv7/needle +3 -0
- android-armv7/needle.h +35 -0
- android-riscv64/libneedle.a +3 -0
- android-riscv64/needle +3 -0
- android-riscv64/needle.h +35 -0
- assets/architecture.png +3 -0
- assets/banner.png +3 -0
- assets/frontier.png +0 -0
- banner.png +3 -0
- checkpoints/needle2.pkl +3 -0
- config.json +38 -0
- frontier.svg +42 -0
- ios-arm64/libneedle.a +3 -0
- ios-arm64/needle.h +35 -0
- ios-sim-arm64/libneedle.a +3 -0
- ios-sim-arm64/needle.h +35 -0
- linux-arm64/libneedle.a +3 -0
- linux-arm64/needle +3 -0
- linux-arm64/needle.h +35 -0
- linux-armv7/libneedle.a +3 -0
- linux-armv7/needle +3 -0
- linux-armv7/needle.h +35 -0
- linux-mipsel/libneedle.a +3 -0
- linux-mipsel/needle +3 -0
- linux-mipsel/needle.h +35 -0
- linux-riscv64/libneedle.a +3 -0
- linux-riscv64/needle +3 -0
- linux-riscv64/needle.h +35 -0
- linux-x86_64/libneedle.a +3 -0
- linux-x86_64/needle +3 -0
- linux-x86_64/needle.h +35 -0
- macos-arm64/libneedle.a +3 -0
- macos-arm64/needle +3 -0
- macos-arm64/needle.h +35 -0
- needle2.cact +3 -0
- python/cactus_needle-2.0.0-py3-none-any.whl +0 -0
- python/cactus_needle-2.0.0-py3-none-macosx_11_0_arm64.whl +3 -0
- python/cactus_needle-2.0.0-py3-none-macosx_11_0_x86_64.whl +3 -0
- python/cactus_needle-2.0.0-py3-none-manylinux2014_aarch64.whl +3 -0
- python/cactus_needle-2.0.0-py3-none-manylinux2014_x86_64.whl +3 -0
- python/cactus_needle-2.0.0-py3-none-musllinux_1_2_aarch64.whl +3 -0
- python/cactus_needle-2.0.0-py3-none-musllinux_1_2_x86_64.whl +3 -0
- python/cactus_needle-2.0.0-py3-none-win_amd64.whl +3 -0
.gitattributes
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
android-arm64/libneedle.a filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
android-arm64/needle filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
android-armv7/libneedle.a filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
android-armv7/needle filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
android-riscv64/libneedle.a filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
android-riscv64/needle filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
ios-arm64/libneedle.a filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
ios-sim-arm64/libneedle.a filter=lfs diff=lfs merge=lfs -text
|
| 44 |
+
linux-arm64/libneedle.a filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
linux-arm64/needle filter=lfs diff=lfs merge=lfs -text
|
| 46 |
+
linux-armv7/libneedle.a filter=lfs diff=lfs merge=lfs -text
|
| 47 |
+
linux-armv7/needle filter=lfs diff=lfs merge=lfs -text
|
| 48 |
+
linux-riscv64/libneedle.a filter=lfs diff=lfs merge=lfs -text
|
| 49 |
+
linux-riscv64/needle filter=lfs diff=lfs merge=lfs -text
|
| 50 |
+
linux-x86_64/libneedle.a filter=lfs diff=lfs merge=lfs -text
|
| 51 |
+
linux-x86_64/needle filter=lfs diff=lfs merge=lfs -text
|
| 52 |
+
macos-arm64/libneedle.a filter=lfs diff=lfs merge=lfs -text
|
| 53 |
+
macos-arm64/needle filter=lfs diff=lfs merge=lfs -text
|
| 54 |
+
python/cactus_needle-2.0.0-py3-none-macosx_11_0_arm64.whl filter=lfs diff=lfs merge=lfs -text
|
| 55 |
+
python/cactus_needle-2.0.0-py3-none-manylinux2014_aarch64.whl filter=lfs diff=lfs merge=lfs -text
|
| 56 |
+
python/cactus_needle-2.0.0-py3-none-manylinux2014_x86_64.whl filter=lfs diff=lfs merge=lfs -text
|
| 57 |
+
tvos-arm64/libneedle.a filter=lfs diff=lfs merge=lfs -text
|
| 58 |
+
watchos-arm64/libneedle.a filter=lfs diff=lfs merge=lfs -text
|
| 59 |
+
windows-arm64/libneedle.a filter=lfs diff=lfs merge=lfs -text
|
| 60 |
+
windows-arm64/needle.exe filter=lfs diff=lfs merge=lfs -text
|
| 61 |
+
windows-x86_64/libneedle.a filter=lfs diff=lfs merge=lfs -text
|
| 62 |
+
windows-x86_64/needle.exe filter=lfs diff=lfs merge=lfs -text
|
| 63 |
+
banner.png filter=lfs diff=lfs merge=lfs -text
|
| 64 |
+
linux-mipsel/libneedle.a filter=lfs diff=lfs merge=lfs -text
|
| 65 |
+
linux-mipsel/needle filter=lfs diff=lfs merge=lfs -text
|
| 66 |
+
python/cactus_needle-2.0.0-py3-none-macosx_11_0_x86_64.whl filter=lfs diff=lfs merge=lfs -text
|
| 67 |
+
python/cactus_needle-2.0.0-py3-none-musllinux_1_2_aarch64.whl filter=lfs diff=lfs merge=lfs -text
|
| 68 |
+
python/cactus_needle-2.0.0-py3-none-musllinux_1_2_x86_64.whl filter=lfs diff=lfs merge=lfs -text
|
| 69 |
+
python/cactus_needle-2.0.0-py3-none-win_amd64.whl filter=lfs diff=lfs merge=lfs -text
|
| 70 |
+
python/cactus_needle-2.0.0-py3-none-win_arm64.whl filter=lfs diff=lfs merge=lfs -text
|
| 71 |
+
assets/architecture.png filter=lfs diff=lfs merge=lfs -text
|
| 72 |
+
needle2.cact filter=lfs diff=lfs merge=lfs -text
|
| 73 |
+
python/cactus_needle-2.0.1-py3-none-macosx_11_0_arm64.whl filter=lfs diff=lfs merge=lfs -text
|
| 74 |
+
python/cactus_needle-2.0.1-py3-none-macosx_11_0_x86_64.whl filter=lfs diff=lfs merge=lfs -text
|
| 75 |
+
python/cactus_needle-2.0.1-py3-none-manylinux2014_aarch64.whl filter=lfs diff=lfs merge=lfs -text
|
| 76 |
+
python/cactus_needle-2.0.1-py3-none-manylinux2014_x86_64.whl filter=lfs diff=lfs merge=lfs -text
|
| 77 |
+
python/cactus_needle-2.0.1-py3-none-musllinux_1_2_aarch64.whl filter=lfs diff=lfs merge=lfs -text
|
| 78 |
+
python/cactus_needle-2.0.1-py3-none-musllinux_1_2_x86_64.whl filter=lfs diff=lfs merge=lfs -text
|
| 79 |
+
python/cactus_needle-2.0.1-py3-none-win_amd64.whl filter=lfs diff=lfs merge=lfs -text
|
| 80 |
+
python/cactus_needle-2.0.1-py3-none-win_arm64.whl filter=lfs diff=lfs merge=lfs -text
|
| 81 |
+
python/cactus_needle-2.0.2-py3-none-macosx_11_0_arm64.whl filter=lfs diff=lfs merge=lfs -text
|
| 82 |
+
python/cactus_needle-2.0.2-py3-none-macosx_11_0_x86_64.whl filter=lfs diff=lfs merge=lfs -text
|
| 83 |
+
python/cactus_needle-2.0.2-py3-none-manylinux2014_aarch64.whl filter=lfs diff=lfs merge=lfs -text
|
| 84 |
+
python/cactus_needle-2.0.2-py3-none-manylinux2014_x86_64.whl filter=lfs diff=lfs merge=lfs -text
|
| 85 |
+
python/cactus_needle-2.0.2-py3-none-musllinux_1_2_aarch64.whl filter=lfs diff=lfs merge=lfs -text
|
| 86 |
+
python/cactus_needle-2.0.2-py3-none-musllinux_1_2_x86_64.whl filter=lfs diff=lfs merge=lfs -text
|
| 87 |
+
python/cactus_needle-2.0.2-py3-none-win_amd64.whl filter=lfs diff=lfs merge=lfs -text
|
| 88 |
+
python/cactus_needle-2.0.2-py3-none-win_arm64.whl filter=lfs diff=lfs merge=lfs -text
|
LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
Apache License
|
| 3 |
+
Version 2.0, January 2004
|
| 4 |
+
http://www.apache.org/licenses/
|
| 5 |
+
|
| 6 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 7 |
+
|
| 8 |
+
1. Definitions.
|
| 9 |
+
|
| 10 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 11 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 12 |
+
|
| 13 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 14 |
+
the copyright owner that is granting the License.
|
| 15 |
+
|
| 16 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 17 |
+
other entities that control, are controlled by, or are under common
|
| 18 |
+
control with that entity. For the purposes of this definition,
|
| 19 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 20 |
+
direction or management of such entity, whether by contract or
|
| 21 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 22 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 23 |
+
|
| 24 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 25 |
+
exercising permissions granted by this License.
|
| 26 |
+
|
| 27 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 28 |
+
including but not limited to software source code, documentation
|
| 29 |
+
source, and configuration files.
|
| 30 |
+
|
| 31 |
+
"Object" form shall mean any form resulting from mechanical
|
| 32 |
+
transformation or translation of a Source form, including but
|
| 33 |
+
not limited to compiled object code, generated documentation,
|
| 34 |
+
and conversions to other media types.
|
| 35 |
+
|
| 36 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 37 |
+
Object form, made available under the License, as indicated by a
|
| 38 |
+
copyright notice that is included in or attached to the work
|
| 39 |
+
(an example is provided in the Appendix below).
|
| 40 |
+
|
| 41 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 42 |
+
form, that is based on (or derived from) the Work and for which the
|
| 43 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 44 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 45 |
+
of this License, Derivative Works shall not include works that remain
|
| 46 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 47 |
+
the Work and Derivative Works thereof.
|
| 48 |
+
|
| 49 |
+
"Contribution" shall mean any work of authorship, including
|
| 50 |
+
the original version of the Work and any modifications or additions
|
| 51 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 52 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 53 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 54 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 55 |
+
means any form of electronic, verbal, or written communication sent
|
| 56 |
+
to the Licensor or its representatives, including but not limited to
|
| 57 |
+
communication on electronic mailing lists, source code control systems,
|
| 58 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 59 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 60 |
+
excluding communication that is conspicuously marked or otherwise
|
| 61 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 62 |
+
|
| 63 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 64 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 65 |
+
subsequently incorporated within the Work.
|
| 66 |
+
|
| 67 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 68 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 69 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 70 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 71 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 72 |
+
Work and such Derivative Works in Source or Object form.
|
| 73 |
+
|
| 74 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 75 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 76 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 77 |
+
(except as stated in this section) patent license to make, have made,
|
| 78 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 79 |
+
where such license applies only to those patent claims licensable
|
| 80 |
+
by such Contributor that are necessarily infringed by their
|
| 81 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 82 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 83 |
+
institute patent litigation against any entity (including a
|
| 84 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 85 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 86 |
+
or contributory patent infringement, then any patent licenses
|
| 87 |
+
granted to You under this License for that Work shall terminate
|
| 88 |
+
as of the date such litigation is filed.
|
| 89 |
+
|
| 90 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 91 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 92 |
+
modifications, and in Source or Object form, provided that You
|
| 93 |
+
meet the following conditions:
|
| 94 |
+
|
| 95 |
+
(a) You must give any other recipients of the Work or
|
| 96 |
+
Derivative Works a copy of this License; and
|
| 97 |
+
|
| 98 |
+
(b) You must cause any modified files to carry prominent notices
|
| 99 |
+
stating that You changed the files; and
|
| 100 |
+
|
| 101 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 102 |
+
that You distribute, all copyright, patent, trademark, and
|
| 103 |
+
attribution notices from the Source form of the Work,
|
| 104 |
+
excluding those notices that do not pertain to any part of
|
| 105 |
+
the Derivative Works; and
|
| 106 |
+
|
| 107 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 108 |
+
distribution, then any Derivative Works that You distribute must
|
| 109 |
+
include a readable copy of the attribution notices contained
|
| 110 |
+
within such NOTICE file, excluding those notices that do not
|
| 111 |
+
pertain to any part of the Derivative Works, in at least one
|
| 112 |
+
of the following places: within a NOTICE text file distributed
|
| 113 |
+
as part of the Derivative Works; within the Source form or
|
| 114 |
+
documentation, if provided along with the Derivative Works; or,
|
| 115 |
+
within a display generated by the Derivative Works, if and
|
| 116 |
+
wherever such third-party notices normally appear. The contents
|
| 117 |
+
of the NOTICE file are for informational purposes only and
|
| 118 |
+
do not modify the License. You may add Your own attribution
|
| 119 |
+
notices within Derivative Works that You distribute, alongside
|
| 120 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 121 |
+
that such additional attribution notices cannot be construed
|
| 122 |
+
as modifying the License.
|
| 123 |
+
|
| 124 |
+
You may add Your own copyright statement to Your modifications and
|
| 125 |
+
may provide additional or different license terms and conditions
|
| 126 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 127 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 128 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 129 |
+
the conditions stated in this License.
|
| 130 |
+
|
| 131 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 132 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 133 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 134 |
+
this License, without any additional terms or conditions.
|
| 135 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 136 |
+
the terms of any separate license agreement you may have executed
|
| 137 |
+
with Licensor regarding such Contributions.
|
| 138 |
+
|
| 139 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 140 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 141 |
+
except as required for reasonable and customary use in describing the
|
| 142 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 143 |
+
|
| 144 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 145 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 146 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 147 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 148 |
+
implied, including, without limitation, any warranties or conditions
|
| 149 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 150 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 151 |
+
appropriateness of using or redistributing the Work and assume any
|
| 152 |
+
risks associated with Your exercise of permissions under this License.
|
| 153 |
+
|
| 154 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 155 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 156 |
+
unless required by applicable law (such as deliberate and grossly
|
| 157 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 158 |
+
liable to You for damages, including any direct, indirect, special,
|
| 159 |
+
incidental, or consequential damages of any character arising as a
|
| 160 |
+
result of this License or out of the use or inability to use the
|
| 161 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 162 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 163 |
+
other commercial damages or losses), even if such Contributor
|
| 164 |
+
has been advised of the possibility of such damages.
|
| 165 |
+
|
| 166 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 167 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 168 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 169 |
+
or other liability obligations and/or rights consistent with this
|
| 170 |
+
License. However, in accepting such obligations, You may act only
|
| 171 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 172 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 173 |
+
defend, and hold each Contributor harmless for any liability
|
| 174 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 175 |
+
of your accepting any such warranty or additional liability.
|
| 176 |
+
|
| 177 |
+
END OF TERMS AND CONDITIONS
|
| 178 |
+
|
| 179 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 180 |
+
|
| 181 |
+
To apply the Apache License to your work, attach the following
|
| 182 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 183 |
+
replaced with your own identifying information. (Don't include
|
| 184 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 185 |
+
comment syntax for the file format. We also recommend that a
|
| 186 |
+
file or class name and description of purpose be included on the
|
| 187 |
+
same "printed page" as the copyright notice for easier
|
| 188 |
+
identification within third-party archives.
|
| 189 |
+
|
| 190 |
+
Copyright [yyyy] [name of copyright owner]
|
| 191 |
+
|
| 192 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 193 |
+
you may not use this file except in compliance with the License.
|
| 194 |
+
You may obtain a copy of the License at
|
| 195 |
+
|
| 196 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 197 |
+
|
| 198 |
+
Unless required by applicable law or agreed to in writing, software
|
| 199 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 200 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 201 |
+
See the License for the specific language governing permissions and
|
| 202 |
+
limitations under the License.
|
README.md
ADDED
|
@@ -0,0 +1,309 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: cactus-needle
|
| 3 |
+
pipeline_tag: text-generation
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
tags:
|
| 6 |
+
- tool-calling
|
| 7 |
+
- function-calling
|
| 8 |
+
- on-device
|
| 9 |
+
- edge
|
| 10 |
+
- quantization
|
| 11 |
+
- webassembly
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+

|
| 15 |
+
|
| 16 |
+
# Needle 2
|
| 17 |
+
|
| 18 |
+
Needle 2 is an open 45M-parameter model for tool calling, device use and structured extraction. The whole model is a single 14MB binary that runs a full session in 28MB of RAM. It is built on our Simple Attention Network findings, compressed to CQ2-bit with Cactus Quants, and baked into its own engine. On the benchmarks below, Needle 2 trades wins with other small models like FunctionGemma 270M, LFM2.5 230M and Apple FM, at 5x to 70x smaller, and 2 bits against their f16. Needle hits 500 tokens/sec decode speed on a Raspberry Pi 5, between 400-1,500 tokens/sec on VR devices like Meta Quest 3S and Apple Vision Pro, and ranges 300-700 on sub-$200 phones such as the Samsung A-Series. With a peak session RAM around 28MB, Needle reaches microcontrollers like the ESP32-P4; others have reported running it on an ESP32-S3 in about 11MB.
|
| 19 |
+
|
| 20 |
+
- **Self-contained**: model baked into the binary, no runtime, no downloads, no network.
|
| 21 |
+
- **Runs everywhere**: ARM64, x86-64, ARMv7, RISC-V, and WebAssembly, on Apple, Windows, Linux, Android, Raspberry Pi.
|
| 22 |
+
- **Simple contract**: tool calls come back as structured data, text in, JSON out; a byte-level grammar compiled from your schemas constrains every token.
|
| 23 |
+
- **Confidence-gated**: every response carries a calibrated confidence score from a learned head; set a threshold, act above it, escalate below it.
|
| 24 |
+
- **Tool retrieval**: declare a large catalogue and a built-in retrieval head renders only the top five tools per turn, with the grammar constrained to that subset.
|
| 25 |
+
- **Bounded memory**: a 256-token sliding window with the tools pinned as KV sinks, so total memory stays near 28MB no matter how long the conversation runs.
|
| 26 |
+
|
| 27 |
+
Source, engine, and training code: [github.com/cactus-compute/needle](https://github.com/cactus-compute/needle).
|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
|
| 31 |
+
## Simple Attention Network
|
| 32 |
+
|
| 33 |
+
Needle 2 is a Simple Attention Network, our dense small-model recipe: a Hadamard MLP in place of the FFN, GQA attention, engram key-value memory, and multi-lane hyper-connections. See the paper for the design and ablations: [arXiv:2607.18363](https://arxiv.org/abs/2607.18363).
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
|
| 37 |
+
Each block carries its update rule. Here x̂ is the RMS-normalised flattening of the four residual streams, H the orthonormal Walsh-Hadamard transform (a fixed matrix, applied in n log n time with no weights to read), (kₜ, vₜ) rows gathered from hashed n-gram tables, and P the doubly-stochastic normalisation of the routing logits A, computed by Sinkhorn iteration; a, b, g and all σ-gates are learned and input-dependent. Both attention and MLP residuals are sandwich-normed and gated, the engram sites fire at two layers, and decoding is constrained by a byte-level grammar compiled from the declared schemas.
|
| 38 |
+
|
| 39 |
+
## Quickstart with Python
|
| 40 |
+
|
| 41 |
+
```sh
|
| 42 |
+
pip install cactus-needle
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
Needle reads your tool descriptions to decide what to call and how to fill arguments, so describing them well is the whole game. You can do it three ways, from least to most control.
|
| 46 |
+
|
| 47 |
+
**Simple**: decorate a function. The signature gives the argument types, the docstring is the tool description, and `run()` completes the loop: model picks the call, Needle executes your function, feeds the result back, and returns the model's final answer.
|
| 48 |
+
|
| 49 |
+
```python
|
| 50 |
+
import needle
|
| 51 |
+
|
| 52 |
+
@needle.tool
|
| 53 |
+
def get_weather(city: str):
|
| 54 |
+
"Get the current weather for a city."
|
| 55 |
+
return {"city": city, "temp_c": 27, "sky": "clear"}
|
| 56 |
+
|
| 57 |
+
agent = needle.Needle(tools=[get_weather])
|
| 58 |
+
print(agent.run("what's it like in Lagos right now?")["reasoning"])
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
**Medium**: describe each argument and offer choices. Needle reads a Google-style `Args:` block for per-parameter descriptions; a default makes an argument optional; a `Literal` becomes a fixed set the model must choose from (it cannot emit anything else).
|
| 62 |
+
|
| 63 |
+
```python
|
| 64 |
+
from typing import Literal
|
| 65 |
+
|
| 66 |
+
@needle.tool
|
| 67 |
+
def set_thermostat(temperature: int, mode: Literal["heat", "cool", "auto"] = "auto"):
|
| 68 |
+
"""Set the thermostat.
|
| 69 |
+
|
| 70 |
+
Args:
|
| 71 |
+
temperature: target temperature in Celsius
|
| 72 |
+
mode: heating strategy to use
|
| 73 |
+
"""
|
| 74 |
+
return {"temperature": temperature, "mode": mode}
|
| 75 |
+
|
| 76 |
+
agent = needle.Needle(tools=[set_thermostat])
|
| 77 |
+
agent.run("make it 21 and cool the room")
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
**Advanced**: constrain the values with `needle.Field`, attached inline via `Annotated`. Ranges, patterns, lengths, and item counts are compiled into the decode grammar, so the model can only ever emit values that satisfy them.
|
| 81 |
+
|
| 82 |
+
```python
|
| 83 |
+
from typing import Annotated
|
| 84 |
+
|
| 85 |
+
@needle.tool
|
| 86 |
+
def send_money(
|
| 87 |
+
amount: Annotated[float, needle.Field(gt=0, le=10000, description="USD, up to 10,000")],
|
| 88 |
+
to: Annotated[str, needle.Field(pattern=r"^@[a-z0-9_]+$", description="recipient handle")],
|
| 89 |
+
memo: Annotated[str, needle.Field(max_length=80)] = "",
|
| 90 |
+
):
|
| 91 |
+
"Send money to a handle."
|
| 92 |
+
return {"sent": amount, "to": to}
|
| 93 |
+
```
|
| 94 |
+
|
| 95 |
+
`Field` supports `description`, `enum`, `const`, `ge`/`le`/`gt`/`lt`, `multiple_of`, `min_length`/`max_length`, `pattern`, `format`, `min_items`/`max_items`, and `unique_items`.
|
| 96 |
+
|
| 97 |
+
**Extraction**: to pull structured data out of text, declare the shape and call `extract()`. Pass a Pydantic model and you get a typed object back.
|
| 98 |
+
|
| 99 |
+
```python
|
| 100 |
+
from pydantic import BaseModel
|
| 101 |
+
|
| 102 |
+
class Invoice(BaseModel):
|
| 103 |
+
vendor: str
|
| 104 |
+
total: float
|
| 105 |
+
due_date: str
|
| 106 |
+
|
| 107 |
+
invoice = needle.extract("Invoice from Acme Corp, $1,200.00, due 2026-09-01", Invoice)
|
| 108 |
+
print(invoice.vendor, invoice.total) # -> Acme Corp 1200.0
|
| 109 |
+
```
|
| 110 |
+
|
| 111 |
+
**By hand** - the decorator just builds a JSON schema; you can pass that schema directly, which is exactly what Needle consumes. This is how you set descriptions and constraints without the decorator (and `tools.json` for the CLI is the same shape):
|
| 112 |
+
|
| 113 |
+
```python
|
| 114 |
+
tools = [{
|
| 115 |
+
"name": "set_lights",
|
| 116 |
+
"description": "Turn a room's lights on or off and set brightness",
|
| 117 |
+
"parameters": {
|
| 118 |
+
"type": "object",
|
| 119 |
+
"properties": {
|
| 120 |
+
"room": {"type": "string", "description": "which room to control"},
|
| 121 |
+
"on": {"type": "boolean"},
|
| 122 |
+
"brightness": {"type": "integer", "minimum": 0, "maximum": 100},
|
| 123 |
+
},
|
| 124 |
+
"required": ["room", "on"],
|
| 125 |
+
},
|
| 126 |
+
}]
|
| 127 |
+
agent = needle.Needle(tools=tools)
|
| 128 |
+
```
|
| 129 |
+
|
| 130 |
+
Prefer to drive the loop yourself instead of `run()`? `complete()` returns the raw call and you execute it:
|
| 131 |
+
|
| 132 |
+
```python
|
| 133 |
+
import json
|
| 134 |
+
response = agent.complete("dim the living room to 30")
|
| 135 |
+
if response["type"] == "call":
|
| 136 |
+
result = set_lights(**response["function_calls"][0]["arguments"])
|
| 137 |
+
response = agent.complete(json.dumps(result)) # feed the result back
|
| 138 |
+
```
|
| 139 |
+
|
| 140 |
+
With a large catalogue, persist tool embeddings across runs with `needle.Needle(tools=..., tool_index_path="tools.idx")`. Every turn returns one JSON object:
|
| 141 |
+
|
| 142 |
+
```json
|
| 143 |
+
{
|
| 144 |
+
"type": "call",
|
| 145 |
+
"success": true,
|
| 146 |
+
"error": null,
|
| 147 |
+
"error_code": null,
|
| 148 |
+
"function_calls": [ { "name": "set_lights", "arguments": { "room": "living room", "on": true, "brightness": 30 } } ],
|
| 149 |
+
"reasoning": "'living room' -> room; 'dim' -> on true, brightness 30",
|
| 150 |
+
"confidence": 0.94,
|
| 151 |
+
"prefill_tps": 4300.0,
|
| 152 |
+
"decode_tps": 850.0,
|
| 153 |
+
"peak_ram_mb": 28.0
|
| 154 |
+
}
|
| 155 |
+
```
|
| 156 |
+
|
| 157 |
+
## Behaviour
|
| 158 |
+
|
| 159 |
+
Needle solves every problem as a function call. The context declares what may be called; the model answers with calls. Performing an action and extracting structured data are the same operation, the only difference is what you declare.
|
| 160 |
+
|
| 161 |
+
- A request no declared tool can serve is refused with the empty call `[]`. That is the whole contract for off-topic input; there is no free-text fallback.
|
| 162 |
+
- Arguments contain only values evidenced by the input. An optional field with no evidence is omitted, not guessed; omission is the field-level `[]`.
|
| 163 |
+
- `reasoning` is the model's short derivation of each argument from its source span (`'ten minutes' -> minutes 10`). It is generated unconstrained; only the call itself is grammar-constrained, so the JSON cannot be malformed while the derivation stays legible.
|
| 164 |
+
- After you execute a call, pass the result back as the next `complete()`. The model continues from it, and later arguments may depend on earlier results: `search_for_contact` first, then `send_instant_message` with the returned `contact_id`. A final step may answer in plain text from the results: `"type": "respond"` with empty `function_calls`.
|
| 165 |
+
- A session shares one toolset. Later turns are bare queries against the same tools; `reset()` rewinds the conversation and keeps the tools loaded.
|
| 166 |
+
|
| 167 |
+
## System facts
|
| 168 |
+
|
| 169 |
+
An optional system turn carries environment state as facts, never instructions:
|
| 170 |
+
|
| 171 |
+
```
|
| 172 |
+
date: 2026-07-21 Tue 14:30; locale: en-US; device: phone; battery: 62%
|
| 173 |
+
```
|
| 174 |
+
|
| 175 |
+
Recognized keys are `date`, `locale`, `device`, `battery`, `network`, `location`, `user`, and `assistant`. The model resolves relative language against them: "tomorrow at 7" becomes an absolute time only when a `date:` fact licenses it, otherwise the human phrase passes through verbatim. `assistant:` declares the identity the model binds to. Pass the turn with `--system system.txt` on the CLI or `needle.Needle(tools=tools, system="date: ...")` in Python. Needle trains with and without the turn, so omitting it is safe; instructions placed there do not steer the model.
|
| 176 |
+
|
| 177 |
+
## Deploy Needle
|
| 178 |
+
|
| 179 |
+
Download the folder for your platform from the release:
|
| 180 |
+
|
| 181 |
+
| your device | folder | command-line | library |
|
| 182 |
+
| --- | --- | --- | --- |
|
| 183 |
+
| Mac (Apple Silicon) | `macos-arm64` | `needle` | `libneedle.a` |
|
| 184 |
+
| Linux x86-64 (PC, server, AMD) | `linux-x86_64` | `needle` | `libneedle.a` |
|
| 185 |
+
| Linux ARM64 (Raspberry Pi, server) | `linux-arm64` | `needle` | `libneedle.a` |
|
| 186 |
+
| Linux ARMv7 (32-bit) | `linux-armv7` | `needle` | `libneedle.a` |
|
| 187 |
+
| Linux RISC-V | `linux-riscv64` | `needle` | `libneedle.a` |
|
| 188 |
+
| Linux MIPS32el (Ingenic cameras, routers) | `linux-mipsel` | `needle` | `libneedle.a` |
|
| 189 |
+
| Windows x64 | `windows-x86_64` | `needle.exe` | `libneedle.a` |
|
| 190 |
+
| Windows ARM | `windows-arm64` | `needle.exe` | `libneedle.a` |
|
| 191 |
+
| Android | `android-arm64` / `android-armv7` / `android-riscv64` | `needle` | `libneedle.a` |
|
| 192 |
+
| iOS / watchOS / tvOS | `ios-arm64` / `watchos-arm64` / `tvos-arm64` | - | `libneedle.a` |
|
| 193 |
+
| Browser / Node (WebAssembly) | `wasm` | - | `needle.js` + `needle.wasm` |
|
| 194 |
+
|
| 195 |
+
To run it, use the command-line binary. On macOS, Linux, or Android:
|
| 196 |
+
|
| 197 |
+
```sh
|
| 198 |
+
# answer one query and exit
|
| 199 |
+
./needle --tools tools.json --prompt "dim the living room to 30"
|
| 200 |
+
|
| 201 |
+
# or an HTTP server on localhost:8080 (POST /complete {"input": "..."})
|
| 202 |
+
./needle --tools tools.json --serve
|
| 203 |
+
|
| 204 |
+
# with a large tool catalogue, persist tool embeddings across runs
|
| 205 |
+
./needle --tools tools.json --tool-index tools.idx --serve
|
| 206 |
+
```
|
| 207 |
+
|
| 208 |
+
`tools.json` is a JSON array of the functions the assistant may call:
|
| 209 |
+
|
| 210 |
+
```json
|
| 211 |
+
[
|
| 212 |
+
{
|
| 213 |
+
"name": "set_lights",
|
| 214 |
+
"description": "Turn a room's lights on or off and set brightness",
|
| 215 |
+
"parameters": {
|
| 216 |
+
"type": "object",
|
| 217 |
+
"properties": {
|
| 218 |
+
"room": { "type": "string" },
|
| 219 |
+
"on": { "type": "boolean" },
|
| 220 |
+
"brightness": { "type": "integer", "description": "0 to 100" }
|
| 221 |
+
},
|
| 222 |
+
"required": ["room", "on"]
|
| 223 |
+
}
|
| 224 |
+
},
|
| 225 |
+
{
|
| 226 |
+
"name": "play_music",
|
| 227 |
+
"description": "Play music matching a mood, genre, or artist",
|
| 228 |
+
"parameters": {
|
| 229 |
+
"type": "object",
|
| 230 |
+
"properties": { "query": { "type": "string" } },
|
| 231 |
+
"required": ["query"]
|
| 232 |
+
}
|
| 233 |
+
},
|
| 234 |
+
{
|
| 235 |
+
"name": "send_message",
|
| 236 |
+
"description": "Text a contact",
|
| 237 |
+
"parameters": {
|
| 238 |
+
"type": "object",
|
| 239 |
+
"properties": {
|
| 240 |
+
"to": { "type": "string" },
|
| 241 |
+
"body": { "type": "string" }
|
| 242 |
+
},
|
| 243 |
+
"required": ["to", "body"]
|
| 244 |
+
}
|
| 245 |
+
}
|
| 246 |
+
]
|
| 247 |
+
```
|
| 248 |
+
|
| 249 |
+
## Tool retrieval
|
| 250 |
+
|
| 251 |
+
Five or fewer declared tools render directly. Above that, retrieval engages: at init every tool schema is embedded once by a built-in contrastive head, each turn embeds the query, and only the five highest-scoring tools enter the context, with the grammar rebuilt over just that subset. An unselected tool is unreachable, not merely unlikely. `--tool-index <path>` (CLI) or `tool_index_path` (Python) persists the embeddings on disk, keyed by a fingerprint over the schemas and the model; a matching fingerprint loads instantly, a changed schema re-embeds only what changed.
|
| 252 |
+
|
| 253 |
+
## Confidence
|
| 254 |
+
|
| 255 |
+
The `confidence` field is the minimum of two signals: a calibrated post-hoc head that scores the full prompt plus the call the model just produced, and the decoding probability of the call tokens. A call is accepted only when both agree, so the failure mode is escalation, not wrong execution. The contract: pick a threshold for your product, act at or above it, re-ask or route to a bigger model below it. Off-topic requests return the empty call `[]`.
|
| 256 |
+
|
| 257 |
+
## Fine-tuning
|
| 258 |
+
|
| 259 |
+
Needle is open and trainable end to end. Fine-tune it on your own tools and domains, then export to a `.cact` and ship it like the base model. See the [needle repo](https://github.com/cactus-compute/needle) for training and export.
|
| 260 |
+
|
| 261 |
+
## Extraction
|
| 262 |
+
|
| 263 |
+
Extraction is the same exchange as tool calling: declare the record schema as the only tool and pass the content as the prompt; the passage sits where the query sits, and the returned call's `arguments` are the extracted fields. With one declared tool the grammar admits exactly one call of that name, the `tool_choice` equivalent, so schema conformance is guaranteed rather than requested. There is no separate JSON mode.
|
| 264 |
+
|
| 265 |
+
`schema.json` describes the record to extract:
|
| 266 |
+
|
| 267 |
+
```json
|
| 268 |
+
[
|
| 269 |
+
{
|
| 270 |
+
"name": "receipt",
|
| 271 |
+
"description": "A purchase receipt shared as text",
|
| 272 |
+
"parameters": {
|
| 273 |
+
"type": "object",
|
| 274 |
+
"properties": {
|
| 275 |
+
"merchant": { "type": "string" },
|
| 276 |
+
"total": { "type": "number" },
|
| 277 |
+
"currency": { "type": "string" },
|
| 278 |
+
"line_items": { "type": "array", "items": { "type": "object" } }
|
| 279 |
+
},
|
| 280 |
+
"required": ["merchant", "total"]
|
| 281 |
+
}
|
| 282 |
+
}
|
| 283 |
+
]
|
| 284 |
+
```
|
| 285 |
+
|
| 286 |
+
```sh
|
| 287 |
+
./needle --tools schema.json --prompt "GreenMart receipt: oat milk 3.50, total 7.75 paid by visa"
|
| 288 |
+
```
|
| 289 |
+
|
| 290 |
+
```json
|
| 291 |
+
{ "type": "call", "function_calls": [ { "name": "receipt", "arguments": { "merchant": "GreenMart", "total": 7.75 } } ] }
|
| 292 |
+
```
|
| 293 |
+
|
| 294 |
+
## Citation
|
| 295 |
+
|
| 296 |
+
Needle 2 is built by the Cactus Compute team. If you use it in your work, please cite:
|
| 297 |
+
|
| 298 |
+
```bibtex
|
| 299 |
+
@misc{needle2_2026,
|
| 300 |
+
title = {Needle 2: A 45M-Parameter Foundation Tool-Calling Model for Tiny Devices},
|
| 301 |
+
author = {Ndubuaku, Henry and Mosoyan, Karen and Mroz, Jakub and Cylich, Noah and
|
| 302 |
+
Kumar, Satyajit and Sandhu, Parkirat and Shemet, Roman and Lee, Justin H.},
|
| 303 |
+
year = {2026},
|
| 304 |
+
organization = {Cactus Compute, Inc.},
|
| 305 |
+
howpublished = {\url{https://github.com/cactus-compute/needle}}
|
| 306 |
+
}
|
| 307 |
+
```
|
| 308 |
+
|
| 309 |
+
Reach out on founders@cactuscompute.com for partnerships, collaborations, synergies and deploying Needle2 in your product.
|
android-arm64/libneedle.a
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d002c1e42372284b5893c434edcd3802260e6c9f11e6a1137cf4ca8f9f3bc7f0
|
| 3 |
+
size 20595100
|
android-arm64/needle
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:da6d9daef473a711a660deee42337995e445bc244789c26924febcc31ef72fbb
|
| 3 |
+
size 14805656
|
android-arm64/needle.h
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#ifndef NEEDLE_H
|
| 2 |
+
#define NEEDLE_H
|
| 3 |
+
|
| 4 |
+
#ifndef NEEDLE_API
|
| 5 |
+
#define NEEDLE_API __attribute__((visibility("default")))
|
| 6 |
+
#endif
|
| 7 |
+
|
| 8 |
+
#ifdef __cplusplus
|
| 9 |
+
extern "C" {
|
| 10 |
+
#endif
|
| 11 |
+
|
| 12 |
+
NEEDLE_API int needle_init(
|
| 13 |
+
const char* system_prompt,
|
| 14 |
+
const char* tools_json,
|
| 15 |
+
const char* tool_index_path
|
| 16 |
+
);
|
| 17 |
+
|
| 18 |
+
NEEDLE_API int needle_complete(
|
| 19 |
+
const char* input,
|
| 20 |
+
int max_new_tokens,
|
| 21 |
+
char* out,
|
| 22 |
+
int out_capacity
|
| 23 |
+
);
|
| 24 |
+
|
| 25 |
+
NEEDLE_API void needle_reset(void);
|
| 26 |
+
|
| 27 |
+
NEEDLE_API int needle_load(
|
| 28 |
+
const unsigned char* cact,
|
| 29 |
+
unsigned long long n
|
| 30 |
+
);
|
| 31 |
+
|
| 32 |
+
#ifdef __cplusplus
|
| 33 |
+
}
|
| 34 |
+
#endif
|
| 35 |
+
#endif
|
android-armv7/libneedle.a
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9480d64453850e1e1c5647cf6fcad1a7b4e01761a6590574ff210809556083d3
|
| 3 |
+
size 17901618
|
android-armv7/needle
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:982c151f359e5a3650cef6a6fa079e5278695b4fb850695f335339add0d1ccb1
|
| 3 |
+
size 14449500
|
android-armv7/needle.h
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#ifndef NEEDLE_H
|
| 2 |
+
#define NEEDLE_H
|
| 3 |
+
|
| 4 |
+
#ifndef NEEDLE_API
|
| 5 |
+
#define NEEDLE_API __attribute__((visibility("default")))
|
| 6 |
+
#endif
|
| 7 |
+
|
| 8 |
+
#ifdef __cplusplus
|
| 9 |
+
extern "C" {
|
| 10 |
+
#endif
|
| 11 |
+
|
| 12 |
+
NEEDLE_API int needle_init(
|
| 13 |
+
const char* system_prompt,
|
| 14 |
+
const char* tools_json,
|
| 15 |
+
const char* tool_index_path
|
| 16 |
+
);
|
| 17 |
+
|
| 18 |
+
NEEDLE_API int needle_complete(
|
| 19 |
+
const char* input,
|
| 20 |
+
int max_new_tokens,
|
| 21 |
+
char* out,
|
| 22 |
+
int out_capacity
|
| 23 |
+
);
|
| 24 |
+
|
| 25 |
+
NEEDLE_API void needle_reset(void);
|
| 26 |
+
|
| 27 |
+
NEEDLE_API int needle_load(
|
| 28 |
+
const unsigned char* cact,
|
| 29 |
+
unsigned long long n
|
| 30 |
+
);
|
| 31 |
+
|
| 32 |
+
#ifdef __cplusplus
|
| 33 |
+
}
|
| 34 |
+
#endif
|
| 35 |
+
#endif
|
android-riscv64/libneedle.a
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:12642705bdbbca93ec86bb18bef9abdce967b6e6b3272d33df9816d76c58a0a3
|
| 3 |
+
size 28885474
|
android-riscv64/needle
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5f56fce955df3570c6de69201e157f308229d743c1ffe86d927b37a80d99595e
|
| 3 |
+
size 14802544
|
android-riscv64/needle.h
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#ifndef NEEDLE_H
|
| 2 |
+
#define NEEDLE_H
|
| 3 |
+
|
| 4 |
+
#ifndef NEEDLE_API
|
| 5 |
+
#define NEEDLE_API __attribute__((visibility("default")))
|
| 6 |
+
#endif
|
| 7 |
+
|
| 8 |
+
#ifdef __cplusplus
|
| 9 |
+
extern "C" {
|
| 10 |
+
#endif
|
| 11 |
+
|
| 12 |
+
NEEDLE_API int needle_init(
|
| 13 |
+
const char* system_prompt,
|
| 14 |
+
const char* tools_json,
|
| 15 |
+
const char* tool_index_path
|
| 16 |
+
);
|
| 17 |
+
|
| 18 |
+
NEEDLE_API int needle_complete(
|
| 19 |
+
const char* input,
|
| 20 |
+
int max_new_tokens,
|
| 21 |
+
char* out,
|
| 22 |
+
int out_capacity
|
| 23 |
+
);
|
| 24 |
+
|
| 25 |
+
NEEDLE_API void needle_reset(void);
|
| 26 |
+
|
| 27 |
+
NEEDLE_API int needle_load(
|
| 28 |
+
const unsigned char* cact,
|
| 29 |
+
unsigned long long n
|
| 30 |
+
);
|
| 31 |
+
|
| 32 |
+
#ifdef __cplusplus
|
| 33 |
+
}
|
| 34 |
+
#endif
|
| 35 |
+
#endif
|
assets/architecture.png
ADDED
|
Git LFS Details
|
assets/banner.png
ADDED
|
Git LFS Details
|
assets/frontier.png
ADDED
|
banner.png
ADDED
|
Git LFS Details
|
checkpoints/needle2.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4b0a972d163ffc7678fb3c36bace508114872e9d2ce9e10f225825752d3795bc
|
| 3 |
+
size 90426504
|
config.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type": "needle",
|
| 3 |
+
"architectures": ["NeedleForToolCalling"],
|
| 4 |
+
"name_or_path": "Cactus-Compute/needle2",
|
| 5 |
+
"vocab_size": 8192,
|
| 6 |
+
"hidden_size": 512,
|
| 7 |
+
"num_hidden_layers": 27,
|
| 8 |
+
"num_attention_heads": 8,
|
| 9 |
+
"num_key_value_heads": 4,
|
| 10 |
+
"head_dim": 64,
|
| 11 |
+
"max_position_embeddings": 2048,
|
| 12 |
+
"rope_theta": 100000.0,
|
| 13 |
+
"tie_word_embeddings": true,
|
| 14 |
+
"torch_dtype": "float16",
|
| 15 |
+
"total_parameters": 44900000,
|
| 16 |
+
"sliding_window": 256,
|
| 17 |
+
"attention": "gqa",
|
| 18 |
+
"mlp": "hadamard",
|
| 19 |
+
"extras": {
|
| 20 |
+
"engram": {"sites": [2, 15], "orders": [2, 3], "slots": 8192, "sub_dim": 128, "conv_taps": 4, "conv_dilation": 3},
|
| 21 |
+
"mhc_lanes": 4,
|
| 22 |
+
"heads": ["contrastive_retrieval", "confidence"]
|
| 23 |
+
},
|
| 24 |
+
"quantization": {
|
| 25 |
+
"method": "cactus-quants",
|
| 26 |
+
"scheme": "embedding=4,mhc=4,default=2",
|
| 27 |
+
"effective_bits": 2.2,
|
| 28 |
+
"group_size": 128,
|
| 29 |
+
"kv_cache_bits": 8,
|
| 30 |
+
"activation_bits": 8
|
| 31 |
+
},
|
| 32 |
+
"deployment": {
|
| 33 |
+
"format": "cact",
|
| 34 |
+
"binary_size_mb": 14,
|
| 35 |
+
"session_ram_mb": 28,
|
| 36 |
+
"runtime": "self-contained C++ / WebAssembly, no dependencies"
|
| 37 |
+
}
|
| 38 |
+
}
|
frontier.svg
ADDED
|
|
ios-arm64/libneedle.a
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:984b30ded8ed3b17fb097ec17d51a11d1ff6fde28eca8bc0998eaf9905799093
|
| 3 |
+
size 14172216
|
ios-arm64/needle.h
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#ifndef NEEDLE_H
|
| 2 |
+
#define NEEDLE_H
|
| 3 |
+
|
| 4 |
+
#ifndef NEEDLE_API
|
| 5 |
+
#define NEEDLE_API __attribute__((visibility("default")))
|
| 6 |
+
#endif
|
| 7 |
+
|
| 8 |
+
#ifdef __cplusplus
|
| 9 |
+
extern "C" {
|
| 10 |
+
#endif
|
| 11 |
+
|
| 12 |
+
NEEDLE_API int needle_init(
|
| 13 |
+
const char* system_prompt,
|
| 14 |
+
const char* tools_json,
|
| 15 |
+
const char* tool_index_path
|
| 16 |
+
);
|
| 17 |
+
|
| 18 |
+
NEEDLE_API int needle_complete(
|
| 19 |
+
const char* input,
|
| 20 |
+
int max_new_tokens,
|
| 21 |
+
char* out,
|
| 22 |
+
int out_capacity
|
| 23 |
+
);
|
| 24 |
+
|
| 25 |
+
NEEDLE_API void needle_reset(void);
|
| 26 |
+
|
| 27 |
+
NEEDLE_API int needle_load(
|
| 28 |
+
const unsigned char* cact,
|
| 29 |
+
unsigned long long n
|
| 30 |
+
);
|
| 31 |
+
|
| 32 |
+
#ifdef __cplusplus
|
| 33 |
+
}
|
| 34 |
+
#endif
|
| 35 |
+
#endif
|
ios-sim-arm64/libneedle.a
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:427e9589bb70011dd38a1abadf299c4393a46c08e8a3382f434e505229001579
|
| 3 |
+
size 14180216
|
ios-sim-arm64/needle.h
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#ifndef NEEDLE_H
|
| 2 |
+
#define NEEDLE_H
|
| 3 |
+
|
| 4 |
+
#ifndef NEEDLE_API
|
| 5 |
+
#define NEEDLE_API __attribute__((visibility("default")))
|
| 6 |
+
#endif
|
| 7 |
+
|
| 8 |
+
#ifdef __cplusplus
|
| 9 |
+
extern "C" {
|
| 10 |
+
#endif
|
| 11 |
+
|
| 12 |
+
NEEDLE_API int needle_init(
|
| 13 |
+
const char* system_prompt,
|
| 14 |
+
const char* tools_json,
|
| 15 |
+
const char* tool_index_path
|
| 16 |
+
);
|
| 17 |
+
|
| 18 |
+
NEEDLE_API int needle_complete(
|
| 19 |
+
const char* input,
|
| 20 |
+
int max_new_tokens,
|
| 21 |
+
char* out,
|
| 22 |
+
int out_capacity
|
| 23 |
+
);
|
| 24 |
+
|
| 25 |
+
NEEDLE_API void needle_reset(void);
|
| 26 |
+
|
| 27 |
+
NEEDLE_API int needle_load(
|
| 28 |
+
const unsigned char* cact,
|
| 29 |
+
unsigned long long n
|
| 30 |
+
);
|
| 31 |
+
|
| 32 |
+
#ifdef __cplusplus
|
| 33 |
+
}
|
| 34 |
+
#endif
|
| 35 |
+
#endif
|
linux-arm64/libneedle.a
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:289fee626efe9f3367a085ce631a0ca3661854c6717acd06d2d93fd34e7912a5
|
| 3 |
+
size 20100940
|
linux-arm64/needle
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d85c7ede0ded15dbce0e20d746a41c454eccf55217238ada8a31ae2a69a13180
|
| 3 |
+
size 14802264
|
linux-arm64/needle.h
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#ifndef NEEDLE_H
|
| 2 |
+
#define NEEDLE_H
|
| 3 |
+
|
| 4 |
+
#ifndef NEEDLE_API
|
| 5 |
+
#define NEEDLE_API __attribute__((visibility("default")))
|
| 6 |
+
#endif
|
| 7 |
+
|
| 8 |
+
#ifdef __cplusplus
|
| 9 |
+
extern "C" {
|
| 10 |
+
#endif
|
| 11 |
+
|
| 12 |
+
NEEDLE_API int needle_init(
|
| 13 |
+
const char* system_prompt,
|
| 14 |
+
const char* tools_json,
|
| 15 |
+
const char* tool_index_path
|
| 16 |
+
);
|
| 17 |
+
|
| 18 |
+
NEEDLE_API int needle_complete(
|
| 19 |
+
const char* input,
|
| 20 |
+
int max_new_tokens,
|
| 21 |
+
char* out,
|
| 22 |
+
int out_capacity
|
| 23 |
+
);
|
| 24 |
+
|
| 25 |
+
NEEDLE_API void needle_reset(void);
|
| 26 |
+
|
| 27 |
+
NEEDLE_API int needle_load(
|
| 28 |
+
const unsigned char* cact,
|
| 29 |
+
unsigned long long n
|
| 30 |
+
);
|
| 31 |
+
|
| 32 |
+
#ifdef __cplusplus
|
| 33 |
+
}
|
| 34 |
+
#endif
|
| 35 |
+
#endif
|
linux-armv7/libneedle.a
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:63442ed58cae565ba1165e462ea60ee1bfa74ba962f563da558e7772a2a42564
|
| 3 |
+
size 17709260
|
linux-armv7/needle
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0f94c3582140952617f57ad01b81cfbe45d36c553ffedce20035788447bc88b9
|
| 3 |
+
size 14719788
|
linux-armv7/needle.h
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#ifndef NEEDLE_H
|
| 2 |
+
#define NEEDLE_H
|
| 3 |
+
|
| 4 |
+
#ifndef NEEDLE_API
|
| 5 |
+
#define NEEDLE_API __attribute__((visibility("default")))
|
| 6 |
+
#endif
|
| 7 |
+
|
| 8 |
+
#ifdef __cplusplus
|
| 9 |
+
extern "C" {
|
| 10 |
+
#endif
|
| 11 |
+
|
| 12 |
+
NEEDLE_API int needle_init(
|
| 13 |
+
const char* system_prompt,
|
| 14 |
+
const char* tools_json,
|
| 15 |
+
const char* tool_index_path
|
| 16 |
+
);
|
| 17 |
+
|
| 18 |
+
NEEDLE_API int needle_complete(
|
| 19 |
+
const char* input,
|
| 20 |
+
int max_new_tokens,
|
| 21 |
+
char* out,
|
| 22 |
+
int out_capacity
|
| 23 |
+
);
|
| 24 |
+
|
| 25 |
+
NEEDLE_API void needle_reset(void);
|
| 26 |
+
|
| 27 |
+
NEEDLE_API int needle_load(
|
| 28 |
+
const unsigned char* cact,
|
| 29 |
+
unsigned long long n
|
| 30 |
+
);
|
| 31 |
+
|
| 32 |
+
#ifdef __cplusplus
|
| 33 |
+
}
|
| 34 |
+
#endif
|
| 35 |
+
#endif
|
linux-mipsel/libneedle.a
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7eaa8878c1d5ebf5ea9d1cf1d6340087a12517273470a8ea3d98d59394aaf537
|
| 3 |
+
size 17519030
|
linux-mipsel/needle
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:61a709649c7505f22ecfe35b64a23efef7ccb57775b3ad6ffb20f41ce91dde39
|
| 3 |
+
size 15273868
|
linux-mipsel/needle.h
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#ifndef NEEDLE_H
|
| 2 |
+
#define NEEDLE_H
|
| 3 |
+
|
| 4 |
+
#ifndef NEEDLE_API
|
| 5 |
+
#define NEEDLE_API __attribute__((visibility("default")))
|
| 6 |
+
#endif
|
| 7 |
+
|
| 8 |
+
#ifdef __cplusplus
|
| 9 |
+
extern "C" {
|
| 10 |
+
#endif
|
| 11 |
+
|
| 12 |
+
NEEDLE_API int needle_init(
|
| 13 |
+
const char* system_prompt,
|
| 14 |
+
const char* tools_json,
|
| 15 |
+
const char* tool_index_path
|
| 16 |
+
);
|
| 17 |
+
|
| 18 |
+
NEEDLE_API int needle_complete(
|
| 19 |
+
const char* input,
|
| 20 |
+
int max_new_tokens,
|
| 21 |
+
char* out,
|
| 22 |
+
int out_capacity
|
| 23 |
+
);
|
| 24 |
+
|
| 25 |
+
NEEDLE_API void needle_reset(void);
|
| 26 |
+
|
| 27 |
+
NEEDLE_API int needle_load(
|
| 28 |
+
const unsigned char* cact,
|
| 29 |
+
unsigned long long n
|
| 30 |
+
);
|
| 31 |
+
|
| 32 |
+
#ifdef __cplusplus
|
| 33 |
+
}
|
| 34 |
+
#endif
|
| 35 |
+
#endif
|
linux-riscv64/libneedle.a
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:baf3370f446d9b9b182914bd8ed4f41122f598192b1278f4d5ebba146f2912fc
|
| 3 |
+
size 21520380
|
linux-riscv64/needle
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b794b67d4ae08fba0407eb25e4074433990c4c09d1e90b7e386146b6b44d5da0
|
| 3 |
+
size 14758368
|
linux-riscv64/needle.h
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#ifndef NEEDLE_H
|
| 2 |
+
#define NEEDLE_H
|
| 3 |
+
|
| 4 |
+
#ifndef NEEDLE_API
|
| 5 |
+
#define NEEDLE_API __attribute__((visibility("default")))
|
| 6 |
+
#endif
|
| 7 |
+
|
| 8 |
+
#ifdef __cplusplus
|
| 9 |
+
extern "C" {
|
| 10 |
+
#endif
|
| 11 |
+
|
| 12 |
+
NEEDLE_API int needle_init(
|
| 13 |
+
const char* system_prompt,
|
| 14 |
+
const char* tools_json,
|
| 15 |
+
const char* tool_index_path
|
| 16 |
+
);
|
| 17 |
+
|
| 18 |
+
NEEDLE_API int needle_complete(
|
| 19 |
+
const char* input,
|
| 20 |
+
int max_new_tokens,
|
| 21 |
+
char* out,
|
| 22 |
+
int out_capacity
|
| 23 |
+
);
|
| 24 |
+
|
| 25 |
+
NEEDLE_API void needle_reset(void);
|
| 26 |
+
|
| 27 |
+
NEEDLE_API int needle_load(
|
| 28 |
+
const unsigned char* cact,
|
| 29 |
+
unsigned long long n
|
| 30 |
+
);
|
| 31 |
+
|
| 32 |
+
#ifdef __cplusplus
|
| 33 |
+
}
|
| 34 |
+
#endif
|
| 35 |
+
#endif
|
linux-x86_64/libneedle.a
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:150b4bad3909f5be4d1889e57ca1486ab77ca01014dc2b52b143a7d575312b02
|
| 3 |
+
size 19542284
|
linux-x86_64/needle
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2713ed0f26e8ff0e1555de69f891cb25578259b729c04f8ea4540a06166d7334
|
| 3 |
+
size 14869408
|
linux-x86_64/needle.h
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#ifndef NEEDLE_H
|
| 2 |
+
#define NEEDLE_H
|
| 3 |
+
|
| 4 |
+
#ifndef NEEDLE_API
|
| 5 |
+
#define NEEDLE_API __attribute__((visibility("default")))
|
| 6 |
+
#endif
|
| 7 |
+
|
| 8 |
+
#ifdef __cplusplus
|
| 9 |
+
extern "C" {
|
| 10 |
+
#endif
|
| 11 |
+
|
| 12 |
+
NEEDLE_API int needle_init(
|
| 13 |
+
const char* system_prompt,
|
| 14 |
+
const char* tools_json,
|
| 15 |
+
const char* tool_index_path
|
| 16 |
+
);
|
| 17 |
+
|
| 18 |
+
NEEDLE_API int needle_complete(
|
| 19 |
+
const char* input,
|
| 20 |
+
int max_new_tokens,
|
| 21 |
+
char* out,
|
| 22 |
+
int out_capacity
|
| 23 |
+
);
|
| 24 |
+
|
| 25 |
+
NEEDLE_API void needle_reset(void);
|
| 26 |
+
|
| 27 |
+
NEEDLE_API int needle_load(
|
| 28 |
+
const unsigned char* cact,
|
| 29 |
+
unsigned long long n
|
| 30 |
+
);
|
| 31 |
+
|
| 32 |
+
#ifdef __cplusplus
|
| 33 |
+
}
|
| 34 |
+
#endif
|
| 35 |
+
#endif
|
macos-arm64/libneedle.a
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1d071ab8337da74ae1b168e766474ee0b8f86039ec4768c97f2cc66322ccc7b5
|
| 3 |
+
size 14183632
|
macos-arm64/needle
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9ca6fd54e478d85f4a0bb29961d048815e8638c6a4980e3a0610051ae187dbb0
|
| 3 |
+
size 14594024
|
macos-arm64/needle.h
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#ifndef NEEDLE_H
|
| 2 |
+
#define NEEDLE_H
|
| 3 |
+
|
| 4 |
+
#ifndef NEEDLE_API
|
| 5 |
+
#define NEEDLE_API __attribute__((visibility("default")))
|
| 6 |
+
#endif
|
| 7 |
+
|
| 8 |
+
#ifdef __cplusplus
|
| 9 |
+
extern "C" {
|
| 10 |
+
#endif
|
| 11 |
+
|
| 12 |
+
NEEDLE_API int needle_init(
|
| 13 |
+
const char* system_prompt,
|
| 14 |
+
const char* tools_json,
|
| 15 |
+
const char* tool_index_path
|
| 16 |
+
);
|
| 17 |
+
|
| 18 |
+
NEEDLE_API int needle_complete(
|
| 19 |
+
const char* input,
|
| 20 |
+
int max_new_tokens,
|
| 21 |
+
char* out,
|
| 22 |
+
int out_capacity
|
| 23 |
+
);
|
| 24 |
+
|
| 25 |
+
NEEDLE_API void needle_reset(void);
|
| 26 |
+
|
| 27 |
+
NEEDLE_API int needle_load(
|
| 28 |
+
const unsigned char* cact,
|
| 29 |
+
unsigned long long n
|
| 30 |
+
);
|
| 31 |
+
|
| 32 |
+
#ifdef __cplusplus
|
| 33 |
+
}
|
| 34 |
+
#endif
|
| 35 |
+
#endif
|
needle2.cact
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b43aabfcaf1a6db6acf488076eab71d823c08697c7af4521fc1d174b60ede5ba
|
| 3 |
+
size 13737807
|
python/cactus_needle-2.0.0-py3-none-any.whl
ADDED
|
Binary file (6.33 kB). View file
|
|
|
python/cactus_needle-2.0.0-py3-none-macosx_11_0_arm64.whl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c5571e3649c88997c2373d6dcb54801b1d9674826c97b58fb1dc7e122df932bc
|
| 3 |
+
size 13314602
|
python/cactus_needle-2.0.0-py3-none-macosx_11_0_x86_64.whl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2f7c10b474696d2c5d8d5c107596aa2e0282f55d1faf9a843980e969b3c1f65d
|
| 3 |
+
size 13206788
|
python/cactus_needle-2.0.0-py3-none-manylinux2014_aarch64.whl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6660386292916935188edfe8eef94fbf24712085d7c84f80b0698f79509edde3
|
| 3 |
+
size 13281360
|
python/cactus_needle-2.0.0-py3-none-manylinux2014_x86_64.whl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f44f2a87f9989c185ed1a22adbbcd8f6ecf04ec5ce7b0acc7dbf5146e6a38ff7
|
| 3 |
+
size 13273360
|
python/cactus_needle-2.0.0-py3-none-musllinux_1_2_aarch64.whl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1dd5686fba83507fc167d0d371c869bf8948b8fd41bf8fc2c0dd1be24eaeb46a
|
| 3 |
+
size 13284229
|
python/cactus_needle-2.0.0-py3-none-musllinux_1_2_x86_64.whl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:64e6dc706b0a9daaf971af4738ee45b862635aae44e6907385cf2a9c30ca31b5
|
| 3 |
+
size 13275775
|
python/cactus_needle-2.0.0-py3-none-win_amd64.whl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5c35e1f2ffcdf088bbe6e4b0d30394a5c69efbcf229783f169f31942bedc79e2
|
| 3 |
+
size 13291496
|