GGUF

GGUF

vLLM에서 GGUF 모델을 실행할 수 있어요. GGUF는 특히 메모리 풋프린트를 줄이는 데 유용한 형식이지만, 현재 vLLM의 GGUF 지원은 고도로 실험적이며 최적화가 덜 되어 있어 다른 기능과 호환되지 않을 수 있습니다.

⚠️ 경고: vLLM의 GGUF 지원은 현재 고도로 실험적이고 최적화가 덜 되어 있어 다른 기능과 호환되지 않을 수 있습니다. 현재는 메모리 풋프린트를 줄이는 용도로 GGUF를 사용할 수 있어요. 문제가 발생하면 vLLM 팀에 보고해 주세요.

참고: GGUF 지원은 OOT vllm-gguf-plugin 으로 이전되었습니다. GGUF 모델을 서빙하기 전에 GGUF 플러그인이 설치되어 있는지 확인하세요.

출처: 문서

본문

GGUF 모델을 서빙하기 전에 vllm-gguf-plugin 을 설치하세요.

uv pip install vllm-gguf-plugin

HuggingFace에서 로드 (Load from HuggingFace)

vLLM으로 GGUF 모델을 실행하려면 repo_id:quant_type 형식을 사용해 HuggingFace에서 직접 로드할 수 있어요. 예를 들어 unsloth/Qwen3-0.6B-GGUF 에서 Q4_K_M 양자화 모델을 로드하려면:

# We recommend using the tokenizer from base model to avoid long-time and buggy tokenizer conversion.
vllm serve unsloth/Qwen3-0.6B-GGUF:Q4_K_M --tokenizer Qwen/Qwen3-0.6B

--tensor-parallel-size 2 를 추가해 2개 GPU로 텐서 병렬 추론을 활성화할 수도 있습니다.

vllm serve unsloth/Qwen3-0.6B-GGUF:Q4_K_M \
   --tokenizer Qwen/Qwen3-0.6B \
   --tensor-parallel-size 2

로컬 GGUF 파일 사용

로컬 GGUF 파일을 다운로드해 사용할 수도 있습니다.

wget https://huggingface.co/unsloth/Qwen3-0.6B-GGUF/resolve/main/Qwen3-0.6B-Q4_K_M.gguf
vllm serve ./Qwen3-0.6B-Q4_K_M.gguf --tokenizer Qwen/Qwen3-0.6B

경고: GGUF 모델 대신 베이스 모델의 토크나이저를 사용하는 것을 권장합니다. GGUF에서의 토크나이저 변환은 시간이 걸리고 불안정하기 때문이에요, 특히 어휘 크기가 큰 일부 모델에서는 더욱 그렇습니다.

GGUF는 HuggingFace가 메타데이터를 구성 파일로 변환할 수 있다고 가정합니다. HuggingFace가 모델을 지원하지 않는 경우 구성을 수동으로 만들어 hf-config-path 로 전달할 수 있어요.

# If your model is not supported by HuggingFace you can manually provide a HuggingFace compatible config path
vllm serve unsloth/Qwen3-0.6B-GGUF:Q4_K_M \
   --tokenizer Qwen/Qwen3-0.6B \
   --hf-config-path Qwen/Qwen3-0.6B

LLM 엔트리포인트 사용

GGUF 모델을 LLM 엔트리포인트를 통해 직접 사용할 수도 있습니다.

from vllm import LLM, SamplingParams

# In this script, we demonstrate how to pass input to the chat method:
conversation = [
   {
      "role": "system",
      "content": "You are a helpful assistant",
   },
   {
      "role": "user",
      "content": "Hello",
   },
   {
      "role": "assistant",
      "content": "Hello! How can I assist you today?",
   },
   {
      "role": "user",
      "content": "Write an essay about the importance of higher education.",
   },
]

# Create a sampling params object.
sampling_params = SamplingParams(temperature=0.8, top_p=0.95)

# Create an LLM using repo_id:quant_type format.
llm = LLM(
   model="unsloth/Qwen3-0.6B-GGUF:Q4_K_M",
   tokenizer="Qwen/Qwen3-0.6B",
)
# Generate texts from the prompts. The output is a list of RequestOutput objects
# that contain the prompt, generated text, and other information.
outputs = llm.chat(conversation, sampling_params)

# Print the outputs.
for output in outputs:
   prompt = output.prompt
   generated_text = output.outputs[0].text
   print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")

더 알아보기 (Learn more)