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
|
@@ -1,232 +1,11 @@
|
|
|
1
1
|
#ifndef CACTUS_H
|
|
2
2
|
#define CACTUS_H
|
|
3
3
|
|
|
4
|
-
#include
|
|
5
|
-
#include
|
|
6
|
-
#include
|
|
7
|
-
#include "
|
|
8
|
-
#include "
|
|
9
|
-
#include "
|
|
10
|
-
|
|
11
|
-
#
|
|
12
|
-
#include "llama-impl.h"
|
|
13
|
-
#include "sampling.h"
|
|
14
|
-
#if defined(__ANDROID__)
|
|
15
|
-
#include <android/log.h>
|
|
16
|
-
#endif
|
|
17
|
-
|
|
18
|
-
struct mtmd_context;
|
|
19
|
-
|
|
20
|
-
namespace cactus {
|
|
21
|
-
|
|
22
|
-
std::string tokens_to_output_formatted_string(const llama_context *ctx, const llama_token token);
|
|
23
|
-
|
|
24
|
-
std::string tokens_to_str(llama_context *ctx, const std::vector<llama_token>::const_iterator begin, const std::vector<llama_token>::const_iterator end);
|
|
25
|
-
|
|
26
|
-
lm_ggml_type kv_cache_type_from_str(const std::string & s);
|
|
27
|
-
|
|
28
|
-
enum stop_type
|
|
29
|
-
{
|
|
30
|
-
STOP_FULL,
|
|
31
|
-
STOP_PARTIAL,
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
enum tts_type {
|
|
35
|
-
TTS_UNKNOWN = -1,
|
|
36
|
-
TTS_OUTETTS_V0_2 = 1,
|
|
37
|
-
TTS_OUTETTS_V0_3 = 2,
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
struct completion_token_output
|
|
41
|
-
{
|
|
42
|
-
struct token_prob
|
|
43
|
-
{
|
|
44
|
-
llama_token tok;
|
|
45
|
-
float prob;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
std::vector<token_prob> probs;
|
|
49
|
-
llama_token tok;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
struct conversation_result {
|
|
53
|
-
std::string text;
|
|
54
|
-
std::chrono::milliseconds time_to_first_token;
|
|
55
|
-
std::chrono::milliseconds total_time;
|
|
56
|
-
int tokens_generated;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
struct cactus_tokenize_result {
|
|
60
|
-
std::vector<llama_token> tokens;
|
|
61
|
-
bool has_media = false;
|
|
62
|
-
std::vector<std::string> bitmap_hashes;
|
|
63
|
-
std::vector<size_t> chunk_pos;
|
|
64
|
-
std::vector<size_t> chunk_pos_media;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
struct cactus_context {
|
|
68
|
-
bool is_predicting = false;
|
|
69
|
-
bool is_interrupted = false;
|
|
70
|
-
bool has_next_token = false;
|
|
71
|
-
std::string generated_text;
|
|
72
|
-
std::vector<completion_token_output> generated_token_probs;
|
|
73
|
-
|
|
74
|
-
size_t num_prompt_tokens = 0;
|
|
75
|
-
size_t num_tokens_predicted = 0;
|
|
76
|
-
size_t n_past = 0;
|
|
77
|
-
size_t n_remain = 0;
|
|
78
|
-
|
|
79
|
-
std::vector<llama_token> embd;
|
|
80
|
-
common_params params;
|
|
81
|
-
common_init_result llama_init;
|
|
82
|
-
|
|
83
|
-
llama_model *model = nullptr;
|
|
84
|
-
float loading_progress = 0;
|
|
85
|
-
bool is_load_interrupted = false;
|
|
86
|
-
|
|
87
|
-
llama_context *ctx = nullptr;
|
|
88
|
-
common_sampler *ctx_sampling = nullptr;
|
|
89
|
-
common_chat_templates_ptr templates;
|
|
90
|
-
|
|
91
|
-
int n_ctx;
|
|
92
|
-
|
|
93
|
-
bool truncated = false;
|
|
94
|
-
bool stopped_eos = false;
|
|
95
|
-
bool stopped_word = false;
|
|
96
|
-
bool stopped_limit = false;
|
|
97
|
-
std::string stopping_word;
|
|
98
|
-
bool incomplete = false;
|
|
99
|
-
|
|
100
|
-
std::vector<common_adapter_lora_info> lora;
|
|
101
|
-
|
|
102
|
-
bool context_full = false;
|
|
103
|
-
std::vector<llama_token> guide_tokens;
|
|
104
|
-
bool next_token_uses_guide_token = true;
|
|
105
|
-
|
|
106
|
-
struct cactus_context_mtmd {
|
|
107
|
-
mtmd_context* mtmd_ctx = nullptr;
|
|
108
|
-
};
|
|
109
|
-
cactus_context_mtmd *mtmd_wrapper = nullptr;
|
|
110
|
-
bool has_multimodal = false;
|
|
111
|
-
std::vector<std::string> mtmd_bitmap_past_hashes;
|
|
112
|
-
|
|
113
|
-
struct cactus_context_vocoder {
|
|
114
|
-
common_init_result init_result;
|
|
115
|
-
llama_model *model = nullptr;
|
|
116
|
-
llama_context *ctx = nullptr;
|
|
117
|
-
tts_type type = TTS_UNKNOWN;
|
|
118
|
-
};
|
|
119
|
-
cactus_context_vocoder *vocoder_wrapper = nullptr;
|
|
120
|
-
bool has_vocoder = false;
|
|
121
|
-
std::vector<llama_token> audio_tokens;
|
|
122
|
-
|
|
123
|
-
// Conversation management state
|
|
124
|
-
bool conversation_active = false;
|
|
125
|
-
std::string last_chat_template = "";
|
|
126
|
-
|
|
127
|
-
~cactus_context();
|
|
128
|
-
|
|
129
|
-
void rewind();
|
|
130
|
-
|
|
131
|
-
bool initSampling();
|
|
132
|
-
|
|
133
|
-
bool loadModel(common_params ¶ms_);
|
|
134
|
-
|
|
135
|
-
bool validateModelChatTemplate(bool use_jinja, const char *name) const;
|
|
136
|
-
|
|
137
|
-
common_chat_params getFormattedChatWithJinja(
|
|
138
|
-
const std::string &messages,
|
|
139
|
-
const std::string &chat_template,
|
|
140
|
-
const std::string &json_schema,
|
|
141
|
-
const std::string &tools,
|
|
142
|
-
const bool ¶llel_tool_calls,
|
|
143
|
-
const std::string &tool_choice
|
|
144
|
-
) const;
|
|
145
|
-
|
|
146
|
-
std::string getFormattedChat(
|
|
147
|
-
const std::string &messages,
|
|
148
|
-
const std::string &chat_template
|
|
149
|
-
) const;
|
|
150
|
-
|
|
151
|
-
void truncatePrompt(std::vector<llama_token> &prompt_tokens);
|
|
152
|
-
|
|
153
|
-
void loadPrompt();
|
|
154
|
-
|
|
155
|
-
void loadPrompt(const std::vector<std::string> &media_paths);
|
|
156
|
-
|
|
157
|
-
void setGuideTokens(const std::vector<llama_token> &tokens);
|
|
158
|
-
|
|
159
|
-
void beginCompletion();
|
|
160
|
-
|
|
161
|
-
void endCompletion();
|
|
162
|
-
|
|
163
|
-
completion_token_output nextToken();
|
|
164
|
-
|
|
165
|
-
size_t findStoppingStrings(const std::string &text, const size_t last_token_size, const stop_type type);
|
|
166
|
-
|
|
167
|
-
completion_token_output doCompletion();
|
|
168
|
-
|
|
169
|
-
std::vector<float> getEmbedding(common_params &embd_params);
|
|
170
|
-
|
|
171
|
-
std::string bench(int pp, int tg, int pl, int nr);
|
|
172
|
-
|
|
173
|
-
int applyLoraAdapters(std::vector<common_adapter_lora_info> lora);
|
|
174
|
-
|
|
175
|
-
void removeLoraAdapters();
|
|
176
|
-
|
|
177
|
-
std::vector<common_adapter_lora_info> getLoadedLoraAdapters();
|
|
178
|
-
|
|
179
|
-
cactus_tokenize_result tokenize(const std::string &text, const std::vector<std::string> &media_paths);
|
|
180
|
-
|
|
181
|
-
bool initMultimodal(const std::string &mmproj_path, bool use_gpu);
|
|
182
|
-
bool isMultimodalEnabled() const;
|
|
183
|
-
bool isMultimodalSupportVision() const;
|
|
184
|
-
bool isMultimodalSupportAudio() const;
|
|
185
|
-
void releaseMultimodal();
|
|
186
|
-
void processMedia(const std::string &prompt, const std::vector<std::string> &media_paths);
|
|
187
|
-
|
|
188
|
-
bool initVocoder(const std::string &vocoder_model_path);
|
|
189
|
-
bool isVocoderEnabled() const;
|
|
190
|
-
tts_type getTTSType() const;
|
|
191
|
-
std::string getFormattedAudioCompletion(const std::string &speaker_json_str, const std::string &text_to_speak);
|
|
192
|
-
std::vector<llama_token> getAudioCompletionGuideTokens(const std::string &text_to_speak);
|
|
193
|
-
std::vector<float> decodeAudioTokens(const std::vector<llama_token> &tokens);
|
|
194
|
-
void releaseVocoder();
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
extern bool cactus_verbose;
|
|
198
|
-
|
|
199
|
-
#if CACTUS_VERBOSE != 1
|
|
200
|
-
#define LOG_VERBOSE(MSG, ...)
|
|
201
|
-
#else
|
|
202
|
-
#define LOG_VERBOSE(MSG, ...) \
|
|
203
|
-
do \
|
|
204
|
-
{ \
|
|
205
|
-
if (cactus_verbose) \
|
|
206
|
-
{ \
|
|
207
|
-
log("VERBOSE", __func__, __LINE__, MSG, ##__VA_ARGS__); \
|
|
208
|
-
} \
|
|
209
|
-
} while (0)
|
|
210
|
-
#endif
|
|
211
|
-
|
|
212
|
-
#define LOG_ERROR(MSG, ...) log("ERROR", __func__, __LINE__, MSG, ##__VA_ARGS__)
|
|
213
|
-
|
|
214
|
-
#define LOG_WARNING(MSG, ...) log("WARNING", __func__, __LINE__, MSG, ##__VA_ARGS__)
|
|
215
|
-
|
|
216
|
-
#define LOG_INFO(MSG, ...) log("INFO", __func__, __LINE__, MSG, ##__VA_ARGS__)
|
|
217
|
-
|
|
218
|
-
void log(const char *level, const char *function, int line, const char *format, ...);
|
|
219
|
-
|
|
220
|
-
void llama_batch_clear(llama_batch *batch);
|
|
221
|
-
|
|
222
|
-
void llama_batch_add(llama_batch *batch, llama_token id, llama_pos pos, const std::vector<llama_seq_id>& seq_ids, bool logits);
|
|
223
|
-
|
|
224
|
-
size_t common_part(const std::vector<llama_token> &a, const std::vector<llama_token> &b);
|
|
225
|
-
|
|
226
|
-
bool ends_with(const std::string &str, const std::string &suffix);
|
|
227
|
-
|
|
228
|
-
size_t find_partial_stop_string(const std::string &stop, const std::string &text);
|
|
229
|
-
|
|
230
|
-
} // namespace cactus
|
|
231
|
-
|
|
232
|
-
#endif /* CACTUS_H */
|
|
4
|
+
#include "graph/graph.h"
|
|
5
|
+
#include "kernel/kernel.h"
|
|
6
|
+
#include "kernel/kernel_utils.h"
|
|
7
|
+
#include "engine/engine.h"
|
|
8
|
+
#include "models/model.h"
|
|
9
|
+
#include "ffi/cactus_ffi.h"
|
|
10
|
+
|
|
11
|
+
#endif // CACTUS_H
|
|
@@ -1,256 +1,55 @@
|
|
|
1
1
|
#ifndef CACTUS_FFI_H
|
|
2
2
|
#define CACTUS_FFI_H
|
|
3
3
|
|
|
4
|
-
#include <stdint.h>
|
|
5
|
-
#include <stdbool.h>
|
|
6
4
|
#include <stddef.h>
|
|
5
|
+
#include <stdint.h>
|
|
7
6
|
|
|
8
|
-
#if
|
|
9
|
-
#
|
|
10
|
-
|
|
11
|
-
#define CACTUS_FFI_EXPORT __attribute__ ((dllexport))
|
|
12
|
-
#else
|
|
13
|
-
#define CACTUS_FFI_EXPORT __declspec(dllexport)
|
|
14
|
-
#endif
|
|
15
|
-
#else
|
|
16
|
-
#ifdef __GNUC__
|
|
17
|
-
#define CACTUS_FFI_EXPORT __attribute__ ((dllimport))
|
|
18
|
-
#else
|
|
19
|
-
#define CACTUS_FFI_EXPORT __declspec(dllimport)
|
|
20
|
-
#endif
|
|
21
|
-
#endif
|
|
22
|
-
#define CACTUS_FFI_LOCAL
|
|
7
|
+
#if __GNUC__ >= 4
|
|
8
|
+
#define CACTUS_FFI_EXPORT __attribute__ ((visibility ("default")))
|
|
9
|
+
#define CACTUS_FFI_LOCAL __attribute__ ((visibility ("hidden")))
|
|
23
10
|
#else
|
|
24
|
-
#
|
|
25
|
-
|
|
26
|
-
#define CACTUS_FFI_LOCAL __attribute__ ((visibility ("hidden")))
|
|
27
|
-
#else
|
|
28
|
-
#define CACTUS_FFI_EXPORT
|
|
29
|
-
#define CACTUS_FFI_LOCAL
|
|
30
|
-
#endif
|
|
11
|
+
#define CACTUS_FFI_EXPORT
|
|
12
|
+
#define CACTUS_FFI_LOCAL
|
|
31
13
|
#endif
|
|
32
14
|
|
|
33
15
|
#ifdef __cplusplus
|
|
34
16
|
extern "C" {
|
|
35
17
|
#endif
|
|
36
18
|
|
|
37
|
-
typedef
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
typedef struct cactus_init_params_c {
|
|
41
|
-
const char* model_path;
|
|
42
|
-
const char* chat_template;
|
|
43
|
-
|
|
44
|
-
int32_t n_ctx;
|
|
45
|
-
int32_t n_batch;
|
|
46
|
-
int32_t n_ubatch;
|
|
47
|
-
int32_t n_gpu_layers;
|
|
48
|
-
int32_t n_threads;
|
|
49
|
-
bool use_mmap;
|
|
50
|
-
bool use_mlock;
|
|
51
|
-
bool embedding;
|
|
52
|
-
int32_t pooling_type;
|
|
53
|
-
int32_t embd_normalize;
|
|
54
|
-
bool flash_attn;
|
|
55
|
-
const char* cache_type_k;
|
|
56
|
-
const char* cache_type_v;
|
|
57
|
-
void (*progress_callback)(float progress);
|
|
58
|
-
|
|
59
|
-
} cactus_init_params_c_t;
|
|
60
|
-
|
|
61
|
-
typedef struct cactus_completion_params_c {
|
|
62
|
-
const char* prompt;
|
|
63
|
-
int32_t n_predict;
|
|
64
|
-
int32_t n_threads;
|
|
65
|
-
int32_t seed;
|
|
66
|
-
double temperature;
|
|
67
|
-
int32_t top_k;
|
|
68
|
-
double top_p;
|
|
69
|
-
double min_p;
|
|
70
|
-
double typical_p;
|
|
71
|
-
int32_t penalty_last_n;
|
|
72
|
-
double penalty_repeat;
|
|
73
|
-
double penalty_freq;
|
|
74
|
-
double penalty_present;
|
|
75
|
-
int32_t mirostat;
|
|
76
|
-
double mirostat_tau;
|
|
77
|
-
double mirostat_eta;
|
|
78
|
-
bool ignore_eos;
|
|
79
|
-
int32_t n_probs;
|
|
80
|
-
const char** stop_sequences;
|
|
81
|
-
int stop_sequence_count;
|
|
82
|
-
const char* grammar;
|
|
83
|
-
bool (*token_callback)(const char* token_json);
|
|
84
|
-
|
|
85
|
-
} cactus_completion_params_c_t;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
typedef struct cactus_token_array_c {
|
|
89
|
-
int32_t* tokens;
|
|
90
|
-
int32_t count;
|
|
91
|
-
} cactus_token_array_c_t;
|
|
19
|
+
typedef void* cactus_model_t;
|
|
92
20
|
|
|
93
|
-
typedef
|
|
94
|
-
float* values;
|
|
95
|
-
int32_t count;
|
|
96
|
-
} cactus_float_array_c_t;
|
|
21
|
+
typedef void (*cactus_token_callback)(const char* token, uint32_t token_id, void* user_data);
|
|
97
22
|
|
|
98
|
-
|
|
99
|
-
char* text;
|
|
100
|
-
int32_t tokens_predicted;
|
|
101
|
-
int32_t tokens_evaluated;
|
|
102
|
-
bool truncated;
|
|
103
|
-
bool stopped_eos;
|
|
104
|
-
bool stopped_word;
|
|
105
|
-
bool stopped_limit;
|
|
106
|
-
char* stopping_word;
|
|
107
|
-
} cactus_completion_result_c_t;
|
|
23
|
+
CACTUS_FFI_EXPORT cactus_model_t cactus_init(const char* model_path, size_t context_size, const char* corpus_dir);
|
|
108
24
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
char
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
} cactus_tokenize_result_c_t;
|
|
119
|
-
|
|
120
|
-
CACTUS_FFI_EXPORT cactus_context_handle_t cactus_init_context_c(const cactus_init_params_c_t* params);
|
|
121
|
-
|
|
122
|
-
CACTUS_FFI_EXPORT void cactus_free_context_c(cactus_context_handle_t handle);
|
|
123
|
-
|
|
124
|
-
CACTUS_FFI_EXPORT int cactus_completion_c(
|
|
125
|
-
cactus_context_handle_t handle,
|
|
126
|
-
const cactus_completion_params_c_t* params,
|
|
127
|
-
cactus_completion_result_c_t* result
|
|
25
|
+
CACTUS_FFI_EXPORT int cactus_complete(
|
|
26
|
+
cactus_model_t model,
|
|
27
|
+
const char* messages_json,
|
|
28
|
+
char* response_buffer,
|
|
29
|
+
size_t buffer_size,
|
|
30
|
+
const char* options_json,
|
|
31
|
+
const char* tools_json,
|
|
32
|
+
cactus_token_callback callback,
|
|
33
|
+
void* user_data
|
|
128
34
|
);
|
|
129
35
|
|
|
130
|
-
// **MULTIMODAL COMPLETION**
|
|
131
|
-
CACTUS_FFI_EXPORT int cactus_multimodal_completion_c(
|
|
132
|
-
cactus_context_handle_t handle,
|
|
133
|
-
const cactus_completion_params_c_t* params,
|
|
134
|
-
const char** media_paths,
|
|
135
|
-
int media_count,
|
|
136
|
-
cactus_completion_result_c_t* result
|
|
137
|
-
);
|
|
138
|
-
|
|
139
|
-
CACTUS_FFI_EXPORT void cactus_stop_completion_c(cactus_context_handle_t handle);
|
|
140
|
-
|
|
141
|
-
CACTUS_FFI_EXPORT cactus_token_array_c_t cactus_tokenize_c(cactus_context_handle_t handle, const char* text);
|
|
142
|
-
|
|
143
|
-
CACTUS_FFI_EXPORT char* cactus_detokenize_c(cactus_context_handle_t handle, const int32_t* tokens, int32_t count);
|
|
144
|
-
|
|
145
|
-
CACTUS_FFI_EXPORT cactus_float_array_c_t cactus_embedding_c(cactus_context_handle_t handle, const char* text);
|
|
146
|
-
|
|
147
|
-
CACTUS_FFI_EXPORT void cactus_free_string_c(char* str);
|
|
148
|
-
|
|
149
|
-
CACTUS_FFI_EXPORT void cactus_free_token_array_c(cactus_token_array_c_t arr);
|
|
150
|
-
|
|
151
|
-
CACTUS_FFI_EXPORT void cactus_free_float_array_c(cactus_float_array_c_t arr);
|
|
152
|
-
|
|
153
|
-
CACTUS_FFI_EXPORT void cactus_free_completion_result_members_c(cactus_completion_result_c_t* result);
|
|
154
36
|
|
|
155
|
-
CACTUS_FFI_EXPORT
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
CACTUS_FFI_EXPORT int cactus_init_multimodal_c(cactus_context_handle_t handle, const char* mmproj_path, bool use_gpu);
|
|
162
|
-
|
|
163
|
-
CACTUS_FFI_EXPORT bool cactus_is_multimodal_enabled_c(cactus_context_handle_t handle);
|
|
164
|
-
|
|
165
|
-
CACTUS_FFI_EXPORT bool cactus_supports_vision_c(cactus_context_handle_t handle);
|
|
166
|
-
|
|
167
|
-
CACTUS_FFI_EXPORT bool cactus_supports_audio_c(cactus_context_handle_t handle);
|
|
168
|
-
|
|
169
|
-
CACTUS_FFI_EXPORT void cactus_release_multimodal_c(cactus_context_handle_t handle);
|
|
170
|
-
|
|
171
|
-
CACTUS_FFI_EXPORT int cactus_init_vocoder_c(cactus_context_handle_t handle, const char* vocoder_model_path);
|
|
172
|
-
|
|
173
|
-
CACTUS_FFI_EXPORT bool cactus_is_vocoder_enabled_c(cactus_context_handle_t handle);
|
|
174
|
-
|
|
175
|
-
CACTUS_FFI_EXPORT int cactus_get_tts_type_c(cactus_context_handle_t handle);
|
|
176
|
-
|
|
177
|
-
CACTUS_FFI_EXPORT char* cactus_get_formatted_audio_completion_c(cactus_context_handle_t handle, const char* speaker_json_str, const char* text_to_speak);
|
|
178
|
-
|
|
179
|
-
CACTUS_FFI_EXPORT cactus_token_array_c_t cactus_get_audio_guide_tokens_c(cactus_context_handle_t handle, const char* text_to_speak);
|
|
180
|
-
|
|
181
|
-
CACTUS_FFI_EXPORT cactus_float_array_c_t cactus_decode_audio_tokens_c(cactus_context_handle_t handle, const int32_t* tokens, int32_t count);
|
|
182
|
-
|
|
183
|
-
CACTUS_FFI_EXPORT void cactus_release_vocoder_c(cactus_context_handle_t handle);
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
typedef struct {
|
|
187
|
-
const char* path;
|
|
188
|
-
float scale;
|
|
189
|
-
} cactus_lora_adapter_c_t;
|
|
190
|
-
|
|
191
|
-
typedef struct {
|
|
192
|
-
cactus_lora_adapter_c_t* adapters;
|
|
193
|
-
int32_t count;
|
|
194
|
-
} cactus_lora_adapters_c_t;
|
|
195
|
-
|
|
196
|
-
typedef struct {
|
|
197
|
-
char* model_name;
|
|
198
|
-
int64_t model_size;
|
|
199
|
-
int64_t model_params;
|
|
200
|
-
double pp_avg;
|
|
201
|
-
double pp_std;
|
|
202
|
-
double tg_avg;
|
|
203
|
-
double tg_std;
|
|
204
|
-
} cactus_bench_result_c_t;
|
|
205
|
-
|
|
206
|
-
CACTUS_FFI_EXPORT cactus_bench_result_c_t cactus_bench_c(cactus_context_handle_t handle, int pp, int tg, int pl, int nr);
|
|
207
|
-
CACTUS_FFI_EXPORT int cactus_apply_lora_adapters_c(cactus_context_handle_t handle, const cactus_lora_adapters_c_t* adapters);
|
|
208
|
-
CACTUS_FFI_EXPORT void cactus_remove_lora_adapters_c(cactus_context_handle_t handle);
|
|
209
|
-
CACTUS_FFI_EXPORT cactus_lora_adapters_c_t cactus_get_loaded_lora_adapters_c(cactus_context_handle_t handle);
|
|
210
|
-
CACTUS_FFI_EXPORT bool cactus_validate_chat_template_c(cactus_context_handle_t handle, bool use_jinja, const char* name);
|
|
211
|
-
CACTUS_FFI_EXPORT char* cactus_get_formatted_chat_c(cactus_context_handle_t handle, const char* messages, const char* chat_template);
|
|
212
|
-
|
|
213
|
-
typedef struct {
|
|
214
|
-
char* prompt;
|
|
215
|
-
char* json_schema;
|
|
216
|
-
char* tools;
|
|
217
|
-
char* tool_choice;
|
|
218
|
-
bool parallel_tool_calls;
|
|
219
|
-
} cactus_chat_result_c_t;
|
|
220
|
-
|
|
221
|
-
CACTUS_FFI_EXPORT cactus_chat_result_c_t cactus_get_formatted_chat_with_jinja_c(
|
|
222
|
-
cactus_context_handle_t handle,
|
|
223
|
-
const char* messages,
|
|
224
|
-
const char* chat_template,
|
|
225
|
-
const char* json_schema,
|
|
226
|
-
const char* tools,
|
|
227
|
-
bool parallel_tool_calls,
|
|
228
|
-
const char* tool_choice
|
|
37
|
+
CACTUS_FFI_EXPORT int cactus_embed(
|
|
38
|
+
cactus_model_t model,
|
|
39
|
+
const char* text,
|
|
40
|
+
float* embeddings_buffer,
|
|
41
|
+
size_t buffer_size,
|
|
42
|
+
size_t* embedding_dim
|
|
229
43
|
);
|
|
230
44
|
|
|
231
|
-
CACTUS_FFI_EXPORT void
|
|
232
|
-
CACTUS_FFI_EXPORT bool cactus_init_sampling_c(cactus_context_handle_t handle);
|
|
233
|
-
|
|
234
|
-
CACTUS_FFI_EXPORT void cactus_begin_completion_c(cactus_context_handle_t handle);
|
|
235
|
-
CACTUS_FFI_EXPORT void cactus_end_completion_c(cactus_context_handle_t handle);
|
|
236
|
-
CACTUS_FFI_EXPORT void cactus_load_prompt_c(cactus_context_handle_t handle);
|
|
237
|
-
CACTUS_FFI_EXPORT void cactus_load_prompt_with_media_c(cactus_context_handle_t handle, const char** media_paths, int media_count);
|
|
238
|
-
|
|
239
|
-
CACTUS_FFI_EXPORT int cactus_do_completion_step_c(cactus_context_handle_t handle, char** token_text);
|
|
240
|
-
CACTUS_FFI_EXPORT size_t cactus_find_stopping_strings_c(cactus_context_handle_t handle, const char* text, size_t last_token_size, int stop_type);
|
|
45
|
+
CACTUS_FFI_EXPORT void cactus_reset(cactus_model_t model);
|
|
241
46
|
|
|
242
|
-
CACTUS_FFI_EXPORT
|
|
243
|
-
CACTUS_FFI_EXPORT int32_t cactus_get_n_embd_c(cactus_context_handle_t handle);
|
|
244
|
-
CACTUS_FFI_EXPORT char* cactus_get_model_desc_c(cactus_context_handle_t handle);
|
|
245
|
-
CACTUS_FFI_EXPORT int64_t cactus_get_model_size_c(cactus_context_handle_t handle);
|
|
246
|
-
CACTUS_FFI_EXPORT int64_t cactus_get_model_params_c(cactus_context_handle_t handle);
|
|
47
|
+
CACTUS_FFI_EXPORT void cactus_stop(cactus_model_t model);
|
|
247
48
|
|
|
248
|
-
CACTUS_FFI_EXPORT void
|
|
249
|
-
CACTUS_FFI_EXPORT void cactus_free_lora_adapters_c(cactus_lora_adapters_c_t* adapters);
|
|
250
|
-
CACTUS_FFI_EXPORT void cactus_free_chat_result_members_c(cactus_chat_result_c_t* result);
|
|
49
|
+
CACTUS_FFI_EXPORT void cactus_destroy(cactus_model_t model);
|
|
251
50
|
|
|
252
51
|
#ifdef __cplusplus
|
|
253
52
|
}
|
|
254
53
|
#endif
|
|
255
54
|
|
|
256
|
-
#endif
|
|
55
|
+
#endif
|