TerslerThe little junk rig that could

Source files / install · raw

tersler.conf

# tersler configuration (bash, sourced by every script)
#
# Defaults live here and are version-controlled. Put machine-specific values
# (model URL, host/port, overrides) into install/tersler.local.conf, which
# is sourced afterwards and ignored by git.
# `sudo ./install/install.sh config` copies both to /etc/tersler/.

# ---- paths ----
JR_PREFIX=/opt/tersler                 # builds, scripts, state
JR_MODEL_DIR=/opt/tersler/models       # GGUF files (~22 GB per 27B Q6_K)
JR_USER=""                              # service user; empty = the user who ran sudo

# ---- NVIDIA driver ----
# R580 is the LAST branch with Pascal (sm_60) support. Never use the
# "-open" kernel modules: they do not support Pascal.
# Headless: kernel module (DKMS) + CUDA/NVML libraries, no Xorg. The
# nvidia-driver-* meta package would pull in xserver-xorg-core.
DRIVER_PKG=nvidia-headless-580-server
DRIVER_EXTRA_PKGS=(nvidia-utils-580-server)   # nvidia-smi
DRIVER_BRANCH=580

# ---- CUDA ----
# CUDA 13 dropped Pascal; stay on 12.x. Toolkit only, no driver from NVIDIA's repo.
CUDA_KEYRING_URL=https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb
CUDA_PKG=cuda-toolkit-12-9
CUDA_HOME=/usr/local/cuda-12.9

# ---- kernel ----
KERNEL_PARAMS="iommu=pt"                # needed for GGML_CUDA_P2P=1

# ---- llama.cpp (P100 fork) ----
LLAMA_REPO=https://github.com/Kmic-68/llama.cpp
LLAMA_BRANCH=p100-optimizations
LLAMA_COMMIT=790a3eaa1                  # d90ec36a3 (reference build) + the 9-16-token GGML_ASSERT fix; bump after benchmarking
LLAMA_CMAKE_FLAGS=(
  -DGGML_CUDA=ON
  -DCMAKE_CUDA_ARCHITECTURES=60         # sm_60 ONLY: a 2nd arch disables the Pascal tuning
  -DGGML_CUDA_NCCL=OFF
  -DGGML_CUDA_FA_QUANTS=all
  -DCMAKE_BUILD_TYPE=Release
)
BUILD_JOBS=auto                         # auto = limited by RAM (~2.5 GB per nvcc job)

# ---- GPUs ----
GPU_POWER_LIMIT=150                     # W per card; more gave <1% in the reference build
GPU_ENABLE_ECC=0                        # 1 = set ECC on at boot if off (takes effect after reboot)

# ---- model ----
# Direct download URL of the GGUF (e.g. a Hugging Face ".../resolve/main/<file>.gguf"
# link). Must include the MTP head for --spec-type draft-mtp. Set it in the local conf.
MODEL_URL=""
MODEL_FILE=""                           # file name in JR_MODEL_DIR; default = basename of MODEL_URL
MODEL_SHA256=""                         # optional; verified after download
MODEL_HF_REPO=""                        # optional "owner/repo", lets check-updates watch it
MMPROJ_URL=""                           # optional vision encoder (mmproj GGUF) for image input
MMPROJ_FILE=""                          # file name in JR_MODEL_DIR; default = basename of MMPROJ_URL
MMPROJ_SHA256=""                        # optional; verified after download

# ---- serving engine ----
# Which service answers on LLAMA_HOST:LLAMA_PORT at boot: llama (tersler-llama, the 27B) or
# strata (tersler-strata, Flash-Next on qr0n's P100 Strata; set up with scripts/strata-test.sh prep).
# Both need both GPUs, so the units conflict; `install.sh services` enables the chosen one.
SERVE_ENGINE=llama
STRATA_SRC=$JR_PREFIX/src/p100-strata             # qr0n/p100-strata checkout + .venv
STRATA_WORK=$JR_PREFIX/strata                     # weight pack, MTP head, logs, config

# ---- llama-server ----
LLAMA_HOST=127.0.0.1                    # 0.0.0.0 to serve the LAN (no auth!)
LLAMA_PORT=8080
LLAMA_P2P=auto                          # auto = only if iommu=pt is active; 1/0 to force
LLAMA_ENV=(
  GGML_CUDA_GRAPHS_PRE_VOLTA=3
  LLAMA_SPEC_SAMPLE_TEMP=1.0              # matches --temp 1.0; Kmic build verifies with the speculative-sampling rule. 0 tested 2026-11-07: -12..-20 % tg
  LLAMA_SPEC_DRAFT_TOPK=20
)
LLAMA_ARGS=(
  -ngl 99 -sm tensor -fa 1 -ctk q4_0 -ctv q4_0
  -c 262144 -b 32768 -ub 2048 -np 1
  --spec-type draft-mtp --spec-draft-n-max 4 --spec-draft-p-min 0.2
  -ngld 99 -ubd 64 -ctkd q4_0 -ctvd q4_0
  --jinja --temp 1.0 --top-k 20 --top-p 0.95 --min-p 0.0
  --cache-ram 16384 -ctxcp 32            # host RAM for the prompt cache (MiB) + context checkpoints (~150 MiB each).
                                         # Was 3072/8 on 16 GB RAM after an OOM kill (2026-11-08); raised for 64 GB
                                         # (2026-11-10). Entries can overshoot the limit (6.2 GB for a 212k chat).
)

# ---- fan control (optional) ----
# Drives a board PWM header from GPU temperatures. Run
# `tersler-fan-control --discover` on the rig to find the values.
FAN_CONTROL=0
FAN_HWMON_NAME=""                       # e.g. nct6779 (from /sys/class/hwmon/*/name)
FAN_PWM=""                              # e.g. pwm2
FAN_INPUT=""                            # matching tach input, e.g. fan5 (logging only)
FAN_T_MIN=45                            # °C at which the fan runs at FAN_PWM_MIN
FAN_T_MAX=75                            # °C at which the fan runs at 255
FAN_PWM_MIN=60                          # 0-255
FAN_INTERVAL=3                          # seconds
FAN_SMOOTH=8                            # pwm follows the curve over ~N intervals (no pulsing on 1 °C steps)