lm-studio-api-extended 0.1.2

Unofficial Rust client for LM Studio with text embedding support.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use lm_studio_api_extended::embedding::*;

#[tokio::main]
async fn main() {
    let mut embedder = Embedding::new(None); // Uses default localhost:1234
    let req = EmbeddingRequest {
        model: EmbeddingModel::AllMiniLmL6,
        input: vec!["Rust is magic.".to_string()],
        encoding_format: Some("float".to_string()),
    };

    let res = embedder.embed(req).await.unwrap();
    println!("Embedding: {:?}", res);
    //println!("Length of embedding: {}", res.len());
}