Skip to main content
Installation

Multiple nodes

Load balancing and failover across several vLLM instances for one model, installing and auto-updating the GPU node agent, remote vLLM deployment from the console, and what to watch when several gateways share one database.

Several inference upstreams

One model can have several vLLM instances. Under Upstreams on the model, add one row per server with its URL and --served-model-name.

  • Load balancing: every 3 seconds the gateway reads each vLLM's /metrics (the upstream URL without /v1, plus /metrics) and, together with its own in-flight count, sends each request to the least busy instance. Instances with KV cache usage above 80% are weighted down. Without metrics, requests are spread by in-flight count and weight.
  • Prefix-cache affinity: requests with the same system prompt and opening messages go to the same vLLM where possible, to reuse its prefix cache. When that instance is clearly busier than the least busy one, the request goes to the least busy one instead. Turn on --enable-prefix-caching in vLLM.
  • Failover: an upstream that fails to connect is skipped for 30 seconds and its requests go to the others. A 502 to 504 answer is retried on another upstream. When every upstream is unavailable, the fallback models are tried in order; without fallback models the gateway returns 502 upstream_unavailable.
  • Concurrency and priority: Model concurrency limit is the number of requests all upstreams handle at once; set it to the sum of each vLLM's --max-num-seqs. At capacity, requests queue by key priority for up to RST_FABRIC_QUEUE_TIMEOUT seconds. If vLLM runs with --scheduling-policy priority, turn on Forward priority so that priority also applies inside vLLM.

Suggested vLLM flags:

vllm serve Qwen/Qwen2.5-72B-Instruct \
  --served-model-name qwen2.5-72b \
  --host 0.0.0.0 --port 8000 \
  --api-key <internal-secret, optional> \
  --scheduling-policy priority

With --api-key set, enter the same value as the upstream's Upstream API key, so that vLLM cannot be called around the gateway.

The licence sets an inference node limit. The node count is the number of distinct host:port pairs across the enabled upstreams of all enabled models. A model that would exceed the limit cannot be saved.

Install the GPU node agent

The agent is a single static binary that reports GPU utilisation, memory, temperature, power and host memory and load to the gateway every 15 seconds. It needs the NVIDIA driver and systemd.

Steps

  1. In the console, open GPU Nodes, select Add node and enter a node name.

  2. Copy the access token (starting with fnd_, shown once) and the generated systemd unit.

  3. On the GPU server, install the binary from the package's agent/ directory and save the unit as /etc/systemd/system/rst-ai-fabric-agent.service:

    install -m 755 agent/rst-ai-fabric-agent /usr/local/bin/
    systemctl daemon-reload && systemctl enable --now rst-ai-fabric-agent

    You can also use agent/rst-ai-fabric-agent.service from the package and set RST_FABRIC_SERVER to the gateway URL and RST_FABRIC_NODE_TOKEN to the token.

  4. The node shows as online on the GPU Nodes page.

To troubleshoot collection, run one collection and print the result:

RST_FABRIC_SERVER=http://<gateway>:8080 RST_FABRIC_NODE_TOKEN=fnd_... rst-ai-fabric-agent -once

A node that has not reported for 60 seconds shows as offline.

Agent auto-update

The gateway image carries signed agent binaries for amd64 and arm64. After a gateway upgrade, agents older than the bundled version download the new one from the gateway, verify its signature and switch over when systemd restarts them. GPU nodes need no internet access.

  • Agents only move forward. If a new version fails to complete a heartbeat on three starts in a row, the agent returns to the previous working version and does not try that version again for 24 hours.
  • Keep StateDirectory=rst-ai-fabric-agent in the unit; new versions are staged in /var/lib/rst-ai-fabric-agent.
  • To turn auto-update off, set Environment=RST_FABRIC_AGENT_AUTO_UPDATE=0 in the unit.
  • When an agent's version differs from the bundled one, the GPU Nodes page shows the gateway's bundled version next to it.

Remote vLLM deployment

With remote management on, the console can start and stop vLLM containers on a GPU node and register them as model upstreams. The agent pulls its configuration, so the gateway never needs to reach a management port on the node.

Prerequisites

  • Docker and the NVIDIA Container Toolkit on the GPU node.
  • The agent runs as a user in the docker group: replace DynamicUser=yes in the unit with such a user, for example User=fabric-agent.

Steps

  1. Add these environment variables to the agent's unit and restart it:

    Environment=RST_FABRIC_AGENT_MANAGE=1
    Environment=RST_FABRIC_ALLOWED_IMAGES=vllm/vllm-openai
    Environment=RST_FABRIC_HF_CACHE=/data/hf-cache
    Environment=RST_FABRIC_MODEL_DIR=/data/models
    Environment=RST_FABRIC_ADVERTISE_HOST=10.0.0.5
    VariableDescription
    RST_FABRIC_AGENT_MANAGE1 turns remote management on
    RST_FABRIC_ALLOWED_IMAGESImages the agent may run, comma separated; default vllm/vllm-openai
    RST_FABRIC_HF_CACHEModel download cache; default /var/lib/rst-ai-fabric/hf-cache
    RST_FABRIC_MODEL_DIROptional local model directory, mounted read-only at /models in the container
    RST_FABRIC_ADVERTISE_HOSTAddress the gateway uses to reach this server. When it is an IP, vLLM ports are opened on that address only
  2. Create a deployment on the Deployments tab of the GPU Nodes page; see GPU nodes.

The agent runs only allowlisted images. Parameters entered in the console go to vLLM only; they cannot add Docker options such as privileged mode or host mounts. New deployments get a generated vLLM API key that the gateway sends automatically. If the network cannot reach Hugging Face, add HF_ENDPOINT=https://hf-mirror.com to the deployment's environment variables, or place the model in RST_FABRIC_MODEL_DIR.

Several gateways

Several gateways can share one PostgreSQL database. Keep in mind:

  • Set the same RST_FABRIC_SECRET_KEY in every gateway's .env; otherwise a key created on one gateway cannot be viewed on another.
  • Each gateway is activated separately and uses one of the licence's gateway activations. When none are left, activation reports max_nodes reached.
  • Key RPM, TPM and concurrency limits and model concurrency limits are counted on each gateway separately. Daily and monthly budgets and limits sync with usage in the database about once a minute.

On this page