0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

LLMをAndorid純正ターミナルで完全ローカルで動かす

Last updated at Posted at 2025-05-04

最近Andoridで純正のLinuxターミナルが使えるようになりましたね。(現時点ではPixel限定らしいですけど。)

ということはLlama.cppも動くはずなのでやってみました。

実行環境

  • Pixel 6a
  • Android 15
  • モデル: unsloth/gemma-3-1b-it-GGUF/gemma-3-1b-it-UD-IQ1_S.gguf

実行コマンド

Andoridからコマンドを打つことになると思うので、コピペしやすくコマンド1個1個書いていきます。

なお、AndoridでLinuxターミナルを使えるようにするまでは他の人が解説していると思うので割愛します。

aptの更新

sudo apt update
sudo apt upgrade -y

パッケージのインストール

sudo apt install -y wget git cmake g++ libcurl4-openssl-dev

Llama.cppのインストール

git clone https://github.com/ggml-org/llama.cpp
cd llama.cpp
cmake -B build
cmake --build build --config Release
cd ..

モデルのダウンロード

今回はunslothが量子化したGemma-3-1b-itを使ってみます。軽いので。

wget https://huggingface.co/unsloth/gemma-3-1b-it-GGUF/resolve/main/gemma-3-1b-it-UD-IQ1_S.gguf

モデルの起動

./llama.cpp/build/bin/llama-server -m gemma-3-1b-it-UD-IQ1_S.gguf

実行したあとに8080番ポートの開放の通知があるので開放する。

推論の実行

ブラウザアプリを起動して、以下のアドレスへアクセスする。

http://localhost:8080

開いたページでこんな感じでモデルとチャットができるようになります。

Screenshot_20250504-210133.png

結論

めちゃくちゃ遅いですし、応答内容もこんな感じですので使い物にならないですね。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?