Quick Start#
In this the microservice can be run as an ephemeral (one-shot) container that downloads or converts a model and exits automatically. This is useful for CI/CD pipelines, pre-provisioning model caches, or scripted workflows.
Prerequisites#
Docker installed and running. Installation guide here
curlandpython3available on the host
One-liner Setup#
Download and run directly — no repo clone needed. The script starts a temporary Docker container, downloads the model to your local disk, and automatically removes the container once the operation completes.
curl -sSLO https://raw.githubusercontent.com/open-edge-platform/edge-ai-libraries/main/microservices/model-download/scripts/get_model.sh && source ./get_model.sh --model-name sentence-transformers/all-MiniLM-L6-v2 --hub huggingface --plugins huggingface
Quick Examples#
Download a HuggingFace model#
. ./get_model.sh \
--model-name sentence-transformers/all-MiniLM-L6-v2 \
--hub huggingface --plugins huggingface
Download and convert to OpenVINO (OVMS-ready)#
. ./get_model.sh \
--model-name meta-llama/Llama-3.2-1B \
--hub openvino \
--type llm \
--is-ovms \
--precision int8 \
--device CPU \
--plugins huggingface,openvino
Download an Ollama model#
. ./get_model.sh \
--model-name llama3.2 \
--hub ollama \
--plugins ollama
Download an Ultralytics model#
. ./get_model.sh \
--model-name yolov8s \
--hub ultralytics \
--plugins ultralytics
Advanced Options#
Model Parameters#
Argument |
Description |
Required |
|---|---|---|
|
Model identifier (e.g. |
Yes |
|
Source hub: |
Yes |
|
Model type: |
No |
|
Branch, tag, or commit hash |
No |
|
Convert to OpenVINO format after downloading |
No |
|
Weight precision: |
No |
|
Target device: |
No |
|
KV cache size in GB (for LLM/VLM conversion) |
No |
|
Sub-directory under models dir for downloads |
No |
Docker Options#
Argument |
Description |
Default |
|---|---|---|
|
Host path for model storage |
|
|
Docker image tag |
|
|
Comma-separated plugins to enable |
|
|
OVMS release tag |
|
Environment Variables#
Variable |
Purpose |
|---|---|
|
HuggingFace authentication for gated models |
|
Geti server hostname |
|
Geti authentication token |
|
Geti workspace ID |
Troubleshooting#
On failure, the script creates an error log at:
.model_download_logs/model_download_YYYYMMDD_HHMMSS.log
The log path is printed at the end of a failed run.
Reading the error log#
The log file contains structured sections:
===== Model Download Ephemeral Mode - Error Log =====
Timestamp: 2026-05-22T12:46:17+05:30
Command: source ./get_model.sh --model-name ... --hub ...
Image: model-download:latest
Model Path: /home/user/models
Plugins: huggingface,openvino
[2026-05-22T12:46:44+05:30] ERROR: Job xxx failed: <error message>
===== Job Failure: <job-id> =====
{ full JSON response from API }
===== Container Logs =====
<last 100 lines of container output>
Common issues#
Plugin not activated
Plugin 'openvino' was not activated during container startup. Active plugins: huggingface
Fix: Add the required plugin to --plugins (e.g., --plugins huggingface,openvino).
Gated model access denied
Access to Gated or private models is restricted. You must be authenticated.
Fix: Set HF_TOKEN with a token that has access to the model:
export HF_TOKEN="hf_..."
source ./get_model.sh --model-name meta-llama/Llama-2-7b-hf --hub huggingface
Container failed to start
ERROR: Failed to get mapped port for container.
Fix: Check that the Docker image exists (docker images | grep model-download) and rebuild if needed.
Service health timeout
ERROR: Service failed to start within 180s.
Fix: Check the container logs in the error log file. Common causes: missing dependencies, network issues during plugin setup.
Cleanup stale containers#
If the script was interrupted, you may need to remove the leftover container:
docker rm -f model-download-ephemeral