@@ -72,11 +72,7 @@ def prepare_payload(
7272 A response containing the object type ``"list"`` and a ``data``
7373 field with the available model tags.
7474 """
75- # models = self.__proper_models_list_format()
76- models = self .__proper_models_list_format ()
77- # import json
78- # print(json.dumps(models, indent=2, ensure_ascii=False))
79- return {"models" : models }
75+ return self .__proper_models_list_format ()
8076
8177 def __proper_models_list_format (self ):
8278 _models_data = self ._api_type_dispatcher .tags (
@@ -86,17 +82,17 @@ def __proper_models_list_format(self):
8682 proper_models = []
8783 for m in _models_data :
8884 _model = {
85+ "id" : m ["id" ],
86+ "object" : "model" ,
8987 "type" : "llm" ,
90- "modelKey" : m ["id" ],
91- "format" : "gguf" ,
92- "displayName" : m ["id" ],
93- "path" : m ["id" ],
94- "sizeBytes" : 4683073952 ,
95- "paramsString" : "7B" ,
96- "architecture" : "qwen2" ,
97- "vision" : False ,
98- "trainedForToolUse" : True ,
99- "maxContextLength" : 32768 ,
88+ "publisher" : m ["publisher" ],
89+ "arch" : m ["arch" ],
90+ "compatibility_type" : "gguf" ,
91+ "quantization" : "Q8_0" ,
92+ "state" : "loaded" ,
93+ "max_context_length" : m ["max_context_length" ],
10094 }
10195 proper_models .append (_model )
102- return proper_models
96+
97+ _response = {"data" : proper_models , "object" : "list" }
98+ return _response
0 commit comments