#!/usr/bin/env bash # Installs the BGE-M3 sparse IO processor plugin from /opt/plugin (or $PLUGIN_SRC) # and then hands control over to the vLLM API server. # # The plugin lives in a python distribution, because vLLM discovers IO # processors through entry points (group "vllm.io_processor_plugins"), so a # plain PYTHONPATH mount is not enough. set -euo pipefail PLUGIN_SRC="${PLUGIN_SRC:-/opt/plugin}" PLUGIN_NAME="bge_m3_sparse_plugin" if [ -d "$PLUGIN_SRC" ]; then # pip needs a writable copy to build the wheel, so the git mount stays read-only rm -rf /tmp/bge-m3-sparse-plugin cp -r "$PLUGIN_SRC" /tmp/bge-m3-sparse-plugin python3 -m pip install \ --no-deps \ --no-build-isolation \ --no-cache-dir \ --disable-pip-version-check \ --quiet \ /tmp/bge-m3-sparse-plugin python3 - <<'PY' from importlib.metadata import entry_points found = [f"{ep.name} -> {ep.value}" for ep in entry_points(group="vllm.io_processor_plugins")] print(f"[bge-m3-sparse] io processor plugins: {found}", flush=True) PY fi exec "$@"