Learn R Programming

rtemis.llm (version 0.8.1)

openai_check_model: Check OpenAI-compatible Model Is Available

Description

Check OpenAI-compatible Model Is Available

Usage

openai_check_model(
  x,
  base_url = OPENAI_URL_DEFAULT,
  api_key = NULL,
  api_key_env = OPENAI_API_KEY_ENV_DEFAULT,
  keychain_service = NULL,
  organization = NULL,
  project = NULL
)

Value

NULL, invisibly, if model is available; otherwise throws an error.

Arguments

x

Character: Name of model.

base_url

Character: Base URL of the OpenAI-compatible server.

api_key

Optional character: API key.

api_key_env

Character: Environment variable containing the API key.

keychain_service

Optional character: macOS Keychain service containing the API key.

organization

Optional character: OpenAI organization id.

project

Optional character: OpenAI project id.

Author

EDG

Examples

Run this code
# Requires running OpenAI-compatible server with /models endpoint
if (FALSE) {
  openai_check_model(
    x = "local-model",
    base_url = "http://localhost:1234/v1",
    api_key = "test-key"
  )
}

Run the code above in your browser using DataLab