Add exclusive LLM and video modes with isolated LTX worker and job API

This commit is contained in:
Mikei386
2026-09-29 13:10:23 +02:00
parent 7910307cfb
commit bec79a23aa
21 changed files with 534 additions and 18 deletions
+12
View File
@@ -72,6 +72,18 @@ class EndpointTests(unittest.TestCase):
self.assertEqual(self.worker.requests[-1].get('reasoning_effort'),'max' if effort=='ultra' else effort)
for effort in ([],True,3,'invalid'):
self.assertEqual(self.request('/v1/chat/completions',dict(model='alpha',messages=[dict(role='user',content='synthetic')],reasoning_effort=effort))[0],400)
def test_video_mode_rejects_chat_without_starting_llama(self):
self.ep.video=Mock();self.ep.scheduler.gpu_mode='video'
code,body=self.request('/v1/chat/completions',dict(model='alpha',messages=[dict(role='user',content='synthetic')]))
self.assertEqual(code,503);self.assertEqual(body['error']['code'],'video_mode_active');self.assertFalse(self.worker.started)
self.ep.video=None
def test_video_job_api_and_auth(self):
self.ep.video=Mock();self.ep.video.generate.return_value={'id':'a'*32,'state':'running'}
self.ep.video.status.return_value={'job':{'id':'a'*32,'state':'complete'}}
self.assertEqual(self.request('/v1/videos',{'prompt':'synthetic'})[0],202)
self.assertEqual(self.request('/v1/videos/'+'a'*32)[1]['state'],'complete')
self.assertEqual(self.request('/v1/videos/'+'b'*32)[0],404)
self.ep.video=None
def test_stt_endpoint_multipart_and_publication(self):
from test_stt import audio
self.rows.append(dict(id='stt',name='stt',kind='stt',runnable=True,blockers=[],parameters={}))