Open6
Flutter ローカルLLM
llama.cpp
git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
Build MacOS
mkdir build
cd build
cmake ..
make
Build iOS (Metal)
mkdir build-metal
cd build-metal
cmake -DLLAMA_METAL=ON ..
cmake --build . --config Release
cd ..
Build Android
mkdir build-android
cd build-android
export NDK=<your_ndk_directory>
cmake -DCMAKE_TOOLCHAIN_FILE=$NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-23 -DCMAKE_C_FLAGS=-march=armv8.4a+dotprod ..
make
flutter アプリ作成
flutter create flutter_llm_sample
cd flutter_llm_sample
ffi install
flutter pub add ffi
llama_cpp_dart install
flutter pub add llama_cpp_dart
Package / repository
ios/.symlinks/plugins/llama_cpp_dart/ios/llama_cpp_dart.podspec
Pod::Spec.new do |s|
s.name = 'llama_cpp_dart'
s.version = '0.0.1'
s.summary = 'Llama Cpp Dart'
s.homepage = 'https://github.com/netdur/llama_cpp_dart'
s.license = { :type => 'MIT' }
s.author = { 'netdur' => 'team@myteam.com' }
s.source = { :git => '', :version => s.version.to_s }
s.ios.deployment_target = '17.2'
s.macos.deployment_target = '10.15'
# Framework linking is handled by Flutter tooling, not CocoaPods.
# Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs.
s.vendored_frameworks = 'path/to/nothing'
end