{"record":{"id":"77b53ce91940b529","repo":"unslothai/unsloth","slug":"llama-server-did-not-become-ready-for-model-id","errorCode":null,"errorMessage":"llama-server did not become ready for '{model_id}'.","messagePattern":"llama-server did not become ready for '(.+?)'\\.","errorType":"http","errorClass":"SttUnavailableError","httpStatus":501,"severity":"error","filePath":"studio/backend/core/inference/stt_mtmd_sidecar.py","lineNumber":927,"sourceCode":"                # Die with Studio, so a crash never orphans a server on the GPU.\n                **child_popen_kwargs(),\n            )\n            # Published before the wait, so training can preempt a startup that\n            # is already allocating; _process is not set for another 180s.\n            with self._lock:\n                self._starting_process = process\n            adopt_pid(process.pid)  # terminate_all backstop for graceful exits\n            if not self._wait_for_server(process, port, cancel_event):\n                # Reap it here: _process was never assigned, so unload() cannot\n                # reach a child that ignores SIGTERM and keeps port and VRAM.\n                _reap(process)\n                if cancel_event.is_set():\n                    # 409 through the route, like the other sidecars: expected\n                    # preemption, not a broken or missing runtime (501).\n                    raise SttLoadCancelledError(\n                        \"Dictation model loading was cancelled so training could start.\"\n                    )\n                raise SttUnavailableError(f\"llama-server did not become ready for '{model_id}'.\")\n            with self._lock:\n                self._process = process\n                self._port = port\n                self._model_id = model_id\n                self._gpu_disabled = training\n                self._generation += 1\n                self._schedule_idle_unload_locked()\n        finally:\n            with self._lock:\n                self._loading = False\n                self._load_cancel_event = None\n                self._load_owner_cancel_event = None\n                self._starting_process = None\n\n    @staticmethod\n    def _wait_for_server(\n        process: subprocess.Popen,\n        port: int,","sourceCodeStart":909,"sourceCodeEnd":945,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/core/inference/stt_mtmd_sidecar.py#L909-L945","documentation":"SttUnavailableError raised when _wait_for_server() returns False without cancellation: llama-server was spawned for model_id but did not answer its readiness probe in time. The failed process is reaped first (it was never assigned to self._process, so unload() could not reach it), then the error names the model.","triggerScenarios":"llama-server startup exceeding the readiness timeout: huge model loading from disk, GPU driver stall/OOM during CUDA init, corrupt GGUF file, or the server crashing on an incompatible mmproj/model pairing.","commonSituations":"First load of a large model on a slow disk; VRAM exhausted by other processes; mismatched model/mmproj revisions after a partial download; antivirus or sandbox slowing process spawn on Windows.","solutions":["Retry once — cold-cache loads of large models can exceed the readiness window.","Check llama-server logs/stderr for crash causes (bad GGUF, CUDA OOM, missing mmproj).","Free GPU memory (close other model backends) or pick a smaller STT model.","Re-download the model to rule out a corrupted snapshot."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"```python\nimport shutil, psutil\nif psutil.virtual_memory().percent > 95 or gpu_memory_free() < model_min_vram(model_id):\n    free_resources_before_load(model_id)\n```","typeGuard":null,"tryCatchPattern":"```python\ntry:\n    sidecar.load(model_id)\nexcept SttUnavailableError as exc:\n    if \"did not become ready\" in str(exc):\n        log_llama_server_stderr()\n        retry_once_after(freeing_vram=True)\n    raise\n```","preventionTips":["Keep llama-server logs accessible to diagnose crash-on-start causes.","Preload models during idle time so cold-start timeouts never hit a live user.","Match model size to available VRAM; re-download on suspicion of corruption."],"tags":["stt","startup-timeout","llama-cpp","gpu","sidecar"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}