#!/bin/bash # Launch llama-server for the Genoria Qwen3.6-27B Fable-Fusion-711 demo. # Every knob is a runtime env var so it can be tuned from Space settings # without a rebuild. Defaults follow DavidAU's model card ("thinking mode"): # temperature=1.0 top_p=0.95 top_k=20 min_p=0.0 repetition_penalty=1.0 set -euo pipefail THREADS="${THREADS:-$(nproc)}" KV_QUANT="${KV_QUANT:-q8_0}" ARGS=( --model "$MODEL_PATH" --alias "${MODEL_ALIAS:-genoria/qwen3.6-27b-fable-fusion-711}" --host 0.0.0.0 --port "${PORT:-7860}" --ctx-size "${CTX_SIZE:-8192}" --n-predict "${MAX_TOKENS:-8192}" --threads "$THREADS" --n-gpu-layers "${NGL:-999}" --cache-type-k "$KV_QUANT" --cache-type-v "$KV_QUANT" --temp "${TEMP:-1.0}" --top-p "${TOP_P:-0.95}" --top-k "${TOP_K:-20}" --min-p "${MIN_P:-0.0}" --repeat-penalty "${REPEAT_PENALTY:-1.0}" --presence-penalty "${PRESENCE_PENALTY:-0.0}" --jinja --no-warmup ) # Vision (image-text-to-text) via the repo's mmproj; disable with ENABLE_VISION=0 if [[ "${ENABLE_VISION:-1}" == "1" && -f "${MMPROJ_PATH:-}" ]]; then ARGS+=(--mmproj "$MMPROJ_PATH") fi # Escape hatch for any extra llama-server flags if [[ -n "${EXTRA_ARGS:-}" ]]; then # shellcheck disable=SC2206 ARGS+=(${EXTRA_ARGS}) fi echo "Starting llama-server: model=$MODEL_PATH threads=$THREADS ctx=${CTX_SIZE:-8192} kv=$KV_QUANT" exec /app/llama-server "${ARGS[@]}"