#!/usr/bin/env bash set -euo pipefail # NemoClaw deployment helper for the Desineuron SGLang runtime. # This script intentionally avoids Ollama-era assumptions and configures # NemoClaw/OpenShell to talk to the shared OpenAI-compatible SGLang endpoint. NVME_ROOT="${NVME_ROOT:-/opt/dlami/nvme/nemoclaw}" SGLANG_BASE_URL="${SGLANG_BASE_URL:-https://llm.desineuron.in}" SGLANG_MODEL="${SGLANG_MODEL:-qwen3.6:35b-a3b}" SGLANG_API_TOKEN="${SGLANG_API_TOKEN:-}" OPENSHELL_PORT="${OPENSHELL_PORT:-8080}" AGENT_NAME="${AGENT_NAME:-velocity-sentinel}" if [[ "${EUID}" -ne 0 ]]; then echo "Run this script with sudo or as root." exit 1 fi echo "==> Desineuron NemoClaw deploy" echo "NVME root : ${NVME_ROOT}" echo "SGLang base URL: ${SGLANG_BASE_URL}" echo "Model : ${SGLANG_MODEL}" echo "Agent : ${AGENT_NAME}" mkdir -p "${NVME_ROOT}"/{logs,state,home} if ! command -v node >/dev/null 2>&1; then curl -fsSL https://deb.nodesource.com/setup_22.x | bash - apt-get update -y apt-get install -y nodejs fi if ! command -v docker >/dev/null 2>&1; then apt-get update -y apt-get install -y docker.io systemctl enable --now docker fi if ! command -v openshell >/dev/null 2>&1; then npm install -g @nvidia/openshell || true fi if ! command -v nemoclaw >/dev/null 2>&1; then npm install -g @nvidia/nemoclaw || true fi cat >/etc/default/desineuron-nemoclaw </dev/null 2>&1; then openshell inference set \ --provider compatible-endpoint \ --base-url "${SGLANG_BASE_URL}/v1" \ --api-key "${SGLANG_API_TOKEN:-desineuron}" \ --model "${SGLANG_MODEL}" \ --context-window 8192 \ --max-tokens 4096 || true fi cat >/etc/systemd/system/desineuron-nemoclaw-gateway.service <