Skip to content

Conversation

TheBlackHacker
Copy link

@TheBlackHacker TheBlackHacker commented May 5, 2025

This pull request introduces support for specifying an API key to authenticate requests to the VLLM server. The API key can now be passed as a CLI option (--api-key) to the relevant commands, or in config file. When provided, the API key is added to the HTTP headers in requests made to the server.

Changes:

  1. Added an api_key CLI option to commands such as system-check, create, and curate. Also added into llm_client.py.
  2. Modified the server check logic to include an Authorization header when an API key is provided.
  3. Ensured backward compatibility by falling back to configuration settings if the CLI option is not used.

Motivation and Context:

  • Enhances the security of the Synthetic Data Kit by allowing more flexible authentication mechanisms.
  • Provides a straightforward way to configure API credentials both via CLI and configuration files.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label May 5, 2025
Copy link

@SuienS SuienS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add api_key under vllm in the configs

self.model = model_name or vllm_config.get('model')
self.max_retries = max_retries or vllm_config.get('max_retries')
self.retry_delay = retry_delay or vllm_config.get('retry_delay')
self.api_key = api_key or vllm_config.get('api_key') # save API key
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to add api_key under vllm in the configs as well.
Also here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants