docker-compose.yaml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. services:
  2. # vLLM server - serves the Huihui Qwen3.8-27B AWQ W4A16 checkpoint as "foundation"
  3. vllm:
  4. # Moving target: re-pull deliberately. 0.27.2rc1 (nightly) is the tested build;
  5. # v0.18.0 (also cached locally) predates qwen3_5 support.
  6. image: vllm/vllm-openai:nightly
  7. container_name: coding-stack-vllm
  8. restart: unless-stopped
  9. volumes:
  10. # HF cache root: /storage-models/vllm/hub/models--shawnw3i--…
  11. - /storage-models/vllm:/models
  12. environment:
  13. - HF_HOME=/models
  14. - VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS=1
  15. - VLLM_NO_USAGE_STATS=1
  16. - PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True,max_split_size_mb:512
  17. - VLLM_FLOAT32_MATMUL_PRECISION=high
  18. - VLLM_USE_FLASHINFER_SAMPLER=1
  19. - OMP_NUM_THREADS=1
  20. - CUDA_DEVICE_MAX_CONNECTIONS=8
  21. - VLLM_ALLOW_LONG_MAX_MODEL_LEN=1
  22. - TRITON_CACHE_DIR=/root/.triton/cache
  23. - VLLM_WORKER_MULTIPROC_METHOD=spawn
  24. - VLLM_MARLIN_USE_ATOMIC_ADD=1
  25. - VLLM_LOGGING_LEVEL=INFO
  26. shm_size: 8g
  27. ports:
  28. - "18080:8000"
  29. entrypoint: ["python3", "-m", "vllm.entrypoints.openai.api_server"]
  30. command:
  31. - --model
  32. - shawnw3i/Huihui-Qwen3.8-27B-abliterated-AWQ-MTP
  33. - --port
  34. - "8000"
  35. - --served-model-name
  36. - foundation
  37. # ~248k tokens: 20 GB AWQ weights + ~15.5 GiB f16 KV + overhead on 48 GB.
  38. - --max-model-len
  39. - "253952"
  40. - --reasoning-parser
  41. - qwen3
  42. - --tool-call-parser
  43. - qwen3_coder
  44. - --dtype
  45. - float16
  46. # Vision tower skipped. Drop this and lower --max-model-len to ~200000
  47. # if you ever want images through vLLM.
  48. - --language-model-only
  49. - --gpu-memory-utilization
  50. - "0.93"
  51. # One 250k-token sequence needs the whole KV pool; more seqs would starve it.
  52. - --max-num-seqs
  53. - "1"
  54. - --max-num-batched-tokens
  55. - "16384"
  56. - --enable-chunked-prefill
  57. - --enable-prefix-caching
  58. - --enable-auto-tool-choice
  59. - --trust-remote-code
  60. - --host
  61. - 0.0.0.0
  62. - --disable-log-stats
  63. networks:
  64. - coding-stack-network
  65. healthcheck:
  66. test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
  67. interval: 30s
  68. timeout: 10s
  69. retries: 5
  70. start_period: 900s
  71. deploy:
  72. resources:
  73. reservations:
  74. devices:
  75. - driver: nvidia
  76. count: all
  77. capabilities: [gpu]
  78. # OpenAI-compatible facade on :11433 that injects a SearXNG web_search tool
  79. proxy:
  80. image: python:3.11-slim
  81. container_name: coding-stack-proxy
  82. restart: unless-stopped
  83. ports:
  84. - "11433:11536"
  85. volumes:
  86. - ./proxy-passthrough.py:/app/proxy.py:ro
  87. environment:
  88. - BACKEND_URL=http://vllm:8000
  89. - SEARXNG_URL=http://host.docker.internal:8889
  90. - SEARXNG_RESULTS=5
  91. # vLLM serves without auth unless --api-key is added above
  92. # - BACKEND_API_KEY=
  93. extra_hosts:
  94. - "host.docker.internal:host-gateway"
  95. command: sh -c "pip install -q flask requests && python /app/proxy.py"
  96. networks:
  97. - coding-stack-network
  98. depends_on:
  99. - vllm
  100. networks:
  101. coding-stack-network:
  102. driver: bridge