alith_models/local_model/
mod.rs1use gguf::GgufLoader;
2use metadata::LocalLLMMetadata;
3
4pub mod chat_template;
5pub mod gguf;
6pub mod hf_loader;
7pub mod metadata;
8
9use super::LLMModelBase;
10pub use chat_template::LLMChatTemplate;
11pub use gguf::{GgufLoaderTrait, preset::GgufPresetTrait};
12pub use hf_loader::HfTokenTrait;
13
14pub struct LocalLLMModel {
15 pub model_base: LLMModelBase,
16 pub local_model_path: std::path::PathBuf,
17 pub model_metadata: LocalLLMMetadata,
18 pub chat_template: LLMChatTemplate,
19}
20
21impl Default for LocalLLMModel {
22 fn default() -> Self {
23 let mut loader = GgufLoader::default();
24 loader.load().expect("Failed to load LLMPreset")
25 }
26}
27
28impl std::fmt::Debug for LocalLLMModel {
29 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
30 let mut debug_struct = f.debug_struct("LocalLLMModel");
31 debug_struct.field("model_id", &self.model_base.model_id);
32 debug_struct.field("local_model_path", &self.local_model_path);
33 debug_struct.field("model_metadata", &self.model_metadata);
34 debug_struct.field("chat_template", &self.chat_template);
35 debug_struct.finish()
36 }
37}