# darkscarlett-charrp-reasoning — Dark-Scarlett-v1.0-27B NVFP4A16 char-rp-reasoning seat
# (THINKING default) on ana-ml2 GPU1. Replaces the retired heretic2-charrp-reasoning seat.
#
# Qwen3.6 hybrid GatedDeltaNet linear-attention -> KV-cheap, serves the full native 256K.
# Quantized with llm-compressor NVFP4A16 loaded through the Qwen3_5ForConditionalGeneration
# WRAPPER class (an AutoModelForCausalLM save produces a flat config vLLM/SGLang both reject;
# the wrapper keeps the config they accept). Served --language-model-only (text RP).
# MTP was dropped by the quant loader -> deferred -> NO --speculative-config.
#
# Co-located on GPU1 with the utility model cluster (rerankers/embed/reward/selene/coder/lfm).
# Tunables in .env.

name: darkscarlett-charrp-reasoning

services:
  vllm-darkscarlett-rp:
    image: ${DS_IMAGE:-vllm/vllm-openai:latest}
    container_name: ${DS_CONTAINER:-vllm-darkscarlett-rp}
    restart: unless-stopped
    ipc: host
    ports:
      - "${DS_PORT:-8018}:8000"
    volumes:
      - /tank/aimodels:/tank/aimodels
    environment:
      - PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
      - VLLM_API_KEY=${API_KEY:-}
    command:
      - ${DS_MODEL:-/tank/aimodels/darkscarlett-nvfp4-work/Dark-Scarlett-v1.0-27B-NVFP4A16-wrapper}
      - --quantization
      - compressed-tensors
      - --language-model-only
      - --served-model-name
      - char-rp-reasoning
      - --reasoning-parser
      - qwen3
      - --tool-call-parser
      - qwen3_coder
      - --enable-auto-tool-choice
      - --max-model-len
      - "${DS_MAX_MODEL_LEN:-262144}"
      - --max-num-seqs
      - "${DS_MAX_NUM_SEQS:-32}"
      - --gpu-memory-utilization
      - "${DS_GPU_MEM_UTIL:-0.44}"
      - --kv-cache-dtype
      - fp8
      - --trust-remote-code
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              device_ids:
                - "${DS_GPU_ID:-1}"
              capabilities:
                - gpu
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 600s
    networks:
      - tnet
    labels:
      - homepage.group=AI - Inference
      - homepage.name=char-rp-reasoning (Dark-Scarlett NVFP4)
      - homepage.icon=mdi-brain
      - homepage.description=Dark-Scarlett-v1.0-27B NVFP4A16 thinking seat, 256K (ana-ml2 GPU1)
      - homepage.href=http://10.250.50.54:${DS_PORT:-8018}/docs

networks:
  tnet:
    name: traefik-net
    external: true
