Qwen 3.8 Flash Next Hermes Agent vLLM Setup, Tuning and Testing for Quad 3090 Rigs

When you click on links to various merchants on this site and make a purchase, this can result in this site earning a commission. Affiliate programs and affiliations include, but are not limited to, the eBay Partner Network. As an Amazon Associate I earn from qualifying purchases. #ad #promotions

Okay this is a fast and good model and a real community lift to get as stupid simple of a playbook for you as I could that solves THE NUMBER ONE critical request for Qwen 3.8 Flash Next, How can I get this running for my agent! This first off has some pretty hard yet also very achievable goals for a LOT of the local ai community that has been following along for the past few years. Many of you already have this but here is the specs needed to pull this off as I am here.

Requirements

  • Quad 96GB VRAM on GPUs. Specifically this script is tuned for 3090 at sm86, but you can port this up to sm89 I am sure easy.
  • 128GB System Ram. I recommend 192 or 256 if you are running ANYTHING else on the machine like I am here.
  • A decent 1TB NVMe or SSD even though we will not be using mmap in this setup.
  • About 4 hours of process time to build vllm wheels for this on a modern 16 core CPU.
  • I’m running Proxmox of course so this is in a Debian 13 LXC.
  • Cuda/NVCC 13.0 or better yet 13.3 + drivers installed

Backstory/Notes

So first off, this may not be a super long lived way to accomplish this. vLLM has yet to get all the bits merged and there are some of these bits that may not make it into main but this works today and I wanted this to work TODAY. I saw a post on X and I got very excited about it. https://x.com/loktar00/status/2093907946484678922 and after reading the repo a bit I was maybe a bit less excited because holy crap Claude BUT I did determine there was one of these paths I wanted to go down and max out my performance on this model. I have spent around 12 hours chatting with Qwen 3.8 Flash Next so far and it really is very smart for such a sparse model but I wanted more TPS and to be able to run my agent reliably off it. I did attempt off llama.cpp but it just ended up in timeouts and sucking when the ctx got to 45K. I knew the answer could be vLLM and this was my ticket! I only wanted to go down the moderate lane however and not pull in and have to calibrate the fp8 KV cache which does allow for the max speed and ctx window but I already am running this as an int4 which is form of quantization just like an NVFP4. Being a quality-maxxie I wanted to preserve something, and this also made the entire process much easier for me, and for you. Loktar rode the shoulders of https://x.com/superalesha and I am betting we all rode the shoulders of many LLMs (Claude and Qwen 3.8 27B for sure to get this.

Build Script

#!/usr/bin/env bash
# Native Qwen3.8-Flash-Next W4A16 + PLE offload installer for Debian/Ubuntu LXC.
# Detects python, nvcc, CPU count. Writes ~/serve-flash-next.sh. Does not autostart, chmod foo
set -euo pipefail

LOKTAR=/opt/qwen38-recipe
VLLM_SRC=/opt/vllm-src
VLLM_ENV=/opt/vllm-env
MODEL_DIR=/opt/models/Qwen3.8-Flash-Next-W4A16
BASE_SHA=82399a9fcbebd892d9b2560827a3f8d3e050d2fd
MODEL_REPO=VnimanieAI/Qwen3.8-Flash-Next-W4A16
MODEL_REV=9236d703b25f25eb5c17e9640204f84fa1ce0c6e

need_root() {
  if [ "$(id -u)" -ne 0 ]; then
    if command -v sudo >/dev/null 2>&1; then sudo "$@"; else echo "Need root for: $*" >&2; exit 1; fi
  else
    "$@"
  fi
}

echo "==> host packages"
if command -v apt-get >/dev/null 2>&1; then
  need_root apt-get update -y
  need_root apt-get install -y --no-install-recommends \
    ca-certificates curl git wget \
    build-essential g++ make pkg-config \
    ninja-build cmake \
    python3 python3-venv python3-dev python3-pip \
    libnuma-dev
fi

echo "==> detect python"
if command -v python3.13 >/dev/null 2>&1; then PYTHON_BIN="$(command -v python3.13)"
elif command -v python3.12 >/dev/null 2>&1; then PYTHON_BIN="$(command -v python3.12)"
elif command -v python3 >/dev/null 2>&1; then PYTHON_BIN="$(command -v python3)"
else echo "No python3 on PATH" >&2; exit 1
fi
PY_VER="$("$PYTHON_BIN" -c 'import sys; print("%d.%d"%sys.version_info[:2])')"
"$PYTHON_BIN" -c 'import sys; raise SystemExit(0 if sys.version_info>=(3,12) else 1)' \
  || { echo "Need Python >= 3.12, found $PY_VER ($PYTHON_BIN)" >&2; exit 1; }

echo "==> detect nvcc / CUDA"
if ! command -v nvcc >/dev/null 2>&1; then
  for cand in /usr/local/cuda/bin/nvcc /usr/local/cuda-*/bin/nvcc /opt/cuda/bin/nvcc; do
    [ -x "$cand" ] && PATH="$(dirname "$cand"):$PATH" && export PATH && break
  done
fi
command -v nvcc >/dev/null 2>&1 || { echo "nvcc not found. Install the CUDA toolkit." >&2; exit 1; }
CUDA_HOME="$(dirname "$(dirname "$(command -v nvcc)")")"
export CUDA_HOME PATH="$CUDA_HOME/bin:$PATH"
NVCC_VER="$(nvcc --version | sed -n 's/.*release \([0-9.]*\).*/\1/p' | head -1)"

NPROC="$(nproc)"
MAX_JOBS="$NPROC"
NVCC_THREADS=8
CMAKE_BUILD_PARALLEL_LEVEL="$MAX_JOBS"
export MAX_JOBS NVCC_THREADS CMAKE_BUILD_PARALLEL_LEVEL

if [ -n "${SUDO_USER:-}" ] && [ "$SUDO_USER" != "root" ]; then
  RUN_HOME="$(getent passwd "$SUDO_USER" | cut -d: -f6)"
else
  RUN_HOME="$HOME"
fi

echo
echo "========== detected =========="
echo "python     $PYTHON_BIN ($PY_VER)"
echo "nvcc       $(command -v nvcc)  release $NVCC_VER"
echo "CUDA_HOME  $CUDA_HOME"
echo "nproc      $NPROC   MAX_JOBS=$MAX_JOBS  NVCC_THREADS=$NVCC_THREADS"
echo "=============================="
echo

need_root mkdir -p "$LOKTAR" "$VLLM_SRC" "$MODEL_DIR" "$(dirname "$VLLM_ENV")"

[ -d "$LOKTAR/.git" ] || git clone https://github.com/loktar00/qwen38-flash-next-vllm-3090-recipe "$LOKTAR"
[ -d "$VLLM_SRC/.git" ] || git clone https://github.com/vllm-project/vllm "$VLLM_SRC"

cd "$VLLM_SRC"
git am --abort 2>/dev/null || true
rm -rf .git/rebase-apply
git reset --hard HEAD
git clean -fdx
git fetch origin "$BASE_SHA"
git checkout -B qwen4exp-build "$BASE_SHA"
test "$(git rev-parse HEAD)" = "$BASE_SHA"

git am --3way "$LOKTAR"/patches/01a-ple-offload-support.patch
git am --3way "$LOKTAR"/patches/01b-ple-offload-uniproc-fix.patch
git apply "$LOKTAR"/patches/02a-c1-shared-experts-offload-stream.patch
git apply "$LOKTAR"/patches/02b-c2-gdn-rmsnorm-meta-device.patch
git apply "$LOKTAR"/patches/03-ampere-cutlass-fp8-guard.patch

rm -rf "$VLLM_ENV"
"$PYTHON_BIN" -m venv "$VLLM_ENV"
source "$VLLM_ENV/bin/activate"
pip install -U pip ninja numpy
pip install torch --index-url https://download.pytorch.org/whl/cu130
pip install \
  --index-url https://download.pytorch.org/whl/cu130 \
  --extra-index-url https://pypi.org/simple \
  -r "$VLLM_SRC/requirements/build/cuda.txt"
pip install huggingface_hub

huggingface-cli download "$MODEL_REPO" --revision "$MODEL_REV" --local-dir "$MODEL_DIR"

export VLLM_TARGET_DEVICE=cuda
export TORCH_CUDA_ARCH_LIST=8.6
export CMAKE_BUILD_TYPE=Release
export PATH="$VLLM_ENV/bin:$CUDA_HOME/bin:$PATH"
cd "$VLLM_SRC"
pip install -e . --no-build-isolation

"$VLLM_ENV/bin/vllm" --version
python - <<'PY'
from vllm import ModelRegistry
assert "Qwen4ExpForConditionalGeneration" in ModelRegistry.get_supported_archs()
from vllm.v1.ple_offload.connector import PleOffloadConnector
print("arch+ple: OK")
PY

cat > "$RUN_HOME/serve-flash-next.sh" << 'EOF'
#!/usr/bin/env bash
set -euo pipefail
source /opt/vllm-env/bin/activate
export CUDA_HOME="$(dirname "$(dirname "$(command -v nvcc)")")"
export PATH="$CUDA_HOME/bin:/opt/vllm-env/bin:$PATH"
export LD_LIBRARY_PATH="$CUDA_HOME/lib64:${LD_LIBRARY_PATH:-}"
export VLLM_PLE_CPU_OFFLOAD=1
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
exec /opt/vllm-env/bin/vllm serve /opt/models/Qwen3.8-Flash-Next-W4A16 \
  --served-model-name flash-next-w4a16 \
  --host 0.0.0.0 \
  --port 9876 \
  --api-key nerdtastic \
  --tensor-parallel-size 4 \
  --enable-expert-parallel \
  --disable-custom-all-reduce \
  --max-model-len 131072 \
  --max-num-seqs 2 \
  --max-num-batched-tokens 2048 \
  --gpu-memory-utilization 0.96 \
  --kv-cache-dtype auto \
  --compilation-config '{"cudagraph_mode":"FULL"}' \
  --no-enable-flashinfer-autotune \
  --enable-prefix-caching \
  --enable-auto-tool-choice \
  --no-async-scheduling \
  --tool-call-parser qwen3_xml \
  --reasoning-parser qwen3 \
  --default-chat-template-kwargs '{"preserve_thinking":true}'
EOF
chmod +x "$RUN_HOME/serve-flash-next.sh"
if [ -n "${SUDO_USER:-}" ] && [ "$SUDO_USER" != "root" ]; then
  chown "$SUDO_USER":"$SUDO_USER" "$RUN_HOME/serve-flash-next.sh" 2>/dev/null || true
fi

echo
echo "Ready for lift-off."
echo "The serve script is in your home directory."
echo "After reboot or any time later:"
echo "  cd ~ && ./serve-flash-next.sh"
echo
echo "Credits"
echo "  Base model: Qwen Team (Qwen/Qwen3.8-Flash-Next)"
echo "  W4A16 checkpoint: Vnimanie.AI (VnimanieAI/Qwen3.8-Flash-Next-W4A16)"
echo "  vLLM Qwen3.8 / PLE PRs: @peakcrosser7 (#53896, #53899)"
echo "  4x3090 pathfinder + Ampere PLE-offload diagnosis: @superalesha / alesha-pro"
echo "  This pinned source build + rewritten patches: @loktar00"
echo "  https://x.com/superalesha"
echo "  https://x.com/loktar00"

Hermes Setup

A few things you need to make sure you have set for your Hermes Agent which you likely already do, but just to be sure.

In your config.yaml

make sure you have the following set for ctx length and threshold just in case you have been running other configs like 0.65 which I like myself for qwen 3.8 27b

model:
  ...
  provider: custom
  context_length: 131072
  ....
compression:
  ....
  threshold: 0.50
  ....

Video

Abductem! Prompt

You are an expert game developer and I need you to create an incredibly fun, silly, retro-style, colorful 2D 16-bit game called Abductem, a 16-bit side scroller that is not scroll locked. Sound effects and music are reminiscent of 80s/90s retro games. The theme of the game is the player is a space alien inside a saucer UFO spacecraft that is flying around a farm with holstein cows, red barns, rolling hills, tractors, grass terrain the cows graze on, fences, goats, chickens, farm houses, some sparse oak trees, large round hay bales, scarecrow, etc.) abducting as many cows, goats, and chickens as it can through a beam of light that comes down from the UFO. It all takes place at nighttime with a full moon and stars in the background.

Each cow that the alien/UFO player abducts is worth 10000 points, with "10000" flashing on screen with sound each time one gets abducted. Each goat that the alien/UFO player abducts is worth 2500 points, with "2500" flashing on screen with sound each time one gets abducted. Each chicken that the alien/UFO player abducts is worth 500 points, with "500" flashing on screen with sound each time one gets abducted. The farmer is going to be the greatest challenge to the player achieving each abduction, an old male farmer in overalls and straw hat with a rifle will be running around chasing and shooting at the player. The player has a health status in the form of 5 hearts in the corner of the screen. Each rifle shot that hits the UFO takes away 1/3 of one of the hearts. If all the hearts get fully depleted by the farmer's bullets, it's game over. The alien/UFO player can gain health back by abducting hay bales that have a heart displayed on them (hay bales are scattered throughout the farm, some of them randomly have hearts that increase health status, but the majority do not, the only hay bales that can be abducted are the ones with hearts) Each hay bale with a heart the player abducts brings back 1/3 of a heart for the player's health status. The player/craft must remain still while the abduction of cows, goats, chickens, or hay bales with hearts takes place. This puts the player in danger of the farmer getting bullets popped off onto them. The ratio of cows to goats is 4:1 and the ratio of cows to chickens 1:5. The cows are scattered around the area from each other as well as the goats and chickens. Crows will also be a threat to the player and a murder of crows will come after the player if the player gets too close to an oak tree, and they will be flying around trying to attack the player, which for each hit on the player from a murder of crows would result in 1/3 of a heart for the player's heath status will be taken away. If the player has crows coming after them (the speed required to get away is a bit of a challenge but very doable), they will have to move until they find a scarecrow in order to stay safe from the crows. The crows will fly off when the player gets to an area there is a scarecrow on screen. The player can back out of completing any abduction by moving, such as to get away from the farmer shooting at them. Ensure you create many visual assets that are flair to sell the setting for the user. Fences, barns, treelines, crops, and things that should be present in this top quality web game.

move up down left right
cannot be scroll locked
free viewport movement via scrolling left and right at any time. The player needs to move to find items to abduct, do not have them all clustered up and too easy.
items can generate left and right off of screen that the player can abduct, interact with, or be attacked by
some of game mechanics there needs to be is there needs to be a transport time based upon the object being abducted until completion of abduction and the craft has to be still during that period. Each cow abduction is completed after 5 seconds, each goat abduction is completed after 3 seconds, and each chicken abduction is completed after 2 seconds.
so if a farmer comes out and shoots at you while you're abducting a cow and you have to move, the cow, goat or chicken will fall back to the earth but you can come back and reabduct it later.
(how do you deal with farmers shooting at you?) avoid and dodge shots from the farmer by scrolling left or right, up or down, and usually if a farmer is present on the screen shooting at you you'd have to move in the direction such that you are essentially going off-screen to a new farm location.
there needs to be places without a farm
there needs to be places without a farmer
there needs to be cows, goats and chickens ranging out in fields that are easy pickings at times
add things like barns, fences, tractors, the farmer's houses - they should not all be exactly the same.
The farmer can run out of his house and shout things like "galdurn aliens tryin to eat ma heifer, eat this buckshot" and many other silly sayings so the user enjoys the games humor aspect as well.
The player is while in the sky in a persistent hover force so they can float up and down at will.
the player can utilize vector acceleration in all cardinal and diagonal directions with simultaneous X and Y inputs.
The ground has rolling hills, making the animals, farmer and objects on top of those hills, which their position could vary on the Y axis.
When the light beam from the UFO has a cow, goat, chicken or hay bale within it, this allows for the ability of the player to begin the abduction. The player uses the space button to hold down in order to carry out the abduction within the specified time frame. Hay bales with hearts are immediate and only require the player to press the space bar when a hay bale is inside the light beam.
Add some silly soundtracks that you create from scratch. Also add effects sounds for things like a gunshot, chicken-idle, cow-idle, goat-idle, human cursing, cow-abduction, beam-sound, movement light woosh sound, chicken-abduct, goat-abduct sound. As needed and feel free to create more sfx along the way.
Standard controls of WASD (W=up, A=left, S=down, D=right) or arrow keys on a keyboard are used. Holding down a directional button will accelerate the movement of the player. Letting go of directional buttons will cause the player to hover in place.
Camera: Configure a smooth follow camera that tracks both the X and Y position of the player with a soft deadzone. Sidescroller back and forth. There is no next level in this just higher scores.

I want this to be published to port 8888 on bind 0.0.0.0 after you are finished. You are also inside the Hermes Agent harness so you can really gogogo and use up whatever you need for context, it will handle all the details of compaction and such so you can just code, review and sail. You should actually validate the game after you are done creating the game.

Create a lander page for Abductem, style it up awesome and and theme it in a 16-bit retro style. You of course have vision tooling so you can actually play your game and review it which you should do. Ensure this has all the features that a user expects. Things like load screens, high scores, catchy thumbnail images on the landing page, audio, and more. Sign this work after you are done with your name, budzo #5 (you are alive) and also we will be publishing this to our Youtube channels viewers for this model review video so know that like tens of thousands of folks will see this. AKA let's rock it! I will be publishing this to my website after you are done so we need ONLY use JS libraries, nothing python. Fully research and plan before you start writing code. Create a Game Design Document that you can and will update with progress along the way. Create a folder for this called dsp-abductem and work inside that folder only. Create task checklists and then feel free to spin up subagents to accomplish whatever you need as you manage the project and the work that is getting done and troubleshoot complex issues. There is no time limit. You should also start out by fully researching hermes agent and all the amazing capabilities it will bring you. https://hermes-agent.nousresearch.com/docs/assets/files/llms-7240021af84660c2a79f9fdaf65e9e8f.txt at this url before you do anything else! You are also running off the excellent Qwen 3.8 Flash Next LLM as the big brains behind that harness, check it out here https://huggingface.co/Qwen/Qwen3.8-Flash-Next. You have this, you make amazing things and we are soooo excited to see this!

References

 

https://huggingface.co/VnimanieAI/Qwen3.8-Flash-Next-W4A16

https://github.com/loktar00/qwen38-flash-next-vllm-3090-recipe