The ONNX Runtime Server is a server that provides TCP and HTTP/HTTPS REST APIs for ONNX inference.
7.6K
1.30.0-linux-cuda13 amd64(CUDA 13.x, cuDNN 9.x)1.30.0-linux-cuda12 amd64(CUDA 12.x, cuDNN 9.x)1.30.0-linux-cpu amd64, arm64--gpus all option when running docker run,
the nvidia-container-toolkit package must be installed on the host OS.
sudo apt install nvidia-container-toolkit
/your_model_dir directory on the host OS.
See this document for paths and
naming conventions for onnx files
${model_dir}/${model_name}/${model_version}/model.onnxhttps://mobile.events.data.microsoft.com/OneCollector/1.0. This is ONNX Runtime's own behaviour, not the
server's. To turn it off, set ORT_DISABLE_TELEMETRY=1 on the container:
docker run ... -e "ORT_DISABLE_TELEMETRY=1" ${DOCKER_IMAGE}
DOCKER_IMAGE=kibaes/onnxruntime-server:1.30.0-linux-cuda13 # or 1.30.0-linux-cuda12 or 1.30.0-linux-cpu
docker pull ${DOCKER_IMAGE}
# simple http backend
docker run --name onnxruntime_server_container -d --rm --gpus all \
-p 80:80 \
-v "/your_model_dir:/app/models" \
-v "/your_log_dir:/app/logs" \
-e "ONNX_SERVER_SWAGGER_URL_PATH=/api-docs" \
${DOCKER_IMAGE}
# with https backend. cert, key files must be located in the /your_cert_dir directory on the host OS.
docker run --name onnxruntime_server_container -d --rm --gpus all \
-p 80:80 \
-p 443:443 \
-v "/your_model_dir:/app/models" \
-v "/your_log_dir:/app/logs" \
-v "/your_cert_dir:/app/certs" \
-e "ONNX_SERVER_SWAGGER_URL_PATH=/api-docs" \
-e "ONNX_SERVER_HTTPS_PORT=443" \
-e "ONNX_SERVER_HTTPS_CERT=/app/certs/cert.pem" \
-e "ONNX_SERVER_HTTPS_KEY=/app/certs/key.pem" \
${DOCKER_IMAGE}
services:
# Available environment variables can be found at
# https://github.com/kibae/onnxruntime-server#run-the-server
onnxruntime_server_simple:
# After the docker container is up, you can use the REST API (http://localhost:8080).
# API documentation will be available at http://localhost:8080/api-docs.
image: kibaes/onnxruntime-server:1.30.0-linux-cuda13 # or 1.30.0-linux-cuda12
ports:
- "8080:80" # for http backend
volumes:
# for model files
# https://github.com/kibae/onnxruntime-server#run-the-server
- /your_model_dir:/app/models
# for log files
- /your_log_dir:/app/logs
environment:
# for swagger(optional)
- ONNX_SERVER_SWAGGER_URL_PATH=/api-docs
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [ gpu ]
services:
# Available environment variables can be found at
# https://github.com/kibae/onnxruntime-server#run-the-server
onnxruntime_server_advanced:
# After the docker container is up, you can use the REST API (http://localhost, https://localhost).
# API documentation wl be available at http://localhost/api-docs.
image: kibaes/onnxruntime-server:1.30.0-linux-cuda13 # or 1.30.0-linux-cuda12
ports:
- "80:80" # for http backend
- "443:443" # for https backend
- "8001:8001" # for tcp backend. binary protocol
volumes:
# for model files
# https://github.com/kibae/onnxruntime-server#run-the-server
- /your_model_dir:/app/models
# for log files
- /your_log_dir:/app/logs
# for cert files
- /your_cert_dir:/app/certs
environment:
# for https backend
- ONNX_SERVER_HTTPS_PORT=443
# https backend needs cert, key files
- ONNX_SERVER_HTTPS_CERT=/app/certs/cert.pem
- ONNX_SERVER_HTTPS_KEY=/app/certs/key.pem
# for onnx session preparation
- ONNX_SERVER_PREPARE_MODEL="model1:v1(cuda=true) model1:v2(cuda=0) model2:v2"
# for swagger(optional)
- ONNX_SERVER_SWAGGER_URL_PATH=/api-docs
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [ gpu ]
Content type
Image
Digest
sha256:9d9fd423c…
Size
2.1 GB
Last updated
16 days ago
docker pull kibaes/onnxruntime-server:1.30.0-linux-cuda13