Connecting DGX Spark privately via WireGuard
The DGX is an optional local LLM server in Graz. The cloud voice pipeline remains independent; an outage of the home line must not cause an unverified complete telephony outage. Whether your quantized 8B/14B model reaches the required quality/latency is determined by measurement. This guide does not download any model automatically and does not promise any GPU capacity. NVIDIA DGX Spark operation
Cloudhost: 10.70.0.1 ── WireGuard/UDP 51820 ── DGX: 10.70.0.2
Voiceworker ── http://10.70.0.2:8000/v1 ── privater LLM
└─ bei Vor-Ausgabe-Fehler/Timeout ── Cloud-LLM
1. Generate separate keys for each host
Install WireGuard on the cloud host and the DGX. Copy deploy/wireguard/prepare_peer.py to the DGX as well. On each host use separate keys:
sudo apt-get install -y wireguard
sudo python3 deploy/wireguard/prepare_peer.py keys --directory /etc/wireguard/aihub
The helper creates the private file with mode 0600, processes it only in memory/via stdin and does not output it. It does not overwrite existing keys. Transfer only public.key to the other host, for example as cloud-public.key or dgx-public.key. Private keys are written neither into chat messages, wg set ...-arguments nor into the shell history. WireGuard key handling
2. Create configurations
Cloud host, once the DGX public key is available:
sudo python3 deploy/wireguard/prepare_peer.py config --role cloud --directory /etc/wireguard/aihub --peer-public-file /etc/wireguard/aihub/dgx-public.key --output /etc/wireguard/wg-aihub.conf
DGX, once the cloud public key is available; replace CLOUD_PUBLIC_IPV4:
sudo python3 deploy/wireguard/prepare_peer.py config --role dgx --directory /etc/wireguard/aihub --peer-public-file /etc/wireguard/aihub/cloud-public.key --endpoint CLOUD_PUBLIC_IPV4:51820 --output /etc/wireguard/wg-aihub.conf
The cloud listens on UDP 51820. The DGX initiates the connection and uses PersistentKeepalive=25, so this peer does not normally require port forwarding in the home router. AllowedIPs contains only the respective peer; your other internet traffic is not sent through the tunnel as the default route. NAT keepalive
sudo systemctl enable --now wg-quick@wg-aihub
sudo wg show wg-aihub
wg show shows public peer/handshake information, not the private key. wg showconf on the other hand, can reveal the private configuration content and is not used for diagnostics here. From the cloud, check ping -c 3 10.70.0.2, from the DGX ping -c 3 10.70.0.1. Open UDP 51820 only on the cloud host; do not expose TCP 8000 publicly.
3. Choose the model and inference server deliberately
Check on the DGX uname -m, nvidia-smi and the installed CUDA compiler. Update DGX OS/runtime according to NVIDIA's instructions. Choose a commercially usable quantized instruct model with 8B or 14B parameters to start with. Document the source, license, quantization, chat template and file checksum. A specific “latest Qwen version” is not fixed without verification.
As a reproducible, OpenAI-compatible serving path, llama.cpp is planned. Choose a verified release/commit, build it on ARM64 with CUDA matching the DGX and install the binary under /opt/llama.cpp/build/bin/llama-server:
sudo apt-get install -y git cmake build-essential
git clone https://github.com/ggml-org/llama.cpp.git
cd llama.cpp
git checkout --detach DEIN_GEPRUEFTER_RELEASE_ODER_COMMIT
cmake -S . -B build -DGGML_CUDA=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release
cmake --build build --target llama-server --parallel 8
sudo install -d -m 0755 /opt/llama.cpp/build/bin
sudo install -m 0755 build/bin/llama-server /opt/llama.cpp/build/bin/llama-server
ldd /opt/llama.cpp/build/bin/llama-server
Replace the commit placeholder. If the compiler/GPU target is not supported, adjust the runtime/build based on the selected release; do not use an x86-only container on the ARM64 DGX. Place the deliberately obtained model at /srv/aihub-models/operator-model.gguf manually. The project template does not obtain any model itself. Official CUDA build
4. Set up the private server key and service
On the new DGX, create a system user aihub-llm if it does not exist yet. It needs read access to the binary/model, not a root account:
sudo useradd --system --user-group --home-dir /nonexistent --shell /usr/sbin/nologin aihub-llm
sudo install -d -o aihub-llm -g aihub-llm -m 0700 /etc/aihub-dgx
sudo install -d -o root -g aihub-llm -m 0750 /srv/aihub-models
sudo install -o root -g aihub-llm -m 0640 /PFAD/ZU/DEINEM_MODELL.gguf /srv/aihub-models/operator-model.gguf
Replace the model path and check that ldd does not report any missing CUDA/system libraries. Transfer the already generated AIHUB_DGX_API_KEY from the protected cloud environment via a secure channel; do not output it as a CLI argument. Write it to the local file using hidden input:
sudo python3 - <<'PY'
import getpass, os, pwd
key = getpass.getpass('DGX API-Key verdeckt eingeben: ').strip()
if not key or '\n' in key:
raise SystemExit('Ungültiger Key')
account = pwd.getpwnam('aihub-llm')
fd = os.open('/etc/aihub-dgx/api-key', os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0o600)
with os.fdopen(fd, 'w') as file:
file.write(key + '\n')
os.chown('/etc/aihub-dgx/api-key', account.pw_uid, account.pw_gid)
PY
The template deploy/dgx/aihub-llm.service binds exclusively to 10.70.0.2:8000, reads the key from the protected file and gives the API model as an alias aihub-local for the API model. --parallel 4, context size and GPU offloading are starting parameters for tests, not a performance promise. Adjust them to the model actually chosen and the measured memory usage. Server/key file options
The service explicitly enables the model-specific Jinja chat template path for tool calls and disables the built-in web interface. With your chosen GGUF model, test an actual search_knowledge-tool turn; the model and chat template must emit tool calls correctly. A reachable /v1-endpoint alone does not prove this capability.
Install the service only after checking the paths/permissions:
sudo cp deploy/dgx/aihub-llm.service /etc/systemd/system/aihub-llm.service
sudo systemctl daemon-reload
sudo systemctl enable --now aihub-llm.service
sudo systemctl status aihub-llm.service
sudo ss -lntp
TCP 8000 must not listen on 0.0.0.0, the LAN IP or the public address. Use your actual firewall to allow only the cloud peer on the WireGuard interface. Existing DGX firewall rules are not replaced wholesale.
5. Cloud worker and hybrid mode
In the cloud operator file:
AIHUB_DGX_BASE_URL=http://10.70.0.2:8000/v1
AIHUB_DGX_MODEL=aihub-local
AIHUB_DGX_API_KEY=DERSELBE_GESCHUETZTE_SERVERKEY
AIHUB_LOCAL_LLM_TIMEOUT_SECONDS=1.2
VOICE_LLM_PROVIDER=openai
OPENAI_MODEL=DEIN_VERFUEGBARES_CLOUDMODELL
Here, HTTP only runs inside the encrypted WireGuard path as transport. A URL entered freely in the agent must not override the operator target. Check the complete configuration:
sudo docker compose --env-file deploy/.env.production -f deploy/compose.yml run --rm --no-deps app python manage.py check-config --voice --hybrid
sudo docker compose --env-file deploy/.env.production -f deploy/compose.yml up -d --force-recreate app
sudo docker compose --env-file deploy/.env.production -f deploy/compose.yml --profile voice up -d --force-recreate voice-worker-a voice-worker-b
In the assistant, set the field data.llm_route=hybrid and publish the agent version only once the local URL, model ID and cloud provider work. Alternatively, use the workspace setting llm_route=hybrid, which applies as long as the agent does not specify its own route (PATCH /api/settings with {"llm_route":"hybrid"}).
Also check from the Docker voice container that the private DGX is reachable. A successful host ping alone does not prove a container route. If there are problems, check Docker bridge/NAT/forwarding rules and the VPN handshake time without capturing headers or keys. Each additional physical worker machine needs its own peer/key and its own matching VPN address; never copy the private cloud key to multiple hosts.
6. Verify the fallback for real
Make a single authorized call. Then, for a controlled test, stop only aihub-llm, then only the DGX WireGuard peer. Check that the next response turn switches to the cloud model before local output is repeated. Measure outage/response times and watch the error counters. Then start the services again and check the recovery.
A timeout value of 1.2 seconds is a configuration target, not a guaranteed end-to-end response time. Audio already generated, interrupted tool actions and provider limits need their own error handling. The load/failure evidence belongs in the record under Capacity acceptance, not in an unsubstantiated marketing promise.