troupekit-local 0.4.0

On-device models for the Troupekit LLM agent framework: the LocalModel trait, model catalog and llama.cpp.
Documentation
1
2
3
4
5
6
7
8
9
10
11
use crate::width_src::embedding_width;

#[test]
fn embedding_width_must_match_the_output_width() {
    assert_eq!(embedding_width(576, 576), Ok(576));
    let err = embedding_width(576, 1_024).unwrap_err();
    assert!(err.contains("576") && err.contains("1024"), "{err}");
    assert!(embedding_width(1_024, 576).is_err());
    assert!(embedding_width(0, 0).is_err());
    assert!(embedding_width(-1, -1).is_err());
}