vllm - 💡(How to fix) Fix [Feature]: Hashicorp Vault Integration for API Key [1 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#41553Fetched 2026-05-04 04:58:55
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
labeled ×1
RAW_BUFFERClick to expand / collapse

🚀 The feature, motivation and pitch

Add option to use a Hashicorp KV V2 endpoint for API Key check.

Update/end entrypoints/openai/server_utils.py to use an argument use-vault and then use environment variables VAULT_ADDR, VAULT_TOKEN and VAULT_SECRET_PATH to validate the api-token header on each request.

Currently, to change the api-key, the vllm service needs to restart, by externalizing to Vault, the key can be changed independently without requiring the restart.

Alternatives

  • static key and restart of the vllm server on key change
  • externalize endpoint protection to a proxy/sidecar

Additional context

None

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

TL;DR

To implement the feature, update the server_utils.py file to accept a use-vault argument and utilize Hashicorp KV V2 endpoint for API key validation using environment variables.

Guidance

  • Review the current implementation of API key validation in server_utils.py to understand the existing logic.
  • Introduce a new argument use-vault to toggle between the current static key approach and the new Vault-based validation.
  • Use environment variables VAULT_ADDR, VAULT_TOKEN, and VAULT_SECRET_PATH to configure the Vault connection for API key validation.
  • Consider implementing a fallback mechanism to handle cases where the Vault connection is unavailable or the API key is not found.

Example

import os
import hvac

# Assuming hvac is the Hashicorp Vault client library
vault_url = os.environ['VAULT_ADDR']
vault_token = os.environ['VAULT_TOKEN']
secret_path = os.environ['VAULT_SECRET_PATH']

vault_client = hvac.Client(url=vault_url, token=vault_token)
api_key = vault_client.secrets.kv.v2.read_secret_version(
    path=secret_path
)['data']['data']['api-key']

Notes

The implementation details may vary depending on the specific requirements and constraints of the project. This guidance provides a general outline of the steps needed to integrate Hashicorp KV V2 endpoint for API key validation.

Recommendation

Apply workaround by implementing the use-vault argument and Vault-based API key validation, as this approach allows for more flexibility and independence from service restarts.

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

vllm - 💡(How to fix) Fix [Feature]: Hashicorp Vault Integration for API Key [1 participants]