#!/usr/bin/env bash set -euo pipefail CONTAINER_NAME="nim-llama-3.3-70b" IMAGE="nvcr.io/nim/meta/llama-3.3-70b-instruct:latest" PORT="8000" CACHE_DIR="/home/azurian/.cache/nim/llama-3.3-70b" if [[ -z "${NGC_API_KEY:-}" ]]; then echo "Errore: la variabile NGC_API_KEY non รจ definita." echo "Esegui:" echo "export NGC_API_KEY='LA_TUA_API_KEY'" exit 1 fi mkdir -p "$CACHE_DIR" chmod -R a+rwX "$CACHE_DIR" if docker ps -a --format '{{.Names}}' | grep -qx "$CONTAINER_NAME"; then echo "Rimuovo il container precedente..." docker rm -f "$CONTAINER_NAME" fi echo "Avvio Llama 3.3 70B NIM..." docker run -d \ --name "$CONTAINER_NAME" \ --restart unless-stopped \ --runtime=nvidia \ --gpus all \ --ipc=host \ --shm-size=32G \ -e NGC_API_KEY="$NGC_API_KEY" \ -v "$CACHE_DIR:/opt/nim/.cache" \ -p "${PORT}:8000" \ "$IMAGE" echo echo "Container avviato: $CONTAINER_NAME" echo "Log:" echo "docker logs -f $CONTAINER_NAME" echo echo "Health:" echo "curl http://localhost:${PORT}/v1/health/ready" echo echo "Modelli:" echo "curl http://localhost:${PORT}/v1/models"