Every Hugging Face model can ship a generation_config.json with the sampling values its creator recommends. vLLM applies that file by default, which usually gives the best results — but if you want vLLM’s own defaults instead, you can switch it off.
Keep the model’s config, or switch it off
Do nothing and vLLM applies generation_config.json from the model repository when it exists, so the creator’s recommended sampling values become the defaults. To disable that behaviour, pass --generation-config vllm when launching the server, or generation_config="vllm" when creating the offline LLM instance. Then vLLM’s own defaults apply and your explicit SamplingParams are the only overrides.
# server: use vLLM defaults instead of the model's file
vllm serve Qwen/Qwen2.5-1.5B-Instruct --generation-config vllm
# offline: same choice in code
llm = LLM(model="Qwen/Qwen2.5-1.5B-Instruct", generation_config="vllm")
The docs warn that in most cases the model’s own file gives the best results, so only switch it off when you have a reason — for example when you are comparing models on identical settings, or when a model’s file sets values that break your use case.
Try it: four checks
| Check | What you should see | If you do not see it |
|---|---|---|
| Default behaviour | Without the flag, the model’s config applies | Check the server log for the applied config |
| Flag accepted | With –generation-config vllm the server starts | Check the flag spelling on your version |
| Sampling changes | Replies differ between the two modes | Compare the same prompt in both modes |
| Explicit params win | Your SamplingParams still apply in either mode | Pass temperature and top_p explicitly |
Expected result. We checked the vLLM OpenAI-Compatible Server docs and Quickstart, which say the server applies generation_config.json by default and that –generation-config vllm disables it, and the same for the offline LLM class. We did not run vLLM on this machine.
Limits
This guide covers the generation config switch only. Which sampling values a given model recommends is a property of that model’s file. We did not test either mode ourselves.
