5 unstable releases

0.3.2 Aug 14, 2024
0.3.0 Aug 13, 2024
0.2.1 Feb 28, 2024
0.2.0 Feb 18, 2024
0.1.0 Dec 16, 2023

#979 in Machine learning

Download history 16/week @ 2024-06-29 17/week @ 2024-07-06 12/week @ 2024-07-13 3/week @ 2024-07-20 25/week @ 2024-07-27 7/week @ 2024-08-03 238/week @ 2024-08-10 35/week @ 2024-08-17 19/week @ 2024-08-24 27/week @ 2024-08-31 8/week @ 2024-09-07 204/week @ 2024-09-14 128/week @ 2024-09-21 126/week @ 2024-09-28 72/week @ 2024-10-05 74/week @ 2024-10-12

456 downloads per month
Used in 4 crates (via kalosm-language)

MIT/Apache

345KB
8K SLoC

RPhi

RPhi is a Rust implementation of the quantized Phi 1.5 language model.

Phi-1.5 is a very small but performant language model that can be easily run on your local machine.

This library uses Quantized Mixformer from Candle to run Phi-1.5.

Usage

use rphi::prelude::*;
#[tokio::main]
async fn main() {
    let mut model = Phi::v2().await.unwrap();
    let prompt = "The capital of France is ";
    let mut result = model.stream_text(prompt).await.unwrap();

    print!("{prompt}");
    while let Some(token) = result.next().await {
        print!("{token}");
    }
}

Dependencies

~34–54MB
~1M SLoC