# RadixArk/Qwen3.8-Flash-Next-NVFP4
# docker compose up -d   (the first start downloads the weights)
name: best_sglang_official_qwen38_flash_next
services:
  flashnext-official:
    image: lmsysorg/sglang:dev-qwen38-next-local
    container_name: flashnext-official
    gpus: all
    ipc: host
    shm_size: 32gb
    mem_limit: 86g
    memswap_limit: 86g
    ports:
    - 127.0.0.1:8000:8000
    ulimits:
      memlock: -1
      stack: 67108864
      nofile:
        soft: 1048576
        hard: 1048576
    environment:
      HF_HOME: /hf
      HF_TOKEN: ${HF_TOKEN:-}
      CUDA_VISIBLE_DEVICES: '0'
      PYTORCH_CUDA_ALLOC_CONF: expandable_segments:True
      SGLANG_OPT_MAMBA_SKIP_DECODE_LOCK: '1'
    volumes:
    - type: bind
      source: ${HF_HOME:-${HOME}/.cache/huggingface}
      target: /hf
      read_only: false
      bind:
        create_host_path: true
    entrypoint:
    - sglang
    command:
    - serve
    - --model-path
    - RadixArk/Qwen3.8-Flash-Next-NVFP4
    - --revision
    - 7b719225242aacd3dbd3f9407468c2ee9a9d2594
    - --served-model-name
    - Qwen3.8-Flash-Next
    - --host
    - 0.0.0.0
    - --port
    - '8000'
    - --tp
    - '1'
    - --quantization
    - modelopt_fp4
    - --fp4-gemm-backend
    - flashinfer_cutlass
    - --moe-runner-backend
    - flashinfer_cutlass
    - --page-size
    - '64'
    - --mamba-track-interval
    - '64'
    - --chunked-prefill-size
    - '4096'
    - --context-length
    - '262144'
    - --speculative-algorithm
    - NEXTN
    - --speculative-num-steps
    - '3'
    - --speculative-eagle-topk
    - '1'
    - --speculative-num-draft-tokens
    - '4'
    - --mamba-radix-cache-strategy
    - extra_buffer_lazy
    - --max-running-requests
    - '1'
    - --max-mamba-cache-size
    - '5'
    - --mamba-ssm-dtype
    - bfloat16
    - --mem-fraction-static
    - ${SGLANG_MEM_FRACTION_STATIC:-0.96}
    - --cuda-graph-max-bs-decode
    - '1'
    - --ple-offload-embedding
    - --reasoning-parser
    - qwen3
    - --tool-call-parser
    - qwen3_coder
    - --enable-metrics
    healthcheck:
      test:
      - CMD
      - curl
      - -fsS
      - http://127.0.0.1:8000/health
      interval: 15s
      timeout: 5s
      retries: 40
      start_period: 3600s
    restart: 'no'
