Add owned OpenAI endpoint and coordinated native model switching
This commit is contained in:
@@ -35,6 +35,7 @@ class Profiles:
|
||||
def __init__(self,path,catalog):
|
||||
self.path=Path(path);self.catalog=catalog;self.lock=threading.RLock()
|
||||
self.image_runtime_ready=lambda:False
|
||||
self.chat_blockers=None
|
||||
self.rows=json.loads(self.path.read_text()) if self.path.exists() else []
|
||||
def status(self):
|
||||
with self.lock:
|
||||
@@ -52,6 +53,8 @@ class Profiles:
|
||||
except ValueError as exc:p['model']=None;p['blockers']=[str(exc)]
|
||||
if p.get('model') and p['model']['repo']==QWEN_REPO and p['model']['file'].endswith('.gguf') and self.image_runtime_ready():
|
||||
p['blockers']=[b for b in p['blockers'] if not b.startswith('Eine eigene Bildlaufzeit')]
|
||||
if p['kind']=='chat' and self.chat_blockers and p.get('model'):p['blockers']=self.chat_blockers(p)
|
||||
if p['kind']=='image' and (p['parameters']['width']>1024 or p['parameters']['height']>1024):p['blockers'].append('Die Bildlaufzeit unterstützt derzeit maximal 1024 × 1024 Pixel.')
|
||||
p['runnable']=not p['blockers'];p['state']='ready' if p['runnable'] else 'configured'
|
||||
return {'profiles':rows,'schemas':SCHEMAS}
|
||||
def save(self,data):
|
||||
|
||||
Reference in New Issue
Block a user