cactus-react-native 0.2.11 → 1.0.2
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 +550 -69
- 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_v8.so → libcactus.a} +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libcactus_util.so +0 -0
- package/cpp/HybridCactus.cpp +135 -0
- package/cpp/HybridCactus.hpp +42 -0
- package/cpp/HybridCactusUtil.cpp +47 -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 +545 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ffi_utils.h +400 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/graph.h +338 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/kernel.h +275 -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 +545 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/ffi_utils.h +400 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/graph.h +338 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/kernel.h +275 -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 +151 -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 +238 -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 +26 -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 +67 -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 +205 -0
- package/src/config/CactusConfig.ts +4 -0
- package/src/constants/packageVersion.ts +1 -0
- package/src/hooks/useCactusLM.ts +285 -0
- package/src/index.tsx +23 -0
- package/src/native/Cactus.ts +83 -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 +20 -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 +73 -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 -140
- 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 -748
- 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.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 -204
- 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 -9
- 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 -141
- 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 -5
- 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 -135
- 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 -54
- 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 -663
- 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 -236
- package/src/vlm.ts +0 -276
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
package com.cactus;
|
|
2
|
-
|
|
3
|
-
import androidx.annotation.NonNull;
|
|
4
|
-
|
|
5
|
-
import com.facebook.react.bridge.Promise;
|
|
6
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
7
|
-
import com.facebook.react.bridge.ReactMethod;
|
|
8
|
-
import com.facebook.react.bridge.ReadableMap;
|
|
9
|
-
import com.facebook.react.bridge.ReadableArray;
|
|
10
|
-
import com.facebook.react.module.annotations.ReactModule;
|
|
11
|
-
|
|
12
|
-
import java.util.HashMap;
|
|
13
|
-
import java.util.Random;
|
|
14
|
-
import java.io.File;
|
|
15
|
-
import java.io.FileInputStream;
|
|
16
|
-
import java.io.PushbackInputStream;
|
|
17
|
-
|
|
18
|
-
@ReactModule(name = Cactus.NAME)
|
|
19
|
-
public class CactusModule extends NativeCactusSpec {
|
|
20
|
-
public static final String NAME = Cactus.NAME;
|
|
21
|
-
|
|
22
|
-
private Cactus cactus = null;
|
|
23
|
-
|
|
24
|
-
public CactusModule(ReactApplicationContext reactContext) {
|
|
25
|
-
super(reactContext);
|
|
26
|
-
cactus = new Cactus(reactContext);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
@Override
|
|
30
|
-
@NonNull
|
|
31
|
-
public String getName() {
|
|
32
|
-
return NAME;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
@ReactMethod
|
|
36
|
-
public void toggleNativeLog(boolean enabled, Promise promise) {
|
|
37
|
-
cactus.toggleNativeLog(enabled, promise);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
@ReactMethod
|
|
41
|
-
public void setContextLimit(double limit, Promise promise) {
|
|
42
|
-
cactus.setContextLimit(limit, promise);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
@ReactMethod
|
|
46
|
-
public void modelInfo(final String model, final ReadableArray skip, final Promise promise) {
|
|
47
|
-
cactus.modelInfo(model, skip, promise);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
@ReactMethod
|
|
51
|
-
public void initContext(double id, final ReadableMap params, final Promise promise) {
|
|
52
|
-
cactus.initContext(id, params, promise);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
@ReactMethod
|
|
56
|
-
public void getFormattedChat(double id, String messages, String chatTemplate, ReadableMap params, Promise promise) {
|
|
57
|
-
cactus.getFormattedChat(id, messages, chatTemplate, params, promise);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
@ReactMethod
|
|
61
|
-
public void loadSession(double id, String path, Promise promise) {
|
|
62
|
-
cactus.loadSession(id, path, promise);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
@ReactMethod
|
|
66
|
-
public void saveSession(double id, String path, double size, Promise promise) {
|
|
67
|
-
cactus.saveSession(id, path, size, promise);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
@ReactMethod
|
|
71
|
-
public void completion(double id, final ReadableMap params, final Promise promise) {
|
|
72
|
-
cactus.completion(id, params, promise);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
@ReactMethod
|
|
76
|
-
public void stopCompletion(double id, final Promise promise) {
|
|
77
|
-
cactus.stopCompletion(id, promise);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
@ReactMethod
|
|
81
|
-
public void tokenize(double id, String text, Promise promise) {
|
|
82
|
-
cactus.tokenize(id, text, promise);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
@ReactMethod
|
|
86
|
-
public void tokenize(double id, String text, ReadableArray mediaPaths, Promise promise) {
|
|
87
|
-
cactus.tokenize(id, text, mediaPaths, promise);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
@ReactMethod
|
|
91
|
-
public void detokenize(double id, ReadableArray tokens, Promise promise) {
|
|
92
|
-
cactus.detokenize(id, tokens, promise);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
@ReactMethod
|
|
96
|
-
public void embedding(double id, String text, ReadableMap params, Promise promise) {
|
|
97
|
-
cactus.embedding(id, text, params, promise);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
@ReactMethod
|
|
101
|
-
public void bench(double id, double pp, double tg, double pl, double nr, Promise promise) {
|
|
102
|
-
cactus.bench(id, pp, tg, pl, nr, promise);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
@ReactMethod
|
|
106
|
-
public void applyLoraAdapters(double id, ReadableArray loraAdapters, Promise promise) {
|
|
107
|
-
cactus.applyLoraAdapters(id, loraAdapters, promise);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
@ReactMethod
|
|
111
|
-
public void removeLoraAdapters(double id, Promise promise) {
|
|
112
|
-
cactus.removeLoraAdapters(id, promise);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
@ReactMethod
|
|
116
|
-
public void getLoadedLoraAdapters(double id, Promise promise) {
|
|
117
|
-
cactus.getLoadedLoraAdapters(id, promise);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
@ReactMethod
|
|
121
|
-
public void initMultimodal(double id, String mmprojPath, Boolean useGpu, Promise promise) {
|
|
122
|
-
cactus.initMultimodal(id, mmprojPath, useGpu.booleanValue(), promise);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
@ReactMethod
|
|
126
|
-
public void isMultimodalEnabled(double id, Promise promise) {
|
|
127
|
-
cactus.isMultimodalEnabled(id, promise);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
@ReactMethod
|
|
131
|
-
public void isMultimodalSupportVision(double id, Promise promise) {
|
|
132
|
-
cactus.isMultimodalSupportVision(id, promise);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
@ReactMethod
|
|
136
|
-
public void isMultimodalSupportAudio(double id, Promise promise) {
|
|
137
|
-
cactus.isMultimodalSupportAudio(id, promise);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
@ReactMethod
|
|
141
|
-
public void releaseMultimodal(double id, Promise promise) {
|
|
142
|
-
cactus.releaseMultimodal(id, promise);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
@ReactMethod
|
|
146
|
-
public void multimodalCompletion(double id, String prompt, ReadableArray mediaPaths, ReadableMap params, Promise promise) {
|
|
147
|
-
cactus.multimodalCompletion(id, prompt, mediaPaths, params, promise);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
@ReactMethod
|
|
151
|
-
public void initVocoder(double id, String vocoderModelPath, Promise promise) {
|
|
152
|
-
cactus.initVocoder(id, vocoderModelPath, promise);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
@ReactMethod
|
|
156
|
-
public void isVocoderEnabled(double id, Promise promise) {
|
|
157
|
-
cactus.isVocoderEnabled(id, promise);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
@ReactMethod
|
|
161
|
-
public void getTTSType(double id, Promise promise) {
|
|
162
|
-
cactus.getTTSType(id, promise);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
@ReactMethod
|
|
166
|
-
public void getFormattedAudioCompletion(double id, String speakerJsonStr, String textToSpeak, Promise promise) {
|
|
167
|
-
cactus.getFormattedAudioCompletion(id, speakerJsonStr, textToSpeak, promise);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
@ReactMethod
|
|
171
|
-
public void getAudioCompletionGuideTokens(double id, String textToSpeak, Promise promise) {
|
|
172
|
-
cactus.getAudioCompletionGuideTokens(id, textToSpeak, promise);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
@ReactMethod
|
|
176
|
-
public void decodeAudioTokens(double id, ReadableArray tokens, Promise promise) {
|
|
177
|
-
cactus.decodeAudioTokens(id, tokens, promise);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
@ReactMethod
|
|
181
|
-
public void getDeviceInfo(double id, Promise promise) {
|
|
182
|
-
cactus.getDeviceInfo(id, promise);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
@ReactMethod
|
|
186
|
-
public void releaseVocoder(double id, Promise promise) {
|
|
187
|
-
cactus.releaseVocoder(id, promise);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
@ReactMethod
|
|
191
|
-
public void rewind(double id, Promise promise) {
|
|
192
|
-
cactus.rewind(id, promise);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
@ReactMethod
|
|
196
|
-
public void releaseContext(double id, Promise promise) {
|
|
197
|
-
cactus.releaseContext(id, promise);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
@ReactMethod
|
|
201
|
-
public void releaseAllContexts(Promise promise) {
|
|
202
|
-
cactus.releaseAllContexts(promise);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
package com.cactus;
|
|
2
|
-
|
|
3
|
-
import androidx.annotation.NonNull;
|
|
4
|
-
|
|
5
|
-
import com.facebook.react.bridge.Promise;
|
|
6
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
7
|
-
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
8
|
-
import com.facebook.react.bridge.ReactMethod;
|
|
9
|
-
import com.facebook.react.bridge.ReadableMap;
|
|
10
|
-
import com.facebook.react.bridge.ReadableArray;
|
|
11
|
-
import com.facebook.react.module.annotations.ReactModule;
|
|
12
|
-
|
|
13
|
-
import java.util.HashMap;
|
|
14
|
-
import java.util.Random;
|
|
15
|
-
import java.io.File;
|
|
16
|
-
import java.io.FileInputStream;
|
|
17
|
-
import java.io.PushbackInputStream;
|
|
18
|
-
|
|
19
|
-
@ReactModule(name = Cactus.NAME)
|
|
20
|
-
public class CactusModule extends ReactContextBaseJavaModule {
|
|
21
|
-
public static final String NAME = Cactus.NAME;
|
|
22
|
-
|
|
23
|
-
private Cactus cactus = null;
|
|
24
|
-
|
|
25
|
-
public CactusModule(ReactApplicationContext reactContext) {
|
|
26
|
-
super(reactContext);
|
|
27
|
-
cactus = new Cactus(reactContext);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@Override
|
|
31
|
-
@NonNull
|
|
32
|
-
public String getName() {
|
|
33
|
-
return NAME;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
@ReactMethod
|
|
37
|
-
public void toggleNativeLog(boolean enabled, Promise promise) {
|
|
38
|
-
cactus.toggleNativeLog(enabled, promise);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
@ReactMethod
|
|
42
|
-
public void setContextLimit(double limit, Promise promise) {
|
|
43
|
-
cactus.setContextLimit(limit, promise);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
@ReactMethod
|
|
47
|
-
public void modelInfo(final String model, final ReadableArray skip, final Promise promise) {
|
|
48
|
-
cactus.modelInfo(model, skip, promise);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
@ReactMethod
|
|
52
|
-
public void initContext(double id, final ReadableMap params, final Promise promise) {
|
|
53
|
-
cactus.initContext(id, params, promise);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
@ReactMethod
|
|
57
|
-
public void getFormattedChat(double id, String messages, String chatTemplate, ReadableMap params, Promise promise) {
|
|
58
|
-
cactus.getFormattedChat(id, messages, chatTemplate, params, promise);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
@ReactMethod
|
|
62
|
-
public void loadSession(double id, String path, Promise promise) {
|
|
63
|
-
cactus.loadSession(id, path, promise);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
@ReactMethod
|
|
67
|
-
public void saveSession(double id, String path, int size, Promise promise) {
|
|
68
|
-
cactus.saveSession(id, path, size, promise);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
@ReactMethod
|
|
72
|
-
public void completion(double id, final ReadableMap params, final Promise promise) {
|
|
73
|
-
cactus.completion(id, params, promise);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
@ReactMethod
|
|
77
|
-
public void stopCompletion(double id, final Promise promise) {
|
|
78
|
-
cactus.stopCompletion(id, promise);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
@ReactMethod
|
|
82
|
-
public void tokenize(double id, final String text, final Promise promise) {
|
|
83
|
-
cactus.tokenize(id, text, promise);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
@ReactMethod
|
|
87
|
-
public void tokenize(double id, final String text, final ReadableArray mediaPaths, final Promise promise) {
|
|
88
|
-
cactus.tokenize(id, text, mediaPaths, promise);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
@ReactMethod
|
|
92
|
-
public void detokenize(double id, final ReadableArray tokens, final Promise promise) {
|
|
93
|
-
cactus.detokenize(id, tokens, promise);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
@ReactMethod
|
|
97
|
-
public void embedding(double id, final String text, final ReadableMap params, final Promise promise) {
|
|
98
|
-
cactus.embedding(id, text, params, promise);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
@ReactMethod
|
|
102
|
-
public void bench(double id, final double pp, final double tg, final double pl, final double nr, final Promise promise) {
|
|
103
|
-
cactus.bench(id, pp, tg, pl, nr, promise);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
@ReactMethod
|
|
107
|
-
public void applyLoraAdapters(double id, final ReadableArray loraAdapters, final Promise promise) {
|
|
108
|
-
cactus.applyLoraAdapters(id, loraAdapters, promise);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
@ReactMethod
|
|
112
|
-
public void removeLoraAdapters(double id, final Promise promise) {
|
|
113
|
-
cactus.removeLoraAdapters(id, promise);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
@ReactMethod
|
|
117
|
-
public void getLoadedLoraAdapters(double id, final Promise promise) {
|
|
118
|
-
cactus.getLoadedLoraAdapters(id, promise);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
@ReactMethod
|
|
122
|
-
public void initMultimodal(double id, final String mmprojPath, final boolean useGpu, final Promise promise) {
|
|
123
|
-
cactus.initMultimodal(id, mmprojPath, useGpu, promise);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
@ReactMethod
|
|
127
|
-
public void isMultimodalEnabled(double id, final Promise promise) {
|
|
128
|
-
cactus.isMultimodalEnabled(id, promise);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
@ReactMethod
|
|
132
|
-
public void isMultimodalSupportVision(double id, final Promise promise) {
|
|
133
|
-
cactus.isMultimodalSupportVision(id, promise);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
@ReactMethod
|
|
137
|
-
public void isMultimodalSupportAudio(double id, final Promise promise) {
|
|
138
|
-
cactus.isMultimodalSupportAudio(id, promise);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
@ReactMethod
|
|
142
|
-
public void releaseMultimodal(double id, final Promise promise) {
|
|
143
|
-
cactus.releaseMultimodal(id, promise);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
@ReactMethod
|
|
147
|
-
public void multimodalCompletion(double id, final String prompt, final ReadableArray mediaPaths, final ReadableMap params, final Promise promise) {
|
|
148
|
-
cactus.multimodalCompletion(id, prompt, mediaPaths, params, promise);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
@ReactMethod
|
|
152
|
-
public void initVocoder(double id, final String vocoderModelPath, final Promise promise) {
|
|
153
|
-
cactus.initVocoder(id, vocoderModelPath, promise);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
@ReactMethod
|
|
157
|
-
public void isVocoderEnabled(double id, final Promise promise) {
|
|
158
|
-
cactus.isVocoderEnabled(id, promise);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
@ReactMethod
|
|
162
|
-
public void getTTSType(double id, final Promise promise) {
|
|
163
|
-
cactus.getTTSType(id, promise);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
@ReactMethod
|
|
167
|
-
public void getFormattedAudioCompletion(double id, final String speakerJsonStr, final String textToSpeak, final Promise promise) {
|
|
168
|
-
cactus.getFormattedAudioCompletion(id, speakerJsonStr, textToSpeak, promise);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
@ReactMethod
|
|
172
|
-
public void getAudioCompletionGuideTokens(double id, final String textToSpeak, final Promise promise) {
|
|
173
|
-
cactus.getAudioCompletionGuideTokens(id, textToSpeak, promise);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
@ReactMethod
|
|
177
|
-
public void decodeAudioTokens(double id, final ReadableArray tokens, final Promise promise) {
|
|
178
|
-
cactus.decodeAudioTokens(id, tokens, promise);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
@ReactMethod
|
|
182
|
-
public void getDeviceInfo(double id, final Promise promise) {
|
|
183
|
-
cactus.getDeviceInfo(id, promise);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
@ReactMethod
|
|
187
|
-
public void releaseVocoder(double id, final Promise promise) {
|
|
188
|
-
cactus.releaseVocoder(id, promise);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
@ReactMethod
|
|
192
|
-
public void rewind(double id, Promise promise) {
|
|
193
|
-
cactus.rewind(id, promise);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
@ReactMethod
|
|
197
|
-
public void releaseContext(double id, Promise promise) {
|
|
198
|
-
cactus.releaseContext(id, promise);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
@ReactMethod
|
|
202
|
-
public void releaseAllContexts(Promise promise) {
|
|
203
|
-
cactus.releaseAllContexts(promise);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
require "json"
|
|
2
|
-
|
|
3
|
-
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
-
base_ld_flags = "-framework Accelerate -framework Foundation -framework Metal -framework MetalKit"
|
|
5
|
-
base_compiler_flags = "-fno-objc-arc -DLM_GGML_USE_CPU -DLM_GGML_USE_ACCELERATE -Wno-shorten-64-to-32"
|
|
6
|
-
|
|
7
|
-
if ENV["CACTUS_DISABLE_METAL"] != "1" then
|
|
8
|
-
base_compiler_flags += " -DLM_GGML_USE_METAL -DLM_GGML_METAL_USE_BF16" # -DLM_GGML_METAL_NDEBUG
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
base_optimizer_flags = "-O3 -DNDEBUG"
|
|
12
|
-
|
|
13
|
-
ios_path = 'ios'
|
|
14
|
-
|
|
15
|
-
Pod::Spec.new do |s|
|
|
16
|
-
s.name = "cactus-react-native"
|
|
17
|
-
s.version = package["version"]
|
|
18
|
-
s.summary = package["description"]
|
|
19
|
-
s.homepage = package["homepage"]
|
|
20
|
-
s.license = package["license"]
|
|
21
|
-
s.authors = package["author"]
|
|
22
|
-
|
|
23
|
-
s.platforms = { :ios => "13.0", :tvos => "13.0" }
|
|
24
|
-
s.source = { :git => "https://github.com/cactus-compute/cactus.git", :tag => "#{s.version}" }
|
|
25
|
-
|
|
26
|
-
s.source_files = "#{ios_path}/**/*.{h,m,mm}"
|
|
27
|
-
s.vendored_frameworks = "#{ios_path}/cactus.xcframework"
|
|
28
|
-
|
|
29
|
-
s.dependency "React-Core"
|
|
30
|
-
|
|
31
|
-
s.compiler_flags = base_compiler_flags
|
|
32
|
-
s.pod_target_xcconfig = {
|
|
33
|
-
"OTHER_LDFLAGS" => base_ld_flags,
|
|
34
|
-
"OTHER_CFLAGS" => base_optimizer_flags,
|
|
35
|
-
"OTHER_CPLUSPLUSFLAGS" => base_optimizer_flags + " -std=c++17"
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
39
|
-
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
|
40
|
-
install_modules_dependencies(s)
|
|
41
|
-
end
|
|
42
|
-
end
|
package/ios/CMakeLists.txt
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
cmake_minimum_required(VERSION 3.16)
|
|
2
|
-
project(cactus VERSION 1.0.0 LANGUAGES CXX C)
|
|
3
|
-
|
|
4
|
-
set(CMAKE_CXX_STANDARD 17)
|
|
5
|
-
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
6
|
-
|
|
7
|
-
# iOS specific settings
|
|
8
|
-
set(CMAKE_OSX_DEPLOYMENT_TARGET 13.0)
|
|
9
|
-
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE NO)
|
|
10
|
-
|
|
11
|
-
# Dependencies and compile options
|
|
12
|
-
add_definitions(
|
|
13
|
-
-DNDEBUG
|
|
14
|
-
-DO3
|
|
15
|
-
-DLM_GGML_USE_CPU
|
|
16
|
-
-DLM_GGML_USE_ACCELERATE
|
|
17
|
-
-DLM_GGML_USE_METAL
|
|
18
|
-
-DLM_GGML_METAL_USE_BF16
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
# Set the source directory to the cpp directory
|
|
22
|
-
set(SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../cpp)
|
|
23
|
-
|
|
24
|
-
# Define public headers
|
|
25
|
-
set(PUBLIC_HEADERS
|
|
26
|
-
${SOURCE_DIR}/cactus.h
|
|
27
|
-
${SOURCE_DIR}/cactus_ffi.h
|
|
28
|
-
${SOURCE_DIR}/llama.h
|
|
29
|
-
${SOURCE_DIR}/llama-impl.h
|
|
30
|
-
${SOURCE_DIR}/ggml.h
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
# Create library target
|
|
34
|
-
add_library(cactus SHARED
|
|
35
|
-
${SOURCE_DIR}/cactus_context.cpp
|
|
36
|
-
${SOURCE_DIR}/cactus_loader.cpp
|
|
37
|
-
${SOURCE_DIR}/cactus_completion.cpp
|
|
38
|
-
${SOURCE_DIR}/cactus_utils.cpp
|
|
39
|
-
${SOURCE_DIR}/cactus_embedding.cpp
|
|
40
|
-
${SOURCE_DIR}/cactus_lora.cpp
|
|
41
|
-
${SOURCE_DIR}/cactus_tokenization.cpp
|
|
42
|
-
${SOURCE_DIR}/cactus_multimodal.cpp
|
|
43
|
-
${SOURCE_DIR}/cactus_tts.cpp
|
|
44
|
-
${SOURCE_DIR}/cactus_bench.cpp
|
|
45
|
-
${SOURCE_DIR}/cactus_chat.cpp
|
|
46
|
-
${SOURCE_DIR}/cactus_ffi.cpp
|
|
47
|
-
${SOURCE_DIR}/tools/mtmd/mtmd.cpp
|
|
48
|
-
${SOURCE_DIR}/tools/mtmd/mtmd-audio.cpp
|
|
49
|
-
${SOURCE_DIR}/tools/mtmd/clip.cpp
|
|
50
|
-
${SOURCE_DIR}/tools/mtmd/mtmd-helper.cpp
|
|
51
|
-
${SOURCE_DIR}/llama.cpp
|
|
52
|
-
${SOURCE_DIR}/llama-mmap.cpp
|
|
53
|
-
${SOURCE_DIR}/llama-memory.cpp
|
|
54
|
-
${SOURCE_DIR}/llama-io.cpp
|
|
55
|
-
${SOURCE_DIR}/llama-cparams.cpp
|
|
56
|
-
${SOURCE_DIR}/llama-hparams.cpp
|
|
57
|
-
${SOURCE_DIR}/llama-model.cpp
|
|
58
|
-
${SOURCE_DIR}/llama-model-loader.cpp
|
|
59
|
-
${SOURCE_DIR}/llama-model-saver.cpp
|
|
60
|
-
${SOURCE_DIR}/llama-kv-cache.cpp
|
|
61
|
-
${SOURCE_DIR}/llama-context.cpp
|
|
62
|
-
${SOURCE_DIR}/llama-chat.cpp
|
|
63
|
-
${SOURCE_DIR}/llama-batch.cpp
|
|
64
|
-
${SOURCE_DIR}/llama-arch.cpp
|
|
65
|
-
${SOURCE_DIR}/llama-adapter.cpp
|
|
66
|
-
${SOURCE_DIR}/llama-sampling.cpp
|
|
67
|
-
${SOURCE_DIR}/llama-grammar.cpp
|
|
68
|
-
${SOURCE_DIR}/llama-vocab.cpp
|
|
69
|
-
${SOURCE_DIR}/llama-impl.cpp
|
|
70
|
-
${SOURCE_DIR}/llama-graph.cpp
|
|
71
|
-
${SOURCE_DIR}/ggml.c
|
|
72
|
-
${SOURCE_DIR}/ggml-alloc.c
|
|
73
|
-
${SOURCE_DIR}/ggml-backend.cpp
|
|
74
|
-
${SOURCE_DIR}/ggml-quants.c
|
|
75
|
-
${SOURCE_DIR}/ggml-opt.cpp
|
|
76
|
-
${SOURCE_DIR}/ggml-threading.cpp
|
|
77
|
-
${SOURCE_DIR}/ggml-backend-reg.cpp
|
|
78
|
-
${SOURCE_DIR}/gguf.cpp
|
|
79
|
-
${SOURCE_DIR}/common.cpp
|
|
80
|
-
${SOURCE_DIR}/chat.cpp
|
|
81
|
-
${SOURCE_DIR}/log.cpp
|
|
82
|
-
${SOURCE_DIR}/sampling.cpp
|
|
83
|
-
${SOURCE_DIR}/json-schema-to-grammar.cpp
|
|
84
|
-
${SOURCE_DIR}/unicode.cpp
|
|
85
|
-
${SOURCE_DIR}/unicode-data.cpp
|
|
86
|
-
${SOURCE_DIR}/ggml-cpu/amx/amx.cpp
|
|
87
|
-
${SOURCE_DIR}/ggml-cpu/amx/mmq.cpp
|
|
88
|
-
${SOURCE_DIR}/ggml-cpu/ggml-cpu.c
|
|
89
|
-
${SOURCE_DIR}/ggml-cpu/ggml-cpu.cpp
|
|
90
|
-
${SOURCE_DIR}/ggml-cpu/ggml-cpu-aarch64.cpp
|
|
91
|
-
${SOURCE_DIR}/ggml-cpu/ggml-cpu-quants.c
|
|
92
|
-
${SOURCE_DIR}/ggml-cpu/ggml-cpu-traits.cpp
|
|
93
|
-
${SOURCE_DIR}/ggml-cpu/unary-ops.cpp
|
|
94
|
-
${SOURCE_DIR}/ggml-cpu/binary-ops.cpp
|
|
95
|
-
${SOURCE_DIR}/ggml-cpu/sgemm.cpp
|
|
96
|
-
${SOURCE_DIR}/ggml-cpu/vec.cpp
|
|
97
|
-
${SOURCE_DIR}/ggml-cpu/ops.cpp
|
|
98
|
-
${SOURCE_DIR}/ggml-metal.m
|
|
99
|
-
${SOURCE_DIR}/minja/minja.hpp
|
|
100
|
-
${SOURCE_DIR}/minja/chat-template.hpp
|
|
101
|
-
${SOURCE_DIR}/json.hpp
|
|
102
|
-
)
|
|
103
|
-
|
|
104
|
-
# Setup include directories, use the cpp directory
|
|
105
|
-
target_include_directories(cactus
|
|
106
|
-
PUBLIC
|
|
107
|
-
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../cpp>
|
|
108
|
-
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../cpp/ggml-cpu>
|
|
109
|
-
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../cpp/tools/mtmd>
|
|
110
|
-
$<INSTALL_INTERFACE:include>
|
|
111
|
-
)
|
|
112
|
-
|
|
113
|
-
# Link required frameworks
|
|
114
|
-
target_link_libraries(cactus PRIVATE
|
|
115
|
-
"-framework Accelerate"
|
|
116
|
-
"-framework Foundation"
|
|
117
|
-
"-framework Metal"
|
|
118
|
-
"-framework MetalKit"
|
|
119
|
-
)
|
|
120
|
-
|
|
121
|
-
# Set properties for framework
|
|
122
|
-
set_target_properties(cactus PROPERTIES
|
|
123
|
-
MACOSX_FRAMEWORK_IDENTIFIER "com.cactus"
|
|
124
|
-
MACOSX_FRAMEWORK_BUNDLE_VERSION 1.0.0
|
|
125
|
-
MACOSX_FRAMEWORK_SHORT_VERSION_STRING 1.0.0
|
|
126
|
-
FRAMEWORK TRUE
|
|
127
|
-
FRAMEWORK_VERSION 1.0.0
|
|
128
|
-
VERSION 1.0.0
|
|
129
|
-
PUBLIC_HEADER "${PUBLIC_HEADERS}"
|
|
130
|
-
XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC NO
|
|
131
|
-
)
|