Integrate Basalt telemetry and shared GPU speech runtimes

Publish the reviewed accumulated runtime, scheduler, profile, UI, native recipes and historical maintenance evidence. Includes Qwen GPU ASR correction and shared Anna/atelier ownership. Validated with 784 local tests, Python/JSON parsing and eight JavaScript syntax checks. Live GPU acceptance and full fresh-host restore limits remain documented.
This commit is contained in:
Mikei386 committed 2026-11-03 21:16:41 +01:00
1 parent 4e404d077d
commit c0bc5d3a1b
172 files changed
+52473 -147

No files matched your search

+30 -5
View File
@@ -6,7 +6,7 @@ from pathlib import Path,PurePosixPath
from auth import atomic_write,validate_record
from backup_codec import seal,open_backup
from catalog import repo_id,file_role,KINDS
from profiles import SCHEMAS,CHAT_GPU_DEFAULTS,chat_parameters,FLOAT_PARAMETERS,ACE_COMPONENTS,qwen_clone_model
from profiles import SCHEMAS,CHAT_GPU_DEFAULTS,chat_parameters,FLOAT_PARAMETERS,ACE_COMPONENTS,qwen_clone_model,STT_DEVICE_DEFAULTS,stt_parameters
SETTINGS=('soulx_singer-data/settings.json','xvc-data/settings.json','applio-data/settings.json','separator-profiles.json','profiles.json','reasoning-budget.json','endpoint.json','audio-policy.json','video/comfy-selection.json','models/huggingface.json','video/comfy-client-token','video/original-work/settings.json')
MAX_HISTORY=40*1024**2
SETTINGS+=('cpu-partition.json',)
@@ -56,13 +56,21 @@ def validate(doc):
if type(p.get('revision')) is not int or not 1<=p['revision']<=1000000:raise ValueError('Ungültige Profilrevision.')
if not isinstance(params,dict):raise ValueError('Ungültige Profilparameter.')
params=chat_parameters(params) if kind=='chat' else params
if set(params)!=(set(SCHEMAS[kind])|(set(CHAT_GPU_DEFAULTS) if kind=='chat' else set(params)&{'video_device','text_encoder_device'} if kind=='video' else set())):raise ValueError('Unbekannte Profilparameter.')
if kind=='stt':params=stt_parameters(params,next(m for m in models if m['id']==p['model_id']))
if kind=='audio':
from profiles import audio_voice_parameters
audio_voice_parameters(params,next(m for m in models if m['id']==p['model_id']))
if set(params)!=(set(SCHEMAS[kind])|(set(CHAT_GPU_DEFAULTS) if kind=='chat' else set(params)&{'video_device','text_encoder_device'} if kind=='video' else set(params)&{'tts_voice'} if kind=='audio' else set(STT_DEVICE_DEFAULTS) if kind=='stt' else set())):raise ValueError('Unbekannte Profilparameter.')
for key,(lo,hi,_) in SCHEMAS[kind].items():
value=params[key]
if isinstance(value,bool) or not isinstance(value,(int,float)) or not lo<=value<=hi or key not in FLOAT_PARAMETERS and type(value) is not int:raise ValueError('Ungültiger Profilparameter: '+key)
if kind=='chat' and params.get('chat_runtime')=='strata':
from strata_runtime import model_quant
model_quant(next(m for m in models if m['id']==p['model_id']))
if kind=='chat' and params.get('chat_runtime')=='basalt':
from basalt_runtime import validate_model,validate_projector
validate_model(next(m for m in models if m['id']==p['model_id']))
if params.get('vision_projector'):validate_projector(next((m for m in models if m['id']==params['vision_projector']),{}))
if kind=='chat' and (params['ubatch']>params['batch'] or params.get('vision_projector') and params['vision_projector'] not in ids):raise ValueError('Ungültige Chat-Zuordnung.')
if kind in ('image','video') and (params['width']%64 or params['height']%64):raise ValueError('Ungültige Bildgröße.')
components=p.get('components',{})
@@ -76,11 +84,19 @@ def validate(doc):
if not isinstance(pn,str) or not 1<=len(pn)<=64 or any(ord(c)<32 for c in pn) or not isinstance(pi,str) or not re.fullmatch('[a-f0-9]{32}',pi) or pi in preset_ids or pn in preset_names or preset['model_id'] not in ids or type(preset['created_at']) not in (int,float):raise ValueError('Ungültige Preset-Metadaten.')
if not isinstance(pp,dict):raise ValueError('Ungültige Preset-Parameter.')
pp=chat_parameters(pp) if kind=='chat' else pp
if set(pp)!=(set(SCHEMAS[kind])|(set(CHAT_GPU_DEFAULTS) if kind=='chat' else set(pp)&{'video_device','text_encoder_device'} if kind=='video' else set())):raise ValueError('Unbekannte Preset-Parameter.')
if kind=='stt':pp=stt_parameters(pp,next(m for m in models if m['id']==preset['model_id']))
if kind=='audio':
from profiles import audio_voice_parameters
audio_voice_parameters(pp,next(m for m in models if m['id']==preset['model_id']))
if set(pp)!=(set(SCHEMAS[kind])|(set(CHAT_GPU_DEFAULTS) if kind=='chat' else set(pp)&{'video_device','text_encoder_device'} if kind=='video' else set(pp)&{'tts_voice'} if kind=='audio' else set(STT_DEVICE_DEFAULTS) if kind=='stt' else set())):raise ValueError('Unbekannte Preset-Parameter.')
for key,(lo,hi,_) in SCHEMAS[kind].items():
value=pp[key]
if isinstance(value,bool) or not isinstance(value,(int,float)) or not lo<=value<=hi or key not in FLOAT_PARAMETERS and type(value) is not int:raise ValueError('Ungültiger Preset-Parameter: '+key)
if kind=='chat' and (pp['ubatch']>pp['batch'] or pp.get('vision_projector') and pp['vision_projector'] not in ids):raise ValueError('Ungültige Preset-Projektorzuordnung.')
if kind=='chat' and pp.get('chat_runtime')=='basalt':
from basalt_runtime import validate_model,validate_projector
validate_model(next(m for m in models if m['id']==preset['model_id']))
if pp.get('vision_projector'):validate_projector(next((m for m in models if m['id']==pp['vision_projector']),{}))
if kind in ('image','video') and (pp['width']%64 or pp['height']%64):raise ValueError('Ungültige Preset-Bildgröße.')
preset_ids.add(pi);preset_names.add(pn)
pids.add(p['id']);names.add(name)
@@ -124,7 +140,7 @@ def validate(doc):
validate_profiles(settings['separator-profiles.json'])
validate_record(doc.get('credentials'))
runtimes=doc.get('runtimes')
if not isinstance(runtimes,dict) or set(runtimes)-{'llama','llama_builds','image','tts','enhancers','swarm_nodes','ltx_original','audio_cpp','separator','voxcpm','omnivoice','acestep','applio','xvc','seed_vc','soulx_singer','music_remix','strata','pocket','articulino','kikiri'} or not {'llama','llama_builds','image','tts','enhancers','swarm_nodes'}<=set(runtimes):raise ValueError('Ungültiges Laufzeitrezept.')
if not isinstance(runtimes,dict) or set(runtimes)-{'llama','llama_builds','image','tts','enhancers','swarm_nodes','ltx_original','audio_cpp','separator','voxcpm','omnivoice','acestep','applio','xvc','seed_vc','soulx_singer','music_remix','strata','basalt','pocket','articulino','kikiri'} or not {'llama','llama_builds','image','tts','enhancers','swarm_nodes'}<=set(runtimes):raise ValueError('Ungültiges Laufzeitrezept.')
if any(qwen_voice_alias(m) for m in models) and runtimes.get('tts') is not True:raise ValueError('Qwen-Stimmklon benötigt das vollständige TTS-Laufzeitrezept.')
if 'separator' in runtimes:
from separator_runtime import MODELS
@@ -137,6 +153,7 @@ def validate(doc):
if 'articulino' in runtimes and type(runtimes['articulino']) is not bool:raise ValueError('Ungültige Articulino-Laufzeit.')
if 'pocket' in runtimes and type(runtimes['pocket']) is not bool:raise ValueError('Ungültige Pocket-Laufzeit.')
if 'strata' in runtimes and type(runtimes['strata']) is not bool:raise ValueError('Ungültige Strata-Laufzeit.')
if 'basalt' in runtimes and type(runtimes['basalt']) is not bool:raise ValueError('Ungültige Basalt-Laufzeit.')
if 'music_remix' in runtimes and type(runtimes['music_remix']) is not bool:raise ValueError('Ungültige Audio-Remix-Laufzeit.')
if 'xvc' in runtimes and type(runtimes['xvc']) is not bool:raise ValueError('Ungültige X-VC-Laufzeit.')
if 'seed_vc' in runtimes and type(runtimes['seed_vc']) is not bool:raise ValueError('Ungültige Seed-VC-Laufzeit.')
@@ -224,6 +241,8 @@ class Backup:
if getattr(s,'strata_runtime',None):
document['runtimes']['strata']=s.strata_runtime.status()['installed']
document['runtime_versions']['strata']=s.strata_runtime.status()['revision']
if getattr(s,'basalt_runtime',None):
document['runtimes']['basalt']=s.basalt_runtime.status()['installed'];document['runtime_versions']['basalt']=s.basalt_runtime.status()['revision']
if getattr(s,'remix_runtime',None):
document['runtimes']['music_remix']=s.remix_runtime.status()['installed']
if document['runtimes']['music_remix']:
@@ -291,6 +310,9 @@ class Backup:
if versions.get('strata'):
from strata_runtime import COMMIT
if versions['strata']!=COMMIT:blockers.append('Backup verlangt eine andere Strata-Version. Passende Deck-Version verwenden.')
if versions.get('basalt'):
from basalt_runtime import COMMIT as BASALT_COMMIT
if versions['basalt']!=BASALT_COMMIT:blockers.append('Backup verlangt eine andere Basalt-Version. Passende Deck-Version verwenden.')
if versions.get('acestep'):
from acestep_runtime import VERSION as ACE_VERSION
if versions['acestep']!=ACE_VERSION:blockers.append('Backup verlangt eine andere ACE-Step-Version. Passende Deck-Version verwenden.')
@@ -323,7 +345,7 @@ class Backup:
if versions.get('applio'):
from applio_runtime import REVISION as APPLIO_REVISION
if versions['applio']!=APPLIO_REVISION:blockers.append('Backup verlangt eine andere Applio-Version.')
if versions and {k:v for k,v in versions.items() if k not in ('ltx_original','audio_cpp','separator','voxcpm','omnivoice','acestep','applio','xvc','seed_vc','soulx_singer','music_remix','strata','pocket','articulino','kikiri')}!=dict(image=dict(comfy=s.image_runtime.status()['comfy_revision'],gguf=s.image_runtime.status()['gguf_revision']),tts=s.tts_runtime.status()['revision']):blockers.append('Backup verlangt andere Bild-/TTS-Laufzeitversionen. Passende Deck-Version oder geprüftes Runtime-Upgrade verwenden.')
if versions and {k:v for k,v in versions.items() if k not in ('ltx_original','audio_cpp','separator','voxcpm','omnivoice','acestep','applio','xvc','seed_vc','soulx_singer','music_remix','strata','basalt','pocket','articulino','kikiri')}!=dict(image=dict(comfy=s.image_runtime.status()['comfy_revision'],gguf=s.image_runtime.status()['gguf_revision']),tts=s.tts_runtime.status()['revision']):blockers.append('Backup verlangt andere Bild-/TTS-Laufzeitversionen. Passende Deck-Version oder geprüftes Runtime-Upgrade verwenden.')
for c in doc['services']:
if not c.get('registry') and not c.get('build_recipe'):warnings.append(c['name']+': Image nur lokal vorhanden; Registry-/Buildquelle fehlt.')
ports=s.endpoint.allowed_ports
@@ -352,6 +374,7 @@ class Backup:
if getattr(getattr(s,'xvc',None),'active',False):raise ValueError('X-VC-Auftrag zuerst abschließen.')
if getattr(getattr(s,'soulx_singer',None),'active',False):raise ValueError('SoulX-Singer-Auftrag zuerst abschließen.')
if getattr(getattr(s,'applio',None),'active',False):raise ValueError('Applio-Auftrag zuerst abschließen.')
if (getattr(getattr(s,'basalt_runtime',None),'job',None) or {}).get('state')=='running':raise ValueError('Basalt-Build zuerst abschließen oder abbrechen.')
if s.catalog.pending or s.catalog.job and s.catalog.job['state']=='downloading' or s.runtime.busy or any((getattr(o,'job',None) or {}).get('state')=='running' for o in (getattr(s,'kikiri_runtime',None),getattr(s,'kikiri',None),getattr(s,'articulino_runtime',None),getattr(s,'articulino',None),s.image_runtime,s.tts_runtime,s.ltx_original_runtime,getattr(s,'strata_runtime',None),getattr(s,'audio_cpp_runtime',None),getattr(s,'acestep_runtime',None),getattr(s,'applio_runtime',None),getattr(s,'xvc_runtime',None),getattr(s,'soulx_singer_runtime',None),getattr(s,'music',None),getattr(s,'remix_runtime',None),getattr(s,'remix',None),getattr(s,'separator_runtime',None),getattr(s,'separator_tests',None),s.prompt_enhancer,s.auto_tests,s.chat_tests,s.image_tests,s.tts_tests,s.stt)):raise ValueError('Zuerst laufende Downloads, Builds und Tests abschließen oder abbrechen.')
self.cancel.clear();self.job=dict(id=secrets.token_hex(16),state='running',phase='Wiederherstellung vorbereiten',completed=0,total=len(doc['models'])+len(data['services'])+5,items=[],started_at=time.time(),theme=doc.get('theme','deck'))
self._save();threading.Thread(target=self._restore,args=(copy.deepcopy(doc),data['services'],data['restore_credentials']),daemon=True).start();self.plan=None
@@ -382,6 +405,8 @@ class Backup:
self._phase('Pocket-CPU-Laufzeit installieren');s.pocket_runtime.start();self._wait(s.pocket_runtime.status)
if r.get('strata') and not s.strata_runtime.status()['installed']:
self._phase('Native Strata-Laufzeit aus gepinntem Rezept bauen');s.strata_runtime.start();self._wait(s.strata_runtime.status)
if r.get('basalt') and not s.basalt_runtime.status()['installed']:
self._phase('Native Basalt-Laufzeit aus gepinntem Rezept bauen · kein Modellstart');s.basalt_runtime.start();self._wait(s.basalt_runtime.status)
if r['image'] and not s.image_runtime.status()['installed']:
self._phase('Vorhandene Bild-/Videolaufzeit prüfen oder installieren');s.image_runtime.start();self._wait(s.image_runtime.status)
if r['tts'] and not s.tts_runtime.status()['installed']: