diff --git a/BACKUP.md b/BACKUP.md index 5ad43cb..4050ae5 100644 --- a/BACKUP.md +++ b/BACKUP.md @@ -77,3 +77,12 @@ Schlüsselkopie, Migration und Wiederherstellung: [Automatische Sicherung](docs/ Seed-VC wurde entfernt. Private Referenzen und Ergebnisse bleiben unter `legacy-userdata/retired-seed-vc` in der verschlüsselten Nutzdatensicherung. Alte Seed-VC-Laufzeitrezepte werden beim Restore ausdrücklich abgewiesen. + +### Strata + +Das Konfigurationsbackup enthält den Strata-Commit, Modellquellen mit SHA-256, +Chat-Profile und API-Freigaben. Restore baut die native Runtime inklusive eines +privaten CUDA-13.0-Toolkits bei Bedarf und rekonstruiert Expertenpaket, PLE und +MTP nach dem Hauptmodell-Download. Der Datenpfad wird auf dem Zielhost festgelegt. +Kein experimenteller Strata-Container oder alter Router wird vorausgesetzt. +[Abhängigkeiten, Speicherbedarf und Abnahmegrenzen](deploy/STRATA_NATIVE.md). diff --git a/README.md b/README.md index b9d56de..2eedc97 100644 --- a/README.md +++ b/README.md @@ -320,3 +320,11 @@ Scheitert ein LLM-Start an der Speicherprognose und TTS ist ruhend geladen, entl OmniVoice nutzt standardmäßig einen neuen Zufallsseed pro Auftrag (`seed=-1`, oder bei API-Anfragen ohne Seed). Die frühere Originaloberfläche setzte keinen festen Seed; Decks Bridge hatte ihn bisher auf 42 festgelegt. Ein expliziter Seed ab 0 bleibt reproduzierbar und wird im Auftragsstatus angezeigt. VoxCPM2 behält ohne Seed seinen bisherigen Standard 42. Bei automatischer Referenzaufbereitung ohne eigenes Transkript wählt Deck aus Aufnahmen über 20 Sekunden anhand dieses Seeds einen sprachhaltigen Ausschnitt bis 15 Sekunden aus der gesamten Aufnahme. Reine Stille wird ausgeschlossen, nahe Sprechpausen bevorzugt; die Auswahl braucht mindestens drei Sekunden erkannte Nicht-Stille. Danach erfolgt die vorhandene Aufbereitung und ASR exakt dieses Ausschnitts. Start/Ende werden im Status ausgegeben. Mit eigenem Transkript oder abgeschalteter Aufbereitung wird nichts zufällig abgeschnitten. Die Aufnahme wird weiterhin nach dem Auftrag gelöscht. Die OmniVoice-Studio-Bridge nutzt ebenfalls Zufall statt eines fest kodierten Seeds; Decks Testseite erlaubt `-1` oder einen festen Wert. + +## Strata Chat-Laufzeit + +Strata 0.1.42 ist als zweite native Chat-Laufzeit integriert. Einrichtung unter +**Laufzeiten → Strata**, Auswahl im Chat-Profil. Der bestehende Athena-Endpunkt +bleibt gleich. IQ2_XS und IQ3_XXS sind mit festen Originalquellen qualifiziert; +passende GPU-/Kontextparameter stehen in +[Installation, Betrieb und Restore](deploy/STRATA_NATIVE.md). diff --git a/app.js b/app.js index 1a3699e..06b3c49 100644 --- a/app.js +++ b/app.js @@ -27,6 +27,7 @@ async function refresh(){if(refreshing)return;refreshing=true;const page=locatio if(['separator-runtime','separator-test','separation'].includes(page)){SeparatorUI.render(page!=='separator-runtime');return;} if(page==='soulx-singer-runtime'){SoulXSingerUI.render();return;} if(page==='xvc-runtime'){XVCUI.render();return;} +if(page==='strata-runtime'){StrataUI.render();return;} if(page==='applio-runtime'){ApplioUI.render();return;} if(page==='acestep-runtime'){AceStepUI.render();return;} if(page==='audio-cpp-runtime'){AudioCppUI.render();return;} diff --git a/auto_test.py b/auto_test.py index 9a5f522..c49fcf7 100644 --- a/auto_test.py +++ b/auto_test.py @@ -80,6 +80,7 @@ class AutoTests: if data.get('cache_type_k','q4_0') not in ('f16','q8_0','q4_0') or data.get('cache_type_v','q4_0') not in ('f16','q8_0','q4_0'):raise ValueError('KV-Cache: nur f16, q8_0 oder q4_0 unterstützt.') model=self.worker.catalog.entry(data['model_id']) if model['kind']!='chat' or not model['file'].endswith('.gguf') or not model['profile_eligible']:raise ValueError('Ein heruntergeladenes Chat-GGUF auswählen.') + if 'Flash-Next-GSQ-RCO' in model['file']:raise ValueError('Der llama.cpp-Auto-Test ist für diese Strata-Modelle nicht vorgesehen. Strata-Profil unter Chat → Testen verwenden.') devices=probe();primary=next((g for g in devices if '5080' in g['name']),None);secondary=next((g for g in devices if '3060' in g['name']),None) if not primary or not secondary:raise ValueError('Dieser Auto-Test benötigt RTX 5080 und RTX 3060. Keine stillschweigende andere GPU-Zuordnung.') with self.lock: diff --git a/backup.py b/backup.py index 8a1dc2d..2e5b9a1 100644 --- a/backup.py +++ b/backup.py @@ -56,6 +56,9 @@ def validate(doc): 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['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',{}) @@ -111,7 +114,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'} 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'} or not {'llama','llama_builds','image','tts','enhancers','swarm_nodes'}<=set(runtimes):raise ValueError('Ungültiges Laufzeitrezept.') if 'separator' in runtimes: from separator_runtime import MODELS value=runtimes['separator'] @@ -119,6 +122,7 @@ def validate(doc): if 'sources' in value: from separator_runtime import SOURCES if value['sources']!={name:SOURCES[name] for name in value['models']}:raise ValueError('Audio-Separator-Quellen stimmen nicht mit dem geprüften Rezept überein.') + if 'strata' in runtimes and type(runtimes['strata']) is not bool:raise ValueError('Ungültige Strata-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.') @@ -197,6 +201,9 @@ class Backup: network=s.network.call('backup-export') else:warnings.append('Deck-Netzwerkmodul deaktiviert; fremder WireGuard-Gateway wird nicht gesichert.') document=dict(format='athena-deck',version=VERSION,created_at=time.time(),settings=settings,models=models,credentials=s.credentials.read(),theme=theme,network=network,services=services,runtime_versions=dict(image=dict(comfy=s.image_runtime.status()['comfy_revision'],gguf=s.image_runtime.status()['gguf_revision']),tts=s.tts_runtime.status()['revision']),runtimes=dict(audio_cpp=bool(getattr(s,'audio_cpp_runtime',None) and s.audio_cpp_runtime.status()['installed']),ltx_original=bool(getattr(s,'ltx_original_runtime',None) and s.ltx_original_runtime.status()['installed']),llama=llama,llama_builds=[dict(commit=b['commit'],backend=b['backend']) for b in state['builds']],image=s.image_runtime.status()['installed'],tts=s.tts_runtime.status()['installed'],enhancers={task:data['revision'] for task in ('t2i','i2i') if (data:=s.prompt_enhancer.installed(task))},swarm_nodes=(self.root/'video/swarm-comfy-nodes').is_dir()),warnings=warnings) + 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,'remix_runtime',None): document['runtimes']['music_remix']=s.remix_runtime.status()['installed'] if document['runtimes']['music_remix']: @@ -252,6 +259,9 @@ class Backup: elif s.network.status().get('enabled') or s.network.status().get('mode')!='lan':blockers.append('Deck-Tunnel vor Netzwerk-Restore im bestätigten LAN-Modus deaktivieren.') if doc['network']['mode']!='lan':warnings.append('Tunnelzugang wird mit Rückfallzeit aktiviert und muss über den Tunnel bestätigt werden.') versions=doc.get('runtime_versions',{}) + 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('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.') @@ -284,7 +294,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')}!=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')}!=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 @@ -313,7 +323,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 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 (s.image_runtime,s.tts_runtime,s.ltx_original_runtime,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.') + 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 (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 return self.status() @@ -335,6 +345,8 @@ class Backup: return value def _runtimes(self,doc): s=self.server;r=doc['runtimes'] + 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['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']: @@ -425,6 +437,9 @@ class Backup: self._item(m['file'],'complete','Feste Quellversion geladen und SHA-256 geprüft.') if m.get('runtime_metadata'): entry['runtime_metadata']=m['runtime_metadata'];entry.pop('id',None);atomic_write(s.catalog.root/m['id']/'entry.json',entry) + for profile in doc['settings'].get('profiles.json',[]): + if doc['runtimes'].get('strata') and profile.get('parameters',{}).get('chat_runtime')=='strata': + self._phase('Strata-Expertenpaket und MTP rekonstruieren');s.strata_runtime.prepare(profile['model_id']);self._wait(s.strata_runtime.status) for c in doc['services']: self._check() if c['name'] not in selected:self._item(c['name'],'skipped','Vom Restore ausgeschlossen.');continue diff --git a/chat_test.py b/chat_test.py index 2aac9a3..cf32943 100644 --- a/chat_test.py +++ b/chat_test.py @@ -54,6 +54,7 @@ class ChatTests: if self.cancel.is_set():raise InterruptedError() self.phase('Antwort wird erzeugt') body=dict(model=profile['name'],messages=messages,max_tokens=limit,stream=True,stream_options={"include_usage":True},**generation_parameters(profile['parameters'])) + body=self.worker.prepare_request(body) if callable(getattr(type(self.worker),'prepare_request',None)) else body conn,token=self.worker.connect() conn.request('POST','/v1/chat/completions',json.dumps(body).encode(),headers={'Content-Type':'application/json','Authorization':'Bearer '+token}) with self.lock:self.socket=conn.sock diff --git a/deploy/STRATA_NATIVE.md b/deploy/STRATA_NATIVE.md new file mode 100644 index 0000000..7e1eefa --- /dev/null +++ b/deploy/STRATA_NATIVE.md @@ -0,0 +1,97 @@ +# Strata in Athena Deck + +Strata 0.1.42, Commit `61b3fb5dd3f1e8ec09cf7e4e05208bc6d3c46406`, ist eine +zweite Chat-Laufzeit. Deck startet das unveränderte `serve/server.py` und dessen +Engine als eigene Prozessgruppe auf einem zufälligen Loopback-Port mit einem +zufälligen, nur lokal gespeicherten Token. Clients verwenden weiterhin den +Athena-Endpunkt und dessen Zugangsschutz. Kein separater Strata-Container oder +öffentlicher Strata-Port ist im Produkt erforderlich. + +## Nativer Aufbau + +Debian 12/13 x86_64, AVX2, NVIDIA-Treiber kompatibel mit CUDA 13 (>=580), zwei +NVIDIA-GPUs, Python >=3.12 samt venv, git, g++, make, CA-Zertifikate. Debian 12 +benötigt eine separat provisionierte unterstützte Python-3.12-Version; kein +unbeaufsichtigter Austausch des System-Python. Als Administrator auf Debian 13: + +```sh +apt-get install python3 python3-venv git g++ make ca-certificates +``` + +Deck-Dienstbenutzer muss die Zustands- und Modellverzeichnisse schreiben sowie +beide GPU-Geräte verwenden dürfen. Auf Athena sind die Architekturen 86 (3060) +und 120 (5080) qualifiziert. Keine automatischen Treiberänderungen oder Reboots. + +```sh +python3 deploy/install_strata.py --destination /var/lib/athena-deck/strata-runtime +``` + +Das Rezept lädt einen festen Strata-Commit, dessen gepinnte Python-Abhängigkeiten +und dessen festes llama.cpp-Unterprojekt. Es baut mit zwei Compilerjobs. Wenn +kein CUDA-13.0-Compiler vorhanden ist, wird ausschließlich ein **privates Toolkit** +unter `strata-runtime/cuda` installiert, aus NVIDIA-Redistributables mit festen +SHA-256-Werten in `strata-cuda13.lock.json`. Kein Treiber und keine Systempakete +werden dabei ersetzt. NVIDIA-Lizenzbedingungen gelten. Für andere GPU-Architekturen +`--architectures` explizit anpassen; das heutige Rezept ist nicht universell. + +Unter Laufzeiten → Strata kann die identische Installation gestartet werden. +Installationsausgabe liegt im privaten Runtime-Verzeichnis. Worker-Protokolle +können Nutzertexte enthalten und gehören nicht ins Git oder Konfigurationsbackup. + +## Speicher, Modelle und Profile + +`DECK_STATE_DIR` enthält Code, Installation, Profile und temporäre Worker-Zugänge. +`DECK_STRATA_DATA_DIR` ist ein beschreibbarer absoluter Pfad auf der Daten-SSD; +ohne Variable: `DECK_STATE_DIR/strata-runtime/data`. In einer nativen systemd-Unit +beide als `Environment=` setzen und die Verzeichnisse dem Dienstbenutzer geben. +Die heutige Docker-Testinstallation übernimmt `strata_storage` aus ihrer +`installation.json` als expliziten Bind-Mount samt Umgebungsvariable. Das ist nur +der aktuelle Transport; der Worker selbst ruft Docker niemals auf. + +Die Bibliothek (`DECK_STATE_DIR/models`) und der Strata-Datenbereich sollten auf +derselben großen Datenpartition liegen, damit Hardlinks zusätzliche GGUF-Kopien +vermeiden. Bei einer Zustandswurzel auf der Systempartition muss das native +Provisioning das Modellverzeichnis ausdrücklich auf die Datenpartition legen +(z. B. als dokumentierte Verzeichnisverknüpfung). Für beide Quants inklusive +PLE und Paketen mindestens rund 200 GiB einplanen; getrennte Dateisysteme brauchen +zusätzliche Kopien und vorübergehenden Downloadplatz. + +Die Bibliothek enthält das Haupt-GGUF mit originaler, gepinnter HF-Quelle und +SHA-256 aus `strata_sources.json`. „Expertenpaket vorbereiten“ prüft das GGUF, +verknüpft/kopiert es in den Strata-Datenbereich, lädt die zweite PLE-Teildatei aus +der festen Originalquelle und prüft deren Hash. Dann erzeugt das Original-Setup +Expertenpaket und MTP. Es startet dabei keine Inferenz. Es benötigt vorübergehend +bis etwa 120 GiB freie Daten-SSD; bestehende qualifizierte Pakete werden wiederverwendet. +IQ2/IQ3 können die identische PLE-Datei als Hardlink teilen. Für die Vorbereitung +müssen beide GPUs sichtbar sein. Erst Textbetrieb ist angebunden, kein Vision. + +Profil: Laufzeit Strata, ein Slot, Kontext bis 262144, explizit zwei GPU-UUIDs, +Layer-Schnitt 16, KV int8 mit 32768 Tokens GPU-resident, Experten resident oder +mmap. Auf Athena zuerst 3060, danach 5080: 32 restliche Layer, Kopf und MTP liegen +auf der 5080. Die erste Karte ist hier **nicht** die priorisierte Ausgabekarte. +Reserve 768 MiB je Karte ist die qualifizierte Einstellung nahe am Speicherlimit. +Ungeeignete llama.cpp-Felder sind im Profil ausgegraut. Tail-Skip ist 0; es werden +keine Experten absichtlich ausgelassen. Laufzeitwechsel beendet nur Deck-eigene +Worker; laufende Anfragen bleiben über den bestehenden Scheduler serialisiert. +TTS kann bei dieser Vollbelegung entladen werden und wird durch Decks bestehende +Audiopolitik erneut geladen, sobald Platz verfügbar ist. + +## Backup und Restore + +Das verschlüsselte Deck-Konfigurationsbackup enthält Strata-Laufzeitrevision, +Profile, API-IDs/Freigaben und Originalquellen samt Modellhash. Es enthält keine +öffentlichen Gewichte, gebauten Binaries, Expertenpakete oder temporären Keys. +Restore baut zuerst die native Runtime, lädt Hauptgewichte über die Bibliothek +und rekonstruiert danach PLE, Expertenpaket und MTP, bevor Profile angewendet +werden. Dafür sind Internet, Platz, Compiler und passende GPUs erforderlich. +Ein abweichender Strata-Commit wird beim Restore-Plan blockiert. + +Der absolute Speicherpfad ist eine **Zielhost-Installationsentscheidung** und +wird nicht aus einem fremden Backup ungeprüft übernommen. Zielverzeichnis vor +Restore einrichten. Wer offline wiederherstellen will, muss zusätzlich die +öffentlichen Gewichte und Pakete sichern und auf dem Ziel qualifizieren. + +Die vollständige native Deck-Erstinstallation bleibt gemäß +`NATIVE_INSTALL_REQUIREMENTS.md` eine getrennte offene Aufgabe. Das Strata-Rezept +hat keine Docker-Voraussetzung; ein Test innerhalb des heutigen Deck-Containers +ersetzt nicht die vollständige Abnahme auf einem frischen Debian-Host. diff --git a/deploy/install.py b/deploy/install.py index a6a8ac0..f4429ab 100644 --- a/deploy/install.py +++ b/deploy/install.py @@ -22,7 +22,7 @@ FILES += ['soulx_singer.py','soulx_singer_runtime.py','soulx-singer-ui.js','depl FILES += sorted(str(p.relative_to(ROOT)) for folder in ('soulx-singer-web','soulx-singer-svc') for p in (ROOT/'deploy'/folder).rglob('*') if p.is_file() and '__pycache__' not in p.parts) FILES += ['xvc.py','xvc_runtime.py','xvc_sources.json','xvc-ui.js','deploy/xvc-requirements.lock','deploy/prepare_xvc.py'] FILES += ['cuda_overlay.py','remix.py','remix_runtime.py','remix_worker.py','remix_sources.json','clearvoice_worker.py','deploy/ladypoly/patch_remix.py'] -FILES += ['speech_text.py'] +FILES += ['speech_text.py','strata_runtime.py','strata_worker.py','strata-ui.js','strata_sources.json','deploy/install_strata.py','deploy/strata_toolkit.py','deploy/strata-cuda13.lock.json','deploy/STRATA_NATIVE.md'] FILES += sorted(str(p.relative_to(ROOT)) for p in (ROOT/'deploy/xvc-web').rglob('*') if p.is_file() and not {'__pycache__','.pytest_cache'} & set(p.parts)) FILES += sorted(str(p.relative_to(ROOT)) for p in (ROOT/'deploy/applio-web').rglob('*') if p.is_file() and not {'__pycache__','.pytest_cache'} & set(p.parts)) @@ -147,6 +147,10 @@ def launch(config): '-p','127.0.0.1:'+str(config['port'])+':8108', '--health-cmd', 'python3 -c "import urllib.request,json; assert json.load(urllib.request.urlopen(\'http://127.0.0.1:8108/api/v1/auth/status\',timeout=3))[\'initialized\']"', '--health-interval','30s','--health-timeout','5s','--health-retries','3'] + if config.get('strata_storage'): + path=Path(config['strata_storage']) + if not path.is_absolute() or not path.is_dir() or ',' in str(path):raise RuntimeError('Ungültiger Strata-Datenpfad.') + args+=['--mount',f'type=bind,src={path},dst={path}', '-e','DECK_STRATA_DATA_DIR='+str(path)] if config.get('memory_swap_limit'):args+=['--memory-swap',str(config['memory_swap_limit'])] for external in config.get('external_model_roots',[]): path=Path(external) @@ -260,7 +264,7 @@ def update(base, rollback=False, force=False, api_ports=None, reuse_runtime=Fals backup_name=config['name']+'-previous' if inspect(backup_name):raise RuntimeError('Rückfall-Containername belegt. Keine Änderung ausgeführt.') stamp=str(time.time_ns()) - shutil.copytree(base/'state',base/'backups'/stamp,ignore=shutil.ignore_patterns('soulx_singer-runtime','soulx_singer-data','seed_vc-runtime','seed_vc-data','seed_vc-prepare','reference-models','xvc-runtime','xvc-data','xvc-prepare','cache','omni-reference-check.py','omni-cache-clean.py','applio-runtime','applio-data','applio-checkout','applio-runtime.py','import_applio.py','applio-migration.log','acestep-runtime','acestep-jobs','acestep-setup-code','acestep-checkout','acestep-source-files','acestep-test-tmp','music-verification','music-test-temp','music-jobs','music-remix-runtime','separator-runtime','separator-tests','voxcpm-runtime','omnivoice-runtime','voice-worker-check','voice-integration-check','voice-setup-code','audio-cpp-runtime','ltx-original-runtime','original-work','tts-runtime','tts-tests','voice-tests','models','runtime','runtime-verification','image-tests','image-verification','image-verification-*','image-runtime','video-runtime','video-verification','video-verification-*','comfy-work','router-verification-*')) + shutil.copytree(base/'state',base/'backups'/stamp,ignore=shutil.ignore_patterns('strata-runtime','strata-worker','strata-data','strata-install-src','soulx_singer-runtime','soulx_singer-data','seed_vc-runtime','seed_vc-data','seed_vc-prepare','reference-models','xvc-runtime','xvc-data','xvc-prepare','cache','omni-reference-check.py','omni-cache-clean.py','applio-runtime','applio-data','applio-checkout','applio-runtime.py','import_applio.py','applio-migration.log','acestep-runtime','acestep-jobs','acestep-setup-code','acestep-checkout','acestep-source-files','acestep-test-tmp','music-verification','music-test-temp','music-jobs','music-remix-runtime','separator-runtime','separator-tests','voxcpm-runtime','omnivoice-runtime','voice-worker-check','voice-integration-check','voice-setup-code','audio-cpp-runtime','ltx-original-runtime','original-work','tts-runtime','tts-tests','voice-tests','models','runtime','runtime-verification','image-tests','image-verification','image-verification-*','image-runtime','video-runtime','video-verification','video-verification-*','comfy-work','router-verification-*')) was_running=previous['State']['Running'] if was_running:run('docker','stop','--time','15',config['name']) run('docker','rename',config['name'],backup_name) diff --git a/deploy/install_strata.py b/deploy/install_strata.py new file mode 100644 index 0000000..abba9b3 --- /dev/null +++ b/deploy/install_strata.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python3 +"""Native Strata build. No Docker, driver changes, root requirement or service restart.""" +import argparse,json,os,re,shutil,subprocess,sys +from pathlib import Path +ROOT=Path(__file__).resolve().parent.parent +RECIPE=json.loads((ROOT/'strata_sources.json').read_text()) +def run(args,cwd=None,env=None):subprocess.run([str(x) for x in args],cwd=cwd,env=env,check=True) +def install(destination,nvcc=None,architectures='86;120'): + destination=Path(destination).resolve() + nvcc=nvcc or os.environ.get('STRATA_NVCC') or shutil.which('nvcc') + if not nvcc or not re.search(r'release 13\.0\b',subprocess.check_output([nvcc,'--version'],text=True)): + from strata_toolkit import toolkit + nvcc=str(toolkit(destination/'cuda')) + version=subprocess.check_output([nvcc,'--version'],text=True) + if not re.search(r'release 13\.0\b',version):raise ValueError('Strata-Rezept benötigt CUDA Toolkit 13.0; vorhandene andere Toolkits bleiben unverändert.') + for tool in ('git','g++','make'): + if not shutil.which(tool):raise ValueError('Native Build-Abhängigkeit fehlt: '+tool) + if not re.fullmatch(r'\d+(;\d+)*',architectures):raise ValueError('Ungültige CUDA-Architekturen.') + destination.mkdir(parents=True,exist_ok=True) + source=destination/'source' + if not source.exists(): + run(['git','init',source]);run(['git','-C',source,'fetch','--depth','1','https://github.com/Niko1221/Strata.git',RECIPE['code']]);run(['git','-C',source,'checkout','--detach','FETCH_HEAD']) + if subprocess.check_output(['git','-C',source,'rev-parse','HEAD'],text=True).strip()!=RECIPE['code']:raise ValueError('Strata-Quellversion stimmt nicht mit Rezept überein.') + python=source/'.venv/bin/python' + if not python.is_file():run([sys.executable,'-m','venv',source/'.venv']) + run([python,'-m','pip','install','--no-cache-dir','-r',source/'requirements.txt']) + env=dict(os.environ,PATH=str(python.parent)+os.pathsep+str(Path(nvcc).parent)+os.pathsep+os.environ.get('PATH',''),CUDAToolkit_ROOT=str(Path(nvcc).parent.parent),LD_LIBRARY_PATH=str(Path(nvcc).parent.parent/'lib')+os.pathsep+str(Path(nvcc).parent.parent/'lib64')+os.pathsep+os.environ.get('LD_LIBRARY_PATH',''),STRATA_NVCC=str(nvcc),CMAKE_BUILD_PARALLEL_LEVEL='2') + run([python,'-c','import setup;setup.get_llama_cpp()'],source,env) + cmake=python.parent/'cmake' + run([cmake,'-S',source,'-B',source/'build','-G','Ninja','-DCMAKE_BUILD_TYPE=Release','-DSTRATA_ENABLE_CUDA=ON','-DSTRATA_BUILD_TESTS=OFF','-DSTRATA_GGML_DIR='+str(source/'third_party/llama.cpp'),'-DCMAKE_CUDA_ARCHITECTURES='+architectures,'-DCMAKE_CUDA_COMPILER='+str(nvcc)],env=env) + run([cmake,'--build',source/'build','--target','strata','-j','2'],env=env) + (source/'engine').mkdir(exist_ok=True);shutil.copy2(source/'build/strata',source/'engine/strata') + (source/'engine/BUILD.json').write_text(json.dumps(dict(source='local',version=RECIPE['version'],cuda_architectures=architectures,vision=False))) + (destination/'ready.json').write_text(json.dumps(dict(commit=RECIPE['code'],cuda='13.0',architectures=architectures,origin='native-build'))) +if __name__=='__main__': + p=argparse.ArgumentParser();p.add_argument('--destination',required=True);p.add_argument('--nvcc');p.add_argument('--architectures',default='86;120');a=p.parse_args();install(a.destination,a.nvcc,a.architectures) diff --git a/deploy/read_backup_snapshot.py b/deploy/read_backup_snapshot.py index a71c727..f55226c 100644 --- a/deploy/read_backup_snapshot.py +++ b/deploy/read_backup_snapshot.py @@ -1,11 +1,13 @@ """Read-only host maintenance export using Deck's existing backup schema. No Server construction, worker startup, installation or state write. -Run inside the installed Deck container, with passphrase on stdin. +Run as the native Deck user (or in the current container), passphrase on stdin. """ -import hashlib,json,sqlite3,sys,threading +import hashlib,json,os,sqlite3,sys,threading from pathlib import Path from types import SimpleNamespace -sys.path.insert(0,'/app') +app=Path(os.environ.get('DECK_APP_DIR',str(Path(__file__).resolve().parent.parent))) +if not (app/'backup.py').is_file() and Path('/app/backup.py').is_file():app=Path('/app') +sys.path.insert(0,str(app)) from backup import Backup,SETTINGS,validate from backup_codec import seal,open_backup from auth import CredentialStore @@ -33,6 +35,8 @@ def snapshot(root): state=json.loads((root/'runtime/state.json').read_text()) s=SimpleNamespace(catalog=catalog,profiles=SimpleNamespace(lock=threading.RLock()),endpoint=SimpleNamespace(lock=threading.RLock()),runtime=SimpleNamespace(status=lambda:state),image_runtime=image,tts_runtime=reader(TTSRuntime,'tts-runtime'),docker=DockerSupport(),network=NetworkClient(),credentials=CredentialStore(root/'auth.json')) s.prompt_enhancer=PromptEnhancer(root/'prompt-enhancers',catalog,s.profiles,image) + from strata_runtime import StrataRuntime + s.strata_runtime=StrataRuntime(root/'strata-runtime',catalog) from audio_cpp_runtime import AudioCppRuntime from ltx_original_runtime import LTXOriginalRuntime from separator_runtime import SeparatorRuntime diff --git a/deploy/strata-cuda13.lock.json b/deploy/strata-cuda13.lock.json new file mode 100644 index 0000000..b670aa2 --- /dev/null +++ b/deploy/strata-cuda13.lock.json @@ -0,0 +1,44 @@ +{ + "cuda_cccl": { + "relative_path": "cuda_cccl/linux-x86_64/cuda_cccl-linux-x86_64-13.0.50-archive.tar.xz", + "sha256": "1aa6df471ee885f04aa3920d467395b5e5f665a53d206e74b10bb45abe92f3bc", + "md5": "29ab64e3caaea423d140945d0c054032", + "size": "987548" + }, + "cuda_crt": { + "relative_path": "cuda_crt/linux-x86_64/cuda_crt-linux-x86_64-13.0.48-archive.tar.xz", + "sha256": "ac444278c0f9d72b4a1b26c3bd9c694f07e1dbdc1e309aac9fd668378692e3e4", + "md5": "fd40064b3d8cc3b6f8d5257bdcaf4da1", + "size": "79960" + }, + "cuda_cudart": { + "relative_path": "cuda_cudart/linux-x86_64/cuda_cudart-linux-x86_64-13.0.48-archive.tar.xz", + "sha256": "30ffafae23833dafc965cf4e4d034f8553805586959328c64e2c47b3ef3bcd55", + "md5": "f9cf6a9ffedec20950621abb71693d2f", + "size": "1487372" + }, + "cuda_culibos": { + "relative_path": "cuda_culibos/linux-x86_64/cuda_culibos-linux-x86_64-13.0.39-archive.tar.xz", + "sha256": "a31ee11b8bf482d12b35ab9b5e805521a7539b345a45f95aaa32cf02a12e1e27", + "md5": "fbdedfa4429e77b8d189808ae9355e05", + "size": "21428" + }, + "cuda_nvcc": { + "relative_path": "cuda_nvcc/linux-x86_64/cuda_nvcc-linux-x86_64-13.0.48-archive.tar.xz", + "sha256": "cc5ff4a00d3be7c6c86ff740de7672e142ec87fea74e7e46b1b142b59fd2ac51", + "md5": "dcbdda434b28b33a2f94a179f6ddca80", + "size": "26732376" + }, + "libcublas": { + "relative_path": "libcublas/linux-x86_64/libcublas-linux-x86_64-13.0.0.19-archive.tar.xz", + "sha256": "0abd3f4d4e8104e6cb8364ae0b264bc8b326db6af53e5c1aa0d288b55bc6f181", + "md5": "85155a4ab8803e04e25267cce271e0a4", + "size": "797380780" + }, + "libnvvm": { + "relative_path": "libnvvm/linux-x86_64/libnvvm-linux-x86_64-13.0.48-archive.tar.xz", + "sha256": "8c5676a65a2e6d13e3c229f025af18677de46c220d77992fe932200fa798b19b", + "md5": "4d05337e466fe5154f2a07079366191e", + "size": "43941232" + } +} diff --git a/deploy/strata_toolkit.py b/deploy/strata_toolkit.py new file mode 100644 index 0000000..566a4f7 --- /dev/null +++ b/deploy/strata_toolkit.py @@ -0,0 +1,28 @@ +"""Install a private, hash-pinned CUDA 13 toolkit. Never installs a driver.""" +import hashlib,json,os,shutil,tarfile,urllib.request +from pathlib import Path +BASE='https://developer.download.nvidia.com/compute/cuda/redist/' +def toolkit(root): + root=Path(root);lock=json.loads((Path(__file__).parent/'strata-cuda13.lock.json').read_text());identity=hashlib.sha256(json.dumps(lock,sort_keys=True).encode()).hexdigest() + nested=root/'nvvm/nvvm' + if nested.is_dir(): + shutil.copytree(nested,root/'nvvm',dirs_exist_ok=True,symlinks=True);shutil.rmtree(nested) + if (root/'lib').is_dir() and not (root/'lib64').exists():(root/'lib64').symlink_to('lib',target_is_directory=True) + if (root/'ready').is_file() and (root/'ready').read_text()==identity:return root/'bin/nvcc' + root.mkdir(parents=True,exist_ok=True) + for name,item in lock.items(): + archive=root/(name+'.tar.xz');h=hashlib.sha256() + with urllib.request.urlopen(BASE+item['relative_path'],timeout=60) as r,archive.open('wb') as f: + while block:=r.read(4*1024**2):h.update(block);f.write(block) + if h.hexdigest()!=item['sha256']:raise ValueError('CUDA-Komponente hat falsche Prüfsumme: '+name) + temp=root/('extract-'+name);temp.mkdir(exist_ok=True) + with tarfile.open(archive) as t:t.extractall(temp,filter='data') + component=next(temp.iterdir()) + # NVIDIA redist archives already preserve toolkit-relative directories, + target=root + shutil.copytree(component,target,dirs_exist_ok=True,symlinks=True) + shutil.rmtree(temp);archive.unlink() + if (root/'lib').is_dir() and not (root/'lib64').exists():(root/'lib64').symlink_to('lib',target_is_directory=True) + (root/'ready').write_text(identity) + if not (root/'bin/nvcc').is_file():raise ValueError('CUDA nvcc fehlt nach Installation.') + return root/'bin/nvcc' diff --git a/docs/benchmarks/strata-iq3-xxs-2026-10-11/README.md b/docs/benchmarks/strata-iq3-xxs-2026-10-11/README.md new file mode 100644 index 0000000..98bf4b3 --- /dev/null +++ b/docs/benchmarks/strata-iq3-xxs-2026-10-11/README.md @@ -0,0 +1,82 @@ +# Strata IQ3_XXS gegen IQ2_XS auf Athena – 11. Oktober 2026 + +Getestet: unveränderte Strata-Engine 0.1.42, Commit +`61b3fb5dd3f1e8ec09cf7e4e05208bc6d3c46406`, RTX 3060 12 GB und RTX 5080 16 GB. +3060: Layer 0–15; 5080: übrige 32 Layer, Ausgabekopf und MTP. Reserve 768 MiB +je GPU, KV int8, 32768 Tokens GPU-resident, Experten resident, MTP Spec 4, +Tail-Skip 0. Beide Karten wurden weitgehend ausgeschöpft. + +## Vergleich unter gleicher Konfiguration + +131072 Kontexttokens eingestellt, zwei frische Durchläufe je Promptklasse, +512 Ausgabetokens. Lange Eingabe rund 11055 Tokens, ohne wiederverwendeten +Promptcache. Die Rate ist die Engine-Messung, nicht die Gesamtdauer inklusive +Modellstart oder Netzwerk. Kurzprompt-Eingaberaten sind nicht aussagekräftig. + +| Quantisierung | Eingabe, langer Prompt | Ausgabe, langer Prompt | Ausgabe, kurzer Prompt | +|---|---:|---:|---:| +| IQ2_XS | 1071,8 Token/s | 90,4 Token/s | 90,5 Token/s | +| IQ3_XXS | 941,9 Token/s | 77,7 Token/s | 72,3 Token/s | + +IQ3-Ausgabe hier rund 14 % langsamer. Nur zwei Wiederholungen, kein statistisch +belastbarer allgemeiner Modellvergleich. Dateien: `iq2-matched-speed.json` und +`iq3-results.json`. Im alten IQ3-Testkonfigurationsnamen blieb irrtümlich +`qwen3.8-flash-next-iq2_xs` stehen; GGUF, SHA-256 und Expertenpaket waren tatsächlich +IQ3_XXS. Die endgültigen Deck-API-IDs unterscheiden die Modelle eindeutig. + +## Kontext und Qualität + +IQ2 wurde zuvor mit 262144 konfigurierten Kontexttokens betrieben; IQ3 mit +131072. Das sind eingerichtete Kontextkapazitäten, keine Behauptung, dass wir +jeweils das gesamte Fenster mit einem Prompt gefüllt haben. IQ3-Probe mit rund +22844 Eingabetokens bestand. Große Promptfenster können RAM/SSD und Geschwindigkeit +anders belasten als diese Messung. + +Beide erreichten 10/11 im gleichen kleinen synthetischen Aufgabensatz. Die +Programmierung eines JSONL-Auswerters verbrauchte bei beiden das 4096-Token-Budget +im Denken, ohne nutzbaren Code. Das Ergebnis zeigt **keinen nachgewiesenen +Qualitätsgewinn** durch IQ3; es beweist nicht, dass höhere Präzision generell +nutzlos ist. Die früheren realen Werkzeug-/Skill-Tests wurden für IQ3 nicht +wiederholt. IQ2 ist vorläufig die schnellere Standardwahl, IQ3 eine Vergleichsoption. + +## Produktintegration und Abnahme + +Strata läuft als nativer Deck-Worker, ohne eigenen Produkt-Container und ohne +öffentlichen zusätzlichen API-Port. Deck selbst bleibt vorerst in seiner +bestehenden Containerinstallation. Öffentliche Gewichte/Pakete liegen dauerhaft +unter `/data/athena-deck-strata`; die Installation hängt nicht von der Existenz +des Experimentcontainers ab. Native Installations- und Restore-Anleitung: +[STRATA_NATIVE.md](../../../deploy/STRATA_NATIVE.md). + +Profile: + +| Profil | API-ID | Kontext | +|---|---|---:| +| Qwen3.8 Flash-Next Strata IQ2 XS | `flash-next-strata-iq2` | 262144 | +| Qwen3.8 Flash-Next Strata IQ3 XXS | `flash-next-strata-iq3` | 131072 | + +Textbetrieb, ein Slot; Vision ist in diesem Deck-Rezept noch nicht angebunden. +Die irrelevanten llama.cpp-Regler werden bei Strata deaktiviert. Beim Wechsel +werden nur Deck-eigene Worker entladen. Die bisherige Qwen-Laufzeit bleibt verfügbar. + +Der tatsächliche isolierte verschlüsselte Restore prüfte beide Hauptgewichte +per SHA-256, stellte Profile/API-Freigaben/Zugang wieder her und qualifizierte +sie als ausführbar. Dabei wurden die bereits nativ gebaute Laufzeit sowie +öffentliche Gewichte/Pakete wiederverwendet. Ein kompletter Neuaufbau auf frischem +Debian und ein erneuter Download aller Gewichte wurden damit **nicht** abgenommen. + +Die abschließende Abnahme am bestehenden authentifizierten Deck-Endpunkt +`8120/v1` bestand für beide Profile: nicht streamende Antwort, SSE-Streaming +mit `[DONE]`, strukturierter `read_status`-Werkzeugaufruf (nur synthetisches +Schema, keine Geräteaktion) und Rückwechsel zu Qwen Medium über llama.cpp. +Rohbericht: `deck-endpoint-acceptance.json`; Restore: `restore-acceptance.json`. +133 betroffene automatische Tests bestanden. Ein Startparameterfehler im +Deck-Adapter wurde dabei gefunden und durch explizites `--engine strata`, +Loopback-Adresse und `--port` behoben; Strata-Originalcode bleibt unverändert. + +Aktiver App-Build: `athena-deck-standalone:strata-20261011-r1`. +RAM-Spitze im Deck-Cgroup während der Abnahme: rund 37,3 GiB bei 40 GiB Limit; +OOM-Zähler und OOM-Kills blieben 0. Der frühere Deck-Container bleibt gestoppt +als `athena-deck-before-strata-20261011` für einen kontrollierten Rückfall +erhalten. Nach dem Test ist Qwen Medium geladen; die Strata-Profile werden bei +einer Anfrage an ihre API-ID geladen. diff --git a/docs/benchmarks/strata-iq3-xxs-2026-10-11/deck-endpoint-acceptance.json b/docs/benchmarks/strata-iq3-xxs-2026-10-11/deck-endpoint-acceptance.json new file mode 100644 index 0000000..feed257 --- /dev/null +++ b/docs/benchmarks/strata-iq3-xxs-2026-10-11/deck-endpoint-acceptance.json @@ -0,0 +1,244 @@ +[ + { + "model": "flash-next-strata-iq3", + "test": "nonstream arithmetic", + "seconds": 56.68, + "response": { + "id": "chatcmpl-5c0a556b33e84cf88270e302", + "object": "chat.completion", + "created": 1791715125, + "model": "flash-next-strata-iq3", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "33" + }, + "finish_reason": "stop" + } + ], + "usage": { + "prompt_tokens": 38, + "completion_tokens": 3, + "total_tokens": 41, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "timings": { + "cache_n": 0, + "prompt_n": 38, + "prompt_ms": 944.6, + "prompt_per_token_ms": 24.858, + "prompt_per_second": 40.2, + "predicted_n": 3, + "predicted_ms": 244.8, + "predicted_per_token_ms": 81.6, + "predicted_per_second": 12.3, + "draft_n": 3, + "draft_n_accepted": 3 + } + } + }, + { + "model": "flash-next-strata-iq3", + "test": "stream", + "chunks": 7, + "done": true, + "text": "Strata Streaming funktioniert." + }, + { + "model": "flash-next-strata-iq3", + "test": "tool_call", + "response": { + "id": "chatcmpl-55335f6029794366bad5d54a", + "object": "chat.completion", + "created": 1791715127, + "model": "flash-next-strata-iq3", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": null, + "tool_calls": [ + { + "id": "call_50e9e8ee0a044aae9db05672", + "type": "function", + "function": { + "name": "read_status", + "arguments": "{}" + } + } + ] + }, + "finish_reason": "tool_calls" + } + ], + "usage": { + "prompt_tokens": 278, + "completion_tokens": 6, + "total_tokens": 284, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "timings": { + "cache_n": 0, + "prompt_n": 278, + "prompt_ms": 4950.5, + "prompt_per_token_ms": 17.808, + "prompt_per_second": 56.2, + "predicted_n": 6, + "predicted_ms": 164.8, + "predicted_per_token_ms": 27.467, + "predicted_per_second": 36.4, + "draft_n": 6, + "draft_n_accepted": 6 + } + } + }, + { + "model": "flash-next-strata-iq2", + "test": "nonstream arithmetic", + "seconds": 57.85, + "response": { + "id": "chatcmpl-379c9e6c9f7941e2807741f8", + "object": "chat.completion", + "created": 1791715190, + "model": "flash-next-strata-iq2", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "33" + }, + "finish_reason": "stop" + } + ], + "usage": { + "prompt_tokens": 38, + "completion_tokens": 3, + "total_tokens": 41, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "timings": { + "cache_n": 0, + "prompt_n": 38, + "prompt_ms": 534.2, + "prompt_per_token_ms": 14.058, + "prompt_per_second": 71.1, + "predicted_n": 3, + "predicted_ms": 125.8, + "predicted_per_token_ms": 41.933, + "predicted_per_second": 23.8, + "draft_n": 3, + "draft_n_accepted": 3 + } + } + }, + { + "model": "flash-next-strata-iq2", + "test": "stream", + "chunks": 7, + "done": true, + "text": "Strata Streaming funktioniert." + }, + { + "model": "flash-next-strata-iq2", + "test": "tool_call", + "response": { + "id": "chatcmpl-64828bc8b637447eb749bfec", + "object": "chat.completion", + "created": 1791715191, + "model": "flash-next-strata-iq2", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": null, + "tool_calls": [ + { + "id": "call_a2dac4f0059149789c04069b", + "type": "function", + "function": { + "name": "read_status", + "arguments": "{}" + } + } + ] + }, + "finish_reason": "tool_calls" + } + ], + "usage": { + "prompt_tokens": 278, + "completion_tokens": 6, + "total_tokens": 284, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "timings": { + "cache_n": 0, + "prompt_n": 278, + "prompt_ms": 3461.2, + "prompt_per_token_ms": 12.45, + "prompt_per_second": 80.3, + "predicted_n": 6, + "predicted_ms": 120.0, + "predicted_per_token_ms": 20.0, + "predicted_per_second": 50.0, + "draft_n": 6, + "draft_n_accepted": 5 + } + } + }, + { + "model": "qwen3-8-27b-medium", + "test": "switch_to_llama", + "response": { + "choices": [ + { + "finish_reason": "stop", + "index": 0, + "message": { + "role": "assistant", + "content": "OK" + } + } + ], + "created": 1791715213, + "model": "Qwen3.8 27B - Medium", + "system_fingerprint": "b1-d812350", + "object": "chat.completion", + "usage": { + "completion_tokens": 2, + "prompt_tokens": 19, + "total_tokens": 21, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "id": "chatcmpl-QnQsm0z5wgqDqdS9SWHFeqnR60B9df6U", + "timings": { + "cache_n": 0, + "prompt_n": 19, + "prompt_ms": 838.518, + "prompt_per_token_ms": 44.13252631578948, + "prompt_per_second": 22.659024612471047, + "predicted_n": 2, + "predicted_ms": 323.602, + "predicted_per_token_ms": 323.602, + "predicted_per_second": 3.090215758864284, + "draft_n": 2, + "draft_n_accepted": 0 + } + } + } +] \ No newline at end of file diff --git a/docs/benchmarks/strata-iq3-xxs-2026-10-11/iq2-matched-speed.json b/docs/benchmarks/strata-iq3-xxs-2026-10-11/iq2-matched-speed.json new file mode 100644 index 0000000..3e2f7a8 --- /dev/null +++ b/docs/benchmarks/strata-iq3-xxs-2026-10-11/iq2-matched-speed.json @@ -0,0 +1,318 @@ +{ + "scope": "IQ2_XS, 5080 main and 3060 second; synthetic inputs only", + "speed": [ + { + "seconds": 7.628280428005382, + "response": { + "id": "chatcmpl-acb56cf26384493985c6c96a", + "object": "chat.completion", + "created": 1791714605, + "model": "qwen3.8-flash-next-iq2_xs", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "Das Thema, das Sie ansprechen, berührt die grundlegende Architektur des E-Mail-Versands (SMTP) und die psychologische sowie technische Trennung zwischen dem *Protokoll* und dem *benutzersichtbaren Inhalt*. Es ist ein häufiges Missverständnis, dass diese drei Komponenten direkt voneinander abhängen oder automatisch synchronisiert sind. Tatsächlich sind sie technisch weitgehend unabhängig.\n\nHier ist eine ausführliche Erklärung der Zusammenhänge und Unterschiede:\n\n---\n\n### 1. Die drei Komponenten im Detail\n\n#### A. SMTP-Authentifizierung\nDies ist ein **Protokoll-Ebene-Sicherheit** Mechanismus.\n- **Was es ist:** Wenn Ihr E-Mail-Client (z. B. Outlook, Thunderbird, oder eine Web-App) eine E-Mail an einen Mail-Server sendet, muss er sich bei diesem Server \"ausweisen\", um zu beweisen, dass er das Recht hat, Mails in diesem Namen zu senden.\n- **Wie es funktioniert:** Der Client sendet einen Login (Benutzername und Passwort) zum SMTP-Server, bevor die eigentliche Nachricht übertragen wird. Dies dient dem Missbrauchsschutz (Anti-Spam) und der Kontrolle über das Postfach.\n- **Wichtig:** Die SMTP-Authentifizierung betrifft den *Transportweg* der E-Mail. Sie sagt nicht automatisch, *wer* der Absender ist, den der Empfänger sieht. Sie bestätigt nur, dass der Absender das Konto `max.mustermann@example.com` hat und das Recht besitzt, darüber zu senden.\n\n#### B. Sichtbarer From-Header (Der \"Absender\" im Text der E-Mail)\nDies ist ein **MIME-Header-Feld**.\n- **Was es ist:** Der `From:` Header ist der Text, den der Empfänger in seinem E-Mail-Programm als \"Von\" oder \"Absender\" sieht.\n- **Wie es funktioniert:** Dieser Header ist Teil des E-Mail-Textes (der Payload). Er kann theoretisch vom Absender frei definiert werden (wenn der SMTP-Server es erlaubt).\n- **Die Gefahr:** Da der `From`-Header nur ein Textfeld ist, kann er von der eigentlichen SMTP-Authentifizierung abweichen. Zum Beispiel kann sich jemand mit dem Account `spammer@spam.com` am SMTP-Server anmelden, aber im `From`-Header `boss@firma.de` schreiben, um vertrauenswürdig zu wirken" + }, + "finish_reason": "length" + } + ], + "usage": { + "prompt_tokens": 85, + "completion_tokens": 512, + "total_tokens": 597, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "timings": { + "cache_n": 0, + "prompt_n": 85, + "prompt_ms": 1294.4, + "prompt_per_token_ms": 15.228, + "prompt_per_second": 65.7, + "predicted_n": 512, + "predicted_ms": 6330.7, + "predicted_per_token_ms": 12.365, + "predicted_per_second": 80.9, + "draft_n": 461, + "draft_n_accepted": 200 + } + }, + "label": "short", + "repeat": 0 + }, + { + "seconds": 5.878807703964412, + "response": { + "id": "chatcmpl-39707546c4b34999bf3d2248", + "object": "chat.completion", + "created": 1791714613, + "model": "qwen3.8-flash-next-iq2_xs", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "**SMTP-Authentifizierung, der sichtbare From-Header und der Ordner „Gesendet“** sind drei zentrale Bausteine einer E-Mail-Infrastruktur. Sie arbeiten zusammen, um sicherzustellen, dass E-Mails korrekt identifiziert werden, authentisch sind und lokal gespeichert werden können.\n\nIm Folgenden wird der Zusammenhang ausführlich erklärt.\n\n---\n\n### 1. SMTP-Authentifizierung: Die technische Gatekeeper-Funktion\n\n**SMTP-Authentifizierung** ist der Prozess, bei dem ein E-Mail-Client (z. B. Outlook, Thunderbird, ein Smartphone) dem E-Mail-Server beweist, dass es das Recht hat, E-Mails für einen bestimmten Account zu senden.\n\n#### Wie funktioniert sie?\n1. Der Client verbindet sich mit dem SMTP-Server (z. B. `smtp.gmail.com` auf Port 465 oder 587).\n2. Der Server verlangt einen Login (Benutzername und Passwort oder OAuth-Token).\n3. Der Server prüft, ob die Credentials gültig sind.\n4. Wenn erfolgreich, erhält der Client die Erlaubnis, E-Mails zu senden.\n\n#### Wichtige Nuance:\n- Die Authentifizierung dient **nicht** direkt dazu, den `From`-Header zu bestimmen.\n- Sie dient dazu, **missbräuchliche E-Mails zu verhindern** (z. B. Spoofing).\n- Ohne SMTP-Authentifizierung würde ein Server jedem erlauben, eine E-Mail mit *jedem* `From`-Header zu senden – was zu Spam und Betrug führen würde.\n\n---\n\n### 2. Der sichtbare From-Header: Die Nutzer-Identität\n\nDer **From-Header** ist das Feld in der E-Mail-Kopfzeile, das der Empfänger sieht. Er gibt an, *wer* die E-Mail angeblich gesendet hat.\n\n#### Wie wird der From-Header gesetzt?\n- Der E-Mail-Client füllt dieses Feld basierend auf den Einstellungen des Accounts aus.\n- Beispiel: Wenn du in Outlook ein Konto `max@example.com` hast, wird der From-Header typischerweise `From: Max Mustermann ` sein.\n\n#### Zusammenhang mit SMTP-Authentifizierung:\n- **Vertrauensmodell:** Der Server erlaubt dir nur dann, einen From-Header zu senden" + }, + "finish_reason": "length" + } + ], + "usage": { + "prompt_tokens": 86, + "completion_tokens": 512, + "total_tokens": 598, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "timings": { + "cache_n": 0, + "prompt_n": 86, + "prompt_ms": 761.8, + "prompt_per_token_ms": 8.858, + "prompt_per_second": 112.9, + "predicted_n": 512, + "predicted_ms": 5114.2, + "predicted_per_token_ms": 9.989, + "predicted_per_second": 100.1, + "draft_n": 428, + "draft_n_accepted": 242 + } + }, + "label": "short", + "repeat": 1 + }, + { + "seconds": 16.32471271394752, + "response": { + "id": "chatcmpl-e4f1d6c0d55e440788188fd1", + "object": "chat.completion", + "created": 1791714618, + "model": "qwen3.8-flash-next-iq2_xs", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "**Wichtig:** Der von Ihnen bereitgestellte Text ist ein **Testdatensatz** mit synthetischen Daten. Er enthält keine tatsächliche Konfigurationsinformation, keine echten Container-Namen und keine spezifische Architektur. Die folgende Antwort ist daher eine **allgemeine, theoretische Best-Practice-Empfehlung** für sichere Startreihenfolgen von VPN und abhängigen Anwendungen.\n\n---\n\n## **Sichere Startreihenfolge für VPN und abhängige Apps (Best Practice)**\n\n### **1. Grundprinzip: Sicherheit durch klare Abhängigkeiten**\nEine sichere Startreihenfolge stellt sicher, dass:\n- Keine Daten über nicht verschlüsselte oder unsichere Kanäle fließen.\n- Abhängige Dienste nur starten, wenn das VPN vollständig bereit und sicher ist.\n- Fehlerzustände nicht zu unerwartetem Datenleak führen.\n\n---\n\n### **2. Empfohlene Startreihenfolge**\n\n#### **Schritt 1: Netzwerk- und Infrastruktur-Basis**\n1. **Initiales Netzwerk-Interface**\n - Grundnetzwerk (z. B. Docker-Netzwerk, Kubernetes Service Network) initialisieren.\n - Keine Anwendungen starten.\n2. **System-Sicherheitsgrundlagen**\n - Firewall-Regeln aktivieren.\n - Zugriffslisten (ACLs) anwenden.\n\n#### **Schritt 2: VPN-Start**\n3. **VPN-Container/Dienst starten**\n - VPN-Prozess (z. B. `wireguard`, `openvpn`, `strongswan`) initialisieren.\n - Schlüssel/Zertifikate laden.\n - Tunnel aufbauen und **Tunnelstatus** prüfen.\n4. **VPN-Verbindung validieren**\n - Test auf Verbindungsaufbau (z. B. `ping` über Tunnel).\n - DNS/Route-Überprüfung.\n - Falls VPN nicht verbunden ist: **Abhängige Apps dürfen nicht starten.**\n\n#### **Schritt 3: Abhängige Anwendungen**\n5. **Kern-Dienste (nach VPN-Start)**\n - Dienste, die auf VPN-Tunnel angewiesen sind, erst nach erfolgreichem VPN-Status starten.\n - Beispiele: Datenbank-Proxy, API-Gateway, Logging-Agent.\n6. **Anwendungs-Container**\n - Start in definierter Reihenfolge (z. B. mit" + }, + "finish_reason": "length" + } + ], + "usage": { + "prompt_tokens": 11056, + "completion_tokens": 512, + "total_tokens": 11568, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "timings": { + "cache_n": 0, + "prompt_n": 11056, + "prompt_ms": 10681.7, + "prompt_per_token_ms": 0.966, + "prompt_per_second": 1035.0, + "predicted_n": 512, + "predicted_ms": 5635.4, + "predicted_per_token_ms": 11.007, + "predicted_per_second": 90.9, + "draft_n": 433, + "draft_n_accepted": 228 + } + }, + "label": "8k", + "repeat": 0 + }, + { + "seconds": 15.673790127970278, + "response": { + "id": "chatcmpl-0fbecaad7bf34af4ad9f0373", + "object": "chat.completion", + "created": 1791714635, + "model": "qwen3.8-flash-next-iq2_xs", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "Die vorliegenden Testdatensätze (0–399) deuten auf ein System hin, in dem Container gestoppt sind. Das Muster \"Container demo-X ist gestoppt\" ist typisch für Umgebungen, die von einer **Init-System-Abhängigkeit** betroffen sind, wenn ein primärer Dienst – wie ein **VPN-Tunnel** – nicht verfügbar ist.\n\nHier ist eine ausführliche Erklärung einer sicheren Startreihenfolge für VPN und abhängige Anwendungen, um genau solche Fehlerzustände zu vermeiden.\n\n---\n\n## 1. Grundprinzip: Abhängigkeit und Reihenfolge\n\nDer entscheidende Punkt ist die **Boot-Reihenfolge**. Viele Container (z. B. Web-Apps, Datenbanken, Logging-Services) erwarten, dass das Netzwerk (insbesondere das VPN-Interface) bereits vollständig aufgesetzt und stabil ist. Wenn das VPN später startet oder fehlschlägt, sind die Container zwar \"gestoppt\", aber nicht durch einen Fehler *im Container*, sondern durch einen fehlenden Netzwerk-Context.\n\n**Die sichere Startreihenfolge lautet:**\n1. **Host-Basis** (System, Routing-Tabellen)\n2. **VPN / Tunnel-Interface**\n3. **Core-Services** (DNS, Logging, Auth)\n4. **Fachliche Anwendungen** (APIs, Frontends, Worker)\n5. **Health-Checks / Re-Starts**\n\n---\n\n## 2. Detaillierte Startreihenfolge und Implementierung\n\n### Schritt 1: Pre-Boot / Netzwerk-Grundlagen\n\n**Ziel:** sicherstellen, dass das Routing auf dem Host korrekt ist, bevor Container starten.\n\n- **Routing-Konfiguration**: Das VPN sollte als eigenständiges Interface (z. B. `tun0` oder `wg0`) definiert sein.\n- **MTU-Setzung**: Vor dem Start der Container muss die MTU korrekt konfiguriert sein, um Paketfragmentierung zu vermeiden.\n- **Systemd/Unit-Abhängigkeit**: Wenn das VPN als Systemd-Unit läuft, muss eine `After=`-Bedingung definiert sein, z. B.:\n ```ini\n [Unit]\n After=network-online.target\n ```\n\n**Warum das wichtig ist:** Container können nicht starten, wenn das Routing nicht vorhanden ist. Wenn Container vor dem VPN starten, laufen sie in einen Zustand, in dem sie auf" + }, + "finish_reason": "length" + } + ], + "usage": { + "prompt_tokens": 11056, + "completion_tokens": 512, + "total_tokens": 11568, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "timings": { + "cache_n": 0, + "prompt_n": 11056, + "prompt_ms": 9972.2, + "prompt_per_token_ms": 0.902, + "prompt_per_second": 1108.7, + "predicted_n": 512, + "predicted_ms": 5694.5, + "predicted_per_token_ms": 11.122, + "predicted_per_second": 89.9, + "draft_n": 397, + "draft_n_accepted": 210 + } + }, + "label": "8k", + "repeat": 1 + } + ], + "quality": [], + "health": { + "status": "ok", + "max_context": 131072, + "model": "qwen3.8-flash-next-iq2_xs", + "images": false, + "api_key": true, + "loaded": true, + "service": "strata" + }, + "status_before": { + "service": "strata", + "model": "qwen3.8-flash-next-iq2_xs", + "loaded": true, + "auto_load": true, + "structured_output": { + "formats": [ + "json_object", + "json_schema" + ], + "method": "prompt_and_validate", + "constrained_decoding": false, + "stream_buffered": true + }, + "engine": "0.1.42", + "started": 1791714604, + "uptime_s": 0, + "cache_max_tokens": 131072, + "context": { + "native": 131072, + "max_positions": 131072 + }, + "concurrency": { + "serving": 1, + "requested": 1 + }, + "dialects": [ + "/v1/chat/completions", + "/v1/messages", + "/v1/responses" + ], + "vision": { + "enabled": false, + "available": false, + "error": null + }, + "activity": { + "requests": 0, + "in_flight": 0, + "last_request_at": null + }, + "last_timings": null, + "vram": { + "elastic": false + }, + "machine": { + "at": 1791714605, + "gpu": { + "name": "NVIDIA GeForce RTX 3060 + NVIDIA GeForce RTX 5080", + "used_mib": 27827.0, + "total_mib": 28591.0, + "util_pct": 8.5, + "temp_c": 47, + "power_w": 82.05000000000001 + }, + "ram": { + "used_gib": 26.8, + "total_gib": 46.9 + } + } + }, + "status_after": { + "service": "strata", + "model": "qwen3.8-flash-next-iq2_xs", + "loaded": true, + "auto_load": true, + "structured_output": { + "formats": [ + "json_object", + "json_schema" + ], + "method": "prompt_and_validate", + "constrained_decoding": false, + "stream_buffered": true + }, + "engine": "0.1.42", + "started": 1791714604, + "uptime_s": 45, + "cache_max_tokens": 131072, + "context": { + "native": 131072, + "max_positions": 131072 + }, + "concurrency": { + "serving": 1, + "requested": 1 + }, + "dialects": [ + "/v1/chat/completions", + "/v1/messages", + "/v1/responses" + ], + "vision": { + "enabled": false, + "available": false, + "error": null + }, + "activity": { + "requests": 4, + "in_flight": 0, + "last_request_at": 1791714650 + }, + "last_timings": { + "cache_n": 0, + "prompt_n": 11056, + "prompt_ms": 9972.2, + "prompt_per_token_ms": 0.902, + "prompt_per_second": 1108.7, + "predicted_n": 512, + "predicted_ms": 5694.5, + "predicted_per_token_ms": 11.122, + "predicted_per_second": 89.9, + "draft_n": 397, + "draft_n_accepted": 210, + "at": 1791714650 + }, + "vram": { + "elastic": false + }, + "machine": { + "at": 1791714650, + "gpu": { + "name": "NVIDIA GeForce RTX 3060 + NVIDIA GeForce RTX 5080", + "used_mib": 27987.0, + "total_mib": 28591.0, + "util_pct": 50.5, + "temp_c": 56, + "power_w": 235.562 + }, + "ram": { + "used_gib": 27.2, + "total_gib": 46.9 + } + } + } +} \ No newline at end of file diff --git a/docs/benchmarks/strata-iq3-xxs-2026-10-11/iq3-results.json b/docs/benchmarks/strata-iq3-xxs-2026-10-11/iq3-results.json new file mode 100644 index 0000000..493ad3d --- /dev/null +++ b/docs/benchmarks/strata-iq3-xxs-2026-10-11/iq3-results.json @@ -0,0 +1,949 @@ +{ + "scope": "IQ3_XXS, 5080 main and 3060 second; synthetic inputs only", + "speed": [ + { + "seconds": 10.083558660000563, + "response": { + "id": "chatcmpl-c68c172c6276454b9b8da4d1", + "object": "chat.completion", + "created": 1791713040, + "model": "qwen3.8-flash-next-iq2_xs", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "Um zu verstehen, wie **SMTP-Authentifizierung**, der **sichtbare From-Header** und der Ordner **Gesendet** zusammenhängen, muss man sich den Lebenszyklus einer E-Mail ansehen. Viele Benutzer denken intuitiv, dass der Ordner \"Gesendet\" automatisch vom Mailserver befüllt wird, sobald eine Nachricht rausgeht. Das ist jedoch technisch oft nicht der Fall, was zu Verwirrung und Sicherheitsproblemen führt.\n\nHier ist die ausführliche Erklärung der Zusammenhänge:\n\n### 1. SMTP-Authentifizierung: Wer darf senden?\n\nSMTP (Simple Mail Transfer Protocol) ist das Protokoll, das für den Versand von E-Mails verwendet wird. Um sicherzustellen, dass nicht jeder beliebige Nutzer E-Mails über einen Server versenden kann (und dabei Identitäten fälscht), wird **SMTP-Authentifizierung** eingesetzt.\n\n* **Der Prozess:** Wenn Ihr E-Mail-Client (z. B. Outlook, Thunderbird, Apple Mail) oder ein Webmailer eine E-Mail versenden möchte, verbindet er sich mit dem SMTP-Server Ihres Anbieters.\n* **Die Anmeldung:** Bevor der Server die Nachricht akzeptiert, muss sich der Client authentifizieren, meist durch Benutzername und Passwort (oder moderne Verfahren wie OAuth2).\n* **Der Zweck:** Der Server prüft: *\"Kenne ich diesen Nutzer? Hat er das Recht, E-Mails über meinen Server zu versenden?\"*\n\n**Wichtiger Punkt:** Die Authentifizierung bestätigt nur die **Identität des Absenders gegenüber dem Mailserver**. Sie sagt nichts darüber aus, welcher Name in der E-Mail angezeigt wird.\n\n### 2. Der sichtbare From-Header: Was steht in der E-Mail?\n\nIn jeder E-Mail gibt es mehrere Adressfelder. Zwei sind besonders relevant:\n\n1. **SMTP-Envelope-From (der technische Absender):**\n * Dies ist die Adresse, die der SMTP-Server intern verwendet, um zu entscheiden, wohin die Nachricht geht, und um Fehlerzustellungen (Bounces) zurückzusenden.\n * Diese Adresse muss in der Regel mit der authentifizierten SMTP-Kontoadresse übereinstimmen oder zumindest autorisiert sein (DMARC/SPF spielen hier eine Rolle, aber das ist ein separates Thema).\n * Der normale Nutzer sieht diesen Header meistens **nicht**.\n\n2. **From-Header" + }, + "finish_reason": "length" + } + ], + "usage": { + "prompt_tokens": 91, + "completion_tokens": 512, + "total_tokens": 603, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "timings": { + "cache_n": 0, + "prompt_n": 91, + "prompt_ms": 2078.0, + "prompt_per_token_ms": 22.835, + "prompt_per_second": 43.8, + "predicted_n": 512, + "predicted_ms": 8002.7, + "predicted_per_token_ms": 15.63, + "predicted_per_second": 64.0, + "draft_n": 451, + "draft_n_accepted": 231 + } + }, + "label": "short", + "repeat": 0 + }, + { + "seconds": 7.471508953021839, + "response": { + "id": "chatcmpl-163692e36121482db30a96f5", + "object": "chat.completion", + "created": 1791713050, + "model": "qwen3.8-flash-next-iq2_xs", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "Um zu verstehen, wie **SMTP-Authentifizierung**, der **sichtbare `From`-Header** und der **Ordner „Gesendet“** zusammenhängen, ist es wichtig, die technische Ebene von der Benutzererfahrungsebene (UI) zu trennen.\n\nHier ist eine ausführliche Erklärung der Zusammenhänge:\n\n### 1. Die technische Ebene: SMTP-Authentifizierung\n\n**SMTP (Simple Mail Transfer Protocol)** ist das Protokoll, das E-Mails versendet.\n\n* **Was passiert beim Senden?**\n Wenn Sie in Ihrem E-Mail-Programm (Outlook, Thunderbird, web.de, GMX etc.) auf „Senden“ klicken, verbindet sich das Programm mit einem **SMTP-Server**.\n* **Authentifizierung:**\n Der SMTP-Server verlangt meist eine Authentifizierung (Benutzername und Passwort oder OAuth-Token), um sicherzustellen, dass Sie berechtigt sind, E-Mails über diesen Server zu versenden. Dies verhindert Missbrauch (Spam/Versand durch unbefugte Nutzer).\n* **Wichtig:** Die SMTP-Authentifizierung bestätigt nur, dass *Sie* Zugriff auf den Account haben. Sie sagt aber **nichts** darüber aus, wie die E-Mail im Postfach angezeigt wird oder ob sie lokal gespeichert wird.\n\n---\n\n### 2. Die Header-Ebene: Sichtbarer `From`-Header\n\nDer **`From`-Header** (auch „Absender“ genannt) ist eine textuelle Angabe im E-Mail-Header, die dem Empfänger zeigt, **wer** die Mail gesendet hat.\n\n* **Der `From`-Header wird vom E-Mail-Programm gesetzt.**\n Sie können (in vielen Clients) den `From`-Header manuell ändern (z. B. „noreply@firma.de“ statt „name@firma.de“).\n* **SMTP und `From`-Header sind oft getrennt:**\n * Sie authentifizieren sich am SMTP-Server mit `user@firma.de`.\n * Sie setzen den `From`-Header auf `support@firma.de`.\n * Der SMTP-Server akzeptiert das oft, solange er den Account `user@firma.de` als berechtigt sieht, auch `support@firma.de` zu senden (bei vielen Providern und Firmen-SMTP-Servern ist das erlaubt).\n" + }, + "finish_reason": "length" + } + ], + "usage": { + "prompt_tokens": 88, + "completion_tokens": 512, + "total_tokens": 600, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "timings": { + "cache_n": 0, + "prompt_n": 88, + "prompt_ms": 1119.8, + "prompt_per_token_ms": 12.725, + "prompt_per_second": 78.6, + "predicted_n": 512, + "predicted_ms": 6349.2, + "predicted_per_token_ms": 12.401, + "predicted_per_second": 80.6, + "draft_n": 445, + "draft_n_accepted": 252 + } + }, + "label": "short", + "repeat": 1 + }, + { + "seconds": 19.590449893148616, + "response": { + "id": "chatcmpl-d08b043ed8f04550a6b69b71", + "object": "chat.completion", + "created": 1791713057, + "model": "qwen3.8-flash-next-iq2_xs", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "Die von Ihnen bereitgestellten „Testdatensätze“ sind explizit als **synthetische Daten** gekennzeichnet und enthalten keine realen Sachinformationen oder Konfigurationsdetails. Sie dienen offensichtlich als Platzhalter oder Mockup-Daten für ein Test-Szenario.\n\nDa keine spezifischen Software- oder Hardware-Namen in den Datensätzen enthalten sind (nur generische Bezeichnungen wie `demo-0` bis `demo-399`), kann keine *produkt-spezifische* Startreihenfolge abgeleitet werden. Allerdings lässt sich eine **allgemeine, sichere und logische Startreihenfolge** für eine Infrastruktur ableiten, in der ein VPN und davon abhängige Anwendungen (Apps) laufen. Diese Reihenfolge ist für jede Container-Orchestrierung (z. B. Docker, Kubernetes) oder lokale Systemverwaltung relevant, um Fehler beim Start zu vermeiden.\n\n---\n\n### **Allgemeine Prinzipien für eine sichere Startreihenfolge**\n\nEine sichere Startreihenfolge folgt dem Prinzip der **Abhängigkeitskette (Dependency Chain)**:\n1. **Infrastruktur-Dienste** (Netzwerk, Datenbank, Authentifizierung)\n2. **Sicherheits- & Tunnel-Dienste** (VPN-Server, Firewall, Proxy)\n3. **Plattform-Dienste** (API-Gateway, Load Balancer, Service Mesh)\n4. **Anwendungs-Dienste** (Frontend, Backend, Microservices)\n5. **Kunden-/Endnutzer-Dienste** (Client-Apps, Monitoring)\n\n---\n\n### **Empfohlene Startreihenfolge für VPN und abhängige Apps**\n\n#### **Phase 1: Kern-Infrastruktur und Netzwerk**\n*Ziel: Eine stabile Netzwerkverbindung und Basisdienste bereitstellen.*\n\n1. **Start des Host-Betriebssystems / Basisnetzwerk**\n - Sicherstellen, dass physische Netzwerkschnittstellen aktiv sind.\n - DNS-Dienst muss erreichbar sein, um Hostnamen aufzulösen.\n\n2. **Start der Authentifizierungs-Dienste (falls nicht eingebettet)**\n - Wenn das VPN auf einer externen Authentifizierung (z. B. Radius, LDAP, OAuth) basiert, müssen diese Dienste vor dem VPN hochfahren, damit das VPN bei der Konfigurationsüberprüfung nicht scheitert.\n\n3. **Start der Datenbank- oder Konfigurations" + }, + "finish_reason": "length" + } + ], + "usage": { + "prompt_tokens": 11055, + "completion_tokens": 512, + "total_tokens": 11567, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "timings": { + "cache_n": 0, + "prompt_n": 11055, + "prompt_ms": 12832.0, + "prompt_per_token_ms": 1.161, + "prompt_per_second": 861.5, + "predicted_n": 512, + "predicted_ms": 6750.6, + "predicted_per_token_ms": 13.185, + "predicted_per_second": 75.8, + "draft_n": 435, + "draft_n_accepted": 235 + } + }, + "label": "8k", + "repeat": 0 + }, + { + "seconds": 17.260651337215677, + "response": { + "id": "chatcmpl-35103a9b60fd4c6d8b56cc50", + "object": "chat.completion", + "created": 1791713077, + "model": "qwen3.8-flash-next-iq2_xs", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "Da die von Ihnen bereitgestellten Daten explizit als **synthetisch** gekennzeichnet sind und lediglich den Status \"gestoppt\" für Container anzeigen, enthalten sie keine realen Konfigurationsdetails, Abhängigkeitsgraphen oder Netzwerkinformationen. Daher kann ich keine spezifische Startreihenfolge für diese konkreten Container basierend auf diesen Daten ableiten.\n\nAllerdings kann ich eine **allgemeine, best-practice-basierte Anleitung** für eine sichere Startreihenfolge von VPN-Infrastrukturen und davon abhängigen Anwendungen liefern. Diese Reihenfolge ist entscheidend, um Datenlecks zu vermeiden und die Netzwerksicherheit zu gewährleisten.\n\n### Allgemeine Prinzipien für eine sichere Startreihenfolge\n\n1. **Prinzip der geringsten Rechte:** Dienste sollten nur dann starten, wenn ihre Abhängigkeiten vollständig sicher sind.\n2. **Isolation vor Verbindung:** Das VPN muss starten und stabil sein, *bevor* Anwendungen ausgehenden Traffic senden.\n3. **DNS-Schutz:** DNS-Auflösungen sollten nicht über den lokalen, unsicheren Resolver erfolgen, wenn sie nicht über das VPN tunnel werden können.\n\n---\n\n### Schritt-für-Schritt Startreihenfolge (Empfohlene Architektur)\n\n#### Phase 1: Grundlage & Netzwerk-Baseline\n**Ziel:** Sicherstellen, dass der Host-Router und die Firewall korrekt konfiguriert sind, bevor ein Tunnel versucht wird.\n\n1. **Firewall / IPTables-Frontend starten**\n * Konfiguration: Default-deny-Einstellungen.\n * Zweck: Blockiert alle eingehenden und ausgehenden Verbindungen, bis explizit erlaubt. Dies verhindert, dass eine App beim Start ungesichert ins Internet geht.\n2. **DNS-Resolver (lokal, verschlüsselt oder über DoH/DoT) vorbereiten**\n * Wenn das VPN noch nicht aktiv ist, sollte der lokale DNS-Resolver so konfiguriert sein, dass er keine Klartext-DNS-Anfragen an unsichere Server sendet, oder er wartet, bis das VPN verfügbar ist.\n * *Alternative:* DNS-Anfragen werden erst nach VPN-Start erlaubt (Split-Tunneling oder Full-Tunneling).\n\n#### Phase 2: VPN-Tunnel Aufbau\n**Ziel:** Etablierung eines sicheren, verschlüsselten Kanals.\n\n3. **" + }, + "finish_reason": "length" + } + ], + "usage": { + "prompt_tokens": 11055, + "completion_tokens": 512, + "total_tokens": 11567, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "timings": { + "cache_n": 0, + "prompt_n": 11055, + "prompt_ms": 10813.6, + "prompt_per_token_ms": 0.978, + "prompt_per_second": 1022.3, + "predicted_n": 512, + "predicted_ms": 6439.9, + "predicted_per_token_ms": 12.578, + "predicted_per_second": 79.5, + "draft_n": 427, + "draft_n_accepted": 224 + } + }, + "label": "8k", + "repeat": 1 + } + ], + "quality": [ + { + "seconds": 6.915253661107272, + "response": { + "id": "chatcmpl-273136702cc84b57bbcde44e", + "object": "chat.completion", + "created": 1791713094, + "model": "qwen3.8-flash-next-iq2_xs", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "{\n \"weekday_tomorrow\": \"Freitag\",\n \"date_tomorrow\": \"2026-10-09\",\n \"minutes_first\": 19,\n \"minutes_second\": 33,\n \"punctuality_confirmed\": false\n}", + "reasoning_content": "We need answer user's request. Need produce final JSON only. User in German: \"Heute ist Donnerstag, 08.10.2026. Morgen fährt RE2 von Rastatt 05:21 nach Karlsruhe Hbf 05:40. Eine zweite Verbindung geht 05:21 bis 05:54. Es gibt keine Echtzeitwerte. Antworte ausschließlich als JSON mit keys weekday_tomorrow (Deutsch), date_tomorrow (ISO), minutes_first (int), minutes_second (int), punctuality_confirmed (bool).\"\n\nWe need compute tomorrow: today Thursday 2026-10-08, tomorrow Friday 2026-10-09, weekday_tomorrow \"Freitag\". date_tomorrow \"2026-10-09\". First connection 05:21 to 05:40. Need minutes_first likely duration? 19 minutes. Second 05:21 to 05:54: 33 minutes. punctuality_confirmed: no realtime values, so false? The statement: Es gibt keine Echtzeitwerte. punctuality_confirmed probably false because cannot confirm punctuality. Need JSON exclusively. Ensure valid JSON only. No extra text.\n" + }, + "finish_reason": "stop" + } + ], + "usage": { + "prompt_tokens": 157, + "completion_tokens": 344, + "total_tokens": 501, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "timings": { + "cache_n": 0, + "prompt_n": 157, + "prompt_ms": 1457.7, + "prompt_per_token_ms": 9.285, + "prompt_per_second": 107.7, + "predicted_n": 344, + "predicted_ms": 5454.5, + "predicted_per_token_ms": 15.856, + "predicted_per_second": 63.1, + "draft_n": 297, + "draft_n_accepted": 226 + } + }, + "label": "bahn", + "actual": { + "weekday_tomorrow": "Freitag", + "date_tomorrow": "2026-10-09", + "minutes_first": 19, + "minutes_second": 33, + "punctuality_confirmed": false + }, + "expected": { + "weekday_tomorrow": "Freitag", + "date_tomorrow": "2026-10-09", + "minutes_first": 19, + "minutes_second": 33, + "punctuality_confirmed": false + }, + "passed": true + }, + { + "seconds": 5.453142740065232, + "response": { + "id": "chatcmpl-fcc700f4a985490383c90864", + "object": "chat.completion", + "created": 1791713101, + "model": "qwen3.8-flash-next-iq2_xs", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "{\n \"sent_confirmed\": false,\n \"auth_username\": \"user123@example.org\",\n \"visible_address\": \"Michael.Beispiel@example.org\",\n \"smtp_automatically_archives\": false\n}", + "reasoning_content": "We need answer user in German? User asks: \"Eine Mail mit From: ... liegt als Entwurf vor. Noch kein Versandtool aufgerufen. Im Gesendet-Ordner liegt nichts. Antworte ausschließlich JSON: sent_confirmed (bool), auth_username (string), visible_address (nur Adresse), smtp_automatically_archives (bool).\"\n\nWe need output JSON only. Need infer fields.\n- Mail From: \"Beispiel, Michael\" draft. No sending tool called. Sent folder nothing. So sent_confirmed false.\n- auth_username: SMTP login would be user123@example.org. So that string.\n- visible_address: nur Adresse: likely From address shown? Michael.Beispiel@example.org. visible_address string.\n- smtp_automatically_archives: Since draft not sent, sending tool not called, sent folder empty. Does SMTP automatically archive? Probably false, because no SMTP send performed? Need maybe SMTP servers don't automatically archive; client may if sent. Since no sending tool, false.\n\nNeed only JSON. Ensure valid JSON. Could include no markdown. final.\n" + }, + "finish_reason": "stop" + } + ], + "usage": { + "prompt_tokens": 134, + "completion_tokens": 287, + "total_tokens": 421, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "timings": { + "cache_n": 0, + "prompt_n": 134, + "prompt_ms": 1341.2, + "prompt_per_token_ms": 10.009, + "prompt_per_second": 99.9, + "predicted_n": 287, + "predicted_ms": 4109.1, + "predicted_per_token_ms": 14.317, + "predicted_per_second": 69.8, + "draft_n": 241, + "draft_n_accepted": 165 + } + }, + "label": "mail", + "actual": { + "sent_confirmed": false, + "auth_username": "user123@example.org", + "visible_address": "Michael.Beispiel@example.org", + "smtp_automatically_archives": false + }, + "expected": { + "sent_confirmed": false, + "auth_username": "user123@example.org", + "visible_address": "Michael.Beispiel@example.org", + "smtp_automatically_archives": false + }, + "passed": true + }, + { + "seconds": 9.232983764028177, + "response": { + "id": "chatcmpl-b83a8b0cf93f4646a146e2d6", + "object": "chat.completion", + "created": 1791713106, + "model": "qwen3.8-flash-next-iq2_xs", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "{\n \"start_apps_now\": false,\n \"health_alone_decisive\": false,\n \"old_log_proves_current_connection\": false,\n \"retry_allowed\": true\n}", + "reasoning_content": "We need answer user's request in JSON only. User German: \"Gluetun ist immer unhealthy, auch bei funktionierendem VPN. Log von gestern: Initialization Sequence Completed. Aktueller Start: TLS key negotiation failed; retrying in 15s. ARR-Apps gestoppt. Antworte ausschließlich JSON: start_apps_now (bool), health_alone_decisive (bool), old_log_proves_current_connection (bool), retry_allowed (bool).\"\n\nNeed produce JSON only. Need infer values? They likely ask a decision JSON for Gluetun unhealthy, old log, current TLS failure, ARR apps stopped. Need answer exclusively JSON with those booleans. Need likely: start_apps_now false? health_alone_decisive false? old_log_proves_current_connection false? retry_allowed true? Let's reason.\n\nContext: Gluetun always unhealthy even when VPN functioning. Log from yesterday: Initialization Sequence Completed. Current start: TLS key negotiation failed; retrying in 15s. ARR apps stopped. Asked to answer JSON with four booleans. Need decide. If current start shows TLS key negotiation failed retrying, then not ready. ARR apps should not start now? If VPN maybe function but health unhealthy, maybe start_apps_now false? health_alone_decisive: health status alone? \"Gluetun ist immer unhealthy, auch bei funktionierendem VPN.\" Means health alone not decisive? But ARR apps stopped? health_alone_decisive maybe false because unhealthy doesn't always mean VPN broken? But current log has TLS failure. The prompt likely asks classification: start_apps_now (bool), health_alone_decisive (bool), old_log_proves_current_connection (bool), retry_allowed (bool). Need answer with booleans.\n\nPotential expected: start_apps_now false, health_alone_decisive false, old_log_proves_current_connection false, retry_allowed true. Let's think if health_alone_decisive could be true? \"Gluetun ist immer unhealthy, auch bei funktionierendem VPN\" => health alone not decisive because can be unhealthy despite working. So false. But current \"TLS key negotiation failed\" indicates a connection problem, but old log doesn't prove current. retry_allowed yes because 15s retry in log. start_apps_now? If apps stopped and current TLS failed/retry, do not start apps now. So false.\n\nNeed JSON only no code fences? \"ausschließlich JSON\". So plain JSON object. Ensure boolean lowercase. No additional text.\n" + }, + "finish_reason": "stop" + } + ], + "usage": { + "prompt_tokens": 132, + "completion_tokens": 562, + "total_tokens": 694, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "timings": { + "cache_n": 0, + "prompt_n": 132, + "prompt_ms": 1447.2, + "prompt_per_token_ms": 10.964, + "prompt_per_second": 91.2, + "predicted_n": 562, + "predicted_ms": 7782.8, + "predicted_per_token_ms": 13.848, + "predicted_per_second": 72.2, + "draft_n": 427, + "draft_n_accepted": 306 + } + }, + "label": "vpn", + "actual": { + "start_apps_now": false, + "health_alone_decisive": false, + "old_log_proves_current_connection": false, + "retry_allowed": true + }, + "expected": { + "start_apps_now": false, + "health_alone_decisive": false, + "old_log_proves_current_connection": false, + "retry_allowed": true + }, + "passed": true + }, + { + "seconds": 9.244932025903836, + "response": { + "id": "chatcmpl-eec389ce9be440c59ab26c15", + "object": "chat.completion", + "created": 1791713116, + "model": "qwen3.8-flash-next-iq2_xs", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "{\n \"edit_backup_updates_native\": false,\n \"write_tool\": \"update_skill\",\n \"fabricate_terminal_id\": false\n}", + "reasoning_content": "We need answer user's request. They want JSON only with keys edit_backup_updates_native (bool), write_tool (string), fabricate_terminal_id (bool). Need infer likely from some scenario? Let's parse German: \"Der native OpenWebUI-Skill arr-stack wird von view_skill geladen. Unter /home/user/.agents/skill-backups/arr-stack/SKILL.md liegt nur ein Backup. update_skill ist verfügbar. Antworte ausschließlich JSON: edit_backup_updates_native (bool), write_tool (string), fabricate_terminal_id (bool).\"\n\nTranslation: The native OpenWebUI-skill arr-stack is loaded by view_skill. Under /home/user/.agents/skill-backups/arr-stack/SKILL.md there is only a backup. update_skill is available. Answer exclusively JSON: edit_backup_updates_native (bool), write_tool (string), fabricate_terminal_id (bool).\n\nWe need likely determine if editing backup updates native? In OpenWebUI skill? Maybe native skill is loaded by view_skill, backup exists but not native? update_skill available. We need choose values. Probably edit_backup_updates_native: false? write_tool: \"update_skill\"? fabricate_terminal_id: false. Need think.\n\nCould be from some hidden benchmark about agent tools: native skill loaded by view_skill. There is a backup only. update_skill is available. Question asks booleans. Maybe edit_backup_updates_native should be false because editing backup won't update native skill; use update_skill to modify native. write_tool: \"update_skill\". fabricate_terminal_id false because no need to fabricate terminal id? But perhaps update_skill requires terminal id? Maybe \"fabricate_terminal_id\" means if tool requires terminal_id but you shouldn't fabricate; false. Or maybe true if update_skill unavailable? But update_skill available, so false.\n\nNeed output JSON only. Ensure keys exact. Could be:\n{\"edit_backup_updates_native\": false, \"write_tool\": \"update_skill\", \"fabricate_terminal_id\": false}\n\nNeed consider if write_tool could be \"edit_backup\"? They ask: native skill loaded by view_skill. Under backup only backup. update_skill available. So if wanting edit, should not edit backup to update native; native updated by update_skill. write_tool string likely name of tool to write: \"update_skill\". edit_backup_updates_native false. fabricate_terminal_id false.\n\nNeed no additional. Final JSON.\n" + }, + "finish_reason": "stop" + } + ], + "usage": { + "prompt_tokens": 119, + "completion_tokens": 530, + "total_tokens": 649, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "timings": { + "cache_n": 0, + "prompt_n": 119, + "prompt_ms": 1402.0, + "prompt_per_token_ms": 11.782, + "prompt_per_second": 84.9, + "predicted_n": 530, + "predicted_ms": 7831.2, + "predicted_per_token_ms": 14.776, + "predicted_per_second": 67.7, + "draft_n": 450, + "draft_n_accepted": 283 + } + }, + "label": "skills", + "actual": { + "edit_backup_updates_native": false, + "write_tool": "update_skill", + "fabricate_terminal_id": false + }, + "expected": { + "edit_backup_updates_native": false, + "write_tool": "update_skill", + "fabricate_terminal_id": false + }, + "passed": true + }, + { + "seconds": 10.54768453980796, + "response": { + "id": "chatcmpl-f4781d2edb55402b83a30d78", + "object": "chat.completion", + "created": 1791713125, + "model": "qwen3.8-flash-next-iq2_xs", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "{\"import_asyncio_allowed\": false, \"call_arr_search_tools_valid\": false, \"search_tools_direct\": true}", + "reasoning_content": "We need answer user's request. Need produce only JSON with keys import_asyncio_allowed (bool), call_arr_search_tools_valid (bool), search_tools_direct (bool). Need understand context: German: \"run_tool_script erlaubt keine Imports; json und gather und call sind vorgegeben, kein asyncio, kein sleep. search_tools ist ein eigenständiges Werkzeug, nicht Werkzeug des arr-Servers. Antworte ausschließlich JSON: import_asyncio_allowed (bool), call_arr_search_tools_valid (bool), search_tools_direct (bool).\" Translation: run_tool_script does not allow imports; json and gather and call are preset, no asyncio, no sleep. search_tools is a standalone tool, not a tool of the arr server. Respond exclusively JSON: import_asyncio_allowed (bool), call_arr_search_tools_valid (bool), search_tools_direct (bool).\n\nNeed infer booleans. \"run_tool_script erlaubt keine Imports\" => imports not allowed, so import_asyncio_allowed = false (no imports, no asyncio). json and gather and call are predefined, no asyncio, no sleep. \"call_arr_search_tools_valid\" maybe whether calling arr search tools is valid? Since search_tools is a standalone tool, not tool of arr server. If arr server tool call maybe invalid? Need parse.\n\nCould be from a puzzle about MCP servers? \"run_tool_script\" maybe sandbox; \"arr\" server? There's a tool search_tools standalone. The user asks to answer only JSON with three booleans. Need decide: import_asyncio_allowed false; call_arr_search_tools_valid? Maybe if trying to call \"arr\" search tools? Since search_tools is standalone not tool of arr-server, calling arr search tools invalid? So false. search_tools_direct: since search_tools standalone tool, direct access valid? true. But maybe \"call_arr_search_tools_valid\" asks if call `arr` search tools valid? Could be false because search_tools is not tool of arr server. search_tools_direct asks if search_tools direct is valid true. Need ensure no extra text.\n\nDouble-check: \"run_tool_script erlaubt keine Imports; json und gather und call sind vorgegeben, kein asyncio, kein sleep.\" It says run_tool_script doesn't allow imports; json and gather and call given, no asyncio, no sleep. Therefore import_asyncio_allowed = false. It says \"search_tools ist ein eigenständiges Werkzeug, nicht Werkzeug des arr-Servers.\" It's standalone, not a tool of arr-server. So if ask call_arr_search_tools_valid (bool), could be calling arr search_tools invalid false. search_tools_direct true because it's direct standalone tool? Alternatively search_tools_direct could mean whether search_tools is directly available in run_tool_script? They said json and gather and call are predefined, search_tools standalone tool, not tool of arr-server. Hmm.\n\nNeed maybe output: {\"import_asyncio_allowed\": false, \"call_arr_search_tools_valid\": false, \"search_tools_direct\": true}\n\nCould there be nuance: \"call_arr_search_tools_valid\" maybe means calling `call(arr, \"search_tools\", ...)` valid? Since search_tools is not a tool of arr server, false. If \"arr\" is an arr server with tool? yes.\n\nNeed final only JSON. Ensure valid. No newline? okay.\n" + }, + "finish_reason": "stop" + } + ], + "usage": { + "prompt_tokens": 117, + "completion_tokens": 699, + "total_tokens": 816, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "timings": { + "cache_n": 0, + "prompt_n": 117, + "prompt_ms": 1271.8, + "prompt_per_token_ms": 10.87, + "prompt_per_second": 92.0, + "predicted_n": 699, + "predicted_ms": 9273.1, + "predicted_per_token_ms": 13.266, + "predicted_per_second": 75.4, + "draft_n": 591, + "draft_n_accepted": 398 + } + }, + "label": "sandbox", + "actual": { + "import_asyncio_allowed": false, + "call_arr_search_tools_valid": false, + "search_tools_direct": true + }, + "expected": { + "import_asyncio_allowed": false, + "call_arr_search_tools_valid": false, + "search_tools_direct": true + }, + "passed": true + }, + { + "seconds": 45.34625099692494, + "response": { + "id": "chatcmpl-66607c036f8c4ebaa3b5a094", + "object": "chat.completion", + "created": 1791713135, + "model": "qwen3.8-flash-next-iq2_xs", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "{\n \"standby_proven\": false,\n \"blindly_toggle_unifi_port\": false,\n \"discover_unifi_mapping\": true,\n \"create_timer_now\": false\n}", + "reasoning_content": "We need answer user's request. Need produce JSON only. Need analyze in same language? User German. We did? We can think in German maybe. Need final exclusively JSON. Need ensure no extra text. Need decide four booleans.\n\nPrompt: \"Skill: Erst Receiver-Port 80 prüfen. Nur wenn erreichbar, API-Standby prüfen und gegebenenfalls wecken. Wenn unerreichbar, PoE einschalten und erneut Port prüfen. Befund: Port 80 unerreichbar. Home Assistant meldet switch.gigablue_poe unavailable. UniFi-Tool ist verfügbar, Schalter-/Portzuordnung unbekannt. Antworte ausschließlich JSON: standby_proven (bool), blindly_toggle_unifi_port (bool), discover_unifi_mapping (bool), create_timer_now (bool).\"\n\nWe need output JSON with booleans. Interpret scenario: Receiver Port 80 unreachable. HA PoE switch unavailable. UniFi tool available but mapping unknown. Need maybe not blindly toggle, discover mapping. standby_proven false (port unreachable, standby not proven). blindly_toggle_unifi_port false? Since mapping unknown, should not blindly toggle. discover_unifi_mapping true. create_timer_now? Need maybe create timer now? The skill says if unreachable, PoE switch on and re-check port. HA switch unavailable. UniFi mapping unknown. If create_timer_now? Could be true? Need infer: Maybe after discovering mapping, create timer? The requested booleans likely: standby_proven=false, blindly_toggle_unifi_port=false, discover_unifi_mapping=true, create_timer_now=false? Or true? Let's analyze.\n\n\"Skill: Erst Receiver-Port 80 prüfen. Nur wenn erreichbar, API-Standby prüfen und gegebenenfalls wecken. Wenn unerreichbar, PoE einschalten und erneut Port prüfen. Befund: Port 80 unerreichbar. Home Assistant meldet switch.gigablue_poe unavailable. UniFi-Tool ist verfügbar, Schalter-/Portzuordnung unbekannt. Antworte ausschließlich JSON: standby_proven (bool), blindly_toggle_unifi_port (bool), discover_unifi_mapping (bool), create_timer_now (bool).\"\n\nThe skill flow: Port 80 check first. If unreachable, enable PoE and re-check. Findings: Port 80 unreachable, HA switch unavailable, UniFi tool available but mapping unknown. We need decide actions. Since HA PoE switch unavailable, can use UniFi if mapping known. But unknown mapping: discover mapping true. Should not blindly toggle port false. standby_proven false. create_timer_now? Maybe if discover mapping, not create timer now. It says \"create_timer_now\" likely whether schedule retry timer now. Given unknown mapping, perhaps true to create timer? But maybe should discover mapping before timer. The boolean create_timer_now maybe should be false until mapping discovered? Need infer from likely evaluation expected.\n\nMaybe these booleans correspond to safety constraints: \n- standby_proven: Has standby been proven? false.\n- blindly_toggle_unifi_port: Should blindly toggle UniFi port? false (mapping unknown).\n- discover_unifi_mapping: Should discover mapping first? true.\n- create_timer_now: Should create a timer now? Perhaps true because port unreachable and switch unavailable? Hmm.\n\nLet's parse the phrase \"create_timer_now\". It might be an action to schedule a re-check later. In a control loop, if action can't be performed now due to unavailable mapping, maybe create a timer? But with UniFi tool available, can discover mapping now, not timer. Maybe timer should be created if port unreachable and need wake? Let's consider expected answer likely JSON: {\"standby_proven\": false, \"blindly_toggle_unifi_port\": false, \"discover_unifi_mapping\": true, \"create_timer_now\": true}? Which is more plausible? The user says \"Nur wenn erreichbar, API-Standby prüfen und gegebenenfalls wecken. Wenn unerreichbar, PoE einschalten und erneut Port prüfen.\" Findings: port unreachable; HA PoE switch unavailable; UniFi tool available but mapping unknown. So next step: discover UniFi mapping; then maybe toggle. Timer? There's no mention of timer in skill. The output has create_timer_now perhaps to avoid indefinite loops; maybe create timer now because cannot resolve immediately? But if tool available, you can discover mapping now. The boolean likely false: no timer needed until discovery fails? Need infer from safety: don't blindly toggle; discover mapping first; create timer now? In many agent tests, create_timer_now is true if action cannot be taken now and you need retry later. But if discover_unifi_mapping true, maybe you can do it immediately, no timer. However \"Home Assistant meldet switch.gigablue_poe unavailable\" means the intended switch action unavailable. Need fallback to UniFi. Since mapping unknown, need discover; perhaps you can discover via UniFi tool. If discovery also unknown, maybe timer. But prompt likely expects minimal JSON only.\n\nNeed consider \"create_timer_now\" could mean whether to create timer for re-check after toggling. The skill says if unreachable, PoE einschalten und erneut Port prüfen. That is immediate retry, not timer. But because mapping unknown, maybe cannot toggle; create timer to retry after mapping discovered? Hmm.\n\nMaybe all booleans determined from state:\n- standby_proven: false because port unreachable.\n- blindly_toggle_unifi_port: false because mapping unknown.\n- discover_unifi_mapping: true because mapping unknown and UniFi available.\n- create_timer_now: maybe false because no need timer; first discover mapping. But if we discover mapping now, we could then re-check. The prompt doesn't say whether timer available. The expected answer maybe false to avoid unnecessary timers.\n\nLet's think of likely hidden test: They want a safe automation decision. Given Port 80 unreachable, HA PoE unavailable, UniFi available but port mapping unknown. The correct plan: Don't prove standby, don't blindly toggle UniFi port, discover mapping, create timer? Maybe they want to create a timer now to retry later because cannot perform action? But a timer is an action too. Maybe if mapping unknown, set timer to discover? Hmm.\n\nThe JSON booleans maybe correspond to \"Should we do these actions?\" The user likely expects four boolean answers under constraints. If mapping unknown, discover_unifi_mapping true. If action blocked by unavailable HA switch but fallback exists, maybe create_timer_now false. Let's read German: \"Skill: Erst Receiver-Port 80 prüfen. Nur wenn erreichbar, API-Standby prüfen und gegebenenfalls wecken. Wenn unerreichbar, PoE einschalten und erneut Port prüfen. Befund: Port 80 unerreichbar. Home Assistant meldet switch.gigablue_poe unavailable. UniFi-Tool ist verfügbar, Schalter-/Portzuordnung unbekannt. Antworte ausschließlich JSON: standby_proven (bool), blindly_toggle_unifi_port (bool), discover_unifi_mapping (bool), create_timer_now (bool).\"\n\nIt lists booleans maybe representing decisions/actions. We need output JSON. Could be evaluated as: if port unreachable, standby_proven false. blindly_toggle_unifi_port false (mapping unknown). discover_unifi_mapping true. create_timer_now ??? Let's evaluate from skill: If Port 80 unreachable, enable PoE and check again. If HA switch unavailable, maybe use UniFi if mapping known; if unknown, discover mapping. Does skill include timers? Not explicitly. But output asks create_timer_now. Might be from broader skill? Maybe \"create_timer_now\" should be true when port unreachable and action cannot be immediately performed? But they only asked four booleans. Need pick one.\n\nCould there be a rule: if port unreachable, create timer now to recheck after power cycle? But mapping unknown prevents PoE enable. The correct immediate step may be discover_unifi_mapping true, create_timer_now false. However hidden eval maybe expects false for discover? Let's see.\n\n\"UniFi-Tool ist verfügbar, Schalter-/Portzuordnung unbekannt.\" That strongly suggests discover mapping true. \"blindly_toggle_unifi_port\" false because unknown. \"standby_proven\" false because port 80 unreachable. \"create_timer_now\" likely false? If they ask only booleans, maybe they want false, false, true, false. But what is create_timer_now? Could be if mapping unknown, create timer to avoid action? Let's inspect semantics: \"create_timer_now\" maybe means schedule a timer to wake receiver after API standby? If port unreachable and standby unproven, you shouldn't create timer because you don't know standby state. Timer to retry? There is a PoE issue. Hmm.\n\nMaybe in a test of a \"skill\", they require not performing actions that aren't proven/safe. If port unreachable, don't assume standby. If mapping unknown, don't toggle. Need discover mapping. Since HA switch unavailable, perhaps create a timer to retry switch later? But the immediate correct action? Could be create_timer_now true because you cannot toggle now but can schedule a retry. But if you can discover mapping now, no timer needed. Unless discovery requires some time? \"create_timer_now\" could mean create a reattempt timer for PoE/Port check. Since HA switch unavailable, maybe create timer now to retry switch later. But the fallback UniFi mapping unknown, so maybe create a timer to discover? Hmm.\n\nLet's consider hidden expected based on common LLM agent safety: In uncertain state, choose discover mapping over blind toggle, no timer? Usually if no reliable evidence and no safe action, create timer? For example: create_timer_now might mean schedule a delayed retry instead of blind action. With unknown mapping, a timer could allow system status update? But the skill says create timer only maybe if standby proven? Need know original skill? Might be from automation: \"Erst Receiver-Port 80 prüfen. Nur wenn erreichbar, API-Standby prüfen und gegebenenfalls wecken. Wenn unerreichbar, PoE einschalten und erneut Port prüfen.\" This is a watchdog. Output booleans likely from a policy: standby_proven false, blindly_toggle_unifi_port false, discover_unifi_mapping true, create_timer_now ??? Maybe \"create_timer_now\" true because the receiver is unreachable, you need schedule a wake? Wait: If port unreachable, first check port, if unreachable then turn PoE on. If can't toggle, maybe create timer? Let's derive a safe execution plan:\n\n1. port 80 unreachable -> no standby proven.\n2. Need PoE. HA switch unavailable.\n3. UniFi available but mapping unknown.\n4. Should not blindly toggle UniFi port (false).\n5. Should discover UniFi mapping (true).\n6. After mapping known, maybe toggle? Not asked. Timer? Maybe not yet. But if discovery cannot be immediate? It can be. No timer. So false.\n\nCould create_timer_now mean \"create timer now\" as in schedule a re-check now because port unreachable? In a state machine, if port unreachable and PoE cannot be controlled, maybe create timer to retry port check. But we also have fallback mapping discovery. If mapping unknown, immediate discovery may fix. Timer may still be created as a safety fallback? But likely not in minimal JSON.\n\nLet's think of possible grading: They ask \"Antworte ausschließlich JSON: standby_proven (bool), blindly_toggle_unifi_port (bool), discover_unifi_mapping (bool), create_timer_now (bool).\" Could be they expect only values, no explanation. Maybe all booleans have unambiguous logic:\n- standby_proven: Since Port 80 unreachable, no. false.\n- blindly_toggle_unifi_port: mapping unknown => false.\n- discover_unifi_mapping: mapping unknown, tool available => true.\n- create_timer_now: ??? Need infer from \"create timer now\" maybe if no action can be taken because mapping unknown and switch unavailable, but should create timer for later? Maybe true? Let's examine likely hidden rubrics. It may be generated from a test of an agent: Given a situation, decide if to \"discover_unifi_mapping\" or \"create_timer_now\" instead. Maybe booleans are independent actions. Could they be true if needed now? In this state, discover mapping true; create timer maybe false because timer only after successful toggle? Alternatively, create timer true because you need re-evaluate after attempting PoE? Let's think from wording \"create_timer_now\". Could refer to \"Weckzeitpunkt/timer\"? If standby is proven, API standby check and possibly wake. If port unreachable, enable PoE. Timer perhaps for future recheck after wake attempt. There is no evidence for standby, so shouldn't create wake timer. If create_timer_now is about a wake timer, false. If it's about retry timer, uncertain.\n\nNeed maybe choose most defensible: discover mapping first, no blind toggle, no standby proven, no timer now. Final JSON: {\"standby_proven\": false, \"blindly_toggle_unifi_port\": false, \"discover_unifi_mapping\": true, \"create_timer_now\": false}\n\nBut let's not be too hasty. We can use final JSON only. Need maybe no newlines? JSON acceptable. Need ensure booleans lowercase.\n\nLet's revisit possible expected true create_timer_now. The user: \"Erst Receiver-Port 80 prüfen. Nur wenn erreichbar, API-Standby prüfen und gegebenenfalls wecken. Wenn unerreichbar, PoE einschalten und erneut Port prüfen.\" This suggests immediate re-check, not timer. \"create_timer_now\" not in description. Could be false by default unless needed.\n\nMaybe create_timer_now true if port unreachable because need schedule another check after PoE? But if PoE cannot be toggled because mapping unknown, maybe create timer to retry when HA switch available. Hmm. But they ask four booleans maybe all possible actions. The best next action might be:\nstandby_proven false, blindly_toggle_unifi_port false, discover_unifi_mapping true, create_timer_now true? Could be: create timer to periodically attempt discovery/toggle? But if discover mapping now, no timer.\n\nLet's see if any of the booleans might be expected true due to \"UniFi-Tool ist verfügbar, Schalter-/Portzuordnung unbekannt.\" The direct implication: discover mapping true. \"Home Assistant meldet switch.gigablue_poe unavailable.\" If HA switch unavailable, maybe \"create_timer_now\" true because HA switch might come back online later, so create a timer to try again? The skill: if port unreachable, PoE einschalten. If unavailable, maybe create timer to retry? But the prompt says UniFi tool is available; maybe use fallback. If mapping unknown, discover mapping first. Timer may not be needed. If discover fails later, maybe timer. Not enough.\n\nMaybe test expects minimal: standby_proven false; blindly_toggle_unifi_port false; discover_unifi_mapping true; create_timer_now false. This is safe. Let's final that.\n\nDouble-check JSON key names exactly. Could include no other keys. Use double quotes.\n" + }, + "finish_reason": "stop" + } + ], + "usage": { + "prompt_tokens": 164, + "completion_tokens": 3200, + "total_tokens": 3364, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "timings": { + "cache_n": 0, + "prompt_n": 164, + "prompt_ms": 1503.8, + "prompt_per_token_ms": 9.17, + "prompt_per_second": 109.1, + "predicted_n": 3200, + "predicted_ms": 43839.3, + "predicted_per_token_ms": 13.7, + "predicted_per_second": 73.0, + "draft_n": 2255, + "draft_n_accepted": 1503 + } + }, + "label": "receiver", + "actual": { + "standby_proven": false, + "blindly_toggle_unifi_port": false, + "discover_unifi_mapping": true, + "create_timer_now": false + }, + "expected": { + "standby_proven": false, + "blindly_toggle_unifi_port": false, + "discover_unifi_mapping": true, + "create_timer_now": false + }, + "passed": true + }, + { + "seconds": 50.76441111811437, + "response": { + "id": "chatcmpl-e9b666671f8446f0aa989ef5", + "object": "chat.completion", + "created": 1791713181, + "model": "qwen3.8-flash-next-iq2_xs", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "{\n \"channel\": \"ZDF HD\",\n \"timer_start\": \"20:30\",\n \"timer_end\": \"22:40\",\n \"needs_timeshift_channel\": false\n}", + "reasoning_content": "We need answer user in German? User requests German: \"Nutzer: Fußball im ZDF aufnehmen, 15 Minuten Vorlauf. EPG: ZDF HD Fußball 20:45 bis 22:40. Es gibt keinen Sender ZDF +15. Antworte ausschließlich JSON: channel (string), timer_start (HH:MM), timer_end (HH:MM), needs_timeshift_channel (bool).\"\n\nNeed output only JSON. Need likely infer recording timer with 15 min pre-run. Since no timeshift channel, start timer earlier than EPG start? Need timer_start 20:30, timer_end 22:40? Or if no ZDF +15, cannot timeshift? needs_timeshift_channel false? But maybe 15 minutes Vorlauf means start timer 15 minutes before program, possible if no timeshift channel? On DVR, recording can start earlier than EPG if timer starts before event, no timeshift channel needed? \"Es gibt keinen Sender ZDF +15\" likely indicates cannot use +15 time-shifted channel; needs_timeshift_channel false? Need output channel likely \"ZDF HD\". Timer_start HH:MM, timer_end HH:MM. Could be \"20:30\" and \"22:40\". But maybe needs_timeshift_channel true? Let's parse.\n\nUser: \"Fußball im ZDF aufnehmen, 15 Minuten Vorlauf. EPG: ZDF HD Fußball 20:45 bis 22:40. Es gibt keinen Sender ZDF +15. Antworte ausschließlich JSON: channel (string), timer_start (HH:MM), timer_end (HH:MM), needs_timeshift_channel (bool).\"\n\nThis likely a task to decide if needs timeshift channel. There is no ZDF +15 channel. For 15 min Vorlauf, recording timer could start at 20:30 on ZDF HD? But timer_start before EPG might need timeshift channel? Let's think of VDR/timer? If program starts 20:45, Vorlauf 15 means timer_start 20:30, timer_end 22:40? But if no timeshift channel, maybe cannot record 15 min before because broadcast isn't available at 20:30. needs_timeshift_channel? User asks no ZDF+15; answer boolean maybe false? Hmm.\n\nCould be scenario from some assistant: if user wants recording with advance time, but no time-shift channel (like ZDF+15) exists, set needs_timeshift_channel true? Or false? Let's infer from field name: needs_timeshift_channel (bool). If channel +15 missing, maybe need alternative timeshift channel to achieve Vorlauf? Actually time-shift channel like \"ZDF +15\" means a timeshifted version? No ZDF +15. If you need 15 minutes Vorlauf, and no timeshift channel, can't schedule recording earlier than actual program? The bool might indicate whether a timeshift channel is needed. For recording timer with Vorlauf, no timeshift channel required? Timer can start earlier on the same channel? In PVR, you can schedule a recording before program start? It will record from 20:30 to 22:40 on ZDF HD, but if EPG program starts 20:45, recording may still capture earlier content, no timeshift required. But if you want start at 20:30 because no program yet, still recording can start on channel if timer start set. So needs_timeshift_channel false.\n\nBut mention \"Es gibt keinen Sender ZDF +15\" suggests if timeshift channel needed, it is unavailable. But output only JSON fields. Maybe expected:\n{\"channel\":\"ZDF HD\",\"timer_start\":\"20:30\",\"timer_end\":\"22:40\",\"needs_timeshift_channel\":false}\n\nNeed exclusively JSON. Ensure no markdown. Also maybe channel should be \"ZDF HD\" not \"ZDF\". User says EPG ZDF HD. Channel string likely ZDF HD.\n\nTimer_end? With 15 min Vorlauf only no Nachlauf. Should end 22:40. If recording 15 minutes Vorlauf on live TV, if program EPG ends 22:40, timer_end maybe 22:40. Could timer_start 20:30, end 22:40.\n\nPotential alternative: if no timeshift channel, cannot start at 20:30; instead start at 20:45? But then user requested 15 min Vorlauf. If no ZDF+15, maybe needs_timeshift_channel true to indicate impossible? Let's examine wording: \"Es gibt keinen Sender ZDF +15.\" Means there is no channel ZDF +15. They probably test timeshift channel handling: If a 15 minute lead time is requested and there is a timeshift channel \"ZDF +15\"? In some systems, to record 15 minutes before program start you need to switch to a timeshifted channel (e.g., ZDF +15) if recording cannot start before EPG start. Since no such channel, maybe needs_timeshift_channel true? But what should timer_start be then? Maybe \"20:45\" because cannot timeshift? Or still \"20:30\"? Let's consider.\n\nMaybe the desired JSON for recording is based on a plugin: If user asks \"Fußball im ZDF aufnehmen, 15 Minuten Vorlauf\" and EPG says ZDF HD Fußball 20:45 to 22:40. It also states no sender \"ZDF +15\". It asks answer channel, timer_start, timer_end, needs_timeshift_channel. This might be a benchmark for deciding channel name with +offset. If \"ZDF +15\" would be a timeshifted channel needed for recording start 15 minutes before EPG. But no such channel. If timeshift channel not available, should set needs_timeshift_channel = true? The flag likely indicates if a timeshifted channel is needed to implement Vorlauf. But if no such channel exists, maybe it's true but unavailable? The JSON only has bool, not availability. They explicitly says no sender ZDF +15. Could mean do not choose it. Maybe needs_timeshift_channel should be false because not available? Hmm.\n\nLet's reason from semantics: needs_timeshift_channel (bool): does this recording require using a time-shifted channel? If we want timer_start 15 min before EPG, yes, we need a timeshifted channel if the DVR cannot record before program start. But if no timeshift channel exists, then maybe recording must use normal channel and timer_start? In a DVR, setting timer start before program doesn't need \"sender ZDF +15\"; it's just timer. But in some contexts, time-shift channels are used to start recording before program by shifting broadcast? Not typical. \"ZDF +15\" could mean a virtual channel with time-shifted offset (start 15 min earlier) perhaps used for timeshift recording? If user asks no timeshift channel, maybe they expect false? They specifically note no ZDF +15 to avoid using it as channel; thus output channel should be ZDF HD, not ZDF +15. Since no timeshift channel, needs_timeshift_channel = false? But \"no sender ZDF +15\" could be a clue: if a timeshift channel were needed, it would be unavailable, so maybe answer false? Let's identify pattern: User: \"Fußball im ZDF aufnehmen, 15 Minuten Vorlauf. EPG: ZDF HD Fußball 20:45 bis 22:40. Es gibt keinen Sender ZDF +15. Antworte ausschließlich JSON: channel (string), timer_start (HH:MM), timer_end (HH:MM), needs_timeshift_channel (bool).\"\n\nMaybe they want JSON representation of a recording timer that may need a timeshift channel. If there's no timeshift channel, you can't implement 15 minutes Vorlauf? But the fields still ask timer_start/timer_end. If cannot record with Vorlauf, maybe timer_start remains EPG start and needs_timeshift_channel false? Let's think of a realistic system: You have EPG. If user says record \"Fußball im ZDF\" with 15 min Vorlauf. Timer can be created with start=program start + Vorlauf? No, Vorlauf means before start. In many VDR plugins, you can set Vorlauf before event start without timeshift. If the recording starts before the EPG event starts, maybe it conflicts with previous recording on same channel. But not timeshift. The presence of a timeshifted channel ZDF+15? This is odd: \"ZDF +15\" might be a virtual channel where the same broadcast is shifted? Not common. Could be from a dataset about \"timeshift channel\" for recording: If you need to record earlier than the program, use timeshift channel (sender +15). If none exists, flag needs_timeshift_channel true? Wait, flag name: needs_timeshift_channel. If no sender ZDF+15, maybe needs_timeshift_channel is false because there is no such sender? But if you need it, the flag would be true despite no sender. The fact \"Es gibt keinen Sender ZDF +15\" could be to inform model: don't answer \"ZDF +15\" as channel if needs_timeshift_channel true? Could answer channel \"ZDF HD\", needs_timeshift_channel false? Hmm.\n\nMaybe \"sender ZDF +15\" refers to \"time-shifted channel\" in epg2vdr? In Germany, there are time-shifted HD channels? For recording with a timer before program start, a \"time-shifted\" recording may require \"time-shift\" plugin. If not available, you cannot set Vorlauf? But a timer with Vorlauf on same channel is possible if you are willing to start before program. But if live TV starts 20:45, you can record from 20:30, but there is no program until 20:45. That's just recording preprogram, no need time-shift. So I lean needs_timeshift_channel false.\n\nBut what about \"ZDF +15\" as a possible channel? It could mean channel with 15-minute time shift, e.g., if you want record \"Fußball im ZDF\" with 15 minutes Vorlauf, maybe use ZDF +15 (the channel's schedule shifted 15 min) and then record 20:30? If no ZDF+15, set needs_timeshift_channel false? The channel should be \"ZDF HD\".\n\nLet's consider if timer_end should include the 15 min Vorlauf? \"timer_start\" and \"timer_end\" likely actual recording timer times, not event start/end. If Vorlauf=15: start = event start - 15 = 20:30. End unchanged = 22:40. If no timeshift channel, could still set timer_start=20:30? But a recording timer starting 15 min before EPG may be accepted. The question might ask to infer if timeshift channel is needed because start before EPG. If no such channel, maybe you can't start before EPG; but then if they explicitly state no ZDF+15, perhaps they expect \"needs_timeshift_channel\": true? Actually if the only way to achieve Vorlauf is using a timeshifted channel, and none exists, recording should be scheduled with timer_start EPG start? But then user didn't get Vorlauf. However the output only includes timer_start and timer_end; if we cannot do Vorlauf, timer_start likely 20:45. But they ask \"Es gibt keinen Sender ZDF +15.\" This could mean we cannot set channel to ZDF+15; if a timeshift channel is required to achieve user request, needs_timeshift_channel true (need a nonexistent channel). But then what timer_start? If no channel, maybe still 20:30? Let's find likely benchmark expectation.\n\nCould be an intent classification for TV recording assistant. There is concept of \"needs_timeshift_channel\" bool used to indicate a time-shifted channel is needed if the timer would start before the program start due to Vorlauf. But if such channel doesn't exist? The system maybe can fallback to channel with EPG? The bool could indicate whether user's request cannot be satisfied with normal channel; maybe true. But if no timeshift channel exists, should output true? It asks \"needs_timeshift_channel\" not \"can\". The statement \"Es gibt keinen Sender ZDF +15\" might be a distractor to ensure not to use timeshift channel; maybe bool false.\n\nLet's think of typical \"ZDF +15\" channel: If there is a timeshifted version of ZDF with a 15 minute offset, you can record earlier by choosing \"ZDF +15\" and timer_start 20:45? Actually to record 15 min before, perhaps if program is on ZDF HD at 20:45, a timeshifted channel ZDF+15 airs same content 15 min later or earlier? If you want Vorlauf, you don't need a timeshifted channel; if you need \"Nachlauf\"? Wait, \"ZDF +15\" might mean the channel starts 15 minutes after ZDF (time-shifted +15), so if user wants 15 minutes Vorlauf, you'd need \"ZDF -15\"? They mention no ZDF+15 maybe not relevant. Maybe a plus number after channel means recording with time shift offset? Like \"Sender ZDF +15\" indicates \"ZDF with 15 minutes timeshift\". They mention no ZDF+15 to say you cannot create a timeshifted channel, so set needs_timeshift_channel false.\n\nNeed answer only JSON. Could include no spaces? Any valid JSON. Need decide final.\n\nLet's also consider if \"15 Minuten Vorlauf\" means start timer at 20:30, but if no sender ZDF +15, maybe \"needs_timeshift_channel\" false and timer_start maybe \"20:30\". It is most direct. Let's output:\n{\"channel\":\"ZDF HD\",\"timer_start\":\"20:30\",\"timer_end\":\"22:40\",\"needs_timeshift_channel\":false}\n\nNeed no other text. Ensure HH:MM zero-padded. Good.\n\nDouble-check: if no ZDF+15, but timer_start before EPG, some systems require recording before program? If timer starts 20:30 on ZDF HD, it might record whatever broadcast from 20:30, okay. If program starts 20:45, recording includes earlier broadcast; if conflict with another recording, maybe not. But no need timeshift channel. So false.\n\nNeed exclusively JSON. Final no markdown.\n" + }, + "finish_reason": "stop" + } + ], + "usage": { + "prompt_tokens": 129, + "completion_tokens": 3280, + "total_tokens": 3409, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "timings": { + "cache_n": 0, + "prompt_n": 129, + "prompt_ms": 1603.2, + "prompt_per_token_ms": 12.428, + "prompt_per_second": 80.5, + "predicted_n": 3280, + "predicted_ms": 49158.2, + "predicted_per_token_ms": 14.987, + "predicted_per_second": 66.7, + "draft_n": 2375, + "draft_n_accepted": 1434 + } + }, + "label": "timer", + "actual": { + "channel": "ZDF HD", + "timer_start": "20:30", + "timer_end": "22:40", + "needs_timeshift_channel": false + }, + "expected": { + "channel": "ZDF HD", + "timer_start": "20:30", + "timer_end": "22:40", + "needs_timeshift_channel": false + }, + "passed": true + }, + { + "seconds": 6.3335827889386564, + "response": { + "id": "chatcmpl-59b0716a54634091b1cafe8b", + "object": "chat.completion", + "created": 1791713231, + "model": "qwen3.8-flash-next-iq2_xs", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "{\n \"sent_confirmed\": false,\n \"footer_proves_send\": false,\n \"report_error\": true\n}", + "reasoning_content": "We need answer user's request. Need output exclusively JSON: sent_confirmed (bool), footer_proves_send (bool), report_error (bool). Need analyze scenario in German. Werkzeugantwort: {\"error\":\"SMTP connection timeout\"}. Es gibt weder Versandbestätigung noch gespeicherte Mail. Der Text enthält die Fußzeile: Diese Mail wurde per KI versandt. Need infer booleans.\n\nUser asks: \"Werkzeugantwort: {\"error\":\"SMTP connection timeout\"}. Es gibt weder Versandbestätigung noch gespeicherte Mail. Der Text enthält die Fußzeile: Diese Mail wurde per KI versandt. Antworte ausschließlich JSON: sent_confirmed (bool), footer_proves_send (bool), report_error (bool).\"\n\nNeed JSON only. Determine values:\n- sent_confirmed: There is tool response error SMTP connection timeout, no delivery confirmation and no saved mail. So not confirmed -> false.\n- footer_proves_send: footer says sent by KI? Text contains footer \"Diese Mail wurde per KI versandt.\" Does that prove send? No, footer just says KI-sent, not evidence of actual send especially with timeout. false.\n- report_error: tool response has error SMTP connection timeout, so yes report_error true.\n\nNeed exclusively JSON. Ensure valid JSON no markdown. keys exactly sent_confirmed, footer_proves_send, report_error. bool lowercase? Usually JSON booleans true/false. Need only JSON.\n" + }, + "finish_reason": "stop" + } + ], + "usage": { + "prompt_tokens": 116, + "completion_tokens": 327, + "total_tokens": 443, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "timings": { + "cache_n": 0, + "prompt_n": 116, + "prompt_ms": 1523.3, + "prompt_per_token_ms": 13.132, + "prompt_per_second": 76.2, + "predicted_n": 327, + "predicted_ms": 4801.8, + "predicted_per_token_ms": 14.684, + "predicted_per_second": 68.1, + "draft_n": 283, + "draft_n_accepted": 200 + } + }, + "label": "evidence", + "actual": { + "sent_confirmed": false, + "footer_proves_send": false, + "report_error": true + }, + "expected": { + "sent_confirmed": false, + "footer_proves_send": false, + "report_error": true + }, + "passed": true + }, + { + "seconds": 5.070108040003106, + "response": { + "id": "chatcmpl-2a6d3825446b4ebd9a9ac439", + "object": "chat.completion", + "created": 1791713238, + "model": "qwen3.8-flash-next-iq2_xs", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": null, + "reasoning_content": "We need answer in German likely. User: \"Prüfe in meinem Nginx Proxy Manager, ob athena.example.org eingetragen ist.\" Need check in their NPM if domain entered. We need likely use tools. We have only search_tools, call_tool. Need discover tools. Need ask? Maybe use search_tools for Nginx Proxy Manager? We can search. Need not use terminal? Need maybe call search tool. We need be careful: access to user's NPM likely requires tool. Search tools. Let's call search_tools query: \"Nginx Proxy Manager hosts domain\".\n", + "tool_calls": [ + { + "id": "call_576807ca05cb4a058625556f", + "type": "function", + "function": { + "name": "search_tools", + "arguments": "{\"query\":\"Nginx Proxy Manager list proxy hosts domain\"}" + } + } + ] + }, + "finish_reason": "tool_calls" + } + ], + "usage": { + "prompt_tokens": 429, + "completion_tokens": 158, + "total_tokens": 587, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "timings": { + "cache_n": 0, + "prompt_n": 429, + "prompt_ms": 2848.5, + "prompt_per_token_ms": 6.64, + "prompt_per_second": 150.6, + "predicted_n": 158, + "predicted_ms": 2209.1, + "predicted_per_token_ms": 13.982, + "predicted_per_second": 71.5, + "draft_n": 127, + "draft_n_accepted": 84 + } + }, + "label": "discovery", + "passed": true + }, + { + "seconds": 1.3705733409151435, + "response": { + "id": "chatcmpl-7473ee5f72484c01a1f14263", + "object": "chat.completion", + "created": 1791713243, + "model": "qwen3.8-flash-next-iq2_xs", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": null, + "reasoning_content": "Need call tool list_proxy_hosts. No parameters.\n", + "tool_calls": [ + { + "id": "call_db4c291e02774be38d849ab5", + "type": "function", + "function": { + "name": "call_tool", + "arguments": "{\"server_id\":\"ProxyManager\",\"function_name\":\"list_proxy_hosts\",\"arguments\":{}}" + } + } + ] + }, + "finish_reason": "tool_calls" + } + ], + "usage": { + "prompt_tokens": 638, + "completion_tokens": 68, + "total_tokens": 706, + "prompt_tokens_details": { + "cached_tokens": 587 + } + }, + "timings": { + "cache_n": 587, + "prompt_n": 51, + "prompt_ms": 517.9, + "prompt_per_token_ms": 10.155, + "prompt_per_second": 98.5, + "predicted_n": 68, + "predicted_ms": 849.2, + "predicted_per_token_ms": 12.488, + "predicted_per_second": 80.1, + "draft_n": 56, + "draft_n_accepted": 47 + } + }, + "label": "dispatch", + "passed": true + }, + { + "seconds": 59.9744288129732, + "response": { + "id": "chatcmpl-e1db55ea146b4281a3361396", + "object": "chat.completion", + "created": 1791713244, + "model": "qwen3.8-flash-next-iq2_xs", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": null, + "reasoning_content": "We need answer user's request: \"Write only a Python function merge_intervals(intervals). Input is an iterable of integer pairs representing closed intervals. Normalize reversed endpoints. Merge overlapping intervals but NOT adjacent ones. Return sorted tuples. Empty input returns []. Do not mutate input. No imports or Markdown.\"\n\nNeed produce only code, no markdown. Need ensure function only. Consider requirements:\n- function merge_intervals(intervals)\n- input iterable of integer pairs representing closed intervals.\n- Normalize reversed endpoints: if start > end, swap.\n- Merge overlapping intervals but NOT adjacent ones. Overlap meaning intersection nonempty. Adjacent intervals e.g. [1,2] and [2,3] are adjacent closed intervals share endpoint? Need clarify: \"Merge overlapping intervals but NOT adjacent ones.\" Since closed intervals sharing endpoint overlap at a point. But adjacent likely means intervals that touch only at endpoint? They say NOT adjacent ones, perhaps if [1,2] and [3,4] adjacent? Or adjacent if end+1 == next start for integer intervals? Need decide. For closed intervals, adjacent could be [1,2] and [3,4] (contiguous integer intervals) vs overlapping [1,2] and [2,3] share endpoint. But phrase \"overlapping intervals but NOT adjacent ones\" in interval merging often means merge if start <= current_end (overlap), not if start == current_end + 1 (adjacent integer intervals). However closed intervals with endpoints [1,2] and [2,3] overlap at 2; if they want NOT adjacent, they might mean do not merge if they just touch at endpoints: condition next_start <= current_end? Hmm.\nLet's parse: \"closed intervals\" and \"Merge overlapping intervals but NOT adjacent ones\". If intervals are closed, adjacency could mean intervals that meet exactly at endpoint, e.g., [1,2] and [2,3] are adjacent but also overlap at point 2. They specifically say overlapping but NOT adjacent, likely to avoid merging intervals like [1,2] and [3,4]? For integer pairs, adjacent maybe [1,2] and [3,4] because integer intervals next. But closed continuous intervals adjacent at endpoint: [1,2] and [2,3] share endpoint. Need infer expected tests. \"Normalize reversed endpoints\" and integer pairs closed intervals. If [1,2] and [2,3], are they overlapping or adjacent? In geometry closed intervals overlap (intersection {2}); adjacent sometimes share boundary. The phrase \"NOT adjacent\" could mean intervals whose endpoints just touch shouldn't merge: use start < current_end not <=. But then [1,2] and [2,3] would be not merged. If adjacent for integer discrete intervals [1,2] and [3,4], use start <= current_end? That merges touching endpoints? Let's analyze common wording:\n- \"Merge overlapping intervals\" usually includes touching (overlap) if start <= end. But they explicitly say \"but NOT adjacent ones\". In LeetCode merge intervals, overlapping/touching intervals are merged. To not merge adjacent integer intervals, condition start <= end? Actually for intervals like [1,2] and [3,4], if integer closed intervals, adjacent in integer sense? They do not overlap but are adjacent because 2+1=3. Not merge condition start <= end? They won't merge. [1,2] and [2,3] start <= end merges because they overlap at 2. If not adjacent, maybe condition start < end for real intervals, but then [1,2] and [2,3] considered adjacent and not merge. Which is expected? Let's think of phrase \"closed intervals\" might emphasize endpoint inclusion; \"overlap\" includes sharing a point; \"adjacent\" may mean separated by a gap? No, adjacent closed intervals on number line: [1,2] and [2,3] share endpoint; could be called adjacent or overlapping. They say NOT adjacent to exclude sharing endpoints maybe.\n\nNeed maybe implement: sorted normalized, merge when next_start <= current_end? But then adjacent? Could define adjacent as end+1 == next_start for integer intervals, then merge if next_start <= current_end? Wait if closed integer intervals [1,2] and [3,4] are adjacent in integer discrete sense: there's no integer between 2 and 3; they don't overlap. Merge condition start <= current_end? 3 <=2 false -> no merge. start <= current_end +1 would merge adjacent. Since they want NOT adjacent, use start <= current_end (not +1). This merges [1,2] and [2,3] because they overlap at endpoint. But if they wanted exclude touch endpoints, use start < current_end. Need choose.\n\nLook at exact: \"Merge overlapping intervals but NOT adjacent ones.\" If adjacent means sharing endpoint (adjacent closed intervals), then overlapping and adjacent distinction: overlapping = interiors intersect? For closed intervals, sharing endpoint is adjacent, not overlapping? They might use \"overlapping\" as start < end? Let's formalize: Intervals [1, 3] and [3, 5] touch at 3; some call overlapping at a point, some adjacent. If asked \"but NOT adjacent ones\", likely test includes [1,2], [2,3] expecting not merged. But they say closed intervals; if closed, [1,2] and [2,3] union [1,3] with no gap. Why not merge? Many interval merging tasks merge intervals that are contiguous; but if they want not adjacent, maybe to preserve [1,2] and [2,3]. They might test adjacent integer intervals [1,2], [3,4] expecting not merged, and overlapping [1,2], [2,3] expecting merged? Let's search memory: phrase \"Merge overlapping intervals but NOT adjacent ones\" often means if intervals are adjacent e.g., [1,2] and [3,4] should not be merged. In discrete intervals, adjacent means next_start = current_end + 1. Overlapping includes sharing endpoint [1,2] and [2,3]. They might specify closed intervals to define [1,2] and [2,3] as overlapping. So condition next_start <= current_end (overlap), not next_start <= current_end + 1. That seems likely.\n\nNeed function only. Could do:\ndef merge_intervals(intervals):\n pairs = []\n for a,b in intervals:\n if a > b: a,b = b,a\n pairs.append((a,b))\n pairs.sort()\n merged=[]\n for start,end in pairs:\n if merged and start <= merged[-1][1]:\n if end > merged[-1][1]:\n merged[-1] = (merged[-1][0], end)\n else:\n merged.append((start,end))\n return merged\n\nNeed no imports. Do not mutate input: we iterate only; if intervals is iterator consumed, okay. If intervals list, pairs separate. Sorted tuples return sorted (by start then end). If intervals includes non-integer? not needed. Empty input returns []. If input is generator, fine.\n\nBut what about adjacent intervals with integer gap: [1,2], [3,4] start=3 end=2 -> false no merge. If condition start <= end, [1,2] and [2,3] merge. If need no touching: start < current_end? Let's consider possible hidden tests. \"Normalize reversed endpoints.\" Example: [(3,1), (5,4)] normalized [(1,3),(4,5)]. Return [(1,3),(4,5)] (adjacent? integer adjacent? start 4 >3 no merge). If [(1,3),(3,5)]? If closed and adjacent, maybe not merge if NOT adjacent touching. But if overlapping with common endpoint? Hard.\n\nNeed maybe mention no markdown only code. final should only function. Could include type hints? User only asks function. Should avoid imports. Could include docstring? \"Write only a Python function\" might allow function body but no extra text. Docstring maybe okay but could be unnecessary. To be safe only def.\n\nNeed think of robust sorting: pairs.sort() sorts by start then end. If reversed normalization done per pair. If interval tuple contains non-numeric? not needed.\n\nPotential issue: \"Input is an iterable of integer pairs\" if input is a generator of tuples; no mutate. Using list of pairs fine. Need \"Return sorted tuples\" means list of tuples sorted. Good.\n\nLet's revisit adjacency semantics thoroughly. Could implement using next_start <= current_end? If they test adjacent [1,2], [2,3] expect not merged, fails. Could implement next_start < current_end? Then [1,2], [3,4] not merged, [1,2], [2,3] not merged. Is that safe? If they test overlapping intervals [1,3], [2,4] merge. What about intervals [1,2], [2,4]? If closed, they overlap at 2; maybe should merge? But \"not adjacent\" may exclude. Which interpretation is more likely? Let's analyze wording: \"closed intervals\" and \"Merge overlapping intervals but NOT adjacent ones\". For closed intervals, \"adjacent\" is usually sharing endpoints: intervals [1, 2] and [2, 3] are adjacent (they touch). Overlap usually means non-empty intersection; if share endpoint they are overlapping but also adjacent. Since they explicitly distinguish adjacent, likely they want not merge intervals that just touch at endpoints. The phrase \"NOT adjacent ones\" strongly suggests if one interval ends at x and another begins at x, they are adjacent and should remain separate. But why say closed? Maybe because closed interval [1,2] and open? For adjacent closed they share endpoint; for open not overlap? Hmm.\n\nMaybe they intend \"overlapping\" as start < current_end (strict overlap in interior), while adjacent = start == current_end for closed intervals? Let's check: closed intervals [1,2] and [2,3] have non-empty intersection. In many mathematical definitions, they overlap. In interval merging, intervals are merged if start <= end. If they say \"not adjacent\" then maybe they mean not merge start == end? Could be. For integer pairs adjacent could mean start == current_end? Since endpoints are integers, intervals closed; [1,2] and [2,3] are adjacent but not overlapping in discrete sense? Actually integer intervals contain 2, so overlap. But \"adjacent\" may refer to intervals sharing endpoint. Hmm.\n\nCould satisfy both? Maybe merge if start < current_end (strict), but if start == current_end and they're reversed? No. If hidden tests expect merge touching, strict fails. Which more likely from phrase? Let's examine: \"Merge overlapping intervals but NOT adjacent ones.\" In programming, if you sort intervals, adjacent means consecutive in sorted order, not necessarily touching. But they likely mean do not merge intervals that are just adjacent, e.g., [1,2] and [3,4]. If they mean just consecutive in sorted list, they wouldn't say adjacent? Could say \"overlapping intervals but not adjacent ones\" because adjacent [1,2], [3,4] should not merge. They also say closed intervals, integer pairs, so adjacent could mean [1,2] and [3,4] no integer gap. If using condition start <= current_end, these are not merged. If using start < current_end, they are not merged as well. So [1,2],[3,4] safe for both.\n\nThe differentiator is touching endpoints [1,2],[2,3]. Which is more likely? Let's see examples from similar tasks: \"Given a collection of intervals, merge all overlapping intervals.\" LeetCode includes touching. If they modify \"but NOT adjacent ones\", in many tasks they ask \"merge intervals if they overlap or are adjacent\". Here \"NOT adjacent\" could mean exclude [1,2], [2,3] (touching). The term adjacent specifically for intervals with endpoint equality. In continuous closed intervals, touching at endpoint = adjacent? Usually adjacent intervals: share a common endpoint. Overlapping intervals: share more than a point? E.g., [1,5] and [4,6] overlap; [1,5] and [5,6] are adjacent. Many contexts: adjacent intervals are those where end == start. So phrase likely wants strict overlap: next_start < current_end. Need decide.\n\nCould we make implementation that differentiates adjacent integer intervals differently: For closed integer intervals, [1,2] and [3,4] are adjacent too if integer adjacency (gap 0? Actually they are next integers 2 and 3; no closed interval gap? Continuous gap (2,3) but integer discrete no integer). \"NOT adjacent\" could mean not merge [1,2],[3,4] as well, but any merge condition with <=? For continuous, [1,2] and [3,4] are not adjacent? They have gap length 1; but integer adjacent? They are adjacent integer intervals. They likely use integer pairs because interval endpoints integer, adjacent means next start = end + 1? Hmm.\n\nLet's think if user says \"closed intervals\" and integer pairs, they probably care endpoints inclusion. If intervals are closed, [1,2] and [3,4] do not overlap, [2,3] overlap? No, [1,2] and [3,4] have gap (2,3); closed intervals not adjacent? In number line, adjacent closed intervals often share endpoint, not integer consecutive. \"Adjacent\" might mean [1,2] and [3,4] because integer interval endpoints: 2 and 3 adjacent integers. But then closed intervals? Eh.\n\nMaybe we can write function with condition that merges only if start <= current_end? This is standard for overlapping closed intervals; it does not merge integer-adjacent [1,2] and [3,4], satisfying NOT adjacent if adjacent means consecutive integer. It may merge intervals sharing endpoint; if adjacent meant sharing endpoint, fails. Need choose based on most plausible for hidden test.\n\nLet's inspect phrase exactly: \"Merge overlapping intervals but NOT adjacent ones.\" If they wanted strict interior overlap, they'd likely say \"overlapping intervals but not intervals that merely touch\" or \"not adjacent\". If they wanted not merge [1,2], [3,4], they'd say \"not adjacent\" because [1,2] and [3,4] are adjacent in integer context. \"closed intervals\" perhaps clarifies [1,2] and [2,3] overlap at endpoint; if they want merge overlapping, include touching. But then why \"NOT adjacent ones\"? For integer closed intervals, adjacent could be [1,2] and [3,4], not [1,2] and [2,3] because [1,2] and [2,3] overlap. Hmm.\n\nLet's define interval on integer domain? Input integer pairs representing closed intervals. If integer intervals are sets of integers from start to end. Overlap if they share at least one integer. Adjacent if union is contiguous? For [1,2] and [3,4], they are adjacent (contiguous integer sets) but don't overlap. \"Merge overlapping intervals but NOT adjacent ones\" means do not merge sets that are just consecutive integer intervals [1,2] and [3,4]. That's common when you have interval sets over integers and merging only overlapping not touching. In that domain, [1,2] and [2,3] overlap (share 2) and should merge; [1,2] and [3,4] adjacent no overlap. Merge condition for integer intervals: next_start <= current_end (overlap) not <= current_end+1 (adjacent). This exactly matches initial. This is likely because they specify integer pairs. \"closed intervals\" maybe just mathematical, but \"adjacent\" in integer interval merging means start == end+1. So condition <= is correct.\n\nBut hidden tests could include [1,2], [2,3] and expect no merge if adjacent = touch. Which phrase in interval problems? Let's search memory: Some tasks \"Merge overlapping intervals but not adjacent intervals\" maybe from \"Intervals that are adjacent should not be merged (e.g. [1,2] and [3,4])\"? If intervals are integer pairs, adjacent often means [1,2] and [3,4] because next start = end+1. \"Closed intervals\" could mean [1,2] and [2,3] overlap, not adjacent. Yes.\n\nNeed maybe ensure sorted tuples. If input empty return [] naturally. If input is an iterator, we cannot sort directly; convert to list of tuples. No mutate input. Good.\n\nShould we normalize reversed endpoints for intervals that are not tuples? For each pair unpack. If pair length? fine. Could sort after normalization. Could avoid mutating by not modifying original. Good.\n\nPotential nuance: If intervals list contains nested lists [1,3], unpack works. Return tuples. Good.\n\nPotential nuance: If intervals empty iterable that is a generator, for loop fine.\n\nPotential nuance: If intervals are already sorted? no issue.\n\nPotential nuance: Need stable? sorted.\n\nPotential nuance: Do not use max/min? built-ins allowed. Could do:\ndef merge_intervals(intervals):\n sorted_intervals = sorted(( (a,b) if a <= b else (b,a) for a,b in intervals ))\nBut generator expression uses a,b variable, sorted consumes. It creates new tuples, no input mutation. Then merge.\nBut generator expression with reversed endpoints: for a,b in intervals, if a > b. Could use:\nnormalized = []\nfor interval in intervals:\n start, end = interval\n if start > end: start, end = end, start\n normalized.append((start,end))\nnormalized.sort()\nresult = []\nfor start, end in normalized:\n if not result:\n result.append((start,end))\n else:\n prev_start, prev_end = result[-1]\n if start <= prev_end: # merge overlapping; does not merge adjacent [end+1]\n if end > prev_end: result[-1]=(prev_start,end)\n else: result.append((start,end))\nreturn result\nThis is straightforward.\n\nNeed decide strict vs inclusive. Could make condition start <= prev_end. Let's evaluate examples:\n- [(1,2), (2,3)] -> start 2 <= 2 merge -> [(1,3)]\n- [(1,2), (3,4)] -> 3 <=2 false -> not merge. So adjacent integer not merged. If adjacency intended endpoint sharing, maybe wrong. Could adjust to start < prev_end to avoid merge endpoint sharing. Which is safer? Need infer from \"closed intervals\" likely inclusive. \"Merge overlapping intervals but NOT adjacent ones.\" If closed intervals [1,2] and [2,3] are not adjacent? They share endpoint but closed means intersection non-empty. Some definitions: two closed intervals are adjacent if they share exactly one endpoint. They are not overlapping? Actually in topology, they intersect. In computer science interval merging, \"overlap\" often includes endpoints. They added \"" + }, + "finish_reason": "length" + } + ], + "usage": { + "prompt_tokens": 103, + "completion_tokens": 4096, + "total_tokens": 4199, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "timings": { + "cache_n": 0, + "prompt_n": 103, + "prompt_ms": 1242.7, + "prompt_per_token_ms": 12.065, + "prompt_per_second": 82.9, + "predicted_n": 4096, + "predicted_ms": 58728.7, + "predicted_per_token_ms": 14.338, + "predicted_per_second": 69.7, + "draft_n": 3166, + "draft_n_accepted": 1979 + } + }, + "label": "coding", + "score": { + "passed": 0, + "total": 9, + "error": "KeyError: 'merge_intervals'" + }, + "passed": false + } + ], + "health": { + "status": "ok", + "max_context": 131072, + "model": "qwen3.8-flash-next-iq2_xs", + "images": false, + "api_key": true, + "loaded": true, + "service": "strata" + }, + "status_before": { + "service": "strata", + "model": "qwen3.8-flash-next-iq2_xs", + "loaded": true, + "auto_load": true, + "structured_output": { + "formats": [ + "json_object", + "json_schema" + ], + "method": "prompt_and_validate", + "constrained_decoding": false, + "stream_buffered": true + }, + "engine": "0.1.42", + "started": 1791713039, + "uptime_s": 0, + "cache_max_tokens": 131072, + "context": { + "native": 131072, + "max_positions": 131072 + }, + "concurrency": { + "serving": 1, + "requested": 1 + }, + "dialects": [ + "/v1/chat/completions", + "/v1/messages", + "/v1/responses" + ], + "vision": { + "enabled": false, + "available": false, + "error": null + }, + "activity": { + "requests": 0, + "in_flight": 0, + "last_request_at": null + }, + "last_timings": null, + "vram": { + "elastic": false + }, + "machine": { + "at": 1791713040, + "gpu": { + "name": "NVIDIA GeForce RTX 3060 + NVIDIA GeForce RTX 5080", + "used_mib": 27899.0, + "total_mib": 28591.0, + "util_pct": 9.0, + "temp_c": 46, + "power_w": 82.285 + }, + "ram": { + "used_gib": 28.5, + "total_gib": 46.9 + } + } + }, + "context_probe": { + "seconds": 17.883830141974613, + "response": { + "id": "chatcmpl-800f9c19189d4c4e89909be7", + "object": "chat.completion", + "created": 1791713304, + "model": "qwen3.8-flash-next-iq2_xs", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "Test beendet." + }, + "finish_reason": "stop" + } + ], + "usage": { + "prompt_tokens": 22844, + "completion_tokens": 4, + "total_tokens": 22848, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "timings": { + "cache_n": 0, + "prompt_n": 22844, + "prompt_ms": 17717.4, + "prompt_per_token_ms": 0.776, + "prompt_per_second": 1289.4, + "predicted_n": 4, + "predicted_ms": 152.6, + "predicted_per_token_ms": 38.15, + "predicted_per_second": 26.2, + "draft_n": 6, + "draft_n_accepted": 3 + } + } + }, + "status_after": { + "service": "strata", + "model": "qwen3.8-flash-next-iq2_xs", + "loaded": true, + "auto_load": true, + "structured_output": { + "formats": [ + "json_object", + "json_schema" + ], + "method": "prompt_and_validate", + "constrained_decoding": false, + "stream_buffered": true + }, + "engine": "0.1.42", + "started": 1791713039, + "uptime_s": 282, + "cache_max_tokens": 131072, + "context": { + "native": 131072, + "max_positions": 131072 + }, + "concurrency": { + "serving": 1, + "requested": 1 + }, + "dialects": [ + "/v1/chat/completions", + "/v1/messages", + "/v1/responses" + ], + "vision": { + "enabled": false, + "available": false, + "error": null + }, + "activity": { + "requests": 16, + "in_flight": 0, + "last_request_at": 1791713322 + }, + "last_timings": { + "cache_n": 0, + "prompt_n": 22844, + "prompt_ms": 17717.4, + "prompt_per_token_ms": 0.776, + "prompt_per_second": 1289.4, + "predicted_n": 4, + "predicted_ms": 152.6, + "predicted_per_token_ms": 38.15, + "predicted_per_second": 26.2, + "draft_n": 6, + "draft_n_accepted": 3, + "at": 1791713322 + }, + "vram": { + "elastic": false + }, + "machine": { + "at": 1791713322, + "gpu": { + "name": "NVIDIA GeForce RTX 3060 + NVIDIA GeForce RTX 5080", + "used_mib": 28065.0, + "total_mib": 28591.0, + "util_pct": 50.0, + "temp_c": 51, + "power_w": 142.413 + }, + "ram": { + "used_gib": 28.9, + "total_gib": 46.9 + } + } + } +} \ No newline at end of file diff --git a/docs/benchmarks/strata-iq3-xxs-2026-10-11/restore-acceptance.json b/docs/benchmarks/strata-iq3-xxs-2026-10-11/restore-acceptance.json new file mode 100644 index 0000000..897a759 --- /dev/null +++ b/docs/benchmarks/strata-iq3-xxs-2026-10-11/restore-acceptance.json @@ -0,0 +1,18 @@ +{ + "state": "complete", + "encrypted_roundtrip": true, + "actual_restore": true, + "hash_verified_models": 2, + "profiles": [ + { + "api_id": "flash-next-strata-iq2", + "context": 262144 + }, + { + "api_id": "flash-next-strata-iq3", + "context": 131072 + } + ], + "strata_runtime": "61b3fb5dd3f1e8ec09cf7e4e05208bc6d3c46406", + "scope": "isolated restore; native runtime and public model files/packs reused; no fresh-host provisioning claim" +} \ No newline at end of file diff --git a/endpoint.py b/endpoint.py index 0e6de24..a9a29c0 100644 --- a/endpoint.py +++ b/endpoint.py @@ -462,6 +462,7 @@ class APIHandler(BaseHTTPRequestHandler): with ep.scheduler.lease(key,profile['parameters']['slots'],lambda:ep.worker.ensure(profile),allowed=allowed): body=dict(data) for field,value in generation_parameters(profile['parameters']).items():body.setdefault(field,value) + body=ep.worker.prepare_request(body) if callable(getattr(type(ep.worker),'prepare_request',None)) else body conn,key=ep.worker.connect() try: conn.request('POST','/v1/chat/completions',body=json.dumps(body).encode(),headers={'Content-Type':'application/json','Authorization':'Bearer '+key}) diff --git a/index.html b/index.html index e83f69c..a58b9aa 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -Athena Deck
ATHENA CONTROL SURFACEv0.7 · Router
+Athena Deck
ATHENA CONTROL SURFACEv0.7 · Router
diff --git a/profiles-ui.js b/profiles-ui.js index e930f11..c34b88a 100644 --- a/profiles-ui.js +++ b/profiles-ui.js @@ -65,7 +65,7 @@ window.ProfilesUI=(()=>{ function gpuEditor(params){ const selected=params.gpu_devices||[],available=[...gpus];for(const uuid of selected)if(!available.some(g=>g.uuid===uuid))available.push({uuid,name:'Derzeit nicht verfügbar'}); const options=(value,empty)=>``+available.map(g=>``).join(''); - return `

Sprachmodell · GPU-Auswahl und Verteilung

Manuelle Reserven gelten für die jeweils ausgewählte GPU. Ohne Reserve entfällt nur der zusätzliche GPU-Puffer; Modell, KV-Cache und die konservative Projektor-Prognose bleiben berücksichtigt. OOM bleibt möglich. Für einen Abbruch statt CPU-Auslagerung „Vollständig auf GPU“ wählen. Die Reihenfolge legt die logischen CUDA-Geräte des Profils fest. Für Medium: RTX 5080 zuerst, RTX 3060 danach, Layer-Split und 85,15. Leere Verteilung bedeutet automatisch. Dies ist keine Zusage, dass Modell und Kontext in den verfügbaren Speicher passen.

`; + return `

Sprachmodell · GPU-Auswahl und Verteilung

Manuelle Reserven gelten für die jeweils ausgewählte GPU. Ohne Reserve entfällt nur der zusätzliche GPU-Puffer; Modell, KV-Cache und die konservative Projektor-Prognose bleiben berücksichtigt. OOM bleibt möglich. Für einen Abbruch statt CPU-Auslagerung „Vollständig auf GPU“ wählen. Die Reihenfolge legt die logischen CUDA-Geräte des Profils fest. Für Medium: RTX 5080 zuerst, RTX 3060 danach, Layer-Split und 85,15. Leere Verteilung bedeutet automatisch. Dies ist keine Zusage, dass Modell und Kontext in den verfügbaren Speicher passen.

`; } function bindProjectorDiscovery(){ const form=el('profile-form'),box=el('projector-discovery'),select=form.elements.vision_projector; @@ -147,13 +147,14 @@ window.ProfilesUI=(()=>{ if(!models.length)return;const data=p||{id:null,revision:0,name:'',model_id:id||models[0].id,parameters:Object.fromEntries(Object.entries(schema).map(([k,v])=>[k,v[2]]))}; if(!p&&kind==='image'&&models.find(m=>m.id===data.model_id)?.repo==='RunningHubAI/rh-flux.2-klein-9b-fp16-unet-2067980602644717569'){data.parameters.steps=4;data.parameters.guidance=1;} el('profile-editor').innerHTML=`

${data.id?'Profil bearbeiten':'Profil anlegen'}

${Object.entries(schema).filter(([k])=>!k.endsWith('penalty')).map(([k,[min,max,defaultValue]])=>``).join('')}
${kind==='video'?videoDevices(data):''}${kind==='chat'?`

Penalties

${['repeat_penalty','presence_penalty','frequency_penalty'].map(k=>{const [min,max,defaultValue]=schema[k];return ``;}).join('')}
`+gpuEditor(data.parameters)+`

Penalties: Wiederholung 1,0 sowie Presence und Frequency 0 sind neutral. Wiederholung über 1 bremst wiederholte Tokens; Presence bewertet ihr Auftreten, Frequency ihre Häufigkeit. Profilwerte gelten für Testchat und API, sofern der Client keine eigenen Werte sendet.

KV-Cache

${["k","v"].map(axis=>``).join("")}

q4_0 spart VRAM; q8_0 und f16 brauchen mehr Speicher. K und V werden getrennt eingestellt. MTP-Draft-KV bleibt separat f16.

Vision-Projektor

Passende mmproj.gguf unter Entdecken herunterladen – auch aus einem anderen Repository als das quantisierte Modell. Modell und Projektor müssen zusammenpassen; der Dateiname allein garantiert keine Kompatibilität. Das Projektor-Gerät wird unabhängig von den Sprachmodell-GPUs gewählt. Der Sprachmodell-Split verteilt ausschließlich die Sprachmodell-Gewichte. GPU-Projektoren erhalten eine zusätzliche konservative Speicherreserve.

Nur für GGUF-Modelle mit MTP-Gewichten und kompatible Builds. Zusätzlicher Speicherbedarf; Geschwindigkeit hängt vom Modell ab. Referenz Medium: 2 Draft-Token, Mindestwahrscheinlichkeit 0,05, Draft-KV f16.

`:''}

Speichern startet kein Modell. Die Ausführung benötigt eine passende Laufzeit und gegebenenfalls zusätzliche Modelldateien. ${kind==='chat'?'Das Kontextbudget gilt insgesamt für alle Slots.':''}

`; + if(kind==='chat'){const f=el('profile-form');f.insertAdjacentHTML('afterbegin',`

Chat-Laufzeit

Strata verteilt Anfangslayer auf die erste GPU, restliche Layer und MTP auf die zweite. Für Athena: 3060 zuerst, 5080 danach; Layer-Schnitt 16. llama.cpp-Regler sind dabei deaktiviert.

Strata: KV int8, 32768 KV-Tokens in VRAM, Rest in RAM; MTP mit bis zu 4 Draft-Tokens. Vision derzeit nicht angebunden.

`);f.elements.chat_runtime.value=data.parameters.chat_runtime||'llama';f.elements.strata_experts.value=data.parameters.strata_experts||'resident';const mode=()=>{const on=f.elements.chat_runtime.value==='strata';f.dataset.runtime=on?'strata':'llama';f.querySelector('[data-llama-gpu-note]').hidden=on;f.elements.gpu_reserve_mode.querySelector('option[value=auto]').textContent=on?'Automatisch · 768 MiB je GPU':'Automatisch · mindestens 512 MiB je GPU';for(const n of ['threads','batch','ubatch','slots','mtp','mtp_tokens','mtp_min_p','load_mode','gpu_offload','split_mode','tensor_split','cache_type_k','cache_type_v','vision_projector','vision_device'])f.elements[n].disabled=on;f.querySelector('#strata-profile-fields').hidden=!on;f.querySelector('#projector-discovery').hidden=on;const reserveNone=f.elements.gpu_reserve_mode.querySelector('option[value=none]');reserveNone.disabled=on;if(on&&f.elements.gpu_reserve_mode.value==='none')f.elements.gpu_reserve_mode.value='auto';};f.elements.chat_runtime.onchange=mode;mode();} if(kind==='chat'){const threads=el('profile-form').querySelector('[name=threads]').closest('label');const advanced=document.createElement('details');advanced.innerHTML='Erweitert: CPU-Threads

CPU-Threads steuern CPU-Arbeit und Offloading, nicht die Anzahl der CUDA-Rechenkerne.

';advanced.append(threads);el('profile-form').insertBefore(advanced,el('profile-form').querySelector('.note'));} if(kind==='chat'){bindProjectorDiscovery();const f=el('profile-form');const reserveFields=()=>{for(const n of ['reserve_first','reserve_second'])f.elements[n].disabled=f.elements.gpu_reserve_mode.value!=='manual';};f.elements.gpu_reserve_mode.onchange=reserveFields;reserveFields();} if(kind==='video')bindVideoDevices(data); const identityForm=el('profile-form');let automaticId=!data.id&&!data.api_id;identityForm.elements.api_id.oninput=()=>{automaticId=false;};identityForm.elements.name.oninput=()=>{if(automaticId)identityForm.elements.api_id.value=identityForm.elements.name.value.replace(/ß/g,'ss').normalize('NFKD').replace(/[\u0300-\u036f]/g,'').toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-+|-+$/g,'').slice(0,64).replace(/-+$/g,'')||'model';};identityForm.elements.name.oninput(); el('profile-close').onclick=()=>el('profile-editor').replaceChildren(); el('profile-form').onsubmit=async event=>{event.preventDefault();const form=event.target,values=new FormData(form),button=form.querySelector('button:not([type=button])');button.disabled=true; - try{const parameters=Object.fromEntries(Object.keys(schema).map(k=>[k,Number(values.get(k))]));if(kind==='video'){parameters.video_device=values.get('video_device');parameters.text_encoder_device=values.get('text_encoder_device');}if(kind==='chat'){parameters.vision_projector=values.get('vision_projector')||null;parameters.vision_device=values.get('vision_device');parameters.mtp=values.has('mtp');parameters.cache_type_k=values.get('cache_type_k');parameters.cache_type_v=values.get('cache_type_v');parameters.load_mode=values.get('load_mode');parameters.gpu_offload=values.get('gpu_offload');if(values.get('gpu_second')&&!values.get('gpu_first'))throw Error('Bitte zuerst die erste GPU auswählen.');if((data.parameters.gpu_devices||[]).length>2)throw Error('Dieses Profil enthält mehr als zwei GPUs; der Editor unterstützt derzeit zwei.');parameters.gpu_devices=[values.get('gpu_first'),values.get('gpu_second')].filter(Boolean);parameters.gpu_reserve_mode=values.get('gpu_reserve_mode');parameters.gpu_reserve_mib=parameters.gpu_reserve_mode==='manual'?Object.fromEntries([['gpu_first','reserve_first'],['gpu_second','reserve_second']].filter(([g])=>values.get(g)).map(([g,r])=>[values.get(g),Number(values.get(r))])):{};parameters.split_mode=values.get('split_mode');const raw=String(values.get('tensor_split')).trim();parameters.tensor_split=raw?raw.split(',').map(x=>x.trim()?Number(x):NaN):[];}await api('profiles/save',{id:data.id,revision:data.revision,name:values.get('name'),api_id:values.get('api_id'),kind,model_id:values.get('model_id'),parameters});if(!root.isConnected)return;el('profile-editor').replaceChildren();await load();message('Profil auf Athena gespeichert. Kein Modell gestartet.');} + try{const parameters=Object.fromEntries(Object.keys(schema).map(k=>[k,Number(form.elements[k].disabled?(data.parameters[k]??schema[k][2]):values.get(k))]));if(kind==='video'){parameters.video_device=values.get('video_device');parameters.text_encoder_device=values.get('text_encoder_device');}if(kind==='chat'){parameters.vision_projector=values.get('vision_projector')||null;parameters.vision_device=values.get('vision_device');parameters.mtp=values.has('mtp');parameters.cache_type_k=values.get('cache_type_k');parameters.cache_type_v=values.get('cache_type_v');parameters.load_mode=values.get('load_mode');parameters.gpu_offload=values.get('gpu_offload');if(values.get('gpu_second')&&!values.get('gpu_first'))throw Error('Bitte zuerst die erste GPU auswählen.');if((data.parameters.gpu_devices||[]).length>2)throw Error('Dieses Profil enthält mehr als zwei GPUs; der Editor unterstützt derzeit zwei.');parameters.gpu_devices=[values.get('gpu_first'),values.get('gpu_second')].filter(Boolean);parameters.gpu_reserve_mode=values.get('gpu_reserve_mode');parameters.gpu_reserve_mib=parameters.gpu_reserve_mode==='manual'?Object.fromEntries([['gpu_first','reserve_first'],['gpu_second','reserve_second']].filter(([g])=>values.get(g)).map(([g,r])=>[values.get(g),Number(values.get(r))])):{};parameters.split_mode=values.get('split_mode');const raw=String(values.get('tensor_split')).trim();parameters.tensor_split=raw?raw.split(',').map(x=>x.trim()?Number(x):NaN):[];parameters.chat_runtime=values.get('chat_runtime')||'llama';parameters.strata_layer_split=Number(values.get('strata_layer_split')||16);parameters.strata_experts=values.get('strata_experts')||'resident';if(parameters.chat_runtime==='strata'){parameters.slots=1;parameters.load_mode='none';parameters.gpu_offload='auto';parameters.split_mode='layer';parameters.tensor_split=[];parameters.mtp=false;parameters.vision_projector=null;parameters.vision_device='cpu';parameters.cache_type_k='q4_0';parameters.cache_type_v='q4_0';}}await api('profiles/save',{id:data.id,revision:data.revision,name:values.get('name'),api_id:values.get('api_id'),kind,model_id:values.get('model_id'),parameters});if(!root.isConnected)return;el('profile-editor').replaceChildren();await load();message('Profil auf Athena gespeichert. Kein Modell gestartet.');} catch(error){if(root.isConnected)el('profile-error').textContent=error.message;}finally{button.disabled=false;} }; el('profile-editor').scrollIntoView({behavior:'smooth',block:'start'}); diff --git a/profiles.py b/profiles.py index 7758c55..1952d89 100644 --- a/profiles.py +++ b/profiles.py @@ -26,7 +26,7 @@ def video_parameters(params): raise ValueError('Video-Gerät muss eine GPU-UUID sein; CPU wird im Disk-Streaming-Adapter noch nicht unterstützt.') return params -CHAT_GPU_DEFAULTS={'load_mode':'none','gpu_devices':[], 'split_mode':'none', 'tensor_split':[], 'mtp':False,'gpu_offload':'auto','gpu_reserve_mode':'auto','gpu_reserve_mib':{},'vision_projector':None,'vision_device':'cpu','cache_type_k':'q4_0','cache_type_v':'q4_0'} +CHAT_GPU_DEFAULTS={'chat_runtime':'llama','strata_layer_split':16,'strata_experts':'resident','load_mode':'none','gpu_devices':[], 'split_mode':'none', 'tensor_split':[], 'mtp':False,'gpu_offload':'auto','gpu_reserve_mode':'auto','gpu_reserve_mib':{},'vision_projector':None,'vision_device':'cpu','cache_type_k':'q4_0','cache_type_v':'q4_0'} FLOAT_PARAMETERS=frozenset({'guidance','speed','temperature','top_p','min_p','mtp_min_p','repeat_penalty','presence_penalty','frequency_penalty'}) CHAT_GENERATION_DEFAULTS={'temperature':.8,'top_p':.95,'top_k':40,'min_p':0.0,'repeat_penalty':1.0,'presence_penalty':0.0,'frequency_penalty':0.0} CHAT_SAMPLING={**CHAT_GENERATION_DEFAULTS,'mtp_tokens':2,'mtp_min_p':.05} @@ -36,6 +36,11 @@ def generation_parameters(params): def chat_parameters(params): params={**CHAT_GPU_DEFAULTS,**CHAT_SAMPLING,**params} + if params['chat_runtime'] not in ('llama','strata'):raise ValueError('Unbekannte Chat-Laufzeit.') + if type(params['strata_layer_split']) is not int or not 1<=params['strata_layer_split']<=47:raise ValueError('Strata-Layer-Schnitt: 1 bis 47.') + if params['strata_experts'] not in ('resident','mmap'):raise ValueError('Strata-Experten: resident oder mmap.') + if params['chat_runtime']=='strata' and (params.get('slots',1)!=1 or params.get('context',8192)>262144 or params['vision_projector']):raise ValueError('Strata: ein Slot, höchstens 262144 Kontexttokens; Vision ist in diesem Rezept nicht angebunden.') + if params['chat_runtime']=='strata' and params['gpu_reserve_mode']=='none':raise ValueError('Strata verwendet mindestens die automatische qualifizierte Reserve; Modus ohne Reserve ist nicht unterstützt.') if params['gpu_reserve_mode'] not in ('auto','manual','none'):raise ValueError('Ungültiger GPU-Reservemodus.') reserve=params['gpu_reserve_mib'] if not isinstance(reserve,dict) or any(k not in params['gpu_devices'] or type(v) is not int or not 0<=v<=32768 for k,v in reserve.items()):raise ValueError('GPU-Reserve muss je ausgewählter GPU zwischen 0 und 32768 MiB liegen.') @@ -49,6 +54,7 @@ def chat_parameters(params): if params['vision_projector'] is not None and (not isinstance(params['vision_projector'],str) or not re.fullmatch(r'[a-f0-9]{64}',params['vision_projector'])):raise ValueError('Ungültige Projektor-ID.') if params['vision_device']!='cpu' and (not isinstance(params['vision_device'],str) or not re.fullmatch(r'GPU-[0-9a-fA-F-]{36}',params['vision_device'])):raise ValueError('Projektor-Gerät muss CPU oder eine gültige GPU-UUID sein.') devices=params['gpu_devices'];split=params['tensor_split'] + if params['chat_runtime']=='strata' and (not isinstance(devices,list) or len(devices)!=2):raise ValueError('Dieses Strata-Rezept benötigt genau zwei explizite GPU-UUIDs.') if not isinstance(devices,list) or len(devices)>16 or any(not isinstance(v,str) or not re.fullmatch(r'GPU-[0-9a-fA-F-]{36}',v) for v in devices) or len(set(devices))!=len(devices):raise ValueError('GPUs müssen als eindeutige, geordnete GPU-UUIDs angegeben werden.') if params['split_mode'] not in ('none','layer','row'):raise ValueError('Ungültiger GPU-Split-Modus.') if not isinstance(split,list) or any(isinstance(v,bool) or not isinstance(v,(int,float)) or not 0{ + const esc=v=>String(v??'').replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c])); + function render(){document.querySelector('#view').innerHTML='

Strata

Flash-Next als native Chat-Laufzeit hinter dem bestehenden Athena-Endpunkt. Zwei GPUs, Experten in RAM/SSD, MTP auf der zweiten GPU. Kein zusätzlicher öffentlicher API-Port.

Chat-Profile öffnen →';refresh();} + async function api(path='',body){const r=await fetch('/api/v1/strata-runtime'+path,body!==undefined?{method:'POST',headers:{'Content-Type':'application/json','X-Athena-Deck':'1'},body:JSON.stringify(body)}:{});const d=await r.json();if(!r.ok)throw Error(d.error);return d;} + async function refresh(){const root=document.querySelector('#strata-state');if(!root)return;try{ + const [d,c]=await Promise.all([api(),fetch('/api/v1/catalog').then(r=>r.json())]);if(!root.isConnected)return; + root.innerHTML=`

Strata ${esc(d.version)}

${d.installed?'Installiert':'Einrichtung erforderlich'} · ${esc(d.revision?.slice(0,12))}

${esc(d.job?.phase||'Kein Einrichtungsauftrag aktiv.')}

Vision ist in diesem Rezept noch nicht verfügbar. Ein Chat-Slot, Kontext bis 262144. Große Kontexte benötigen zusätzlichen RAM.

${Object.entries(d.models).map(([q,ready])=>`${esc(q)}: ${ready?'vorbereitet':'Paket fehlt'}`).join(' · ')}

${d.job?.state==='running'?'':''}`; + for(const [id,path,body] of [['strata-install','/install',()=>({})],['strata-prepare','/prepare',()=>({model_id:document.querySelector('#strata-model').value})],['strata-cancel','/cancel',()=>({})]])document.querySelector('#'+id)?.addEventListener('click',async event=>{event.target.disabled=true;try{await api(path,body());refresh();}catch(e){document.querySelector('#strata-message').textContent=e.message;event.target.disabled=false;}}); + }catch(e){if(root.isConnected)root.textContent=e.message;}finally{setTimeout(()=>{if(root.isConnected)refresh();},4000);}} + return {render}; +})(); diff --git a/strata_runtime.py b/strata_runtime.py new file mode 100644 index 0000000..5c65395 --- /dev/null +++ b/strata_runtime.py @@ -0,0 +1,89 @@ +"""Pinned native Strata installation and reproducible model preparation.""" +import hashlib,json,os,re,shutil,sys,threading,time,uuid +from pathlib import Path +from ltx_original_runtime import LTXOriginalRuntime +from catalog import remote +RECIPE=json.loads((Path(__file__).parent/'strata_sources.json').read_text()) +COMMIT=RECIPE['code'] +def model_quant(entry): + for quant,m in RECIPE['models'].items(): + source=entry.get('download_source') or entry + if source.get('repo')==RECIPE['repo'] and source.get('revision')==RECIPE['revision'] and source.get('file')==m['file'] and entry.get('sha256')==m['sha256']:return quant + raise ValueError('Strata unterstützt hier nur die gepinnten Flash-Next IQ2_XS/IQ3_XXS-Dateien. Originalquelle und Prüfsumme müssen passen.') +def digest(path): + h=hashlib.sha256() + with Path(path).open('rb') as f: + for block in iter(lambda:f.read(8*1024**2),b''):h.update(block) + return h.hexdigest() +class StrataRuntime(LTXOriginalRuntime): + name='Strata' + def __init__(self,root,catalog): + super().__init__(root,None);self.catalog=catalog + self.storage=Path(os.environ.get('DECK_STRATA_DATA_DIR',str(self.root/'data'))) + def paths(self):return self.root/'source/.venv/bin/python',self.root/'source' + def status(self): + python,source=self.paths();marker=self.root/'ready.json' + try:ready=json.loads(marker.read_text()) if marker.is_file() else {} + except ValueError:ready={} + return dict(installed=ready.get('commit')==COMMIT and python.is_file() and (source/'engine/strata').is_file(),version=RECIPE['version'],revision=COMMIT,job=dict(self.job) if self.job else None,required_disk_gib=5,models={q:self.model_ready(q) for q in RECIPE['models']},storage=str(self.storage),vision=False) + def start(self): + with self.lock: + if self.job and self.job['state']=='running':raise ValueError('Strata-Einrichtung läuft bereits.') + if self.status()['installed']:raise ValueError('Strata ist bereits installiert.') + if sys.platform!='linux':raise ValueError('Native Strata-Laufzeit benötigt Linux und CUDA 13.0.') + self.root.mkdir(parents=True,exist_ok=True,mode=0o700);self.cancel.clear();self.job=dict(id=uuid.uuid4().hex,state='running',phase='Native Strata-Laufzeit bauen',started_at=time.time());self._save() + self.worker=threading.Thread(target=self._install,daemon=True);self.worker.start();return self.status() + def _install(self): + try: + self._command([sys.executable,Path(__file__).parent/'deploy/install_strata.py','--destination',self.root]);state='complete';phase='Strata installiert. Modellpaket separat vorbereiten.' + except Exception as e:state='cancelled' if self.cancel.is_set() else 'failed';phase=str(e) + with self.lock:self.process=None;self.job.update(state=state,phase=phase,finished_at=time.time());self._save() + def model_ready(self,q): + p=self.storage/'models'/q/'prepared.json' + try: + m=json.loads(p.read_text());return m.get('commit')==COMMIT and m.get('sha256')==RECIPE['models'][q]['sha256'] and all((self.storage/x).is_file() for x in (m['native'],m['ple'],m['pack']+'/experts.bin','mtp/rt/dense.bin')) + except (OSError,ValueError,KeyError):return False + def prepared(self,entry): + q=model_quant(entry) + if not self.model_ready(q):raise ValueError('Strata-Modellpaket fehlt. Unter Laufzeiten → Strata vorbereiten.') + return q,json.loads((self.storage/'models'/q/'prepared.json').read_text()) + def prepare(self,model_id): + entry=self.catalog.entry(model_id);q=model_quant(entry) + if not self.status()['installed']:raise ValueError('Zuerst Strata-Laufzeit installieren.') + with self.lock: + if self.job and self.job['state']=='running':raise ValueError('Strata-Einrichtung läuft bereits.') + if self.model_ready(q):return {**self.status(),'job':None} + self.root.mkdir(parents=True,exist_ok=True);self.cancel.clear();self.job=dict(id=uuid.uuid4().hex,state='running',phase='Modellpaket vorbereiten: '+q,started_at=time.time());self._save() + self.worker=threading.Thread(target=self._prepare,args=(entry,q),daemon=True);self.worker.start();return self.status() + def _prepare(self,entry,q): + try: + self.storage.mkdir(parents=True,exist_ok=True,mode=0o700) + need=RECIPE['ple']['size']+RECIPE['models'][q]['size']+50*1024**3 + if shutil.disk_usage(self.storage).free{ ['SoulX-Singer Gesang','Stimmwerkzeuge','soulx-singer-runtime','/api/v1/soulx-singer-runtime','Gesang in eine Referenzstimme umwandeln, ohne Training. 24 kHz; vorhandenen Gesang umwandeln.'], ['X-VC','Stimmwerkzeuge','xvc-runtime','/api/v1/xvc-runtime','Audio-zu-Audio-Stimmumwandlung; native Laufzeit mit Resemble Enhance und bisheriger Oberfläche.'], ['Applio / RVC','Stimmwerkzeuge','applio-runtime','/api/v1/applio-runtime','Unsere eigene Oberfläche für Stimmen umwandeln, Live und Training. Native Applio-3.6.5-Laufzeit; GPU wird durch Deck gesteuert.'], + ['Strata','Chat & Sprachmodelle','strata-runtime','/api/v1/strata-runtime','Flash-Next mit Experten-Streaming. Native CUDA-13-Laufzeit, IQ2_XS/IQ3_XXS und gemeinsame Deck-API.'], ['Audio Separator','Audio-Trennung','separator-runtime','/api/v1/separator-runtime','Native CUDA-Laufzeit für BS-Roformer, MelBand und Demucs FT/6s. Vollständige Modellpakete mit überprüften Originalquellen und Prüfsummen.'] ]; const runtimeEscape=v=>String(v??'').replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c])); diff --git a/style.css b/style.css index 1d9c5a9..eafc1ee 100644 --- a/style.css +++ b/style.css @@ -48,3 +48,6 @@ nav a.nav-sub{padding-left:28px;font-size:12px;color:var(--deck-tone-a4bda8, #a4 .library-group + .library-group { margin-top: 1.5rem; } .library-group > h3 { margin: .5rem 0 .75rem; } + +#profile-form[data-runtime="strata"] label:has(input:disabled), +#profile-form[data-runtime="strata"] label:has(select:disabled){opacity:.55} diff --git a/test_strata.py b/test_strata.py new file mode 100644 index 0000000..040a7d2 --- /dev/null +++ b/test_strata.py @@ -0,0 +1,51 @@ +import copy,json,tempfile,unittest +from pathlib import Path +from unittest.mock import Mock,patch +from profiles import chat_parameters,SCHEMAS +from strata_runtime import StrataRuntime,RECIPE,model_quant,COMMIT +from strata_worker import ChatWorkerRouter,StrataWorker +from inference import MemoryAdmissionError +class StrataTests(unittest.TestCase): + def params(self):return chat_parameters({**{k:v[2] for k,v in SCHEMAS['chat'].items()},'chat_runtime':'strata','gpu_devices':['GPU-'+'a'*8+'-'+ 'a'*4+'-'+ 'a'*4+'-'+ 'a'*4+'-'+'a'*12,'GPU-'+'b'*8+'-'+ 'b'*4+'-'+ 'b'*4+'-'+ 'b'*4+'-'+'b'*12],'split_mode':'layer'}) + def test_strata_profile_budget_and_legacy_defaults(self): + self.assertEqual(chat_parameters({})['chat_runtime'],'llama') + for override in ({'slots':2},{'context':524288},{'vision_projector':'a'*64},{'strata_layer_split':0},{'strata_experts':'unknown'}): + with self.assertRaises(ValueError):chat_parameters({**self.params(),**override}) + def test_source_identity_is_pinned_not_filename_only(self): + entry=dict(repo=RECIPE['repo'],revision=RECIPE['revision'],**RECIPE['models']['IQ2_XS']) + self.assertEqual(model_quant(entry),'IQ2_XS') + for change in ({'repo':'fake/model'},{'revision':'0'*40},{'sha256':'0'*64}): + with self.assertRaises(ValueError):model_quant({**entry,**change}) + def test_router_switches_only_owned_workers_and_keeps_embeddings_runtime(self): + llama=Mock();strata=Mock();router=ChatWorkerRouter(llama,strata) + p={'parameters':{'chat_runtime':'strata'}};router.ensure(p) + llama.stop.assert_called_once();strata.ensure.assert_called_once_with(p,unittest.mock.ANY) + self.assertIs(router.runtime,llama.runtime);self.assertIs(router.build(),llama.build.return_value) + router.ensure({'parameters':{}});strata.stop.assert_called_once();self.assertIs(router.active,llama) + def test_request_translation_does_not_mutate_input(self): + worker=StrataWorker('/tmp/not-used',Mock(),Mock());body={'chat_template_kwargs':{'enable_thinking':False},'reasoning_effort':'high','cache_prompt':False,'messages':[]};before=copy.deepcopy(body) + result=worker.prepare_request(body);self.assertEqual(result['reasoning_effort'],'none');self.assertNotIn('cache_prompt',result);self.assertEqual(body,before) + def test_native_server_command_selects_real_engine_and_explicit_port(self): + command=StrataWorker.command(Path('/runtime/python'),Path('/runtime/source'),Path('/private/config'),37173) + self.assertEqual(command[command.index('--engine')+1],'strata') + self.assertEqual(command[command.index('--port')+1],'37173') + self.assertEqual(command[command.index('--host')+1],'127.0.0.1') + def test_occupied_gpu_rejected_without_stopping_foreign_processes(self): + with tempfile.TemporaryDirectory() as tmp: + runtime=Mock();runtime.status.return_value={'installed':True};runtime.prepared.return_value=('IQ2_XS',{}) + w=StrataWorker(tmp,Mock(),runtime);params=self.params();gpus=[dict(uuid=i,total_mib=16000,free_mib=8000) for i in params['gpu_devices']] + with patch('strata_worker.probe',return_value=gpus),self.assertRaises(MemoryAdmissionError):w.plan({'parameters':params,'model_id':'model'}) + self.assertIsNone(w.process) + def test_backup_strata_version_and_restore_plan(self): + from server import Server + from backup import validate + from backup_codec import seal,open_backup + with tempfile.TemporaryDirectory() as tmp: + s=Server(0,state_dir=tmp);s.credentials.setup('test administrator password','test_api_token_12345678901234567890');s.docker=Mock();s.docker.call.return_value={'services':[],'configured':True};s.docker.status.return_value={'services':[]} + try: + s.strata_runtime.status=Mock(return_value=dict(installed=True,revision=COMMIT,job=None)) + doc=s.backup.snapshot(include_history=False);validate(doc);key='synthetic restore password';raw=seal(doc,key);restored=open_backup(raw,key);self.assertTrue(restored['runtimes']['strata']);self.assertEqual(restored['runtime_versions']['strata'],COMMIT) + plan=s.backup.inspect(raw,key);self.assertFalse(plan['blockers'],plan) + doc['runtime_versions']['strata']='0'*40;plan=s.backup.inspect(seal(doc,key),key);self.assertTrue(any('Strata-Version' in b for b in plan['blockers'])) + finally:s.backup.stop();s.endpoint.close();s.video.close();s.dashboard.close();s.server_close() +if __name__=='__main__':unittest.main()