Skip to content

Commit

Permalink
update openai model list (#494)
Browse files Browse the repository at this point in the history
  • Loading branch information
leondz authored Feb 20, 2024
1 parent b3e584d commit 0e4f6fb
Showing 1 changed file with 34 additions and 19 deletions.
53 changes: 34 additions & 19 deletions garak/generators/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,42 @@

from garak.generators.base import Generator

completion_models = (
"gpt-3.5-turbo-instruct",
"text-davinci-003",
"text-davinci-002",
"text-curie-001",
"text-babbage-001",
"text-ada-001",
"code-davinci-002",
"code-davinci-001",
"davinci-instruct-beta",
"davinci",
"curie",
"babbage",
"ada",
)
# lists derived from https://platform.openai.com/docs/models
chat_models = (
"gpt-4",
"gpt-4", # links to latest version
"gpt-4-turbo-preview", # links to latest version
"gpt-3.5-turbo", # links to latest version
"gpt-4-32k",
"gpt-4-0125-preview",
"gpt-4-1106-preview",
"gpt-4-vision-preview",
"gpt-4-1106-vision-preview",
"gpt-4-0613",
"gpt-4-32k",
"gpt-3.5-turbo",
"gpt-4-32k-0613",
"gpt-3.5-turbo-0125",
"gpt-3.5-turbo-1106",
"gpt-3.5-turbo-16k",
"gpt-3.5-turbo-0301",
"gpt-3.5-turbo-0613", # deprecated, shutdown 2024-06-13
"gpt-3.5-turbo-16k-0613", # # deprecated, shutdown 2024-06-13
)

completion_models = (
"gpt-3.5-turbo-instruct",
"davinci-002",
"babbage-002",
"davinci-instruct-beta", # unknown status
# "text-davinci-003", # shutdown https://platform.openai.com/docs/deprecations
# "text-davinci-002", # shutdown https://platform.openai.com/docs/deprecations
# "text-curie-001", # shutdown https://platform.openai.com/docs/deprecations
# "text-babbage-001", # shutdown https://platform.openai.com/docs/deprecations
# "text-ada-001", # shutdown https://platform.openai.com/docs/deprecations
# "code-davinci-002", # shutdown https://platform.openai.com/docs/deprecations
# "code-davinci-001", # shutdown https://platform.openai.com/docs/deprecations
# "davinci", # shutdown https://platform.openai.com/docs/deprecations
# "curie", # shutdown https://platform.openai.com/docs/deprecations
# "babbage", # shutdown https://platform.openai.com/docs/deprecations
# "ada", # shutdown https://platform.openai.com/docs/deprecations
)


Expand All @@ -67,7 +82,7 @@ def __init__(self, name, generations=10):
if api_key is None:
raise ValueError(
'Put the OpenAI API key in the OPENAI_API_KEY environment variable (this was empty)\n \
e.g.: export OPENAI_API_KEY="sk-123XXXXXXXXXXXX"'
e.g.: export OPENAI_API_KEY="sk-123Xgenerators/openai.pyXXXXXXXXXXX"'
)

self.client = openai.OpenAI(api_key=api_key)
Expand Down

0 comments on commit 0e4f6fb

Please sign in to comment.