rust-llama.cpp  by mdrokz

Rust bindings for llama.cpp

Created 2 years ago
403 stars

Top 72.0% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides Rust bindings for the popular llama.cpp library, enabling developers to integrate large language model inference directly into Rust applications. It targets Rust developers seeking efficient, native LLM capabilities without relying on external processes or C APIs.

How It Works

The bindings wrap the core llama.cpp C++ library using Rust's FFI (Foreign Function Interface). This approach leverages llama.cpp's optimized C++ implementation for performance while offering a idiomatic Rust interface. The project utilizes git submodules to manage the llama.cpp dependency, ensuring version consistency.

Quick Start & Requirements

  • Install via cargo add llama_cpp_rs.
  • Requires a pre-downloaded .ggmlv3 or .gguf model file.
  • Building locally requires git clone --recurse-submodules.
  • See examples for usage.

Highlighted Details

  • Supports GGUF model format.
  • Includes experimental GPU support (Metal).
  • Work in progress to add CUDA, OpenBLAS, and OpenCL support.
  • Provides a token callback mechanism for streaming output.

Maintenance & Community

The project is actively maintained by mdrokz. There are no explicit community channels or roadmap links provided in the README.

Licensing & Compatibility

Licensed under the MIT license, permitting commercial use and integration into closed-source projects.

Limitations & Caveats

GPU acceleration beyond Metal is still under development. The project is missing comprehensive test cases and features like HTTP/S3 model fetching are planned but not yet implemented.

Health Check
Last Commit

1 year ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
5 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Luis Capelo Luis Capelo(Cofounder of Lightning AI), and
12 more.

llm by rustformers

0.1%
6k
Rust ecosystem for LLM Rust inference (unmaintained)
Created 2 years ago
Updated 1 year ago
Starred by Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), Anil Dash Anil Dash(Former CEO of Glitch), and
23 more.

llamafile by Mozilla-Ocho

0.1%
23k
Single-file LLM distribution and runtime via `llama.cpp` and Cosmopolitan Libc
Created 2 years ago
Updated 2 months ago
Feedback? Help us improve.