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

#1108 in Machine learning

Download history 37/week @ 2024-08-26 6/week @ 2024-09-02 11/week @ 2024-09-09 228/week @ 2024-09-16 125/week @ 2024-09-23 124/week @ 2024-09-30 57/week @ 2024-10-07 86/week @ 2024-10-14 40/week @ 2024-10-21 68/week @ 2024-10-28 39/week @ 2024-11-04 37/week @ 2024-11-11 66/week @ 2024-11-18 49/week @ 2024-11-25 81/week @ 2024-12-02 102/week @ 2024-12-09

304 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

~35–57MB
~1M SLoC