Home / Articles / Practical notes: Qwen3.8–27B as new coding agent of choice with SGLang/vLLM and

This article is published in English.

Practical notes: Qwen3.8–27B as new coding agent of choice with SGLang/vLLM and

Operable walkthrough of Practical notes: Qwen3.8–27B as new coding agent of choice with SGLang/vLLM and: contracts, checks, and drop-in code slots for teams shipping this pattern.

1233 words

This walkthrough rebuilds the path from raw materials to a working system for: Qwen3.8–27B as new coding agent of choice with SGLang/vLLM and Claude. The focus is operable steps, explicit checks, and code that you can drop into a repo without guessing intent. For the Overview stage, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Keep configuration outside application code. Environment files, secret stores, and feature flags belong in one place operators can audit without reading the whole graph.

mkdir -p ~/.config/qwen38
cp "$(find ~/.cache/huggingface/hub/models--RadixArk--Qwen3.8-27B-NVFP4 -name chat_template.jinja | head -1)" ~/.config/qwen38/chat-template-sglang.jinja
Before:

    {%- set resolved_reasoning_effort = reasoning_effort|default('xhigh') %}
    {%- if resolved_reasoning_effort not in ('xhigh', 'medium', 'low') %}
        {{- raise_exception('Unexpected reasoning effort ' ~ reasoning_effort ~ '. Supported types are xhigh (default), medium, and low.') }}
    {%- endif %}

After:

{%- set resolved_reasoning_effort = reasoning_effort|default('xhigh') %}
{%- if resolved_reasoning_effort in ('max', 'high') %}
    {%- set resolved_reasoning_effort = 'xhigh' %}
{%- endif %}
{%- if resolved_reasoning_effort not in ('xhigh', 'medium', 'low') %}
    {{- raise_exception('Unexpected reasoning effort ' + resolved_reasoning_effort + '. Supported types are xhigh (default), medium, and low.') }}
{%- endif %}
Before:
        {%- if not loop.first %}
            {{- raise_exception('System message must be at the beginning.') }}
        {%- endif %}
After:
        {%- if not loop.first %}
            {{- '<|im_start|>user\n<system-reminder>\n' + content + '\n</system-reminder><|im_end|>' + '\n' }}
        {%- endif %}
#!/bin/bash

docker run --gpus all \
  --shm-size 32g \
  --rm \
  -p 8000:8000 \
  -v ~/.cache/huggingface:/root/.cache/huggingface \
  -v ~/.config/qwen38:/config \
  --ipc=host \
  lmsysorg/sglang:qwen38-27b \
  sglang serve \
    --trust-remote-code \
    --model-path RadixArk/Qwen3.8-27B-NVFP4 \
    --mem-fraction-static 0.5 \
    --attention-backend flashinfer \
    --chunked-prefill-size 8192 \
    --disable-prefill-cuda-graph \
    --reasoning-parser qwen3 \
    --tool-call-parser qwen3_coder \
    --speculative-algorithm DSPARK \
    --speculative-draft-model-path RadixArk/Qwen3.8-27B-DSpark \
    --chat-template /config/chat-template-sglang.jinja \
    --served-model-name local-spark-model \
    --mamba-full-memory-ratio 8.26 \
    --max-running-requests 8 \
    --language-only \
    --sleep-on-idle \
    --host 0.0.0.0 \
    --port 8000
hf download Inferact/Qwen3.8-27B-NVFP4
docker pull vllm/vllm-openai:v0.27.1
#!/bin/bash

docker run --gpus all \
      -v ~/.cache/huggingface:/root/.cache/huggingface \
      -v ~/.config/qwen38:/config \
      --env "HF_TOKEN=$HF_TOKEN" \
      -p 8000:8000 \
      --ipc=host \
      vllm/vllm-openai:v0.27.1 \
      --model Inferact/Qwen3.8-27B-NVFP4 \
      --tensor-parallel-size 1 \
      --enable-auto-tool-choice \
      --gpu-memory-utilization 0.8 \
      --max-model-len 262144 \
      --max-num-batched-tokens 8192 \
      --max-num-seqs 8 \
      --attention-backend flash_attn \
      --chat-template /config/chat-template-sglang.jinja \
      --tool-call-parser qwen3_coder \
      --reasoning-parser qwen3 \
      --load-format fastsafetensors \
      --enable-prefix-caching \
      --enable-chunked-prefill \
      --served-model-name 'local-spark-model' \
      --speculative-config '{"method":"mtp","num_speculative_tokens":3}' \
      --language-model-only
curl -fsSL https://claude.ai/install.sh | bash
export ANTHROPIC_BASE_URL=http://spark:8000
export ANTHROPIC_AUTH_TOKEN=dummy
export ANTHROPIC_MODEL=local-spark-model
From:
    --served-model-name local-spark-model \

To:
    --served-model-name claude \
From:
    --served-model-name local-spark-model \

To:
    --served-model-name local-spark-model claude \
ssh -N -L 8000:127.0.0.1:8000 spark

Operational checklist

The Operational checklist stage works best when treated as a measurable surface. Capture one golden transcript, one failure case, and the rollback note before expanding scope.

Record timings and token or query cost next to functional results. Cost visibility early prevents surprise bills when the path moves from demo to shared environments.

Budget tokens per turn and per session. Agentic tools expand context aggressively; hard caps keep demos from becoming surprise invoices.

Put human approval on edges that spend money or change production data. Compile-time wiring does not equal business completeness.

Write a short runbook: how to rotate keys, how to drain the queue, how to roll back the last ingest.

Prefer small, testable units over sprawling scripts. When a step fails, the failure should point at a single responsibility rather than a tangled pipeline.

Before promoting the stack, freeze versions, capture a golden transcript for the critical path, and confirm rollback steps. Shared environments need rate limits, tenancy checks, and a clear owner for secret rotation. Prefer boring reliability over clever one-off demos.

Batch note for f809a9c5f39a: keep provider keys out of the repo, set a per-session token ceiling, and store transcripts next to the eval fixtures so later model swaps stay comparable.

For the hardening note 0 stage, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Prefer small, testable units over sprawling scripts. When a step fails, the failure should point at a single responsibility rather than a tangled pipeline.

Hardening detail 0/876: measure wall time, error class, and token spend for this note, then decide whether to keep the change based on a fixed question set rather than anecdote.

When working through the hardening note 1 stage, write down the contract first: required inputs, success signal, and what happens on partial failure. That checklist keeps later code changes honest. Record timings and token or query cost next to functional results. Cost visibility early prevents surprise bills when the path moves from demo to shared environments.

Hardening detail 1/876: measure wall time, error class, and token spend for this note, then decide whether to keep the change based on a fixed question set rather than anecdote.

The hardening note 2 stage works best when treated as a measurable surface. Capture one golden transcript, one failure case, and the rollback note before expanding scope. Document the happy path and the recovery path together. Retries, human gates, and dead-letter handling are part of the product, not later polish.

Hardening detail 2/876: measure wall time, error class, and token spend for this note, then decide whether to keep the change based on a fixed question set rather than anecdote.

For the hardening note 3 stage, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Treat this stage as a contract between inputs and validated outputs. Name the artifacts, define success checks, and refuse silent partial completion.

Hardening detail 3/876: measure wall time, error class, and token spend for this note, then decide whether to keep the change based on a fixed question set rather than anecdote.

When working through the hardening note 4 stage, write down the contract first: required inputs, success signal, and what happens on partial failure. That checklist keeps later code changes honest. Keep configuration outside application code. Environment files, secret stores, and feature flags belong in one place operators can audit without reading the whole graph.

Hardening detail 4/876: measure wall time, error class, and token spend for this note, then decide whether to keep the change based on a fixed question set rather than anecdote.