Chapter 7. vLLM arguments reference
When you deploy models using Distributed Inference with llm-d, the vLLM runtime handles inference requests. Red Hat AI Inference Server provides comprehensive documentation for vLLM runtime arguments and advanced configuration that you can apply to your llm-d deployments.
For the complete list of vLLM runtime arguments and detailed configuration options, see the following resources:
- Argument reference
- Advanced features
7.1. Common use cases for vLLM arguments Copy linkLink copied to clipboard!
Configure vLLM runtime arguments to achieve the following goals:
- Optimize resource usage
-
Reduce GPU memory consumption to fit larger models or enable more concurrent requests. For example, using
--gpu-memory-utilization=0.85leaves headroom for system operations and prevents out-of-memory errors. -
Adjust context length limits to match your application’s requirements. For example, use
--max-model-len=8192for smaller context length to reduce memory requirements.
-
Reduce GPU memory consumption to fit larger models or enable more concurrent requests. For example, using
- Improve performance
-
Minimize latency in production by controlling log verbosity. For example, using
--disable-access-log-for-endpoints=/health,/metrics,/pingreduces I/O overhead from logging high-frequency health checks while maintaining visibility into inference requests. -
Enable faster text generation using speculative decoding. For example,
--speculative-model=<draft-model>and--use-v2-block-manageruse a smaller draft model to predict tokens, which is verified by the main model.
-
Minimize latency in production by controlling log verbosity. For example, using
- Support specific model requirements
-
Enable tool calling with custom models. For example, using
--enable-auto-tool-choiceand--tool-call-parser=hermesto enable the model to select tools automatically and parse tool calls using model-specific formats. - Support custom chat templates for models that require specific formatting.
-
Enable prefix caching to speed up requests with repeated prompts using
--enable-prefix-caching.
-
Enable tool calling with custom models. For example, using
- Meet operational needs
-
Configure trust settings for custom or private model sources using
--trust-remote-code. - Control log volume for different operational scenarios by using endpoint-specific filtering or blanket suppression.
-
Configure trust settings for custom or private model sources using
7.2. Configure vLLM arguments for llm-d deployments Copy linkLink copied to clipboard!
You can configure vLLM runtime arguments to optimize inference performance by using the VLLM_ADDITIONAL_ARGS environment variable to control memory allocation, request handling, and model behavior without redeploying or rebuilding containers.
Prerequisites
- You have OpenShift AI 3.4 EA2 or later installed.
- You have deployed a model using Distributed Inference with llm-d for distributed inference or single-GPU deployments.
- You have stored a model in S3, a persistent volume claim (PVC), an OCI container registry, downloaded to hostPath storage in your Kubernetes cluster, or Hugging Face.
-
You have access to the OpenShift CLI (
oc) or the OpenShift web console.
Procedure
- Identify the vLLM arguments you want to configure. For the complete argument reference, see Red Hat AI Inference Server vLLM Server Arguments.
Create or edit the
LLMInferenceServicecustom resource to include theVLLM_ADDITIONAL_ARGSenvironment variable underspec.template.containersfor the container namedmain.Example vLLM argument configuration:
apiVersion: serving.kserve.io/v1alpha2 kind: LLMInferenceService metadata: name: my-vllm-service namespace: <my_namespace> spec: replicas: 2 model: uri: hf://RedHatAI/Qwen3-8B-FP8-dynamic name: RedHatAI/Qwen3-8B-FP8-dynamic router: route: {} gateway: {} scheduler: {} template: containers: - name: main env: - name: VLLM_ADDITIONAL_ARGS value: "--max-model-len=10000" resources: limits: cpu: '4' memory: 32Gi nvidia.com/gpu: "1" requests: cpu: '2' memory: 16Gi nvidia.com/gpu: "1"where:
--max-model-len=10000Limits the combined prompt and output length to 10,000 tokens. If you do not specify this option, vLLM derives the maximum context length from the model configuration. Set a lower value when the model’s full context length is not required or cannot be accommodated by the available KV cache capacity. This value also affects memory and runtime structures that vLLM configures when initializing the model.
NoteThe arguments that you specify in
VLLM_ADDITIONAL_ARGSare merged with the default arguments provided by the system. If you specify the same argument as a default, your value takes precedence. You can override specific defaults without affecting other default arguments. To specify multiple arguments, use the YAML folded block scalar>-with each argument on its own line.You can also use
VLLM_ADDITIONAL_ARGSto enable tool calling for models that support it. Add--enable-auto-tool-choiceand--tool-call-parser=<parser>to the environment variable value to configure tool calling on the vLLM runtime. For the complete tool calling configuration procedure, see Configure tool calling for Distributed Inference with llm-d deployments.
Apply the custom resource.
$ oc apply -f llminferenceservice.yaml -n <my_namespace>Example output
llminferenceservice.serving.kserve.io/my-vllm-service configuredIf you are creating a new resource, the output shows
createdinstead ofconfigured.
Verification
Wait for the
LLMInferenceServiceto become ready. This might take several minutes while the model downloads and loads.$ oc get llminferenceservice my-vllm-service -n <my_namespace> -wWait until the
READYcolumn showsTruebefore proceeding.Verify that the arguments are applied correctly.
Check that the
LLMInferenceServiceis running:$ oc get llminferenceservice my-vllm-service -n <my_namespace>Example output
NAME READY AGE my-vllm-service True 5mThe READY column shows
True.Verify your custom arguments appear in the pod specification:
Get the pod name:
$ oc get pods -n <my_namespace> -l app.kubernetes.io/name=my-vllm-serviceInspect the environment variables:
$ oc describe pod <pod_name> -n <my_namespace> | grep -A 1 "VLLM_ADDITIONAL_ARGS"Example output
VLLM_ADDITIONAL_ARGS: --max-model-len=10000Your custom arguments should appear in the
VLLM_ADDITIONAL_ARGSvalue.Test that inference requests work with your configured arguments:
Get the route URL:
$ ROUTE_URL=$(oc get llmisvc -n <my_namespace> my-vllm-service -o jsonpath='{.status.url}')Send a test request:
$ curl -X POST "${ROUTE_URL}/v1/completions" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $(oc whoami -t)" \ -d { "model": "RedHatAI/Qwen3-8B-FP8-dynamic", "prompt": "Explain what Red Hat OpenShift AI is in one sentence.", "max_tokens": 100 }A successful response confirms that your vLLM service is running with the configured arguments.
Additional resources