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 *;
async
This crate provides a unified interface for language models. It supports streaming text, sampling, and embedding.
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}");
}
}