serve tags endpoint

This commit is contained in:
Concedo 2024-07-19 16:08:54 +08:00
parent 24b9616344
commit 1a23d49c32
2 changed files with 7 additions and 0 deletions

View file

@ -1674,6 +1674,9 @@ Enter Prompt:<br>
elif self.path.endswith('/sdapi/v1/upscalers'):
response_body = (json.dumps([]).encode())
elif self.path.endswith(('/api/tags')): #ollama compatible
response_body = (json.dumps({"models":[{"name":"koboldcpp","model":friendlymodelname,"modified_at":"2024-07-19T15:26:55.6122841+08:00","size":394998579,"digest":"b5dc5e784f2a3ee1582373093acf69a2f4e2ac1710b253a001712b86a61f88bb","details":{"parent_model":"","format":"gguf","family":"koboldcpp","families":["koboldcpp"],"parameter_size":"128M","quantization_level":"Q4_0"}}]}).encode())
elif self.path=="/api" or self.path=="/docs" or self.path.startswith(('/api/?json=','/api?json=','/docs/?json=','/docs?json=')):
content_type = 'text/html'
if embedded_kcpp_docs is None: