Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
fix(trellis): ship the libusb and libEGL that open3d dlopens, pin open3d, and fail the build when a system library is missing
nirholas35d798585d97
diff --git a/workers/model-trellis/Dockerfile b/workers/model-trellis/Dockerfileindex 9cfbb00ca..1eab909c0 100644--- a/workers/model-trellis/Dockerfile+++ b/workers/model-trellis/Dockerfile@@ -27,10 +27,14 @@ ENV PYTHONDONTWRITEBYTECODE=1 \# TRELLIS repo lives here and is imported off PYTHONPATH (not a pip package).PYTHONPATH=/app/TRELLIS+# libusb-1.0-0 and libegl1: open3d (imported by TRELLIS's pipelines package)+# dlopens both at import time. Without them the model load dies with+# "libusb-1.0.so.0: cannot open shared object file" and the revision never serves.RUN apt-get update && apt-get install -y --no-install-recommends \python3.10 python3.10-dev python3-pip \git curl wget build-essential ninja-build \libgl1 libglib2.0-0 libgomp1 \+ libusb-1.0-0 libegl1 \&& rm -rf /var/lib/apt/lists/* \&& ln -sf /usr/bin/python3.10 /usr/bin/python3 \&& ln -sf /usr/bin/python3.10 /usr/bin/python \@@ -44,11 +48,13 @@ RUN pip install torch==2.4.0 torchvision==0.19.0 --index-url https://download.py# 2026-07-16 rebuild resolved a version whose CLIP modeling imports DTensor from# torch.distributed.tensor (public only since torch 2.5), so the pipeline failed# to load at boot and every inference on the revision failed. 4.46.3 is the-# TRELLIS-era release verified against torch 2.4.0/cu121.+# TRELLIS-era release verified against torch 2.4.0/cu121. open3d is pinned for+# the same reason: an unpinned resolve on 2026-09-18 pulled a wheel with new+# system-library needs (see the apt layer above) and the load failed at boot.RUN pip install \pillow imageio imageio-ffmpeg tqdm easydict opencv-python-headless \- scipy ninja rembg onnxruntime trimesh open3d xatlas pyvista pymeshfix \- igraph "transformers==4.46.3" \+ scipy ninja rembg onnxruntime trimesh xatlas pyvista pymeshfix \+ igraph "transformers==4.46.3" "open3d==0.20.0" \&& pip install git+https://github.com/EasternJournalist/utils3d.git@9a4eb15e4021b67b12c460c7057d642626897ec8# ── 3. setup.sh --xformers / --spconv / --kaolin (prebuilt wheels) ────────────diff --git a/workers/model-trellis/test_app_contract.py b/workers/model-trellis/test_app_contract.pyindex 5ccaf1b06..ce92ea993 100644--- a/workers/model-trellis/test_app_contract.py+++ b/workers/model-trellis/test_app_contract.py@@ -61,11 +61,28 @@ def png_data_uri(color=(20, 20, 20, 255), size=(24, 24)) -> str:return "data:image/png;base64," + base64.b64encode(buf.getvalue()).decode()+# Libraries the NVIDIA container runtime mounts into a GPU instance. The image+# cannot ship them, so their absence on the CPU-only builder is expected.+_GPU_DRIVER_LIBS = ("libcuda.so", "libnvidia", "libnvrtc")+++def _is_gpu_driver_absence(exc: BaseException) -> bool:+ text = str(exc)+ if "cannot open shared object file" in text:+ return any(lib in text for lib in _GPU_DRIVER_LIBS)+ lowered = text.lower()+ return "cuda" in lowered or "nvidia driver" in lowered or "no gpu" in lowered++def main() -> int:# 1. The vendored TRELLIS tree, including the FlexiCubes submodule the mesh# extractor imports. A ModuleNotFoundError here is the packaging bug this- # check exists for; any other exception is a GPU-less builder refusing to- # initialize a CUDA-backed module, which is not what is under test.+ # check exists for, and so is a missing system shared library: on+ # 2026-09-18 an unpinned open3d resolved to a wheel that dlopens+ # libusb-1.0 and libEGL, this gate filed the ImportError under "no GPU"+ # and skipped it, and the revision latched a load_error on every boot.+ # Only a failure that names the GPU driver itself (which the builder+ # genuinely lacks and Cloud Run injects at runtime) is skipped.try:from trellis.pipelines import TrellisImageTo3DPipeline # noqa: F401from trellis.representations.mesh.flexicubes.flexicubes import FlexiCubes # noqa: F401@@ -73,8 +90,11 @@ def main() -> int:check("trellis import chain resolves", True)except ModuleNotFoundError as exc:check("trellis import chain resolves", False, str(exc))- except Exception as exc: # noqa: BLE001 - no GPU on the builder, see above- print(f"skip trellis import chain (no GPU on this host): {type(exc).__name__}: {exc}")+ except Exception as exc: # noqa: BLE001 - classified below+ if _is_gpu_driver_absence(exc):+ print(f"skip trellis import chain (no GPU on this host): {type(exc).__name__}: {exc}")+ else:+ check("trellis import chain resolves", False, f"{type(exc).__name__}: {exc}")# 2. The service module itself.import main as app_module