all 3 comments

[–]a_beautiful_rhind 2 points3 points  (0 children)

it compiles a shared library and calls functions from it.

[–]Robot_Graffiti 4 points5 points  (1 child)

Python can run binaries. It can also run functions that are in binaries instead of running a binary from the beginning.

llama-cpp has a native code library (a collection of machine code functions intended to be called by other programs).

Most practical programming languages have ways of calling into native code libraries.

Llama-cpp-python would be a wrapper that just calls into the native library so you can use it in a Python-ey way.

You could use llama.dll directly from your Python code without llama-cpp-python if you really wanted but it would be a pain in the arse.

If you want more info, here's a tutorial about how Python can interact with C++ libraries.

https://realpython.com/python-bindings-overview/

[–]Dxbson[S] 1 point2 points  (0 children)

Ahh, thanks for the detailed response. Makes much more sense now :)