entrypoint.sh 1.1 KB

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash -e
  2. echo 'Starting Aphrodite Engine API server...'
  3. CMD="python3 -m aphrodite.endpoints.${ENDPOINT:-openai}.api_server
  4. --host 0.0.0.0
  5. --port 5000
  6. --download-dir ${HF_HOME:?}/hub
  7. ${MODEL_NAME:+--model $MODEL_NAME}
  8. ${REVISION:+--revision $REVISION}
  9. ${DATATYPE:+--dtype $DATATYPE}
  10. ${KVCACHE:+--kv-cache-dtype $KVCACHE}
  11. ${CONTEXT_LENGTH:+--max-model-len $CONTEXT_LENGTH}
  12. ${NUM_GPUS:+--tensor-parallel-size $NUM_GPUS}
  13. ${GPU_MEMORY_UTILIZATION:+--gpu-memory-utilization $GPU_MEMORY_UTILIZATION}
  14. ${QUANTIZATION:+--quantization $QUANTIZATION}
  15. ${ENFORCE_EAGER:+--enforce-eager}
  16. ${CMD_ADDITIONAL_ARGUMENTS}"
  17. # Only the 'openai' endpoint currently supports api-keys and ssl
  18. if [ "${ENDPOINT:-openai}" = "openai" ]; then
  19. CMD+=" ${API_KEY:+--api-keys "$API_KEY"} ${SSL_KEYFILE:+--ssl-keyfile server.key} ${SSL_CERTFILE:+--ssl-certfile server.crt}"
  20. fi
  21. # set umask to ensure group read / write at runtime
  22. umask 002
  23. set -x
  24. exec $CMD