CLOVER🍀

That was when it all began.

llama-cpp-pythonが参照しているllama.cppのバージョンを知りたい

llama-cpp-pythonを使うのはいいのですが、llama-cpp-pythonが使っているllama.cppのバージョンが気になるところです。

リリースの頻度も高いです。

Releases · ggerganov/llama.cpp · GitHub

どれを見ているのでしょう?

llama-cpp-pythonのバージョン確認自体は簡単です。

$ pip3 freeze | grep llama_cpp_python
llama_cpp_python==0.2.19

ですが、llama.cppについてはsoファイルがあるだけで、バージョンを確認できません。

$ find venv -name 'libllama.so'
venv/lib/python3.10/site-packages/lib/libllama.so
venv/lib/python3.10/site-packages/llama_cpp/libllama.so

どうしたものかな?と思っていたのですが、llama-cpp-pythonGitHubリポジトリーに答えがありました。

Gitのサブモジュールとしてllama.cppを取り込んでいるようです。

https://github.com/abetlen/llama-cpp-python/blob/v0.2.19/.gitmodules

こちらですね。

https://github.com/abetlen/llama-cpp-python/tree/v0.2.19/vendor

それから、CHANGELOG.md見たらいいという話もあります。

https://github.com/abetlen/llama-cpp-python/blob/v0.2.19/CHANGELOG.md

llama-cpp-python 0.2.19時点では、llama.cppの以下のコミットを見ていることになります。

https://github.com/ggerganov/llama.cpp/tree/0b871f1a04ef60e114bbe43004fd9c21114e802d

Makefileもありましたし。

https://github.com/abetlen/llama-cpp-python/blob/v0.2.19/Makefile

というわけで、llama-cpp-pythonを使った時にどの時点のllama.cppを使っているのかは該当のllama-cpp-pythonGitHubリポジトリを見て、
CHANGELOG.mdかGitのサブモジュールで参照しているllama.cppの確認しましょう、と。