9 releases

0.1.91 Jan 9, 2025
0.1.90 Dec 30, 2024
0.1.87 Nov 26, 2024
0.1.83 Oct 27, 2024

#216 in Machine learning

Download history 109/week @ 2024-10-23 61/week @ 2024-10-30 217/week @ 2024-11-06 5/week @ 2024-11-13 240/week @ 2024-11-20 70/week @ 2024-11-27 126/week @ 2024-12-04 28/week @ 2024-12-11 148/week @ 2024-12-18 120/week @ 2024-12-25 18/week @ 2025-01-01 130/week @ 2025-01-08

417 downloads per month

MIT/Apache

6.5MB
132K SLoC

C++ 79K SLoC // 0.1% comments C 29K SLoC // 0.1% comments CUDA 8K SLoC // 0.0% comments Metal Shading Language 5K SLoC // 0.0% comments Objective-C 4K SLoC // 0.0% comments Python 3.5K SLoC // 0.1% comments Rust 3K SLoC // 0.1% comments

llama-cpp-rs-4

A wrapper around the llama-cpp library for rust, including new Sampler API from llama-cpp.

Info

It is tightly coupled llama.cpp and mimics its API as closly as possible while being safe in order to stay up to date, including the new Sampler API.

Dependencies

This uses bindgen to build the bindings to llama.cpp. This means that you need to have clang installed on your system.

If this is a problem for you, open an issue, and we can look into including the bindings.

See bindgen for more information.

Disclaimer

This crate is not safe. There is absolutly ways to misuse the llama.cpp API provided to create UB, please create an issue if you spot one. Do not use this code for tasks where UB is not acceptable.

This is not a simple library to use. In an ideal world a nice abstraction would be written on top of this crate to provide an ergonomic API - the benefits of this crate over raw bindings is safety (and not much of it as that) and not much else.

We compensate for this shortcoming (we hope) by providing lots of examples and good documentation. Testing is a work in progress.

Contributing

Contributions are welcome. Please open an issue before starting work on a non-trivial PR.

Dependencies

~0.6–3.5MB
~67K SLoC