Skip to content

[Bug]: --api-key argument ignored when VLLM_API_KEY is set #15568

@awschmeder

Description

@awschmeder

Your current environment

By convention, environment variables take lower precedence than command line arguments. However, for the vLLM API key, the precedence is reversed resulting in unexpected behavior when both are specified.

Example

VLLM_API_KEY=123 vllm serve --api-key ABC

Expected behavior: API Key = "ABC"
Observed behavior: API Key = "123"

🐛 Describe the bug

Example

VLLM_API_KEY=123 vllm serve --api-key ABC

Expected behavior: API Key = "ABC"
Observed behavior: API Key = "123"

Other environment variables should also be checked to ensure the expected precedence order is applied.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions