8 unstable releases (3 breaking)
0.4.0 | Feb 9, 2025 |
---|---|
0.3.3 | Aug 28, 2024 |
0.2.1 | Feb 28, 2024 |
0.1.0 | Dec 16, 2023 |
#788 in Machine learning
439 downloads per month
Used in 11 crates
(8 directly)
380KB
8K
SLoC
Language Model
This crate provides a unified interface for language models. It supports streaming text, sampling, and embedding.
Usage (with the kalosm-llama implementation crate)
use kalosm::language::*;
#[tokio::main]
async fn main() {
let mut model = Llama::phi_3().await.unwrap();
let prompt = "The capital of France is ";
let mut result = model.complete(prompt);
print!("{prompt}");
while let Some(token) = result.next().await {
print!("{token}");
}
}
Dependencies
~3–15MB
~174K SLoC