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:
1 parent
4e404d077d
commit
c0bc5d3a1b
172 files changed
+52473
-147
No files matched your search
@@ -28,6 +28,8 @@ from docker_support import DockerSupport
|
||||
from inference import LlamaWorker,Scheduler,InferenceError
|
||||
from strata_runtime import StrataRuntime
|
||||
from strata_worker import StrataWorker,ChatWorkerRouter
|
||||
from basalt_runtime import BasaltRuntime
|
||||
from basalt_worker import BasaltWorker
|
||||
from endpoint import Endpoint
|
||||
from chat_test import ChatTests
|
||||
from auto_test import AutoTests
|
||||
@@ -139,7 +141,8 @@ class Server(ThreadingHTTPServer):
|
||||
self.server_close()
|
||||
raise RuntimeError('Serverzugang muss vor dem Start eingerichtet werden.')
|
||||
self.strata_runtime=StrataRuntime(self.catalog.root.parent/'strata-runtime',self.catalog)
|
||||
self.worker=ChatWorkerRouter(LlamaWorker(self.catalog.root.parent/'llama-worker',self.catalog,self.runtime),StrataWorker(self.catalog.root.parent/'strata-worker',self.catalog,self.strata_runtime))
|
||||
self.basalt_runtime=BasaltRuntime(self.catalog.root.parent/'basalt-runtime',self.catalog)
|
||||
self.worker=ChatWorkerRouter(LlamaWorker(self.catalog.root.parent/'llama-worker',self.catalog,self.runtime),StrataWorker(self.catalog.root.parent/'strata-worker',self.catalog,self.strata_runtime),BasaltWorker(self.catalog.root.parent/'basalt-worker',self.catalog,self.basalt_runtime))
|
||||
self.scheduler=Scheduler(self.worker)
|
||||
self.runtime.deletion_guard=lambda:"Modellwechsel läuft" if self.scheduler.transition else None
|
||||
self.voxcpm_tests=VoxCPMTests(self.catalog.root.parent/'voice-tests',self.profiles,self.voxcpm_runtime)
|
||||
@@ -166,8 +169,11 @@ class Server(ThreadingHTTPServer):
|
||||
self.image_tests.acquire=self.scheduler.image_reservation
|
||||
self.prompt_enhancer.acquire=self.scheduler.image_reservation
|
||||
self.tts_tests.acquire=self.scheduler.tts_reservation
|
||||
self.voxcpm_tests.shared_tts=self.tts_tests
|
||||
self.scheduler.evict_tts=self.tts_tests.unload_idle
|
||||
self.stt=STT(self.profiles,self.catalog,self.runtime)
|
||||
self.stt.acquire=self.scheduler.stt_reservation
|
||||
self.scheduler.evict_stt=self.stt.unload_gpu_idle
|
||||
self.profiles.stt_blockers=self.stt.blockers
|
||||
if self.stt.parakeet.status()['installed']:
|
||||
marker=self.stt.parakeet.root/'profile-created'
|
||||
@@ -183,6 +189,7 @@ class Server(ThreadingHTTPServer):
|
||||
self.endpoint=Endpoint(self.catalog.root.parent,self.profiles,self.worker,self.scheduler,self.image_tests,self.credentials,self.server_port)
|
||||
self.endpoint.embeddings=self.embeddings
|
||||
self.endpoint.tts=self.tts_tests
|
||||
self.tts_tests.clone_owner_profile=lambda:next((p['id'] for p in self.endpoint.rows() if p['kind']=='audio' and p['enabled'] and not self.tts_tests.blockers(p)),None)
|
||||
self.endpoint.pocket=self.pocket
|
||||
self.endpoint.kikiri=self.kikiri
|
||||
self.endpoint.articulino=self.articulino
|
||||
@@ -333,6 +340,7 @@ class Server(ThreadingHTTPServer):
|
||||
threading.Thread(target=preload_music,daemon=True).start()
|
||||
|
||||
def server_close(self):
|
||||
if getattr(self,'basalt_runtime',None):self.basalt_runtime.stop()
|
||||
if getattr(self,'seedvc',None):self.seedvc.stop()
|
||||
if getattr(self,'humaneness',None):self.humaneness.stop()
|
||||
if getattr(self,'soulx_singer',None):self.soulx_singer.stop()
|
||||
@@ -377,7 +385,7 @@ class Handler(BaseHTTPRequestHandler):
|
||||
return secrets.compare_digest(actual,record['api_token_hash'])
|
||||
|
||||
def token_route(self):
|
||||
return (self.command == 'GET' and (self.path in ('/api/v1/status','/api/v1/hardware','/api/v1/separator-runtime','/api/v1/separator-tests','/api/v1/voice','/api/v1/voice/profiles','/api/v1/music-remix') or urlsplit(self.path).path in ('/api/v1/separator-tests/audio','/api/v1/voice/audio'))) or (self.command=='POST' and self.path in ('/api/v1/separator-jobs/start','/api/v1/separator-chat/start','/api/v1/separator-tests/cancel','/api/v1/voice/start','/api/v1/voice/cancel','/api/v1/music-remix/transcribe'))
|
||||
return (self.command == 'GET' and (self.path in ('/api/v1/status','/api/v1/hardware','/api/v1/separator-runtime','/api/v1/separator-tests','/api/v1/voice','/api/v1/voice/profiles','/api/v1/music-remix') or urlsplit(self.path).path in ('/api/v1/separator-tests/audio','/api/v1/voice/audio'))) or (self.command=='POST' and self.path in ('/api/v1/separator-jobs/start','/api/v1/separator-chat/start','/api/v1/separator-tests/cancel','/api/v1/voice/start','/api/v1/voice/cancel','/api/v1/voice/select','/api/v1/music-remix/transcribe'))
|
||||
|
||||
def session_token(self):
|
||||
try:
|
||||
@@ -489,7 +497,7 @@ class Handler(BaseHTTPRequestHandler):
|
||||
video_runtime = (self.server.video.original_runtime
|
||||
if self.server.video.runtime_kind() == 'original'
|
||||
else self.server.video.runtime)
|
||||
return {'embeddings':chat,'stt':chat,'chat':chat,
|
||||
return {'embeddings':chat,'stt':chat,'chat':chat,'basalt':self.server.basalt_runtime.status()['installed'],
|
||||
'image':self.server.image_runtime.status().get('installed',False),
|
||||
'seedvc':self.server.seedvc_runtime.status()['installed'],'humaneness':self.server.humaneness_runtime.status()['installed'],'kikiri':self.server.kikiri_runtime.status()['installed'],'articulino':self.server.articulino_runtime.status()['installed'],'qwen_native':self.server.qwen_native_runtime.status()['installed'],'pocket':self.server.pocket_runtime.status()['installed'],'audio':self.server.tts_runtime.status().get('installed',False),'parakeet':self.server.stt.parakeet.status()['installed'],
|
||||
'video':video_runtime.status().get('installed',False),
|
||||
@@ -635,6 +643,8 @@ class Handler(BaseHTTPRequestHandler):
|
||||
with path.open('rb') as stream:
|
||||
while chunk:=stream.read(1024*1024):self.wfile.write(chunk)
|
||||
return
|
||||
if self.path in ('/api/v1/basalt-runtime','/api/v1/basalt-runtime/log'):
|
||||
return self.respond(self.server.basalt_runtime.log() if self.path.endswith('/log') else self.server.basalt_runtime.status())
|
||||
if self.path in ('/api/v1/strata-runtime','/api/v1/strata-runtime/log'):
|
||||
return self.respond(self.server.strata_runtime.log() if self.path.endswith('/log') else self.server.strata_runtime.status())
|
||||
if self.path.startswith('/api/v1/runtime'):
|
||||
@@ -765,6 +775,12 @@ class Handler(BaseHTTPRequestHandler):
|
||||
if self.read_json()!={'confirm':True}:raise ValueError('Die Docker-Erstinstallation muss ausdrücklich bestätigt werden.')
|
||||
return self.respond(self.server.docker.install())
|
||||
except (OSError,ValueError) as exc:return self.respond({'error':str(exc) if isinstance(exc,ValueError) else 'Docker-Systemhelfer nicht erreichbar.'},400)
|
||||
if self.path in ('/api/v1/basalt-runtime/install','/api/v1/basalt-runtime/cancel','/api/v1/basalt-runtime/model'):
|
||||
try:
|
||||
if self.read_json()!={}:raise ValueError('Keine zusätzlichen Basalt-Parameter erwartet.')
|
||||
action=self.path.rsplit('/',1)[1]
|
||||
return self.respond(self.server.basalt_runtime.download_model() if action=='model' else self.server.basalt_runtime.stop() if action=='cancel' else self.server.basalt_runtime.start())
|
||||
except (OSError,ValueError) as exc:return self.respond({'error':str(exc)},400)
|
||||
if self.path.startswith('/api/v1/strata-runtime/'):
|
||||
try:
|
||||
data=self.read_json();action=self.path.rsplit('/',1)[1]
|
||||
@@ -920,8 +936,13 @@ class Handler(BaseHTTPRequestHandler):
|
||||
if set(data)-{'profile_id','lyrics','style','seed','max_tokens','steps','duration_seconds','guidance','thinking','instrumental','bpm','language'} or not {'profile_id','lyrics','style'}<=set(data):raise ValueError('Ungültige Musikfelder.')
|
||||
return self.respond(self.server.music.start(**data))
|
||||
except ValueError as exc:return self.respond({'error':str(exc)},400)
|
||||
if self.path in ('/api/v1/voice/start','/api/v1/voice/cancel'):
|
||||
if self.path in ('/api/v1/voice/start','/api/v1/voice/cancel','/api/v1/voice/select'):
|
||||
try:
|
||||
if self.path.endswith('/select'):
|
||||
data=self.read_json()
|
||||
if set(data)!={'profile_id'}:raise ValueError('Nur Profil-ID erwartet.')
|
||||
if self.api_token_authenticated() and not any(p['id']==data['profile_id'] and p['kind']=='voice' and p['enabled'] for p in self.server.endpoint.rows()):raise ValueError('Dieses Stimmprofil ist nicht aktiviert.')
|
||||
return self.respond(self.server.voxcpm_tests.select_shared(data['profile_id']))
|
||||
if self.path.endswith('/cancel'):
|
||||
if self.read_json():raise ValueError('Keine Abbruchparameter erwartet.')
|
||||
return self.respond(self.server.voxcpm_tests.stop())
|
||||
|
||||
Reference in new issue
Block a user