@@ -22,12 +22,13 @@ func isRunnerMode(c *config.InferenceConfig) bool {
2222func installRunnerDependencies (_ * config.InferenceConfig , s llb.State , merge llb.State , platform specs.Platform ) (llb.State , llb.State ) {
2323 savedState := s
2424
25- // Install curl for HTTP/HTTPS downloads and python3 + pip for huggingface-cli.
25+ // Install curl for HTTP/HTTPS downloads, ca-certificates for TLS verification,
26+ // and python3 + pip for huggingface-cli.
2627 // Some backends (diffusers/vllm) already install python, but llama-cpp does not,
2728 // so we always install the minimal set here.
2829 // Note: Runner mode is not supported for Apple Silicon (validated in build).
2930 s = s .Run (
30- utils .Sh ("apt-get update && apt-get install --no-install-recommends -y curl python3 python3-pip && (pip install --break-system-packages huggingface-hub[cli] 2>/dev/null || pip install huggingface-hub[cli]) && apt-get clean" ),
31+ utils .Sh ("apt-get update && apt-get install --no-install-recommends -y curl ca-certificates python3 python3-pip && (pip install --break-system-packages huggingface-hub[cli] 2>/dev/null || pip install huggingface-hub[cli]) && apt-get clean" ),
3132 llb .WithCustomNamef ("Installing runner dependencies for platform %s/%s" , platform .OS , platform .Architecture ),
3233 llb .IgnoreCache ,
3334 ).Root ()
@@ -79,6 +80,7 @@ EXTRA_ARGS=()
7980while [[ $# -gt 0 ]]; do
8081 case "$1" in
8182 --model)
83+ [[ $# -ge 2 ]] || { echo "Error: --model requires a value"; exit 1; }
8284 MODEL="$2"
8385 shift 2
8486 ;;
@@ -91,8 +93,13 @@ while [[ $# -gt 0 ]]; do
9193 shift
9294 ;;
9395 --*)
94- EXTRA_ARGS+=("$1" "$2")
95- shift 2
96+ if [[ $# -ge 2 ]]; then
97+ EXTRA_ARGS+=("$1" "$2")
98+ shift 2
99+ else
100+ EXTRA_ARGS+=("$1")
101+ shift
102+ fi
96103 ;;
97104 *)
98105 if [[ -z "$MODEL" ]]; then
179186 # Direct HTTP/HTTPS download
180187 echo "Downloading model from URL: $MODEL"
181188 FILENAME=$(basename "$MODEL")
182- curl -L --progress-bar -o "/models/$FILENAME" "$MODEL"
189+ curl -fL --progress-bar -o "/models/$FILENAME" "$MODEL"
183190 else
184191 # HuggingFace repo - download GGUF files
185192 echo "Downloading GGUF files from HuggingFace: $MODEL"
217224func generateHFModelConfig (backend string ) string {
218225 return fmt .Sprintf (`# Check if model config matches the requested model (volume mount caching)
219226MODEL_NAME=$(echo "$MODEL" | tr '/' '-')
220- if [[ -f "/models/aikit-model.yaml" ]] && grep -q "model: ${MODEL}$ " /models/aikit-model.yaml 2>/dev/null; then
227+ if [[ -f "/models/aikit-model.yaml" ]] && grep -qF "model: ${MODEL}" /models/aikit-model.yaml 2>/dev/null; then
221228 echo "Found existing model config matching $MODEL in /models, skipping setup"
222229else
223230 if [[ -f "/models/aikit-model.yaml" ]]; then
0 commit comments