Unverified Commit 184afa69 authored by John Wang's avatar John Wang Committed by GitHub

feat: add gpt-3.5-turbo-16k support and update openai gpt-3.5-turbo &...

feat: add gpt-3.5-turbo-16k support and update openai gpt-3.5-turbo & Embedding Ada v2 unit price (#358)
parent ab115b5f
...@@ -4,6 +4,7 @@ models = { ...@@ -4,6 +4,7 @@ models = {
'gpt-4': 'openai', # 8,192 tokens 'gpt-4': 'openai', # 8,192 tokens
'gpt-4-32k': 'openai', # 32,768 tokens 'gpt-4-32k': 'openai', # 32,768 tokens
'gpt-3.5-turbo': 'openai', # 4,096 tokens 'gpt-3.5-turbo': 'openai', # 4,096 tokens
'gpt-3.5-turbo-16k': 'openai', # 16384 tokens
'text-davinci-003': 'openai', # 4,097 tokens 'text-davinci-003': 'openai', # 4,097 tokens
'text-davinci-002': 'openai', # 4,097 tokens 'text-davinci-002': 'openai', # 4,097 tokens
'text-curie-001': 'openai', # 2,049 tokens 'text-curie-001': 'openai', # 2,049 tokens
...@@ -16,6 +17,7 @@ max_context_token_length = { ...@@ -16,6 +17,7 @@ max_context_token_length = {
'gpt-4': 8192, 'gpt-4': 8192,
'gpt-4-32k': 32768, 'gpt-4-32k': 32768,
'gpt-3.5-turbo': 4096, 'gpt-3.5-turbo': 4096,
'gpt-3.5-turbo-16k': 16384,
'text-davinci-003': 4097, 'text-davinci-003': 4097,
'text-davinci-002': 4097, 'text-davinci-002': 4097,
'text-curie-001': 2049, 'text-curie-001': 2049,
...@@ -29,11 +31,13 @@ models_by_mode = { ...@@ -29,11 +31,13 @@ models_by_mode = {
'gpt-4', # 8,192 tokens 'gpt-4', # 8,192 tokens
'gpt-4-32k', # 32,768 tokens 'gpt-4-32k', # 32,768 tokens
'gpt-3.5-turbo', # 4,096 tokens 'gpt-3.5-turbo', # 4,096 tokens
'gpt-3.5-turbo-16k', # 16,384 tokens
], ],
'completion': [ 'completion': [
'gpt-4', # 8,192 tokens 'gpt-4', # 8,192 tokens
'gpt-4-32k', # 32,768 tokens 'gpt-4-32k', # 32,768 tokens
'gpt-3.5-turbo', # 4,096 tokens 'gpt-3.5-turbo', # 4,096 tokens
'gpt-3.5-turbo-16k', # 16,384 tokens
'text-davinci-003', # 4,097 tokens 'text-davinci-003', # 4,097 tokens
'text-davinci-002' # 4,097 tokens 'text-davinci-002' # 4,097 tokens
'text-curie-001', # 2,049 tokens 'text-curie-001', # 2,049 tokens
...@@ -57,9 +61,13 @@ model_prices = { ...@@ -57,9 +61,13 @@ model_prices = {
'completion': Decimal('0.12') 'completion': Decimal('0.12')
}, },
'gpt-3.5-turbo': { 'gpt-3.5-turbo': {
'prompt': Decimal('0.002'), 'prompt': Decimal('0.0015'),
'completion': Decimal('0.002') 'completion': Decimal('0.002')
}, },
'gpt-3.5-turbo-16k': {
'prompt': Decimal('0.003'),
'completion': Decimal('0.004')
},
'text-davinci-003': { 'text-davinci-003': {
'prompt': Decimal('0.02'), 'prompt': Decimal('0.02'),
'completion': Decimal('0.02') 'completion': Decimal('0.02')
...@@ -77,7 +85,7 @@ model_prices = { ...@@ -77,7 +85,7 @@ model_prices = {
'completion': Decimal('0.0004') 'completion': Decimal('0.0004')
}, },
'text-embedding-ada-002': { 'text-embedding-ada-002': {
'usage': Decimal('0.0004'), 'usage': Decimal('0.0001'),
} }
} }
......
...@@ -95,7 +95,8 @@ class AzureProvider(BaseProvider): ...@@ -95,7 +95,8 @@ class AzureProvider(BaseProvider):
if not models: if not models:
raise ValidateFailedError("Please add deployments for 'text-davinci-003', " raise ValidateFailedError("Please add deployments for 'text-davinci-003', "
"'gpt-3.5-turbo', 'text-embedding-ada-002'.") "'gpt-3.5-turbo', 'text-embedding-ada-002' (required) "
"and 'gpt-4', 'gpt-35-turbo-16k' (optional).")
fixed_model_ids = [ fixed_model_ids = [
'text-davinci-003', 'text-davinci-003',
......
...@@ -26,8 +26,10 @@ export type IConifgModelProps = { ...@@ -26,8 +26,10 @@ export type IConifgModelProps = {
const options = [ const options = [
{ id: 'gpt-3.5-turbo', name: 'gpt-3.5-turbo', type: AppType.chat }, { id: 'gpt-3.5-turbo', name: 'gpt-3.5-turbo', type: AppType.chat },
{ id: 'gpt-3.5-turbo-16k', name: 'gpt-3.5-turbo-16k', type: AppType.chat },
{ id: 'gpt-4', name: 'gpt-4', type: AppType.chat }, // 8k version { id: 'gpt-4', name: 'gpt-4', type: AppType.chat }, // 8k version
{ id: 'gpt-3.5-turbo', name: 'gpt-3.5-turbo', type: AppType.completion }, { id: 'gpt-3.5-turbo', name: 'gpt-3.5-turbo', type: AppType.completion },
{ id: 'gpt-3.5-turbo-16k', name: 'gpt-3.5-turbo-16k', type: AppType.completion },
{ id: 'text-davinci-003', name: 'text-davinci-003', type: AppType.completion }, { id: 'text-davinci-003', name: 'text-davinci-003', type: AppType.completion },
{ id: 'gpt-4', name: 'gpt-4', type: AppType.completion }, // 8k version { id: 'gpt-4', name: 'gpt-4', type: AppType.completion }, // 8k version
] ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment