Run FreeToken on a SwissGPU server
FreeToken is an open-source inference engine that can split model work between an NVIDIA GPU and system memory. This guide installs FreeToken 0.2.2 on a dedicated SwissGPU server, runs gpt-oss-20b and connects your local tools to its OpenAI-compatible API over SSH.
1. Rent a GPU server and connect
Start with an RTX 4090 with 24 GB of VRAM for this example. The RTX 5090 with 32 GB gives you more room for model weights and the attention cache. For larger models, check the exact quantization and budget for GPU memory, system RAM, disk and context length before renting.
- Open Rent a server, select a GPU and choose Ubuntu 26.04 LTS. Use the GPU catalogue to compare hardware or the Offers API to read prices and availability as JSON.
- Once installation finishes, use the SSH command and credentials shown on your server page. SwissGPU uses IPv6 by default. Follow the SSH guide for login and the network guide if you need shared IPv4.
- On the server, confirm Ubuntu 26.04 on
x86_64, a visible NVIDIA GPU and at least 50 GB of free disk space for this walkthrough. The toolkit, Python packages, model weights and kernel caches all use disk space.
. /etc/os-release
printf '%s (%s)\n' "$PRETTY_NAME" "$(uname -m)"
nvidia-smi
free -h
df -h "$HOME"FreeToken requires NVIDIA driver R580 or newer. For the CUDA 13.3 toolkit below, use a driver whose nvidia-smi header reports CUDA 13.3 or newer. NVIDIA lists Linux driver 610.43.02 for native CUDA 13.3 support. Check this before installing the toolkit. If the check fails on a fresh SwissGPU installation, contact SwissGPU support before continuing. See the CUDA 13.3 release notes.
2. Install the CUDA 13.3 toolkit
FreeToken can compile CUDA kernels when it first loads a model. nvidia-smi shows the driver’s CUDA capability. Run nvcc --version to check the installed toolkit. If you already have CUDA 13.3 under /usr/local/cuda-13.3, skip to the environment commands.
Run the following on the Ubuntu server. It adds NVIDIA’s signed Ubuntu 26.04 package repository and installs the versioned toolkit while keeping the installed driver.
cuda_repo=https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2604/x86_64
sudo apt-get update &&
sudo apt-get install -y build-essential ca-certificates curl &&
curl -fsSLo /tmp/cuda-keyring_1.1-1_all.deb "$cuda_repo/cuda-keyring_1.1-1_all.deb" &&
sudo dpkg -i /tmp/cuda-keyring_1.1-1_all.deb &&
sudo apt-get update &&
sudo apt-get install -y cuda-toolkit-13-3export CUDA_HOME=/usr/local/cuda-13.3
export PATH="$CUDA_HOME/bin:$PATH"
nvcc --versionCheck that nvcc reports release 13.3.
3. Install FreeToken in a Python environment
The commands below install uv for your user, create a Python 3.12 environment and install the pinned FreeToken release with its acceleration dependencies. Run them as your SSH user.
curl -fsSLo /tmp/uv-install.sh https://astral.sh/uv/install.sh &&
UV_INSTALL_DIR="$HOME/.local/bin" sh /tmp/uv-install.sh &&
mkdir -p "$HOME/freetoken" &&
cd "$HOME/freetoken" &&
"$HOME/.local/bin/uv" venv --python 3.12 --managed-python &&
"$HOME/.local/bin/uv" pip install --python .venv/bin/python "freetoken[accel]==0.2.2" &&
.venv/bin/ft --versionFrom ~/freetoken, run a small PyTorch operation on the GPU. You should see a CUDA 13.x build, your GPU name and CUDA test: 1.0.
.venv/bin/python - <<'PY'
import torch
print("PyTorch CUDA build:", torch.version.cuda)
print("GPU:", torch.cuda.get_device_name(0))
print("CUDA test:", torch.ones(1, device="cuda").item())
PY4. Download and serve gpt-oss-20b
This command pulls the public gpt-oss-20b checkpoint from Hugging Face on first use. Allow time for the download and compiler output. The command limits the first run to one active request and a 4,096-token sequence to reduce memory use.
cd "$HOME/freetoken"
export CUDA_HOME=/usr/local/cuda-13.3
export PATH="$CUDA_HOME/bin:$PATH"
.venv/bin/ft serve --model openai/gpt-oss-20b \
--served-model-name gpt-oss-20b \
--host 127.0.0.1 --port 1919 \
--max-running-requests 1 --max-seq-len-override 4096Keep this SSH session open. When FreeToken reports that the API is ready, open a second SSH session and run both requests. The first lists gpt-oss-20b. The second should return generated text in choices[0].message.content.
curl -fsS http://127.0.0.1:1919/v1/models
curl -fsS http://127.0.0.1:1919/v1/chat/completions \
-H 'Content-Type: application/json' \
-d '{
"model": "gpt-oss-20b",
"messages": [{"role": "user", "content": "Say hello from FreeToken in one sentence."}],
"max_tokens": 256,
"stream": false
}'5. Connect an app or agent through SSH
Keep FreeToken bound to 127.0.0.1 on the server. Run this command on your computer with the SSH hostname from your SwissGPU server page. For shared IPv4, use the dashboard’s SSH destination and preserve its -4 and -p options when adding the tunnel flags.
ssh -N -o ExitOnForwardFailure=yes -L 127.0.0.1:1919:127.0.0.1:1919 ubuntu@YOUR_SERVER_HOSTNAMELeave the tunnel open and repeat the test requests from a separate local terminal. Set an OpenAI-compatible client’s base URL to http://127.0.0.1:1919/v1 and its model to gpt-oss-20b. If the client requires a key field, use a placeholder such as local-freetoken for this loopback-only setup. Keep application traffic inside the SSH tunnel.
Troubleshooting
- GPU or CUDA check fails. Rerun
nvidia-smiandnvcc --versionin the launch shell. Apply theCUDA_HOMEandPATHexports again after logging back in. Check the error against the NVIDIA installation guide. - Model load runs out of memory. Check free GPU memory with
nvidia-smiand available system RAM withfree -h. Stop other jobs you own, keep concurrency at one and try a shorter context or a GPU with more VRAM. See the FreeToken model guide before changing checkpoints or offload settings. - Download stalls. Check free space with
df -h "$HOME"and make sure the server can reach Hugging Face. Rerun the same serve command to reuse cached files. - The local API is unreachable. Test
/v1/modelson the server first. Then check the tunnel and dashboard SSH command. If local port 1919 is busy, change the first port in the tunnel to 1920 and use port 1920 in your local client.
Press Ctrl+C in the server terminal to stop FreeToken. Save any work you want to keep before releasing or reinstalling the server. Manage the rental from your SwissGPU dashboard and check pricing and billing for when charges end.
For model settings and other launch options, see the FreeToken 0.2.2 CLI reference.