{"record":{"id":"2cfda2e59ac3b1c8","repo":"odysseus-dev/odysseus","slug":"boogu-mlx-generation-failed-e","errorCode":null,"errorMessage":"Boogu MLX generation failed: {e}","messagePattern":"Boogu MLX generation failed: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"scripts/mlx_image_server.py","lineNumber":320,"sourceCode":"            422,\n            \"This MLX image pipeline requires a companion vision-language model. \"\n            \"Relaunch with --vlm-model <repo_or_path> or set ODYSSEUS_MLX_IMAGE_VLM_MODEL.\",\n        )\n    try:\n        pipe = BooguImagePipeline.from_pretrained(\n            str(model_path),\n            vlm_model,\n        )\n        img = pipe.generate(\n            prompt,\n            height=height,\n            width=width,\n            steps=steps,\n            guidance=3.5,\n        )\n        Image.fromarray(img).save(out_path)\n    except Exception as e:\n        raise HTTPException(500, f\"Boogu MLX generation failed: {e}\") from e\n\n\n@app.get(\"/v1/models\")\ndef list_models():\n    return {\"data\": [{\"id\": _args.model, \"object\": \"model\", \"owned_by\": \"local\"}]}\n\n\n@app.post(\"/v1/images/generations\")\ndef generate(req: ImageRequest):\n    model = req.model or _args.model\n    width, height = _size(req.size)\n    out_images = []\n    count = max(1, min(int(req.n or 1), 4))\n    for _ in range(count):\n        with tempfile.TemporaryDirectory(prefix=\"odysseus-mlx-image-\") as td:\n            out_path = Path(td) / \"image.png\"\n            if _is_hidream(model):\n                _generate_hidream(model, req.prompt, out_path, width, height, _steps(req.quality))","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/scripts/mlx_image_server.py#L302-L338","documentation":"Raised by _generate_boogu in scripts/mlx_image_server.py with HTTP 500 wrapping any exception from BooguImagePipeline.from_pretrained or pipe.generate (load, VLM fetch, generation, or Image.fromarray(...).save). The chained exception text {e} carries the underlying cause; it is a runtime failure, not a client-input error.","triggerScenarios":"Boogu generation where pipeline construction or generate raises: bad/missing VLM path, corrupted weights, MLX version incompatibility, unsupported height/width/steps causing an internal assertion, or out-of-memory during generate.","commonSituations":"vlm-model pointing at a wrong repo id; mlx package version mismatch with boogu-image-mlx; first-run weight download interrupted; very large resolution requests exhausting unified memory.","solutions":["Read {e} in the response to identify the failing stage (from_pretrained vs generate)","Verify the VLM repo id/path resolves and re-download if the error mentions missing files","Pin/upgrade mlx and boogu-image-mlx to a known-compatible pair (reinstall the git package)","Lower height/width/steps if the error indicates memory pressure"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"from pathlib import Path\nassert Path(vlm_model).exists() or '/' in vlm_model, 'vlm_model must be a hub id or local path'","typeGuard":null,"tryCatchPattern":"except HTTPException as e:\n    if e.status_code == 500 and 'Boogu MLX generation failed' in e.detail:\n        log(e.detail)  # contains chained cause\n        if 'No such file' in e.detail: refresh_vlm_snapshot(); retry_once()\n        else: raise","preventionTips":["Pre-download both the boogu and VLM snapshots before serving","Pin compatible mlx + boogu-image-mlx versions together","Cap resolution/steps to keep memory headroom"],"tags":["boogu","mlx","runtime","http-500"],"backgroundTag":null,"analyzedSha":"f9235ebbf13f693a6fd29ce70b097f6ec83705bf","analyzedAt":"2026-08-14T21:47:48.359Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}