• Stars
    star
    307
  • Rank 134,622 (Top 3 %)
  • Language
    Rust
  • License
    MIT License
  • Created about 1 year ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

LLama.cpp rust bindings

rust_llama.cpp

Docs Crates.io

LLama.cpp rust bindings.

The rust bindings are mostly based on https://github.com/go-skynet/go-llama.cpp/

Building Locally

Note: This repository uses git submodules to keep track of LLama.cpp.

Clone the repository locally:

git clone --recurse-submodules https://github.com/mdrokz/rust-llama.cpp
cargo build

Usage

[dependencies]
llama_cpp_rs = "0.3.0"
use llama_cpp_rs::{
    options::{ModelOptions, PredictOptions},
    LLama,
};

fn main() {
    let model_options = ModelOptions::default();

    let llama = LLama::new(
        "../wizard-vicuna-13B.ggmlv3.q4_0.bin".into(),
        &model_options,
    )
    .unwrap();

    let predict_options = PredictOptions {
        token_callback: Some(Box::new(|token| {
            println!("token1: {}", token);

            true
        })),
        ..Default::default()
    };

    llama
        .predict(
            "what are the national animals of india".into(),
             predict_options,
        )
        .unwrap();
}

Examples

The examples contain dockerfiles to run them

see examples

TODO

  • Implement support for cublas,openBLAS & OpenCL #7
  • Implement support for GPU (Metal)
  • Add some test cases
  • Support for fetching models through http & S3
  • Sync with latest master & support GGUF
  • Add some proper examples #7

LICENSE

MIT

More Repositories

1

auto_generate_cdp

experimental crate to generate the Chrome Devtools Protocol.
Rust
14
star
2

ani_mobile

Mobile app for watching anime based on https://github.com/pystardust/ani-cli
Dart
13
star
3

perplexity_ai_react_clone

TypeScript
5
star
4

steam_price_tracker

an price_tracker program made in rust that tracks steam prices by using the steam public api to fetch user games and scrapes the pages.
Rust
3
star
5

chessEngine

chess engine which calculates best moves from your match in real time when you play on chess.com
JavaScript
3
star
6

port_scanner

an port scanner that scans ports from a given hostname or ip address from an range of ports
C
3
star
7

Magnus_Carlsen_AI

Rust
2
star
8

recursive_file_watcher

a file watcher that recursively copies all of the files inside folders and pastes them at an folder location made in rust.
Rust
2
star
9

corona-tracker

live corona tracking website made in next.js and webassembly
TypeScript
2
star
10

pigie_tracker

a mobile app that lets you keep track of your pigeons made in flutter
Dart
2
star
11

screeps-haxe

haxe extern types for game screeps.
Haxe
2
star
12

csgoBotJava

csgo-bot that displays skins from csgostash.com re-written in Java
Java
1
star
13

Sentient

an electron cctv camera app
JavaScript
1
star
14

super-market1

JavaScript
1
star
15

auto-mount

an cmd utility that mounts your drives in linux based on json file data
Go
1
star
16

among_us_controller

translates controller calls to keyboard calls for among us game
C
1
star
17

Async_Executor

simple bare bones executor for async futures in rust.
Rust
1
star
18

angularmd

1
star
19

phaser-3-sugarizer-template

an phaser 3 template integrated with sugarizer's activities
JavaScript
1
star
20

team-helper-skype

JavaScript
1
star
21

Chess_Online_raylib

Chess Online game made in C game library raylib for windows and linux
C
1
star
22

react-native-stream

Stream module port for react-native
JavaScript
1
star
23

rounds_mod_downloader

Download mods for ROUNDS from https://rounds.thunderstore.io
Rust
1
star