{"record":{"id":"92849dd52b5ee44a","repo":"unslothai/unsloth","slug":"the-local-transcription-runtime-is-being-updated-92849d","errorCode":null,"errorMessage":"The local transcription runtime is being updated. Try dictation again shortly.","messagePattern":"The local transcription runtime is being updated\\. Try dictation again shortly\\.","errorType":"http","errorClass":"SttUnavailableError","httpStatus":501,"severity":"warning","filePath":"studio/backend/core/inference/stt_mtmd_sidecar.py","lineNumber":760,"sourceCode":"        if process is not None and process.poll() is None:\n            try:\n                process.terminate()\n            except Exception:\n                pass\n        return True\n\n    def wait_for_load_to_settle(self) -> None:\n        \"\"\"Block until a cancelled startup has been reaped and its VRAM freed.\n\n        load() holds _start_lock across startup and its cleanup, so taking it\n        is the wait.\n        \"\"\"\n        with self._start_lock:\n            pass\n\n    def _raise_if_update_in_progress(self) -> None:\n        if self._update_in_progress:\n            raise SttUnavailableError(\n                \"The local transcription runtime is being updated. Try dictation again shortly.\"\n            )\n\n    @contextmanager\n    def update_maintenance(self) -> Iterator[bool]:\n        \"\"\"Block new loads while the llama.cpp tree this binary lives in is\n        replaced. The chat backend coordinates its own server; this sidecar runs\n        the same executable, so on Windows a live one blocks the swap.\n\n        The guard is published before waiting for the locks, so a load already\n        past its own check still cannot start a process against a half-swapped\n        tree. Yields whether a warm server had to be unloaded.\n        \"\"\"\n        self._update_in_progress = True\n        try:\n            with self._start_lock, self._lock:\n                model_was_active = self._process_alive()\n                self._release_locked()","sourceCodeStart":742,"sourceCodeEnd":778,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/core/inference/stt_mtmd_sidecar.py#L742-L778","documentation":"Raised by SttMtmdSidecar._raise_if_update_in_progress() as SttUnavailableError when the llama.cpp runtime tree the dictation sidecar's executable lives in is being swapped by update_maintenance(). The _update_in_progress flag is published before the update waits on startup locks, so any load() call that checks it (before or inside _start_lock) is refused for the duration of the binary replacement.","triggerScenarios":"Calling load() or a transcription that triggers load() while an `with sidecar.update_maintenance():` block is active, i.e. the studio backend is replacing the llama.cpp binaries (notably on Windows, where a live llama-server process locks the executable).","commonSituations":"A runtime self-update kicked off while the user started dictation; two studio components (chat backend and STT sidecar share the same llama-server executable) racing one update; retrying dictation immediately after an update prompt.","solutions":["Wait for the update to finish (it typically takes seconds) and retry the load/dictation request.","If it persists, check that no update_maintenance() block is stuck holding _update_in_progress (e.g. a hung updater) and restart the studio backend.","Ensure only one update coordinator runs at a time so the maintenance window stays short."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"```python\nif sidecar._update_in_progress:\n    return \"runtime updating\", 503  # back off and retry shortly\n```","typeGuard":null,"tryCatchPattern":"```python\ntry:\n    sidecar.load(model_id)\nexcept SttUnavailableError as exc:\n    if \"being updated\" in str(exc):\n        backoff_and_retry(delay=2.0)  # maintenance window is short\n    raise\n```","preventionTips":["Surface a 'runtime updating' state in the UI and disable the dictation button during update_maintenance().","Coordinate updates through a single owner so the maintenance window is short.","Retry with backoff once or twice before showing an error."],"tags":["stt","runtime-update","sidecar","transient","llama-cpp"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}