Adds a vllm.io_processor_plugins entry point (bge_m3_sparse_plugin) that serves learned sparse vectors of BAAI/bge-m3 over POST /pooling, on top of the BgeM3EmbeddingModel architecture that already ships with vLLM. - plugin/: python package, sparse (token_classify) and dense (embed) modes, batch support, per-request weight threshold - entrypoint.sh: pip install the plugin from a read-only mount at container start - docker-compose.yml: stack ready for Portainer (git repository deployment) Verified against vLLM 0.30.0 on an RTX 5070: single/batch/parallel requests, validation errors, and weights matching the FlagEmbedding reference formula.
45 lines
1.2 KiB
YAML
45 lines
1.2 KiB
YAML
services:
|
|
vllm-bge-sparse:
|
|
image: ${VLLM_IMAGE:-vllm/vllm-openai:latest}
|
|
container_name: vllm-bge-sparse-backend
|
|
restart: unless-stopped
|
|
entrypoint:
|
|
- /bin/bash
|
|
- /opt/entrypoint.sh
|
|
command:
|
|
- python3
|
|
- -m
|
|
- vllm.entrypoints.openai.api_server
|
|
- --model
|
|
- ${MODEL:-BAAI/bge-m3}
|
|
- --hf-overrides
|
|
- '{"architectures": ["BgeM3EmbeddingModel"], "head_dtype": "float16"}'
|
|
- --pooler-config.task
|
|
- token_classify
|
|
- --io-processor-plugin
|
|
- bge_m3_sparse_plugin
|
|
- --max-model-len
|
|
- ${MAX_MODEL_LEN:-8192}
|
|
- --port
|
|
- "8000"
|
|
- --gpu-memory-utilization
|
|
- ${GPU_MEMORY_UTILIZATION:-0.15}
|
|
ports:
|
|
- "${HOST_PORT:-8083}:8000"
|
|
ipc: host
|
|
volumes:
|
|
- ${HF_CACHE:-/root/.cache/huggingface}:/root/.cache/huggingface
|
|
- ./plugin:/opt/plugin:ro
|
|
- ./entrypoint.sh:/opt/entrypoint.sh:ro
|
|
environment:
|
|
- HF_HUB_ENABLE_HF_TRANSFER=0
|
|
- BGE_M3_SPARSE_MODE=${BGE_M3_SPARSE_MODE:-sparse}
|
|
- BGE_M3_SPARSE_THRESHOLD=${BGE_M3_SPARSE_THRESHOLD:-0.0}
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
count: all
|
|
capabilities: [gpu]
|