Skip to main content
Deploy Qwen3-8B on a Vast.ai GPU with vLLM and connect OpenClaw to it for private, self-hosted AI conversations with tool use.

Overview

OpenClaw is an open-source AI assistant that runs locally on your machine. It supports multiple model providers through an OpenAI-compatible API, including self-hosted models via vLLM. In this guide, you will:
  1. Launch a vLLM inference server on a Vast.ai GPU serving Qwen3-8B
  2. Install and configure OpenClaw locally to connect to the remote vLLM server
  3. Send messages through OpenClaw and receive responses from Qwen3-8B
This gives you a private AI assistant powered by your own GPU instance, no API keys from third-party providers needed.

Requirements

This guide creates a paid GPU instance that bills by the hour. An RTX 3090 typically costs $0.15-0.20/hr, following this guide end-to-end takes about 10 minutes and costs less than $0.05. Remember to destroy the instance when you’re done, see Cleanup.

Step 1: Install the Vast.ai CLI

Bash
Verify the CLI is working:
Bash
You should see your account details and credit balance.

Step 2: Install OpenClaw

Bash
Verify the installation:
Bash
Text
OpenClaw requires Node.js 22.12.0 or later. If you see a version error, update Node.js or use nvm to install a compatible version.
This guide requires OpenClaw 2026.2.13. Later versions have a known bug where the embedded agent times out when connecting to self-hosted OpenAI-compatible backends like vLLM, even though the server is responding correctly. If you have a newer version installed, downgrade with npm install -g openclaw@2026.2.13.

Step 3: Find a GPU Instance

Search for an RTX 3090 with direct port access:
Bash
The results show available machines sorted by price. Note the ID in the first column, you will use it in the next step. The RTX 3090 (24GB VRAM) is the minimum GPU for Qwen3-8B. The model requires ~15 GiB of VRAM, leaving ~4.5 GiB for KV cache.

Step 4: Deploy vLLM with Qwen3-8B

Create an instance using the offer ID from Step 3. The offer ID is in the first column (ID) of the search results.
Bash
Replace YOUR_OFFER_ID with the ID from Step 3 (e.g., 12345678).
Text
Note the new_contract value, this is your instance ID, which is different from the offer ID. You will use the instance ID in the remaining steps. This command uses Vast’s vLLM image, which includes a reverse proxy that automatically generates an authentication token (OPEN_BUTTON_TOKEN) for your instance. Key environment variables:
The --max-model-len value of 32000 is tuned for the RTX 3090. The model uses ~15 GiB of VRAM, leaving ~4.5 GiB for KV cache. Using 32768 (Qwen3-8B’s native context) will fail with an out-of-memory error.
If the command returns success: False, the machine may be unavailable. Try a different offer ID from Step 3.

Step 5: Wait for Model Loading

Replace YOUR_INSTANCE_ID with the new_contract value from Step 4 (e.g., 98765432). Wait for the status to show running:
Bash
Once the instance is running, SSH in and watch the vLLM log until you see Application startup complete.:
Bash
Bash
Replace PORT and HOST with the values from the ssh-url output (e.g., ssh://root@ssh5.vast.ai:33426 means HOST=ssh5.vast.ai and PORT=33426). vLLM will download the model weights (~16 GB), then initialize the GPU and start the API server. This typically takes 3-8 minutes depending on download speed. Press Ctrl+C to stop watching once you see the startup message.

Step 6: Get Connection Details

Find your instance’s IP address and port:
Bash
Text
Next, retrieve the authentication token. The instance automatically generates an OPEN_BUTTON_TOKEN that protects the API. SSH into the instance to get it:
Bash
Text
Bash
Text
Save this token, you will need it for all API requests and for the OpenClaw configuration. Verify the API is responding:
Bash
JSON
Test a chat completion:
Bash
You should see Qwen3-8B introduce itself: “I am Qwen, a large language model developed by Alibaba Cloud.”
Qwen3-8B includes a thinking mode by default. The response may contain <think>...</think> reasoning tokens before the final answer. This is expected behavior.

Step 7: Configure OpenClaw

Set the vLLM API key environment variable to the OPEN_BUTTON_TOKEN from Step 6:
Bash
Create the OpenClaw configuration directory and file:
Bash
Create ~/.openclaw/openclaw.json:
JSON
Replace INSTANCE_IP:EXTERNAL_PORT with the values from Step 6. Key configuration fields: Verify OpenClaw can see the model:
Bash
Text

Step 8: Test OpenClaw

Send a message through OpenClaw to the vLLM backend:
Bash
Text
The --thinking off flag disables Qwen3’s reasoning mode. Without it, responses may include <think>...</think> tokens before the answer. You now have a private AI assistant powered by your own GPU, no third-party API keys required. From here, you can start an interactive session, connect additional tools, or swap in a different model.

Troubleshooting

Instance stuck in “loading”

If the instance stays in loading for more than 15 minutes, it may have failed silently. Destroy it and try a different offer from Step 3:
Bash

“Model context window too small” error

OpenClaw requires a minimum context window of 16,000 tokens. If you see this error, check that --max-model-len in the vLLM creation command is set to at least 32000. OpenClaw’s system prompt and tool schemas consume approximately 12,000-13,000 tokens, so the model needs enough remaining context for your messages and responses.

”auto tool choice requires —enable-auto-tool-choice” error

OpenClaw uses tool calling by default. Add --enable-auto-tool-choice --tool-call-parser hermes to the vLLM creation command.

”LLM request timed out” with newer OpenClaw versions

OpenClaw versions after 2026.2.13 have a known bug in the embedded agent’s streaming response path. The vLLM server generates tokens correctly, but OpenClaw’s client never commits the assistant payload, causing a timeout after ~30 seconds. Direct curl requests to the same endpoint work fine. To fix this, downgrade to the compatible version:
Bash

Context overflow errors

If you see “Context overflow: prompt too large for the model”, the conversation has exceeded the model’s context window. Start a fresh session:
Bash

Cleanup

When you’re done, destroy the instance to stop billing:
Bash

Resources