services: vllm-bge-sparse: image: ${VLLM_IMAGE:-vllm/vllm-openai:latest} container_name: ${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]