Skip to content

Commit

Permalink
Use VLLM_API_KEY (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley authored Dec 18, 2024
1 parent 76185fb commit 8305b1a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
5 changes: 4 additions & 1 deletion R/provider-vllm.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ NULL
#' `chat_vllm()` to connect to endpoints powered by vLLM.
#'
#' @inheritParams chat_openai
#' @param api_key The API key to use for authentication. You generally should
#' not supply this directly, but instead set the `VLLM_API_KEY` environment
#' variable.
#' @inherit chat_openai return
#' @export
chat_vllm <- function(base_url,
Expand Down Expand Up @@ -70,7 +73,7 @@ method(as_json, list(ProviderVllm, ToolDef)) <- function(provider, x) {
}

vllm_key <- function() {
key_get("VLLM_KEY")
key_get("VLLM_API_KEY")
}

vllm_models <- function(base_url, key = vllm_key()) {
Expand Down
6 changes: 6 additions & 0 deletions man/Chat.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 3 additions & 8 deletions man/chat_vllm.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8305b1a

Please sign in to comment.