cactus-react-native 0.2.10 → 1.0.1
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/Cactus.podspec +34 -0
- package/LICENSE +38 -0
- package/README.md +283 -722
- package/android/CMakeLists.txt +40 -0
- package/android/build.gradle +68 -44
- package/android/gradle.properties +5 -5
- package/android/src/main/AndroidManifest.xml +1 -3
- package/android/src/main/cpp/cpp-adapter.cpp +6 -0
- package/android/src/main/java/com/margelo/nitro/cactus/CactusPackage.kt +22 -0
- package/android/src/main/java/com/margelo/nitro/cactus/HybridCactusCrypto.kt +38 -0
- package/android/src/main/java/com/margelo/nitro/cactus/HybridCactusDeviceInfo.kt +24 -0
- package/android/src/main/java/com/margelo/nitro/cactus/HybridCactusFileSystem.kt +227 -0
- package/android/src/main/jniLibs/arm64-v8a/{libcactus.so → libcactus.a} +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libcactus_util.so +0 -0
- package/cpp/HybridCactus.cpp +123 -0
- package/cpp/HybridCactus.hpp +35 -0
- package/cpp/HybridCactusUtil.cpp +45 -0
- package/cpp/HybridCactusUtil.hpp +26 -0
- package/cpp/cactus_ffi.h +55 -0
- package/cpp/cactus_util.h +25 -0
- package/ios/HybridCactusCrypto.swift +37 -0
- package/ios/HybridCactusDeviceInfo.swift +32 -0
- package/ios/HybridCactusFileSystem.swift +234 -0
- package/ios/cactus.xcframework/{info.plist → Info.plist} +2 -37
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/cactus.h +8 -229
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/cactus_ffi.h +28 -229
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/engine.h +347 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ffi_utils.h +286 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/graph.h +319 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/kernel.h +254 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/kernel_utils.h +343 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Info.plist +0 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/cactus +0 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/cactus.h +11 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/cactus_ffi.h +55 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/engine.h +347 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/ffi_utils.h +286 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/graph.h +319 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/kernel.h +254 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/kernel_utils.h +343 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Info.plist +0 -0
- package/ios/cactus.xcframework/{tvos-arm64_x86_64-simulator → ios-arm64-simulator}/cactus.framework/_CodeSignature/CodeResources +1 -1
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/cactus +0 -0
- package/ios/cactus_util.xcframework/Info.plist +39 -0
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Headers/cactus_util.h +25 -0
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Headers/ios_utils.h +10 -0
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Headers/logging.h +25 -0
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Info.plist +0 -0
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/cactus_util +0 -0
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/Headers/cactus_util.h +25 -0
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/Headers/ios_utils.h +10 -0
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/Headers/logging.h +25 -0
- package/ios/{cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework → cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework}/Info.plist +0 -0
- package/ios/{cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework → cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework}/_CodeSignature/CodeResources +36 -2
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/cactus_util +0 -0
- package/lib/module/api/Database.js +60 -0
- package/lib/module/api/Database.js.map +1 -0
- package/lib/module/classes/CactusLM.js +149 -0
- package/lib/module/classes/CactusLM.js.map +1 -0
- package/lib/module/config/CactusConfig.js +6 -0
- package/lib/module/config/CactusConfig.js.map +1 -0
- package/lib/module/constants/packageVersion.js +4 -0
- package/lib/module/constants/packageVersion.js.map +1 -0
- package/lib/module/hooks/useCactusLM.js +233 -0
- package/lib/module/hooks/useCactusLM.js.map +1 -0
- package/lib/module/index.js +9 -409
- package/lib/module/index.js.map +1 -1
- package/lib/module/native/Cactus.js +50 -0
- package/lib/module/native/Cactus.js.map +1 -0
- package/lib/module/native/CactusCrypto.js +10 -0
- package/lib/module/native/CactusCrypto.js.map +1 -0
- package/lib/module/native/CactusDeviceInfo.js +13 -0
- package/lib/module/native/CactusDeviceInfo.js.map +1 -0
- package/lib/module/native/CactusFileSystem.js +35 -0
- package/lib/module/native/CactusFileSystem.js.map +1 -0
- package/lib/module/native/CactusUtil.js +23 -0
- package/lib/module/native/CactusUtil.js.map +1 -0
- package/lib/module/native/index.js +8 -0
- package/lib/module/native/index.js.map +1 -0
- package/lib/module/specs/Cactus.nitro.js +4 -0
- package/lib/module/specs/Cactus.nitro.js.map +1 -0
- package/lib/module/specs/CactusCrypto.nitro.js +4 -0
- package/lib/module/specs/CactusCrypto.nitro.js.map +1 -0
- package/lib/module/specs/CactusDeviceInfo.nitro.js +4 -0
- package/lib/module/specs/CactusDeviceInfo.nitro.js.map +1 -0
- package/lib/module/specs/CactusFileSystem.nitro.js +4 -0
- package/lib/module/specs/CactusFileSystem.nitro.js.map +1 -0
- package/lib/module/specs/CactusUtil.nitro.js +4 -0
- package/lib/module/specs/CactusUtil.nitro.js.map +1 -0
- package/lib/module/telemetry/Telemetry.js +100 -0
- package/lib/module/telemetry/Telemetry.js.map +1 -0
- package/lib/module/types/CactusLM.js +2 -0
- package/lib/module/types/CactusLM.js.map +1 -0
- package/lib/module/types/CactusModel.js +2 -0
- package/lib/module/types/CactusModel.js.map +1 -0
- package/lib/module/utils/error.js +4 -0
- package/lib/module/utils/error.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/api/Database.d.ts +11 -0
- package/lib/typescript/src/api/Database.d.ts.map +1 -0
- package/lib/typescript/src/classes/CactusLM.d.ts +25 -0
- package/lib/typescript/src/classes/CactusLM.d.ts.map +1 -0
- package/lib/typescript/src/config/CactusConfig.d.ts +5 -0
- package/lib/typescript/src/config/CactusConfig.d.ts.map +1 -0
- package/lib/typescript/src/constants/packageVersion.d.ts +2 -0
- package/lib/typescript/src/constants/packageVersion.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useCactusLM.d.ts +20 -0
- package/lib/typescript/src/hooks/useCactusLM.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +6 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/native/Cactus.d.ts +11 -0
- package/lib/typescript/src/native/Cactus.d.ts.map +1 -0
- package/lib/typescript/src/native/CactusCrypto.d.ts +5 -0
- package/lib/typescript/src/native/CactusCrypto.d.ts.map +1 -0
- package/lib/typescript/src/native/CactusDeviceInfo.d.ts +7 -0
- package/lib/typescript/src/native/CactusDeviceInfo.d.ts.map +1 -0
- package/lib/typescript/src/native/CactusFileSystem.d.ts +13 -0
- package/lib/typescript/src/native/CactusFileSystem.d.ts.map +1 -0
- package/lib/typescript/src/native/CactusUtil.d.ts +6 -0
- package/lib/typescript/src/native/CactusUtil.d.ts.map +1 -0
- package/lib/typescript/src/native/index.d.ts +6 -0
- package/lib/typescript/src/native/index.d.ts.map +1 -0
- package/lib/typescript/src/specs/Cactus.nitro.d.ts +13 -0
- package/lib/typescript/src/specs/Cactus.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/CactusCrypto.nitro.d.ts +8 -0
- package/lib/typescript/src/specs/CactusCrypto.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/CactusDeviceInfo.nitro.d.ts +16 -0
- package/lib/typescript/src/specs/CactusDeviceInfo.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/CactusFileSystem.nitro.d.ts +16 -0
- package/lib/typescript/src/specs/CactusFileSystem.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/CactusUtil.nitro.d.ts +10 -0
- package/lib/typescript/src/specs/CactusUtil.nitro.d.ts.map +1 -0
- package/lib/typescript/src/telemetry/Telemetry.d.ts +30 -0
- package/lib/typescript/src/telemetry/Telemetry.d.ts.map +1 -0
- package/lib/typescript/src/types/CactusLM.d.ts +65 -0
- package/lib/typescript/src/types/CactusLM.d.ts.map +1 -0
- package/lib/typescript/src/types/CactusModel.d.ts +12 -0
- package/lib/typescript/src/types/CactusModel.d.ts.map +1 -0
- package/lib/typescript/src/utils/error.d.ts +2 -0
- package/lib/typescript/src/utils/error.d.ts.map +1 -0
- package/nitro.json +31 -0
- package/nitrogen/generated/android/c++/JDeviceInfo.hpp +74 -0
- package/nitrogen/generated/android/c++/JFunc_void_double.hpp +74 -0
- package/nitrogen/generated/android/c++/JHybridCactusCryptoSpec.cpp +65 -0
- package/nitrogen/generated/android/c++/JHybridCactusCryptoSpec.hpp +65 -0
- package/nitrogen/generated/android/c++/JHybridCactusDeviceInfoSpec.cpp +85 -0
- package/nitrogen/generated/android/c++/JHybridCactusDeviceInfoSpec.hpp +66 -0
- package/nitrogen/generated/android/c++/JHybridCactusFileSystemSpec.cpp +192 -0
- package/nitrogen/generated/android/c++/JHybridCactusFileSystemSpec.hpp +73 -0
- package/nitrogen/generated/android/cactus+autolinking.cmake +87 -0
- package/nitrogen/generated/android/cactus+autolinking.gradle +27 -0
- package/nitrogen/generated/android/cactusOnLoad.cpp +86 -0
- package/nitrogen/generated/android/cactusOnLoad.hpp +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/DeviceInfo.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/Func_void_double.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/HybridCactusCryptoSpec.kt +58 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/HybridCactusDeviceInfoSpec.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/HybridCactusFileSystemSpec.kt +95 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/cactusOnLoad.kt +35 -0
- package/nitrogen/generated/ios/Cactus+autolinking.rb +60 -0
- package/nitrogen/generated/ios/Cactus-Swift-Cxx-Bridge.cpp +122 -0
- package/nitrogen/generated/ios/Cactus-Swift-Cxx-Bridge.hpp +373 -0
- package/nitrogen/generated/ios/Cactus-Swift-Cxx-Umbrella.hpp +60 -0
- package/nitrogen/generated/ios/CactusAutolinking.mm +69 -0
- package/nitrogen/generated/ios/CactusAutolinking.swift +55 -0
- package/nitrogen/generated/ios/c++/HybridCactusCryptoSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridCactusCryptoSpecSwift.hpp +77 -0
- package/nitrogen/generated/ios/c++/HybridCactusDeviceInfoSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridCactusDeviceInfoSpecSwift.hpp +88 -0
- package/nitrogen/generated/ios/c++/HybridCactusFileSystemSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridCactusFileSystemSpecSwift.hpp +143 -0
- package/nitrogen/generated/ios/swift/DeviceInfo.swift +98 -0
- package/nitrogen/generated/ios/swift/Func_void.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_DeviceInfo.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_double.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_std__string_.swift +54 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridCactusCryptoSpec.swift +57 -0
- package/nitrogen/generated/ios/swift/HybridCactusCryptoSpec_cxx.swift +139 -0
- package/nitrogen/generated/ios/swift/HybridCactusDeviceInfoSpec.swift +58 -0
- package/nitrogen/generated/ios/swift/HybridCactusDeviceInfoSpec_cxx.swift +164 -0
- package/nitrogen/generated/ios/swift/HybridCactusFileSystemSpec.swift +65 -0
- package/nitrogen/generated/ios/swift/HybridCactusFileSystemSpec_cxx.swift +303 -0
- package/nitrogen/generated/shared/c++/DeviceInfo.hpp +92 -0
- package/nitrogen/generated/shared/c++/HybridCactusCryptoSpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridCactusCryptoSpec.hpp +63 -0
- package/nitrogen/generated/shared/c++/HybridCactusDeviceInfoSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridCactusDeviceInfoSpec.hpp +67 -0
- package/nitrogen/generated/shared/c++/HybridCactusFileSystemSpec.cpp +29 -0
- package/nitrogen/generated/shared/c++/HybridCactusFileSystemSpec.hpp +73 -0
- package/nitrogen/generated/shared/c++/HybridCactusSpec.cpp +26 -0
- package/nitrogen/generated/shared/c++/HybridCactusSpec.hpp +71 -0
- package/nitrogen/generated/shared/c++/HybridCactusUtilSpec.cpp +23 -0
- package/nitrogen/generated/shared/c++/HybridCactusUtilSpec.hpp +66 -0
- package/package.json +84 -143
- package/src/api/Database.ts +83 -0
- package/src/classes/CactusLM.ts +203 -0
- package/src/config/CactusConfig.ts +4 -0
- package/src/constants/packageVersion.ts +1 -0
- package/src/hooks/useCactusLM.ts +282 -0
- package/src/index.tsx +23 -0
- package/src/native/Cactus.ts +79 -0
- package/src/native/CactusCrypto.ts +11 -0
- package/src/native/CactusDeviceInfo.ts +18 -0
- package/src/native/CactusFileSystem.ts +47 -0
- package/src/native/CactusUtil.ts +27 -0
- package/src/native/index.ts +5 -0
- package/src/specs/Cactus.nitro.ts +16 -0
- package/src/specs/CactusCrypto.nitro.ts +6 -0
- package/src/specs/CactusDeviceInfo.nitro.ts +15 -0
- package/src/specs/CactusFileSystem.nitro.ts +21 -0
- package/src/specs/CactusUtil.nitro.ts +8 -0
- package/src/telemetry/Telemetry.ts +159 -0
- package/src/types/CactusLM.ts +71 -0
- package/src/types/CactusModel.ts +14 -0
- package/src/utils/error.ts +2 -0
- package/LICENSE.txt +0 -20
- package/android/src/main/CMakeLists.txt +0 -139
- package/android/src/main/java/com/cactus/Cactus.java +0 -1190
- package/android/src/main/java/com/cactus/CactusPackage.java +0 -48
- package/android/src/main/java/com/cactus/LlamaContext.java +0 -814
- package/android/src/main/jni-utils.h +0 -100
- package/android/src/main/jni.cpp +0 -1605
- package/android/src/main/jniLibs/arm64-v8a/libcactus_v8.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libcactus_v8_2.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libcactus_v8_2_dotprod.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libcactus_v8_2_dotprod_i8mm.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libcactus_v8_2_i8mm.so +0 -0
- package/android/src/newarch/java/com/cactus/CactusModule.java +0 -206
- package/android/src/oldarch/java/com/cactus/CactusModule.java +0 -205
- package/cactus-react-native.podspec +0 -42
- package/ios/CMakeLists.txt +0 -131
- package/ios/Cactus.h +0 -6
- package/ios/Cactus.mm +0 -681
- package/ios/CactusContext.h +0 -81
- package/ios/CactusContext.mm +0 -1032
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/chat.h +0 -145
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/common.h +0 -674
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-alloc.h +0 -76
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-backend-impl.h +0 -255
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-backend.h +0 -354
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-common.h +0 -1857
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-cpp.h +0 -39
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-cpu.h +0 -143
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-impl.h +0 -601
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-metal-impl.h +0 -622
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-metal.h +0 -66
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-opt.h +0 -237
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-quants.h +0 -100
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-threading.h +0 -14
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml.h +0 -2202
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/gguf.h +0 -202
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/json-schema-to-grammar.h +0 -21
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/json.hpp +0 -24766
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-adapter.h +0 -76
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-arch.h +0 -437
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-batch.h +0 -89
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-chat.h +0 -58
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-context.h +0 -276
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-cparams.h +0 -39
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-cpp.h +0 -30
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-grammar.h +0 -173
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-graph.h +0 -640
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-hparams.h +0 -190
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-impl.h +0 -61
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-io.h +0 -35
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-kv-cache.h +0 -515
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-memory.h +0 -32
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-mmap.h +0 -68
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-model-loader.h +0 -169
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-model-saver.h +0 -37
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-model.h +0 -425
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-sampling.h +0 -32
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-vocab.h +0 -131
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama.h +0 -1376
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/log.h +0 -103
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/minja/chat-template.hpp +0 -542
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/minja/minja.hpp +0 -2974
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/sampling.h +0 -107
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/unicode-data.h +0 -20
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/unicode.h +0 -66
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/ggml-llama.metallib +0 -0
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/cactus.h +0 -232
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/cactus_ffi.h +0 -256
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/chat.h +0 -145
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/common.h +0 -674
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-alloc.h +0 -76
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-backend-impl.h +0 -255
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-backend.h +0 -354
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-common.h +0 -1857
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-cpp.h +0 -39
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-cpu.h +0 -143
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-impl.h +0 -601
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-metal-impl.h +0 -622
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-metal.h +0 -66
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-opt.h +0 -237
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-quants.h +0 -100
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-threading.h +0 -14
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml.h +0 -2202
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/gguf.h +0 -202
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/json-schema-to-grammar.h +0 -21
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/json.hpp +0 -24766
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-adapter.h +0 -76
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-arch.h +0 -437
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-batch.h +0 -89
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-chat.h +0 -58
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-context.h +0 -276
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-cparams.h +0 -39
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-cpp.h +0 -30
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-grammar.h +0 -173
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-graph.h +0 -640
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-hparams.h +0 -190
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-impl.h +0 -61
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-io.h +0 -35
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-kv-cache.h +0 -515
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-memory.h +0 -32
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-mmap.h +0 -68
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-model-loader.h +0 -169
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-model-saver.h +0 -37
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-model.h +0 -425
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-sampling.h +0 -32
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-vocab.h +0 -131
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama.h +0 -1376
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/log.h +0 -103
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/minja/chat-template.hpp +0 -542
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/minja/minja.hpp +0 -2974
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/sampling.h +0 -107
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/unicode-data.h +0 -20
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/unicode.h +0 -66
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/cactus +0 -0
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/ggml-llama-sim.metallib +0 -0
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/cactus.h +0 -232
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/cactus_ffi.h +0 -256
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/chat.h +0 -145
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/common.h +0 -674
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-alloc.h +0 -76
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-backend-impl.h +0 -255
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-backend.h +0 -354
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-common.h +0 -1857
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-cpp.h +0 -39
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-cpu.h +0 -143
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-impl.h +0 -601
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-metal-impl.h +0 -622
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-metal.h +0 -66
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-opt.h +0 -237
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-quants.h +0 -100
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-threading.h +0 -14
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml.h +0 -2202
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/gguf.h +0 -202
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/json-schema-to-grammar.h +0 -21
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/json.hpp +0 -24766
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-adapter.h +0 -76
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-arch.h +0 -437
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-batch.h +0 -89
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-chat.h +0 -58
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-context.h +0 -276
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-cparams.h +0 -39
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-cpp.h +0 -30
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-grammar.h +0 -173
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-graph.h +0 -640
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-hparams.h +0 -190
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-impl.h +0 -61
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-io.h +0 -35
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-kv-cache.h +0 -515
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-memory.h +0 -32
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-mmap.h +0 -68
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-model-loader.h +0 -169
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-model-saver.h +0 -37
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-model.h +0 -425
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-sampling.h +0 -32
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-vocab.h +0 -131
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama.h +0 -1376
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/log.h +0 -103
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/minja/chat-template.hpp +0 -542
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/minja/minja.hpp +0 -2974
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/sampling.h +0 -107
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/unicode-data.h +0 -20
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/unicode.h +0 -66
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Info.plist +0 -0
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/cactus +0 -0
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/ggml-llama.metallib +0 -0
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/cactus.h +0 -232
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/cactus_ffi.h +0 -256
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/chat.h +0 -145
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/common.h +0 -674
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-alloc.h +0 -76
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-backend-impl.h +0 -255
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-backend.h +0 -354
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-common.h +0 -1857
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-cpp.h +0 -39
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-cpu.h +0 -143
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-impl.h +0 -601
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-metal-impl.h +0 -622
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-metal.h +0 -66
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-opt.h +0 -237
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-quants.h +0 -100
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-threading.h +0 -14
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml.h +0 -2202
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/gguf.h +0 -202
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/json-schema-to-grammar.h +0 -21
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/json.hpp +0 -24766
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-adapter.h +0 -76
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-arch.h +0 -437
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-batch.h +0 -89
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-chat.h +0 -58
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-context.h +0 -276
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-cparams.h +0 -39
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-cpp.h +0 -30
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-grammar.h +0 -173
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-graph.h +0 -640
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-hparams.h +0 -190
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-impl.h +0 -61
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-io.h +0 -35
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-kv-cache.h +0 -515
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-memory.h +0 -32
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-mmap.h +0 -68
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-model-loader.h +0 -169
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-model-saver.h +0 -37
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-model.h +0 -425
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-sampling.h +0 -32
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-vocab.h +0 -131
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama.h +0 -1376
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/log.h +0 -103
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/minja/chat-template.hpp +0 -542
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/minja/minja.hpp +0 -2974
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/sampling.h +0 -107
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/unicode-data.h +0 -20
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/unicode.h +0 -66
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Info.plist +0 -0
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/cactus +0 -0
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/ggml-llama-sim.metallib +0 -0
- package/lib/commonjs/NativeCactus.js +0 -9
- package/lib/commonjs/NativeCactus.js.map +0 -1
- package/lib/commonjs/agent.js +0 -73
- package/lib/commonjs/agent.js.map +0 -1
- package/lib/commonjs/chat.js +0 -73
- package/lib/commonjs/chat.js.map +0 -1
- package/lib/commonjs/index.js +0 -523
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/lm.js +0 -272
- package/lib/commonjs/lm.js.map +0 -1
- package/lib/commonjs/package.json +0 -1
- package/lib/commonjs/projectId.js +0 -8
- package/lib/commonjs/projectId.js.map +0 -1
- package/lib/commonjs/remote.js +0 -100
- package/lib/commonjs/remote.js.map +0 -1
- package/lib/commonjs/telemetry.js +0 -102
- package/lib/commonjs/telemetry.js.map +0 -1
- package/lib/commonjs/tools.js +0 -72
- package/lib/commonjs/tools.js.map +0 -1
- package/lib/commonjs/tts.js +0 -29
- package/lib/commonjs/tts.js.map +0 -1
- package/lib/commonjs/vlm.js +0 -221
- package/lib/commonjs/vlm.js.map +0 -1
- package/lib/module/NativeCactus.js +0 -5
- package/lib/module/NativeCactus.js.map +0 -1
- package/lib/module/agent.js +0 -68
- package/lib/module/agent.js.map +0 -1
- package/lib/module/chat.js +0 -67
- package/lib/module/chat.js.map +0 -1
- package/lib/module/lm.js +0 -267
- package/lib/module/lm.js.map +0 -1
- package/lib/module/projectId.js +0 -4
- package/lib/module/projectId.js.map +0 -1
- package/lib/module/remote.js +0 -91
- package/lib/module/remote.js.map +0 -1
- package/lib/module/telemetry.js +0 -97
- package/lib/module/telemetry.js.map +0 -1
- package/lib/module/tools.js +0 -66
- package/lib/module/tools.js.map +0 -1
- package/lib/module/tts.js +0 -24
- package/lib/module/tts.js.map +0 -1
- package/lib/module/vlm.js +0 -216
- package/lib/module/vlm.js.map +0 -1
- package/lib/typescript/NativeCactus.d.ts +0 -252
- package/lib/typescript/NativeCactus.d.ts.map +0 -1
- package/lib/typescript/agent.d.ts +0 -31
- package/lib/typescript/agent.d.ts.map +0 -1
- package/lib/typescript/chat.d.ts +0 -23
- package/lib/typescript/chat.d.ts.map +0 -1
- package/lib/typescript/index.d.ts +0 -114
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/lm.d.ts +0 -36
- package/lib/typescript/lm.d.ts.map +0 -1
- package/lib/typescript/projectId.d.ts +0 -2
- package/lib/typescript/projectId.d.ts.map +0 -1
- package/lib/typescript/remote.d.ts +0 -8
- package/lib/typescript/remote.d.ts.map +0 -1
- package/lib/typescript/telemetry.d.ts +0 -25
- package/lib/typescript/telemetry.d.ts.map +0 -1
- package/lib/typescript/tools.d.ts +0 -36
- package/lib/typescript/tools.d.ts.map +0 -1
- package/lib/typescript/tts.d.ts +0 -10
- package/lib/typescript/tts.d.ts.map +0 -1
- package/lib/typescript/vlm.d.ts +0 -33
- package/lib/typescript/vlm.d.ts.map +0 -1
- package/scripts/postInstall.js +0 -33
- package/src/NativeCactus.ts +0 -317
- package/src/agent.ts +0 -112
- package/src/chat.ts +0 -91
- package/src/index.ts +0 -662
- package/src/lm.ts +0 -324
- package/src/projectId.ts +0 -1
- package/src/remote.ts +0 -113
- package/src/telemetry.ts +0 -137
- package/src/tools.ts +0 -94
- package/src/tts.ts +0 -42
- package/src/vlm.ts +0 -276
package/lib/commonjs/index.js
DELETED
|
@@ -1,523 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _exportNames = {
|
|
7
|
-
LlamaContext: true,
|
|
8
|
-
toggleNativeLog: true,
|
|
9
|
-
addNativeLogListener: true,
|
|
10
|
-
setContextLimit: true,
|
|
11
|
-
loadLlamaModelInfo: true,
|
|
12
|
-
initLlama: true,
|
|
13
|
-
releaseAllLlama: true,
|
|
14
|
-
initContext: true,
|
|
15
|
-
initMultimodal: true,
|
|
16
|
-
isMultimodalEnabled: true,
|
|
17
|
-
isMultimodalSupportVision: true,
|
|
18
|
-
isMultimodalSupportAudio: true,
|
|
19
|
-
releaseMultimodal: true,
|
|
20
|
-
multimodalCompletion: true,
|
|
21
|
-
initVocoder: true,
|
|
22
|
-
isVocoderEnabled: true,
|
|
23
|
-
getTTSType: true,
|
|
24
|
-
getFormattedAudioCompletion: true,
|
|
25
|
-
getAudioCompletionGuideTokens: true,
|
|
26
|
-
decodeAudioTokens: true,
|
|
27
|
-
releaseVocoder: true,
|
|
28
|
-
tokenize: true,
|
|
29
|
-
getDeviceInfo: true,
|
|
30
|
-
Tools: true,
|
|
31
|
-
parseAndExecuteTool: true,
|
|
32
|
-
CactusLM: true,
|
|
33
|
-
CactusVLM: true,
|
|
34
|
-
CactusTTS: true,
|
|
35
|
-
CactusAgent: true
|
|
36
|
-
};
|
|
37
|
-
Object.defineProperty(exports, "CactusAgent", {
|
|
38
|
-
enumerable: true,
|
|
39
|
-
get: function () {
|
|
40
|
-
return _agent.CactusAgent;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
Object.defineProperty(exports, "CactusLM", {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () {
|
|
46
|
-
return _lm.CactusLM;
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
Object.defineProperty(exports, "CactusTTS", {
|
|
50
|
-
enumerable: true,
|
|
51
|
-
get: function () {
|
|
52
|
-
return _tts.CactusTTS;
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
Object.defineProperty(exports, "CactusVLM", {
|
|
56
|
-
enumerable: true,
|
|
57
|
-
get: function () {
|
|
58
|
-
return _vlm.CactusVLM;
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
exports.LlamaContext = void 0;
|
|
62
|
-
Object.defineProperty(exports, "Tools", {
|
|
63
|
-
enumerable: true,
|
|
64
|
-
get: function () {
|
|
65
|
-
return _tools.Tools;
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
exports.addNativeLogListener = addNativeLogListener;
|
|
69
|
-
exports.initContext = exports.getTTSType = exports.getFormattedAudioCompletion = exports.getDeviceInfo = exports.getAudioCompletionGuideTokens = exports.decodeAudioTokens = void 0;
|
|
70
|
-
exports.initLlama = initLlama;
|
|
71
|
-
exports.isVocoderEnabled = exports.isMultimodalSupportVision = exports.isMultimodalSupportAudio = exports.isMultimodalEnabled = exports.initVocoder = exports.initMultimodal = void 0;
|
|
72
|
-
exports.loadLlamaModelInfo = loadLlamaModelInfo;
|
|
73
|
-
exports.multimodalCompletion = void 0;
|
|
74
|
-
Object.defineProperty(exports, "parseAndExecuteTool", {
|
|
75
|
-
enumerable: true,
|
|
76
|
-
get: function () {
|
|
77
|
-
return _tools.parseAndExecuteTool;
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
exports.releaseAllLlama = releaseAllLlama;
|
|
81
|
-
exports.releaseVocoder = exports.releaseMultimodal = void 0;
|
|
82
|
-
exports.setContextLimit = setContextLimit;
|
|
83
|
-
exports.toggleNativeLog = toggleNativeLog;
|
|
84
|
-
exports.tokenize = void 0;
|
|
85
|
-
var _reactNative = require("react-native");
|
|
86
|
-
var _NativeCactus = _interopRequireDefault(require("./NativeCactus"));
|
|
87
|
-
var _chat = require("./chat");
|
|
88
|
-
var _tools = require("./tools");
|
|
89
|
-
var _telemetry = require("./telemetry");
|
|
90
|
-
var _remote = require("./remote");
|
|
91
|
-
Object.keys(_remote).forEach(function (key) {
|
|
92
|
-
if (key === "default" || key === "__esModule") return;
|
|
93
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
94
|
-
if (key in exports && exports[key] === _remote[key]) return;
|
|
95
|
-
Object.defineProperty(exports, key, {
|
|
96
|
-
enumerable: true,
|
|
97
|
-
get: function () {
|
|
98
|
-
return _remote[key];
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
var _lm = require("./lm");
|
|
103
|
-
var _vlm = require("./vlm");
|
|
104
|
-
var _tts = require("./tts");
|
|
105
|
-
var _agent = require("./agent");
|
|
106
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
107
|
-
const EVENT_ON_INIT_CONTEXT_PROGRESS = '@Cactus_onInitContextProgress';
|
|
108
|
-
const EVENT_ON_TOKEN = '@Cactus_onToken';
|
|
109
|
-
const EVENT_ON_NATIVE_LOG = '@Cactus_onNativeLog';
|
|
110
|
-
let EventEmitter;
|
|
111
|
-
if (_reactNative.Platform.OS === 'ios') {
|
|
112
|
-
// @ts-ignore
|
|
113
|
-
EventEmitter = new _reactNative.NativeEventEmitter(_NativeCactus.default);
|
|
114
|
-
}
|
|
115
|
-
if (_reactNative.Platform.OS === 'android') {
|
|
116
|
-
EventEmitter = _reactNative.DeviceEventEmitter;
|
|
117
|
-
}
|
|
118
|
-
const logListeners = [];
|
|
119
|
-
|
|
120
|
-
// @ts-ignore
|
|
121
|
-
if (EventEmitter) {
|
|
122
|
-
EventEmitter.addListener(EVENT_ON_NATIVE_LOG, evt => {
|
|
123
|
-
logListeners.forEach(listener => listener(evt.level, evt.text));
|
|
124
|
-
});
|
|
125
|
-
_NativeCactus.default?.toggleNativeLog?.(false)?.catch?.(() => {});
|
|
126
|
-
}
|
|
127
|
-
const getJsonSchema = responseFormat => {
|
|
128
|
-
if (responseFormat?.type === 'json_schema') {
|
|
129
|
-
return responseFormat.json_schema?.schema;
|
|
130
|
-
}
|
|
131
|
-
if (responseFormat?.type === 'json_object') {
|
|
132
|
-
return responseFormat.schema || {};
|
|
133
|
-
}
|
|
134
|
-
return null;
|
|
135
|
-
};
|
|
136
|
-
const telemetryParams = {
|
|
137
|
-
n_gpu_layers: null,
|
|
138
|
-
n_ctx: null,
|
|
139
|
-
model: null
|
|
140
|
-
};
|
|
141
|
-
class LlamaContext {
|
|
142
|
-
gpu = false;
|
|
143
|
-
reasonNoGPU = '';
|
|
144
|
-
constructor({
|
|
145
|
-
contextId,
|
|
146
|
-
gpu,
|
|
147
|
-
reasonNoGPU,
|
|
148
|
-
model
|
|
149
|
-
}) {
|
|
150
|
-
this.id = contextId;
|
|
151
|
-
this.gpu = gpu;
|
|
152
|
-
this.reasonNoGPU = reasonNoGPU;
|
|
153
|
-
this.model = model;
|
|
154
|
-
}
|
|
155
|
-
async loadSession(filepath) {
|
|
156
|
-
let path = filepath;
|
|
157
|
-
if (path.startsWith('file://')) path = path.slice(7);
|
|
158
|
-
return _NativeCactus.default.loadSession(this.id, path);
|
|
159
|
-
}
|
|
160
|
-
async saveSession(filepath, options) {
|
|
161
|
-
return _NativeCactus.default.saveSession(this.id, filepath, options?.tokenSize || -1);
|
|
162
|
-
}
|
|
163
|
-
isLlamaChatSupported() {
|
|
164
|
-
return !!this.model.chatTemplates.llamaChat;
|
|
165
|
-
}
|
|
166
|
-
isJinjaSupported() {
|
|
167
|
-
const {
|
|
168
|
-
minja
|
|
169
|
-
} = this.model.chatTemplates;
|
|
170
|
-
return !!minja?.toolUse || !!minja?.default;
|
|
171
|
-
}
|
|
172
|
-
async getFormattedChat(messages, template, params) {
|
|
173
|
-
const chat = (0, _chat.formatChat)(messages);
|
|
174
|
-
const useJinja = this.isJinjaSupported() && params?.jinja;
|
|
175
|
-
let tmpl = this.isLlamaChatSupported() || useJinja ? undefined : 'chatml';
|
|
176
|
-
if (template) tmpl = template; // Force replace if provided
|
|
177
|
-
const jsonSchema = getJsonSchema(params?.response_format);
|
|
178
|
-
return _NativeCactus.default.getFormattedChat(this.id, JSON.stringify(chat), tmpl, {
|
|
179
|
-
jinja: useJinja,
|
|
180
|
-
json_schema: jsonSchema ? JSON.stringify(jsonSchema) : undefined,
|
|
181
|
-
tools: params?.tools ? JSON.stringify(params.tools) : undefined,
|
|
182
|
-
parallel_tool_calls: params?.parallel_tool_calls ? JSON.stringify(params.parallel_tool_calls) : undefined,
|
|
183
|
-
tool_choice: params?.tool_choice
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
async completionWithTools(params, callback, recursionCount = 0, recursionLimit = 3) {
|
|
187
|
-
if (!params.messages) {
|
|
188
|
-
return this.completion(params, callback);
|
|
189
|
-
}
|
|
190
|
-
if (!params.tools) {
|
|
191
|
-
return this.completion(params, callback);
|
|
192
|
-
}
|
|
193
|
-
if (recursionCount >= recursionLimit) {
|
|
194
|
-
return this.completion({
|
|
195
|
-
...params,
|
|
196
|
-
jinja: true,
|
|
197
|
-
tools: params.tools.getSchemas()
|
|
198
|
-
}, callback);
|
|
199
|
-
}
|
|
200
|
-
const messages = [...params.messages];
|
|
201
|
-
const result = await this.completion({
|
|
202
|
-
...params,
|
|
203
|
-
messages: messages,
|
|
204
|
-
jinja: true,
|
|
205
|
-
tools: params.tools.getSchemas()
|
|
206
|
-
}, callback);
|
|
207
|
-
const {
|
|
208
|
-
toolCalled,
|
|
209
|
-
toolName,
|
|
210
|
-
toolInput,
|
|
211
|
-
toolOutput
|
|
212
|
-
} = await (0, _tools.parseAndExecuteTool)(result, params.tools);
|
|
213
|
-
if (toolCalled && toolName && toolInput) {
|
|
214
|
-
const assistantMessage = {
|
|
215
|
-
role: 'assistant',
|
|
216
|
-
content: result.content,
|
|
217
|
-
tool_calls: result.tool_calls
|
|
218
|
-
};
|
|
219
|
-
messages.push(assistantMessage);
|
|
220
|
-
const toolCallId = result.tool_calls?.[0]?.id;
|
|
221
|
-
const toolMessage = {
|
|
222
|
-
role: 'tool',
|
|
223
|
-
content: JSON.stringify(toolOutput),
|
|
224
|
-
tool_call_id: toolCallId
|
|
225
|
-
};
|
|
226
|
-
messages.push(toolMessage);
|
|
227
|
-
return await this.completionWithTools({
|
|
228
|
-
...params,
|
|
229
|
-
messages: messages
|
|
230
|
-
}, callback, recursionCount + 1, recursionLimit);
|
|
231
|
-
}
|
|
232
|
-
return result;
|
|
233
|
-
}
|
|
234
|
-
async completion(params, callback) {
|
|
235
|
-
const nativeParams = {
|
|
236
|
-
...params,
|
|
237
|
-
prompt: params.prompt || '',
|
|
238
|
-
emit_partial_completion: !!callback
|
|
239
|
-
};
|
|
240
|
-
if (params.messages) {
|
|
241
|
-
const formattedResult = await this.getFormattedChat(params.messages, params.chat_template || params.chatTemplate, {
|
|
242
|
-
jinja: params.jinja,
|
|
243
|
-
tools: params.tools,
|
|
244
|
-
parallel_tool_calls: params.parallel_tool_calls,
|
|
245
|
-
tool_choice: params.tool_choice
|
|
246
|
-
});
|
|
247
|
-
if (typeof formattedResult === 'string') {
|
|
248
|
-
nativeParams.prompt = formattedResult || '';
|
|
249
|
-
} else {
|
|
250
|
-
nativeParams.prompt = formattedResult.prompt || '';
|
|
251
|
-
if (typeof formattedResult.chat_format === 'number') nativeParams.chat_format = formattedResult.chat_format;
|
|
252
|
-
if (formattedResult.grammar) nativeParams.grammar = formattedResult.grammar;
|
|
253
|
-
if (typeof formattedResult.grammar_lazy === 'boolean') nativeParams.grammar_lazy = formattedResult.grammar_lazy;
|
|
254
|
-
if (formattedResult.grammar_triggers) nativeParams.grammar_triggers = formattedResult.grammar_triggers;
|
|
255
|
-
if (formattedResult.preserved_tokens) nativeParams.preserved_tokens = formattedResult.preserved_tokens;
|
|
256
|
-
if (formattedResult.additional_stops) {
|
|
257
|
-
if (!nativeParams.stop) nativeParams.stop = [];
|
|
258
|
-
nativeParams.stop.push(...formattedResult.additional_stops);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
} else {
|
|
262
|
-
nativeParams.prompt = params.prompt || '';
|
|
263
|
-
}
|
|
264
|
-
if (nativeParams.response_format && !nativeParams.grammar) {
|
|
265
|
-
const jsonSchema = getJsonSchema(params.response_format);
|
|
266
|
-
if (jsonSchema) nativeParams.json_schema = JSON.stringify(jsonSchema);
|
|
267
|
-
}
|
|
268
|
-
const startTime = Date.now();
|
|
269
|
-
let firstTokenTime = null;
|
|
270
|
-
const deviceInfo = await getDeviceInfo(this.id);
|
|
271
|
-
const wrappedCallback = callback ? data => {
|
|
272
|
-
if (firstTokenTime === null) firstTokenTime = Date.now();
|
|
273
|
-
callback(data);
|
|
274
|
-
} : undefined;
|
|
275
|
-
let tokenListener = wrappedCallback && EventEmitter.addListener(EVENT_ON_TOKEN, evt => {
|
|
276
|
-
const {
|
|
277
|
-
contextId,
|
|
278
|
-
tokenResult
|
|
279
|
-
} = evt;
|
|
280
|
-
if (contextId !== this.id) return;
|
|
281
|
-
wrappedCallback(tokenResult);
|
|
282
|
-
});
|
|
283
|
-
if (!nativeParams.prompt) throw new Error('Prompt is required');
|
|
284
|
-
const promise = _NativeCactus.default.completion(this.id, nativeParams);
|
|
285
|
-
return promise.then(completionResult => {
|
|
286
|
-
_telemetry.Telemetry.track({
|
|
287
|
-
event: 'completion',
|
|
288
|
-
tok_per_sec: completionResult.timings?.predicted_per_second,
|
|
289
|
-
toks_generated: completionResult.timings?.predicted_n,
|
|
290
|
-
ttft: firstTokenTime ? firstTokenTime - startTime : null
|
|
291
|
-
}, telemetryParams, deviceInfo);
|
|
292
|
-
tokenListener?.remove();
|
|
293
|
-
tokenListener = null;
|
|
294
|
-
return completionResult;
|
|
295
|
-
}).catch(err => {
|
|
296
|
-
tokenListener?.remove();
|
|
297
|
-
tokenListener = null;
|
|
298
|
-
throw err;
|
|
299
|
-
});
|
|
300
|
-
}
|
|
301
|
-
stopCompletion() {
|
|
302
|
-
return _NativeCactus.default.stopCompletion(this.id);
|
|
303
|
-
}
|
|
304
|
-
tokenize(text) {
|
|
305
|
-
return _NativeCactus.default.tokenize(this.id, text);
|
|
306
|
-
}
|
|
307
|
-
detokenize(tokens) {
|
|
308
|
-
return _NativeCactus.default.detokenize(this.id, tokens);
|
|
309
|
-
}
|
|
310
|
-
async embedding(text, params) {
|
|
311
|
-
const startTime = Date.now();
|
|
312
|
-
const embeddingResult = await _NativeCactus.default.embedding(this.id, text, params || {});
|
|
313
|
-
const totalTime = Date.now() - startTime;
|
|
314
|
-
const deviceInfo = await getDeviceInfo(this.id);
|
|
315
|
-
_telemetry.Telemetry.track({
|
|
316
|
-
event: 'embedding',
|
|
317
|
-
mode: 'local',
|
|
318
|
-
embedding_time: totalTime
|
|
319
|
-
}, telemetryParams, deviceInfo);
|
|
320
|
-
return embeddingResult;
|
|
321
|
-
}
|
|
322
|
-
async bench(pp, tg, pl, nr) {
|
|
323
|
-
const result = await _NativeCactus.default.bench(this.id, pp, tg, pl, nr);
|
|
324
|
-
const [modelDesc, modelSize, modelNParams, ppAvg, ppStd, tgAvg, tgStd] = JSON.parse(result);
|
|
325
|
-
return {
|
|
326
|
-
modelDesc,
|
|
327
|
-
modelSize,
|
|
328
|
-
modelNParams,
|
|
329
|
-
ppAvg,
|
|
330
|
-
ppStd,
|
|
331
|
-
tgAvg,
|
|
332
|
-
tgStd
|
|
333
|
-
};
|
|
334
|
-
}
|
|
335
|
-
async applyLoraAdapters(loraList) {
|
|
336
|
-
let loraAdapters = [];
|
|
337
|
-
if (loraList) loraAdapters = loraList.map(l => ({
|
|
338
|
-
path: l.path.replace(/file:\/\//, ''),
|
|
339
|
-
scaled: l.scaled
|
|
340
|
-
}));
|
|
341
|
-
return _NativeCactus.default.applyLoraAdapters(this.id, loraAdapters);
|
|
342
|
-
}
|
|
343
|
-
async removeLoraAdapters() {
|
|
344
|
-
return _NativeCactus.default.removeLoraAdapters(this.id);
|
|
345
|
-
}
|
|
346
|
-
async getLoadedLoraAdapters() {
|
|
347
|
-
return _NativeCactus.default.getLoadedLoraAdapters(this.id);
|
|
348
|
-
}
|
|
349
|
-
async release() {
|
|
350
|
-
return _NativeCactus.default.releaseContext(this.id);
|
|
351
|
-
}
|
|
352
|
-
async rewind() {
|
|
353
|
-
return _NativeCactus.default.rewind(this.id);
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
exports.LlamaContext = LlamaContext;
|
|
357
|
-
async function toggleNativeLog(enabled) {
|
|
358
|
-
return _NativeCactus.default.toggleNativeLog(enabled);
|
|
359
|
-
}
|
|
360
|
-
function addNativeLogListener(listener) {
|
|
361
|
-
logListeners.push(listener);
|
|
362
|
-
return {
|
|
363
|
-
remove: () => {
|
|
364
|
-
logListeners.splice(logListeners.indexOf(listener), 1);
|
|
365
|
-
}
|
|
366
|
-
};
|
|
367
|
-
}
|
|
368
|
-
async function setContextLimit(limit) {
|
|
369
|
-
return _NativeCactus.default.setContextLimit(limit);
|
|
370
|
-
}
|
|
371
|
-
let contextIdCounter = 0;
|
|
372
|
-
const contextIdRandom = () => process.env.NODE_ENV === 'test' ? 0 : Math.floor(Math.random() * 100000);
|
|
373
|
-
const modelInfoSkip = [
|
|
374
|
-
// Large fields
|
|
375
|
-
'tokenizer.ggml.tokens', 'tokenizer.ggml.token_type', 'tokenizer.ggml.merges', 'tokenizer.ggml.scores'];
|
|
376
|
-
async function loadLlamaModelInfo(model) {
|
|
377
|
-
let path = model;
|
|
378
|
-
if (path.startsWith('file://')) path = path.slice(7);
|
|
379
|
-
return _NativeCactus.default.modelInfo(path, modelInfoSkip);
|
|
380
|
-
}
|
|
381
|
-
const poolTypeMap = {
|
|
382
|
-
none: 0,
|
|
383
|
-
mean: 1,
|
|
384
|
-
cls: 2,
|
|
385
|
-
last: 3,
|
|
386
|
-
rank: 4
|
|
387
|
-
};
|
|
388
|
-
async function initLlama({
|
|
389
|
-
model,
|
|
390
|
-
is_model_asset: isModelAsset,
|
|
391
|
-
pooling_type: poolingType,
|
|
392
|
-
lora,
|
|
393
|
-
lora_list: loraList,
|
|
394
|
-
...rest
|
|
395
|
-
}, onProgress) {
|
|
396
|
-
let path = model;
|
|
397
|
-
if (path.startsWith('file://')) path = path.slice(7);
|
|
398
|
-
let loraPath = lora;
|
|
399
|
-
if (loraPath?.startsWith('file://')) loraPath = loraPath.slice(7);
|
|
400
|
-
let loraAdapters = [];
|
|
401
|
-
if (loraList) loraAdapters = loraList.map(l => ({
|
|
402
|
-
path: l.path.replace(/file:\/\//, ''),
|
|
403
|
-
scaled: l.scaled
|
|
404
|
-
}));
|
|
405
|
-
telemetryParams.n_gpu_layers = rest.n_gpu_layers || null;
|
|
406
|
-
telemetryParams.n_ctx = rest.n_ctx || null;
|
|
407
|
-
telemetryParams.model = model;
|
|
408
|
-
const contextId = contextIdCounter + contextIdRandom();
|
|
409
|
-
contextIdCounter += 1;
|
|
410
|
-
let removeProgressListener = null;
|
|
411
|
-
if (onProgress) {
|
|
412
|
-
removeProgressListener = EventEmitter.addListener(EVENT_ON_INIT_CONTEXT_PROGRESS, evt => {
|
|
413
|
-
if (evt.contextId !== contextId) return;
|
|
414
|
-
onProgress(evt.progress);
|
|
415
|
-
});
|
|
416
|
-
}
|
|
417
|
-
const poolType = poolTypeMap[poolingType];
|
|
418
|
-
const {
|
|
419
|
-
gpu,
|
|
420
|
-
reasonNoGPU,
|
|
421
|
-
model: modelDetails,
|
|
422
|
-
androidLib
|
|
423
|
-
} = await _NativeCactus.default.initContext(contextId, {
|
|
424
|
-
model: path,
|
|
425
|
-
is_model_asset: !!isModelAsset,
|
|
426
|
-
use_progress_callback: !!onProgress,
|
|
427
|
-
pooling_type: poolType,
|
|
428
|
-
lora: loraPath,
|
|
429
|
-
lora_list: loraAdapters,
|
|
430
|
-
...rest
|
|
431
|
-
}).catch(err => {
|
|
432
|
-
removeProgressListener?.remove();
|
|
433
|
-
throw err;
|
|
434
|
-
});
|
|
435
|
-
removeProgressListener?.remove();
|
|
436
|
-
return new LlamaContext({
|
|
437
|
-
contextId,
|
|
438
|
-
gpu,
|
|
439
|
-
reasonNoGPU,
|
|
440
|
-
model: modelDetails,
|
|
441
|
-
androidLib
|
|
442
|
-
});
|
|
443
|
-
}
|
|
444
|
-
async function releaseAllLlama() {
|
|
445
|
-
return _NativeCactus.default.releaseAllContexts();
|
|
446
|
-
}
|
|
447
|
-
const initContext = async params => {
|
|
448
|
-
return await _NativeCactus.default.initContext(contextIdCounter++, params);
|
|
449
|
-
};
|
|
450
|
-
exports.initContext = initContext;
|
|
451
|
-
const initMultimodal = async (contextId, mmprojPath, useGpu = false) => {
|
|
452
|
-
return await _NativeCactus.default.initMultimodal(contextId, mmprojPath, useGpu);
|
|
453
|
-
};
|
|
454
|
-
exports.initMultimodal = initMultimodal;
|
|
455
|
-
const isMultimodalEnabled = async contextId => {
|
|
456
|
-
return await _NativeCactus.default.isMultimodalEnabled(contextId);
|
|
457
|
-
};
|
|
458
|
-
exports.isMultimodalEnabled = isMultimodalEnabled;
|
|
459
|
-
const isMultimodalSupportVision = async contextId => {
|
|
460
|
-
return await _NativeCactus.default.isMultimodalSupportVision(contextId);
|
|
461
|
-
};
|
|
462
|
-
exports.isMultimodalSupportVision = isMultimodalSupportVision;
|
|
463
|
-
const isMultimodalSupportAudio = async contextId => {
|
|
464
|
-
return await _NativeCactus.default.isMultimodalSupportAudio(contextId);
|
|
465
|
-
};
|
|
466
|
-
exports.isMultimodalSupportAudio = isMultimodalSupportAudio;
|
|
467
|
-
const releaseMultimodal = async contextId => {
|
|
468
|
-
return await _NativeCactus.default.releaseMultimodal(contextId);
|
|
469
|
-
};
|
|
470
|
-
exports.releaseMultimodal = releaseMultimodal;
|
|
471
|
-
const multimodalCompletion = async (contextId, prompt, mediaPaths, params) => {
|
|
472
|
-
const result = await _NativeCactus.default.multimodalCompletion(contextId, prompt, mediaPaths, params);
|
|
473
|
-
const deviceInfo = await getDeviceInfo(contextId);
|
|
474
|
-
_telemetry.Telemetry.track({
|
|
475
|
-
event: 'completion',
|
|
476
|
-
tok_per_sec: result.timings?.predicted_per_second,
|
|
477
|
-
toks_generated: result.timings?.predicted_n,
|
|
478
|
-
num_images: mediaPaths?.length
|
|
479
|
-
}, telemetryParams, deviceInfo);
|
|
480
|
-
return result;
|
|
481
|
-
};
|
|
482
|
-
exports.multimodalCompletion = multimodalCompletion;
|
|
483
|
-
const initVocoder = async (contextId, vocoderModelPath) => {
|
|
484
|
-
return await _NativeCactus.default.initVocoder(contextId, vocoderModelPath);
|
|
485
|
-
};
|
|
486
|
-
exports.initVocoder = initVocoder;
|
|
487
|
-
const isVocoderEnabled = async contextId => {
|
|
488
|
-
return await _NativeCactus.default.isVocoderEnabled(contextId);
|
|
489
|
-
};
|
|
490
|
-
exports.isVocoderEnabled = isVocoderEnabled;
|
|
491
|
-
const getTTSType = async contextId => {
|
|
492
|
-
return await _NativeCactus.default.getTTSType(contextId);
|
|
493
|
-
};
|
|
494
|
-
exports.getTTSType = getTTSType;
|
|
495
|
-
const getFormattedAudioCompletion = async (contextId, speakerJsonStr, textToSpeak) => {
|
|
496
|
-
return await _NativeCactus.default.getFormattedAudioCompletion(contextId, speakerJsonStr, textToSpeak);
|
|
497
|
-
};
|
|
498
|
-
exports.getFormattedAudioCompletion = getFormattedAudioCompletion;
|
|
499
|
-
const getAudioCompletionGuideTokens = async (contextId, textToSpeak) => {
|
|
500
|
-
return await _NativeCactus.default.getAudioCompletionGuideTokens(contextId, textToSpeak);
|
|
501
|
-
};
|
|
502
|
-
exports.getAudioCompletionGuideTokens = getAudioCompletionGuideTokens;
|
|
503
|
-
const decodeAudioTokens = async (contextId, tokens) => {
|
|
504
|
-
return await _NativeCactus.default.decodeAudioTokens(contextId, tokens);
|
|
505
|
-
};
|
|
506
|
-
exports.decodeAudioTokens = decodeAudioTokens;
|
|
507
|
-
const releaseVocoder = async contextId => {
|
|
508
|
-
return await _NativeCactus.default.releaseVocoder(contextId);
|
|
509
|
-
};
|
|
510
|
-
exports.releaseVocoder = releaseVocoder;
|
|
511
|
-
const tokenize = async (contextId, text, mediaPaths) => {
|
|
512
|
-
if (mediaPaths && mediaPaths.length > 0) {
|
|
513
|
-
return await _NativeCactus.default.tokenize(contextId, text, mediaPaths);
|
|
514
|
-
} else {
|
|
515
|
-
return await _NativeCactus.default.tokenize(contextId, text);
|
|
516
|
-
}
|
|
517
|
-
};
|
|
518
|
-
exports.tokenize = tokenize;
|
|
519
|
-
const getDeviceInfo = async contextId => {
|
|
520
|
-
return await _NativeCactus.default.getDeviceInfo(contextId);
|
|
521
|
-
};
|
|
522
|
-
exports.getDeviceInfo = getDeviceInfo;
|
|
523
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_NativeCactus","_interopRequireDefault","_chat","_tools","_telemetry","_remote","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_lm","_vlm","_tts","_agent","e","__esModule","default","EVENT_ON_INIT_CONTEXT_PROGRESS","EVENT_ON_TOKEN","EVENT_ON_NATIVE_LOG","EventEmitter","Platform","OS","NativeEventEmitter","Cactus","DeviceEventEmitter","logListeners","addListener","evt","listener","level","text","toggleNativeLog","catch","getJsonSchema","responseFormat","type","json_schema","schema","telemetryParams","n_gpu_layers","n_ctx","model","LlamaContext","gpu","reasonNoGPU","constructor","contextId","id","loadSession","filepath","path","startsWith","slice","saveSession","options","tokenSize","isLlamaChatSupported","chatTemplates","llamaChat","isJinjaSupported","minja","toolUse","getFormattedChat","messages","template","params","chat","formatChat","useJinja","jinja","tmpl","undefined","jsonSchema","response_format","JSON","stringify","tools","parallel_tool_calls","tool_choice","completionWithTools","callback","recursionCount","recursionLimit","completion","getSchemas","result","toolCalled","toolName","toolInput","toolOutput","parseAndExecuteTool","assistantMessage","role","content","tool_calls","push","toolCallId","toolMessage","tool_call_id","nativeParams","prompt","emit_partial_completion","formattedResult","chat_template","chatTemplate","chat_format","grammar","grammar_lazy","grammar_triggers","preserved_tokens","additional_stops","stop","startTime","Date","now","firstTokenTime","deviceInfo","getDeviceInfo","wrappedCallback","data","tokenListener","tokenResult","Error","promise","then","completionResult","Telemetry","track","event","tok_per_sec","timings","predicted_per_second","toks_generated","predicted_n","ttft","remove","err","stopCompletion","tokenize","detokenize","tokens","embedding","embeddingResult","totalTime","mode","embedding_time","bench","pp","tg","pl","nr","modelDesc","modelSize","modelNParams","ppAvg","ppStd","tgAvg","tgStd","parse","applyLoraAdapters","loraList","loraAdapters","map","l","replace","scaled","removeLoraAdapters","getLoadedLoraAdapters","release","releaseContext","rewind","enabled","addNativeLogListener","splice","indexOf","setContextLimit","limit","contextIdCounter","contextIdRandom","process","env","NODE_ENV","Math","floor","random","modelInfoSkip","loadLlamaModelInfo","modelInfo","poolTypeMap","none","mean","cls","last","rank","initLlama","is_model_asset","isModelAsset","pooling_type","poolingType","lora","lora_list","rest","onProgress","loraPath","removeProgressListener","progress","poolType","modelDetails","androidLib","initContext","use_progress_callback","releaseAllLlama","releaseAllContexts","initMultimodal","mmprojPath","useGpu","isMultimodalEnabled","isMultimodalSupportVision","isMultimodalSupportAudio","releaseMultimodal","multimodalCompletion","mediaPaths","num_images","length","initVocoder","vocoderModelPath","isVocoderEnabled","getTTSType","getFormattedAudioCompletion","speakerJsonStr","textToSpeak","getAudioCompletionGuideTokens","decodeAudioTokens","releaseVocoder"],"sourceRoot":"../../src","sources":["index.ts"],"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