vllm - 💡(How to fix) Fix [Usage]: How to use Env in yaml [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vllm-project/vllm#36465Fetched 2026-04-08 00:36:45
View on GitHub
Comments
2
Participants
2
Timeline
3
Reactions
0
Timeline (top)
commented ×2labeled ×1
RAW_BUFFERClick to expand / collapse

Your current environment

How would you like to use vllm

I have different graphics cards, and their own video memory is different. I hope to use vllm server-configvllm.yaml to start the model, but I may only want to use 16G, but my image may have been packaged, and I may only start the image. I hope to use environment variables to control the parameters of GPU-memory-utilization. This is written in yaml. How can I control it through environment variables?

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.

extent analysis

Fix: Using Environment Variables to Control GPU Memory Utilization

To control GPU memory utilization through environment variables, you can modify the server-config.yaml file to reference environment variables.

Fix Plan

  • Modify the server-config.yaml file to use environment variables for GPU memory utilization:
gpu-memory-utilization: ${GPU_MEMORY_UTILIZATION}
  • Set the GPU_MEMORY_UTILIZATION environment variable before starting the model:
export GPU_MEMORY_UTILIZATION=16G
  • Alternatively, you can use a command-line argument to set the environment variable when starting the model:
GPU_MEMORY_UTILIZATION=16G vllm-server --config server-config.yaml
  • In your code, you can access the environment variable using your programming language of choice. For example, in Python:
import os

gpu_memory_utilization = os.environ.get('GPU_MEMORY_UTILIZATION')

Verification

  • Verify that the environment variable is set correctly by checking the server-config.yaml file or printing the value of the variable in your code.
  • Check the GPU memory utilization to ensure it matches the value set by the environment variable.

Extra Tips

  • Make sure to update the server-config.yaml file to reference the environment variable correctly.
  • You can also use other environment variables to control other parameters in the server-config.yaml file.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING