cactus-react-native 1.4.0 → 1.5.0
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.
- package/README.md +212 -27
- package/android/src/main/jniLibs/arm64-v8a/libcactus.a +0 -0
- package/cpp/HybridCactus.cpp +119 -0
- package/cpp/HybridCactus.hpp +13 -0
- package/cpp/cactus_ffi.h +24 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/cactus_ffi.h +24 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/cactus_utils.h +41 -1
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/engine.h +66 -48
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/gemma_tools.h +549 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/graph.h +102 -21
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/kernel.h +45 -195
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/kernel_utils.h +399 -140
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/cactus +0 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/cactus_ffi.h +24 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/cactus_utils.h +41 -1
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/engine.h +66 -48
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/gemma_tools.h +549 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/graph.h +102 -21
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/kernel.h +45 -195
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/kernel_utils.h +399 -140
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/cactus +0 -0
- package/lib/module/api/Database.js +0 -92
- package/lib/module/api/Database.js.map +1 -1
- package/lib/module/classes/CactusLM.js +33 -15
- package/lib/module/classes/CactusLM.js.map +1 -1
- package/lib/module/classes/CactusSTT.js +90 -15
- package/lib/module/classes/CactusSTT.js.map +1 -1
- package/lib/module/hooks/useCactusLM.js +14 -5
- package/lib/module/hooks/useCactusLM.js.map +1 -1
- package/lib/module/hooks/useCactusSTT.js +100 -4
- package/lib/module/hooks/useCactusSTT.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/models.js +336 -0
- package/lib/module/models.js.map +1 -0
- package/lib/module/native/Cactus.js +37 -0
- package/lib/module/native/Cactus.js.map +1 -1
- package/lib/module/types/CactusLM.js +2 -0
- package/lib/module/types/CactusSTT.js +2 -0
- package/lib/module/types/common.js +2 -0
- package/lib/module/types/{CactusModel.js.map → common.js.map} +1 -1
- package/lib/typescript/src/api/Database.d.ts +0 -6
- package/lib/typescript/src/api/Database.d.ts.map +1 -1
- package/lib/typescript/src/classes/CactusLM.d.ts +7 -3
- package/lib/typescript/src/classes/CactusLM.d.ts.map +1 -1
- package/lib/typescript/src/classes/CactusSTT.d.ts +13 -4
- package/lib/typescript/src/classes/CactusSTT.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useCactusLM.d.ts +2 -2
- package/lib/typescript/src/hooks/useCactusLM.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useCactusSTT.d.ts +12 -4
- package/lib/typescript/src/hooks/useCactusSTT.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -3
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/models.d.ts +6 -0
- package/lib/typescript/src/models.d.ts.map +1 -0
- package/lib/typescript/src/native/Cactus.d.ts +6 -1
- package/lib/typescript/src/native/Cactus.d.ts.map +1 -1
- package/lib/typescript/src/specs/Cactus.nitro.d.ts +5 -0
- package/lib/typescript/src/specs/Cactus.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types/CactusLM.d.ts +2 -0
- package/lib/typescript/src/types/CactusLM.d.ts.map +1 -1
- package/lib/typescript/src/types/CactusSTT.d.ts +20 -0
- package/lib/typescript/src/types/CactusSTT.d.ts.map +1 -1
- package/lib/typescript/src/types/common.d.ts +28 -0
- package/lib/typescript/src/types/common.d.ts.map +1 -0
- package/nitrogen/generated/shared/c++/HybridCactusSpec.cpp +5 -0
- package/nitrogen/generated/shared/c++/HybridCactusSpec.hpp +5 -0
- package/package.json +1 -1
- package/src/api/Database.ts +0 -133
- package/src/classes/CactusLM.ts +49 -17
- package/src/classes/CactusSTT.ts +118 -17
- package/src/hooks/useCactusLM.ts +25 -5
- package/src/hooks/useCactusSTT.ts +117 -5
- package/src/index.tsx +6 -2
- package/src/models.ts +344 -0
- package/src/native/Cactus.ts +55 -0
- package/src/specs/Cactus.nitro.ts +5 -0
- package/src/types/CactusLM.ts +3 -0
- package/src/types/CactusSTT.ts +26 -0
- package/src/types/common.ts +28 -0
- package/lib/module/types/CactusModel.js +0 -2
- package/lib/module/types/CactusSTTModel.js +0 -2
- package/lib/module/types/CactusSTTModel.js.map +0 -1
- package/lib/typescript/src/types/CactusModel.d.ts +0 -13
- package/lib/typescript/src/types/CactusModel.d.ts.map +0 -1
- package/lib/typescript/src/types/CactusSTTModel.d.ts +0 -8
- package/lib/typescript/src/types/CactusSTTModel.d.ts.map +0 -1
- package/src/types/CactusModel.ts +0 -15
- package/src/types/CactusSTTModel.ts +0 -10
package/src/models.ts
ADDED
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
import type { CactusModel } from './types/common';
|
|
2
|
+
|
|
3
|
+
const models: { [key: string]: CactusModel } = {
|
|
4
|
+
'gemma-3-270m-it': {
|
|
5
|
+
completion: true,
|
|
6
|
+
tools: false,
|
|
7
|
+
vision: false,
|
|
8
|
+
embed: true,
|
|
9
|
+
speech: false,
|
|
10
|
+
quantization: {
|
|
11
|
+
int4: {
|
|
12
|
+
sizeMb: 115,
|
|
13
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int4/gemma-3-270m-it.zip',
|
|
14
|
+
},
|
|
15
|
+
int8: {
|
|
16
|
+
sizeMb: 172,
|
|
17
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int8/gemma-3-270m-it.zip',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
'functiongemma-270m-it': {
|
|
22
|
+
completion: true,
|
|
23
|
+
tools: true,
|
|
24
|
+
vision: false,
|
|
25
|
+
embed: true,
|
|
26
|
+
speech: false,
|
|
27
|
+
quantization: {
|
|
28
|
+
int4: {
|
|
29
|
+
sizeMb: 115,
|
|
30
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int4/functiongemma-270m-it.zip',
|
|
31
|
+
},
|
|
32
|
+
int8: {
|
|
33
|
+
sizeMb: 172,
|
|
34
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int8/functiongemma-270m-it.zip',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
'whisper-small': {
|
|
39
|
+
completion: false,
|
|
40
|
+
tools: false,
|
|
41
|
+
vision: false,
|
|
42
|
+
embed: true,
|
|
43
|
+
speech: true,
|
|
44
|
+
quantization: {
|
|
45
|
+
int4: {
|
|
46
|
+
sizeMb: 104,
|
|
47
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int4/whisper-small.zip',
|
|
48
|
+
pro: {
|
|
49
|
+
apple:
|
|
50
|
+
'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int4/pro/apple/whisper-small.zip',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
int8: {
|
|
54
|
+
sizeMb: 282,
|
|
55
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int8/whisper-small.zip',
|
|
56
|
+
pro: {
|
|
57
|
+
apple:
|
|
58
|
+
'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int8/pro/apple/whisper-small.zip',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
'lfm2-350m': {
|
|
64
|
+
completion: true,
|
|
65
|
+
tools: true,
|
|
66
|
+
vision: false,
|
|
67
|
+
embed: true,
|
|
68
|
+
speech: false,
|
|
69
|
+
quantization: {
|
|
70
|
+
int4: {
|
|
71
|
+
sizeMb: 153,
|
|
72
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int4/lfm2-350m.zip',
|
|
73
|
+
},
|
|
74
|
+
int8: {
|
|
75
|
+
sizeMb: 233,
|
|
76
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int8/lfm2-350m.zip',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
'smollm2-360m-instruct': {
|
|
81
|
+
completion: true,
|
|
82
|
+
tools: false,
|
|
83
|
+
vision: false,
|
|
84
|
+
embed: true,
|
|
85
|
+
speech: false,
|
|
86
|
+
quantization: {
|
|
87
|
+
int4: {
|
|
88
|
+
sizeMb: 140,
|
|
89
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int4/smollm2-360m-instruct.zip',
|
|
90
|
+
},
|
|
91
|
+
int8: {
|
|
92
|
+
sizeMb: 227,
|
|
93
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int8/smollm2-360m-instruct.zip',
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
'lfm2-vl-450m': {
|
|
98
|
+
completion: true,
|
|
99
|
+
tools: false,
|
|
100
|
+
vision: true,
|
|
101
|
+
embed: true,
|
|
102
|
+
speech: false,
|
|
103
|
+
quantization: {
|
|
104
|
+
int4: {
|
|
105
|
+
sizeMb: 318,
|
|
106
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int4/lfm2-vl-450m.zip',
|
|
107
|
+
pro: {
|
|
108
|
+
apple:
|
|
109
|
+
'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int4/pro/apple/lfm2-vl-450m.zip',
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
int8: {
|
|
113
|
+
sizeMb: 480,
|
|
114
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int8/lfm2-vl-450m.zip',
|
|
115
|
+
pro: {
|
|
116
|
+
apple:
|
|
117
|
+
'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int8/pro/apple/lfm2-vl-450m.zip',
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
'nomic-embed-text-v2-moe': {
|
|
123
|
+
completion: false,
|
|
124
|
+
tools: false,
|
|
125
|
+
vision: false,
|
|
126
|
+
embed: true,
|
|
127
|
+
speech: false,
|
|
128
|
+
quantization: {
|
|
129
|
+
int4: {
|
|
130
|
+
sizeMb: 211,
|
|
131
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int4/nomic-embed-text-v2-moe.zip',
|
|
132
|
+
},
|
|
133
|
+
int8: {
|
|
134
|
+
sizeMb: 456,
|
|
135
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int8/nomic-embed-text-v2-moe.zip',
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
'qwen3-0.6b': {
|
|
140
|
+
completion: true,
|
|
141
|
+
tools: true,
|
|
142
|
+
vision: false,
|
|
143
|
+
embed: true,
|
|
144
|
+
speech: false,
|
|
145
|
+
quantization: {
|
|
146
|
+
int4: {
|
|
147
|
+
sizeMb: 234,
|
|
148
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int4/qwen3-0.6b.zip',
|
|
149
|
+
},
|
|
150
|
+
int8: {
|
|
151
|
+
sizeMb: 394,
|
|
152
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int8/qwen3-0.6b.zip',
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
'qwen3-embedding-0.6b': {
|
|
157
|
+
completion: false,
|
|
158
|
+
tools: false,
|
|
159
|
+
vision: false,
|
|
160
|
+
embed: true,
|
|
161
|
+
speech: false,
|
|
162
|
+
quantization: {
|
|
163
|
+
int4: {
|
|
164
|
+
sizeMb: 234,
|
|
165
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int4/qwen3-embedding-0.6b.zip',
|
|
166
|
+
},
|
|
167
|
+
int8: {
|
|
168
|
+
sizeMb: 394,
|
|
169
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int8/qwen3-embedding-0.6b.zip',
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
'lfm2-700m': {
|
|
174
|
+
completion: true,
|
|
175
|
+
tools: true,
|
|
176
|
+
vision: false,
|
|
177
|
+
embed: true,
|
|
178
|
+
speech: false,
|
|
179
|
+
quantization: {
|
|
180
|
+
int4: {
|
|
181
|
+
sizeMb: 300,
|
|
182
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int4/lfm2-700m.zip',
|
|
183
|
+
},
|
|
184
|
+
int8: {
|
|
185
|
+
sizeMb: 467,
|
|
186
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int8/lfm2-700m.zip',
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
'gemma-3-1b-it': {
|
|
191
|
+
completion: true,
|
|
192
|
+
tools: false,
|
|
193
|
+
vision: false,
|
|
194
|
+
embed: false,
|
|
195
|
+
speech: false,
|
|
196
|
+
quantization: {
|
|
197
|
+
int4: {
|
|
198
|
+
sizeMb: 320,
|
|
199
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int4/gemma-3-1b-it.zip',
|
|
200
|
+
},
|
|
201
|
+
int8: {
|
|
202
|
+
sizeMb: 642,
|
|
203
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int8/gemma-3-1b-it.zip',
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
'whisper-medium': {
|
|
208
|
+
completion: false,
|
|
209
|
+
tools: false,
|
|
210
|
+
vision: false,
|
|
211
|
+
embed: true,
|
|
212
|
+
speech: true,
|
|
213
|
+
quantization: {
|
|
214
|
+
int4: {
|
|
215
|
+
sizeMb: 320,
|
|
216
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int4/whisper-medium.zip',
|
|
217
|
+
pro: {
|
|
218
|
+
apple:
|
|
219
|
+
'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int4/pro/apple/whisper-medium.zip',
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
int8: {
|
|
223
|
+
sizeMb: 646,
|
|
224
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int8/whisper-medium.zip',
|
|
225
|
+
pro: {
|
|
226
|
+
apple:
|
|
227
|
+
'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int8/pro/apple/whisper-medium.zip',
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
'lfm2.5-1.2b-instruct': {
|
|
233
|
+
completion: true,
|
|
234
|
+
tools: true,
|
|
235
|
+
vision: false,
|
|
236
|
+
embed: true,
|
|
237
|
+
speech: false,
|
|
238
|
+
quantization: {
|
|
239
|
+
int4: {
|
|
240
|
+
sizeMb: 474,
|
|
241
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int4/lfm2.5-1.2b-instruct.zip',
|
|
242
|
+
},
|
|
243
|
+
int8: {
|
|
244
|
+
sizeMb: 722,
|
|
245
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int8/lfm2.5-1.2b-instruct.zip',
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
'lfm2-1.2b-rag': {
|
|
250
|
+
completion: true,
|
|
251
|
+
tools: true,
|
|
252
|
+
vision: false,
|
|
253
|
+
embed: true,
|
|
254
|
+
speech: false,
|
|
255
|
+
quantization: {
|
|
256
|
+
int4: {
|
|
257
|
+
sizeMb: 474,
|
|
258
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int4/lfm2-1.2b-rag.zip',
|
|
259
|
+
},
|
|
260
|
+
int8: {
|
|
261
|
+
sizeMb: 722,
|
|
262
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int8/lfm2-1.2b-rag.zip',
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
'lfm2-1.2b-tool': {
|
|
267
|
+
completion: true,
|
|
268
|
+
tools: true,
|
|
269
|
+
vision: false,
|
|
270
|
+
embed: true,
|
|
271
|
+
speech: false,
|
|
272
|
+
quantization: {
|
|
273
|
+
int4: {
|
|
274
|
+
sizeMb: 474,
|
|
275
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int4/lfm2-1.2b-tool.zip',
|
|
276
|
+
},
|
|
277
|
+
int8: {
|
|
278
|
+
sizeMb: 722,
|
|
279
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int8/lfm2-1.2b-tool.zip',
|
|
280
|
+
},
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
'lfm2-vl-1.6b': {
|
|
284
|
+
completion: true,
|
|
285
|
+
tools: false,
|
|
286
|
+
vision: true,
|
|
287
|
+
embed: true,
|
|
288
|
+
speech: false,
|
|
289
|
+
quantization: {
|
|
290
|
+
int4: {
|
|
291
|
+
sizeMb: 954,
|
|
292
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int4/lfm2-vl-1.6b.zip',
|
|
293
|
+
pro: {
|
|
294
|
+
apple:
|
|
295
|
+
'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int4/pro/apple/lfm2-vl-1.6b.zip',
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
int8: {
|
|
299
|
+
sizeMb: 1440,
|
|
300
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int8/lfm2-vl-1.6b.zip',
|
|
301
|
+
pro: {
|
|
302
|
+
apple:
|
|
303
|
+
'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int8/pro/apple/lfm2-vl-1.6b.zip',
|
|
304
|
+
},
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
'qwen3-1.7b': {
|
|
309
|
+
completion: true,
|
|
310
|
+
tools: true,
|
|
311
|
+
vision: false,
|
|
312
|
+
embed: true,
|
|
313
|
+
speech: false,
|
|
314
|
+
quantization: {
|
|
315
|
+
int4: {
|
|
316
|
+
sizeMb: 749,
|
|
317
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int4/qwen3-1.7b.zip',
|
|
318
|
+
},
|
|
319
|
+
int8: {
|
|
320
|
+
sizeMb: 1161,
|
|
321
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int8/qwen3-1.7b.zip',
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
},
|
|
325
|
+
'smollm2-1.7b-instruct': {
|
|
326
|
+
completion: true,
|
|
327
|
+
tools: false,
|
|
328
|
+
vision: false,
|
|
329
|
+
embed: true,
|
|
330
|
+
speech: false,
|
|
331
|
+
quantization: {
|
|
332
|
+
int4: {
|
|
333
|
+
sizeMb: 801,
|
|
334
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int4/smollm2-1.7b-instruct.zip',
|
|
335
|
+
},
|
|
336
|
+
int8: {
|
|
337
|
+
sizeMb: 1161,
|
|
338
|
+
url: 'https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/v1.5/int8/smollm2-1.7b-instruct.zip',
|
|
339
|
+
},
|
|
340
|
+
},
|
|
341
|
+
},
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
export default models;
|
package/src/native/Cactus.ts
CHANGED
|
@@ -10,6 +10,9 @@ import type {
|
|
|
10
10
|
import type {
|
|
11
11
|
CactusSTTTranscribeResult,
|
|
12
12
|
TranscribeOptions,
|
|
13
|
+
CactusSTTStreamTranscribeProcessResult,
|
|
14
|
+
StreamTranscribeProcessOptions,
|
|
15
|
+
CactusSTTStreamTranscribeFinalizeResult,
|
|
13
16
|
} from '../types/CactusSTT';
|
|
14
17
|
|
|
15
18
|
export class Cactus {
|
|
@@ -163,6 +166,58 @@ export class Cactus {
|
|
|
163
166
|
}
|
|
164
167
|
}
|
|
165
168
|
|
|
169
|
+
public streamTranscribeInit(): Promise<void> {
|
|
170
|
+
return this.hybridCactus.streamTranscribeInit();
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
public streamTranscribeInsert(audio: number[]): Promise<void> {
|
|
174
|
+
return this.hybridCactus.streamTranscribeInsert(audio);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
public async streamTranscribeProcess(
|
|
178
|
+
options?: StreamTranscribeProcessOptions
|
|
179
|
+
): Promise<CactusSTTStreamTranscribeProcessResult> {
|
|
180
|
+
const optionsJson = options
|
|
181
|
+
? JSON.stringify({
|
|
182
|
+
confirmation_threshold: options.confirmationThreshold,
|
|
183
|
+
})
|
|
184
|
+
: undefined;
|
|
185
|
+
|
|
186
|
+
const response =
|
|
187
|
+
await this.hybridCactus.streamTranscribeProcess(optionsJson);
|
|
188
|
+
|
|
189
|
+
try {
|
|
190
|
+
const parsed = JSON.parse(response);
|
|
191
|
+
|
|
192
|
+
return {
|
|
193
|
+
success: parsed.success,
|
|
194
|
+
confirmed: parsed.confirmed,
|
|
195
|
+
pending: parsed.pending,
|
|
196
|
+
};
|
|
197
|
+
} catch {
|
|
198
|
+
throw new Error('Unable to parse stream transcribe process response');
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
public async streamTranscribeFinalize(): Promise<CactusSTTStreamTranscribeFinalizeResult> {
|
|
203
|
+
const response = await this.hybridCactus.streamTranscribeFinalize();
|
|
204
|
+
|
|
205
|
+
try {
|
|
206
|
+
const parsed = JSON.parse(response);
|
|
207
|
+
|
|
208
|
+
return {
|
|
209
|
+
success: parsed.success,
|
|
210
|
+
confirmed: parsed.confirmed,
|
|
211
|
+
};
|
|
212
|
+
} catch {
|
|
213
|
+
throw new Error('Unable to parse stream transcribe finalize response');
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
public streamTranscribeDestroy(): Promise<void> {
|
|
218
|
+
return this.hybridCactus.streamTranscribeDestroy();
|
|
219
|
+
}
|
|
220
|
+
|
|
166
221
|
public embed(
|
|
167
222
|
text: string,
|
|
168
223
|
embeddingBufferSize: number,
|
|
@@ -27,6 +27,11 @@ export interface Cactus extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
|
|
|
27
27
|
optionsJson?: string,
|
|
28
28
|
callback?: (token: string, tokenId: number) => void
|
|
29
29
|
): Promise<string>;
|
|
30
|
+
streamTranscribeInit(): Promise<void>;
|
|
31
|
+
streamTranscribeInsert(audio: number[]): Promise<void>;
|
|
32
|
+
streamTranscribeProcess(optionsJson?: string): Promise<string>;
|
|
33
|
+
streamTranscribeFinalize(): Promise<string>;
|
|
34
|
+
streamTranscribeDestroy(): Promise<void>;
|
|
30
35
|
embed(
|
|
31
36
|
text: string,
|
|
32
37
|
embeddingBufferSize: number,
|
package/src/types/CactusLM.ts
CHANGED
package/src/types/CactusSTT.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { type ModelOptions } from './common';
|
|
2
|
+
|
|
1
3
|
export interface CactusSTTParams {
|
|
2
4
|
model?: string;
|
|
3
5
|
contextSize?: number;
|
|
6
|
+
options?: ModelOptions;
|
|
4
7
|
}
|
|
5
8
|
|
|
6
9
|
export interface CactusSTTDownloadParams {
|
|
@@ -40,3 +43,26 @@ export interface CactusSTTAudioEmbedParams {
|
|
|
40
43
|
export interface CactusSTTAudioEmbedResult {
|
|
41
44
|
embedding: number[];
|
|
42
45
|
}
|
|
46
|
+
|
|
47
|
+
export interface CactusSTTStreamTranscribeInsertParams {
|
|
48
|
+
audio: number[];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface StreamTranscribeProcessOptions {
|
|
52
|
+
confirmationThreshold?: number;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface CactusSTTStreamTranscribeProcessParams {
|
|
56
|
+
options?: StreamTranscribeProcessOptions;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface CactusSTTStreamTranscribeProcessResult {
|
|
60
|
+
success: boolean;
|
|
61
|
+
confirmed: string;
|
|
62
|
+
pending: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface CactusSTTStreamTranscribeFinalizeResult {
|
|
66
|
+
success: boolean;
|
|
67
|
+
confirmed: string;
|
|
68
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface CactusModel {
|
|
2
|
+
completion: boolean;
|
|
3
|
+
tools: boolean;
|
|
4
|
+
vision: boolean;
|
|
5
|
+
embed: boolean;
|
|
6
|
+
speech: boolean;
|
|
7
|
+
quantization: {
|
|
8
|
+
int4: {
|
|
9
|
+
sizeMb: number;
|
|
10
|
+
url: string;
|
|
11
|
+
pro?: {
|
|
12
|
+
apple: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
int8: {
|
|
16
|
+
sizeMb: number;
|
|
17
|
+
url: string;
|
|
18
|
+
pro?: {
|
|
19
|
+
apple: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface ModelOptions {
|
|
26
|
+
quantization?: 'int4' | 'int8';
|
|
27
|
+
pro?: boolean;
|
|
28
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/CactusSTTModel.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface CactusModel {
|
|
2
|
-
name: string;
|
|
3
|
-
slug: string;
|
|
4
|
-
quantization: number;
|
|
5
|
-
sizeMb: number;
|
|
6
|
-
downloadUrl: string;
|
|
7
|
-
supportsToolCalling: boolean;
|
|
8
|
-
supportsVision: boolean;
|
|
9
|
-
supportsCompletion: boolean;
|
|
10
|
-
createdAt: Date;
|
|
11
|
-
isDownloaded: boolean;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=CactusModel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CactusModel.d.ts","sourceRoot":"","sources":["../../../../src/types/CactusModel.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAE1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,cAAc,EAAE,OAAO,CAAC;IACxB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,SAAS,EAAE,IAAI,CAAC;IAGhB,YAAY,EAAE,OAAO,CAAC;CACvB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CactusSTTModel.d.ts","sourceRoot":"","sources":["../../../../src/types/CactusSTTModel.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAE7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,IAAI,CAAC;IAGhB,YAAY,EAAE,OAAO,CAAC;CACvB"}
|
package/src/types/CactusModel.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export interface CactusModel {
|
|
2
|
-
// API
|
|
3
|
-
name: string;
|
|
4
|
-
slug: string;
|
|
5
|
-
quantization: number;
|
|
6
|
-
sizeMb: number;
|
|
7
|
-
downloadUrl: string;
|
|
8
|
-
supportsToolCalling: boolean;
|
|
9
|
-
supportsVision: boolean;
|
|
10
|
-
supportsCompletion: boolean;
|
|
11
|
-
createdAt: Date;
|
|
12
|
-
|
|
13
|
-
// Local
|
|
14
|
-
isDownloaded: boolean;
|
|
15
|
-
}
|