@@ -87,7 +87,7 @@ def add_local_model(self, model_path: str, alias: Optional[str] = None) -> Dict[
8787 model_id = alias or path .name
8888 return self .add_to_library (model_id = model_id , local_path = str (path ), source = "local" )
8989
90- def list_library (self ) -> list :
90+ def list_library (self ) -> list [ Dict [ str , Any ]] :
9191 """List registered models in the local model library."""
9292 return list (self ._library .values ())
9393
@@ -124,7 +124,7 @@ def load(
124124 self ,
125125 model_path : str ,
126126 model_format : Optional [ModelFormat ] = None ,
127- ** kwargs ,
127+ ** kwargs : Any ,
128128 ) -> Dict [str , Any ]:
129129 """
130130 Load a model and return model objects.
@@ -157,7 +157,7 @@ def load(
157157 else :
158158 raise ValueError (f"Unsupported model format: { model_format } " )
159159
160- def _load_gguf (self , model_path : str , ** kwargs ) -> Dict [str , Any ]:
160+ def _load_gguf (self , model_path : str , ** kwargs : Any ) -> Dict [str , Any ]:
161161 """Load GGUF format model using llama-cpp-python"""
162162 try :
163163 from llama_cpp import Llama
@@ -173,7 +173,7 @@ def _load_gguf(self, model_path: str, **kwargs) -> Dict[str, Any]:
173173
174174 return {"model" : llm , "tokenizer" : None , "format" : "gguf" }
175175
176- def _load_huggingface (self , model_path : str , ** kwargs ) -> Dict [str , Any ]:
176+ def _load_huggingface (self , model_path : str , ** kwargs : Any ) -> Dict [str , Any ]:
177177 """Load HuggingFace transformers model"""
178178 try :
179179 from transformers import AutoModelForCausalLM , AutoTokenizer
@@ -196,7 +196,7 @@ def _load_huggingface(self, model_path: str, **kwargs) -> Dict[str, Any]:
196196
197197 return {"model" : model , "tokenizer" : tokenizer , "format" : "huggingface" }
198198
199- def _load_onnx (self , model_path : str , ** kwargs ) -> Dict [str , Any ]:
199+ def _load_onnx (self , model_path : str , ** kwargs : Any ) -> Dict [str , Any ]:
200200 """Load ONNX model"""
201201 try :
202202 import onnxruntime as ort
@@ -207,12 +207,12 @@ def _load_onnx(self, model_path: str, **kwargs) -> Dict[str, Any]:
207207
208208 return {"model" : session , "tokenizer" : None , "format" : "onnx" }
209209
210- def _load_safetensors (self , model_path : str , ** kwargs ) -> Dict [str , Any ]:
210+ def _load_safetensors (self , model_path : str , ** kwargs : Any ) -> Dict [str , Any ]:
211211 """Load safetensors format model"""
212212 # Safetensors is typically used with transformers
213213 return self ._load_huggingface (model_path , ** kwargs )
214214
215- def download (self , model_id : str , ** kwargs ) -> str :
215+ def download (self , model_id : str , ** kwargs : Any ) -> str :
216216 """
217217 Download a model from HuggingFace Hub.
218218
@@ -246,7 +246,7 @@ def download(self, model_id: str, **kwargs) -> str:
246246
247247 return local_path
248248
249- def list_cached_models (self ) -> list :
249+ def list_cached_models (self ) -> list [ str ] :
250250 """List all cached models"""
251251 return [str (p ) for p in self .cache_dir .iterdir () if p .is_dir ()]
252252
0 commit comments