llama.cpp
やはりC/C++製のLLM推論エンジンが本命かなぁ、あらま;
投稿フォーム:
llama.cppインストール
CPUホスト版なら、大きなGPUが無くても動くらしい
■ まずは llama.cpp をダウンロード
~$ sudo apt install git git-lfs
~$ mkdir git
~$ cd ~/git
~/git$ git clone https://github.com/ggml-org/llama.cpp.git
~/git$ ls
llama.cpp/
~/git$ cd llama.cpp/
■ CPUホストに設定してビルド
~/git/llama.cpp$ sudo apt install cmake g++ libcurlpp-dev ccache libssl-dev
~/git/llama.cpp$ cmake -B build-cpu
~/git/llama.cpp$ cmake --build build-cpu --config Release -j 4
■ コンソールから実行
gemma-4-12bモデル(ggufファイル)をダウンロード
https://www.kaggle.com/models/google/gemma-4/gguf
そして起動
~/git/llama.cpp$ Model=/data/models/gemma-4-12b-it-qat-q4_0.gguf
~/git/llama.cpp$ build-cpu/bin/llama-cli -m "$Model"
_______________________________________________________
build : b11294-185103dcf
model : /data/models/gemma-4-12b-it-qat-q4_0.gguf
ftype : Q4_0
modalities : text
available commands:
/exit or Ctrl+C stop or exit
/regen regenerate the last response
/clear clear the chat history
/read <file> add a text file
/glob <pattern> add text files using globbing pattern
_______________________________________________________
> こんにちは↵
こんにちは!何かお手伝いできることはありますか?
> /exit↵
_______________________________________________________
毎秒数トークンでした。