services:
  xinference:
    image: xprobe/xinference:latest
    container_name: xinference
    command: xinference-local -H 0.0.0.0
    environment:
      - XINFERENCE_MODEL_SRC=modelscope  # 指定国内镜像源
      # - HF_ENDPOINT=https://hf-mirror.com  # 如需切换 HuggingFace 镜像
    ports:
      - "9997:9997"
    volumes:
      - ./xinference:/root/.xinference  # 主配置目录
      - ./huggingface:/root/.cache/huggingface  # HF缓存
      - ./modelscope:/root/.cache/modelscope    # ModelScope缓存
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]