Skip to content

Commit cdec3c8

Browse files
authored
vLLM 모델을 Qwen3.6 NVFP4로 변경 (#741)
1 parent 8eed914 commit cdec3c8

5 files changed

Lines changed: 21 additions & 8 deletions

File tree

backend/problem/llm_hint.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
LOCAL_VLLM_CHAT_COMPLETIONS_URL = "http://localhost:8000/v1/chat/completions"
1313
CLUSTER_VLLM_CHAT_COMPLETIONS_URL = "http://vllm.code-place-prod:8000/v1/chat/completions"
14-
VLLM_MODEL = "Qwen/Qwen3.5-9B"
14+
VLLM_MODEL = "nvidia/Qwen3.6-35B-A3B-NVFP4"
1515
VLLM_CONNECT_TIMEOUT_SEC = 10
1616
VLLM_STREAM_READ_TIMEOUT_SEC = 3600
1717

@@ -135,6 +135,10 @@ def get_vllm_chat_completions_url():
135135
return LOCAL_VLLM_CHAT_COMPLETIONS_URL
136136

137137

138+
def get_vllm_model():
139+
return os.getenv("VLLM_MODEL", VLLM_MODEL)
140+
141+
138142
def _normalize_html_to_text(value):
139143
if not value:
140144
return ""
@@ -228,7 +232,7 @@ def build_hint_payload(problem, previous_hints=None, user_code=None, stream=Fals
228232
messages.append({"role": "user", "content": user_code_prompt})
229233

230234
return {
231-
"model": VLLM_MODEL,
235+
"model": get_vllm_model(),
232236
"messages": messages,
233237
"temperature": 0.2,
234238
"max_tokens": 512,

backend/problem/tests.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from utils.constants import CONTEST_PASSWORD_SESSION_KEY
2424
from .llm_hint import (CLUSTER_VLLM_CHAT_COMPLETIONS_URL, LOCAL_VLLM_CHAT_COMPLETIONS_URL,
2525
VLLM_CONNECT_TIMEOUT_SEC, VLLM_MODEL, VLLM_STREAM_READ_TIMEOUT_SEC,
26-
LLMHintError, get_vllm_chat_completions_url, stream_problem_hint)
26+
LLMHintError, get_vllm_chat_completions_url, get_vllm_model, stream_problem_hint)
2727

2828
from .views.admin import TestCaseAPI
2929
from .utils import parse_problem_template
@@ -751,6 +751,10 @@ def test_get_vllm_chat_completions_url_for_kubernetes(self):
751751
with mock.patch.dict(os.environ, {"KUBERNETES_SERVICE_HOST": "10.0.0.1"}, clear=False):
752752
self.assertEqual(get_vllm_chat_completions_url(), CLUSTER_VLLM_CHAT_COMPLETIONS_URL)
753753

754+
def test_get_vllm_model_uses_env_override(self):
755+
with mock.patch.dict(os.environ, {"VLLM_MODEL": "test/model"}, clear=False):
756+
self.assertEqual(get_vllm_model(), "test/model")
757+
754758
# ------------------------------------------------------------------
755759
# 레거시 대회 (ai_assistant_enabled 필드 도입 이전 생성) 테스트
756760
# ------------------------------------------------------------------

kubernetes/base/backend/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ spec:
9999
value: "http://otel-collector.monitoring.svc.cluster.local:4317"
100100
- name: OTEL_TRACES_SAMPLER_ARG
101101
value: "0.05"
102+
- name: VLLM_MODEL
103+
value: "nvidia/Qwen3.6-35B-A3B-NVFP4"
102104
# TODO: Security Context 설정을 추가해야 합니다. 현재 entrypoint.sh 에서 권한을 변경하고 있지만, 보안 강화를 위해 컨테이너 레벨에서 설정하는 것이 좋습니다. (Junwoo)
103105
startupProbe:
104106
httpGet:

kubernetes/base/vllm/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
## 전제 조건
99

1010
- 클러스터에 NVIDIA device plugin 이 설치되어 있어야 합니다.
11-
- `vLLM`을 띄울 GPU 노드 정확히 1대에만 아래 라벨이 붙어 있어야 합니다.
11+
- `vLLM`을 띄울 RTX 5090 GPU 노드 정확히 1대에만 아래 라벨이 붙어 있어야 합니다.
1212

1313
```bash
1414
kubectl label node <gpu-node-name> workload.code-place.ai/vllm=true
@@ -35,8 +35,8 @@ kubectl describe pod -n code-place-prod -l app=vllm
3535

3636
## 현재 설정
3737

38-
- 이미지: `vllm/vllm-openai:v0.20.0`
39-
- 모델: `Qwen/Qwen3.5-9B`
38+
- 이미지: `vllm/vllm-openai:v0.24.0`
39+
- 모델: `nvidia/Qwen3.6-35B-A3B-NVFP4`
4040
- 포트: `8000`
4141
- 주요 옵션: `--dtype auto`, `--gpu-memory-utilization 0.9`, `--max-model-len 4096`, `--kv-cache-dtype fp8`, `--calculate-kv-scales`, `--enable-prefix-caching`, `--enable-chunked-prefill`, `--max-num-seqs 60`
4242
- 리소스: `cpu: 16`, `memory: 64Gi`, `nvidia.com/gpu: 1`
@@ -50,6 +50,7 @@ kubectl describe pod -n code-place-prod -l app=vllm
5050
- `livenessProbe` 가 계속 실패하면 쿠버네티스가 컨테이너를 재시작합니다.
5151
- `Service``ClusterIP` 이므로 외부에 직접 노출되지 않습니다.
5252
- Longhorn replica 수는 YAML 에서 고정하지 않고, 필요하면 Longhorn UI 에서 직접 조정하는 전제를 둡니다.
53+
- 현재 모델은 NVFP4 모델이므로 RTX 5090 같은 Blackwell GPU 전제를 유지해야 합니다.
5354
- `max-num-seqs=60` 은 처리량 위주 값이라, 메모리 압박이나 OOM 이 보이면 가장 먼저 낮춰야 합니다.
5455
- 더 보수적으로 운영하려면 이미지 tag 대신 digest 로 pin 하는 것이 가장 안전합니다.
5556

kubernetes/base/vllm/deployment.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,16 @@ spec:
2626
fsGroup: 1000
2727
containers:
2828
- name: vllm
29-
image: vllm/vllm-openai:v0.20.0
29+
image: vllm/vllm-openai:v0.24.0
3030
env:
3131
- name: VLLM_PORT
3232
value: "8000"
33+
- name: VLLM_MODEL
34+
value: "nvidia/Qwen3.6-35B-A3B-NVFP4"
3335
imagePullPolicy: IfNotPresent
3436
args:
3537
- --model
36-
- Qwen/Qwen3.5-9B
38+
- $(VLLM_MODEL)
3739
- --port
3840
- "8000"
3941
- --host

0 commit comments

Comments
 (0)