Skip to content

Commit

Permalink
Update model token mappings/cost to include 0613 models (#6122)
Browse files Browse the repository at this point in the history
Add `gpt-3.5-turbo-16k` to model token mappings, as per the following
new OpenAI blog post:
https://openai.com/blog/function-calling-and-other-api-updates

Fixes #6118 


Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
Co-authored-by: Dev 2049 <dev.dev2049@gmail.com>
  • Loading branch information
3 people committed Jun 21, 2023
1 parent 5d149e4 commit e0f468f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions langchain/llms/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,10 +517,15 @@ def modelname_to_contextsize(modelname: str) -> int:
model_token_mapping = {
"gpt-4": 8192,
"gpt-4-0314": 8192,
"gpt-4-0613": 8192,
"gpt-4-32k": 32768,
"gpt-4-32k-0314": 32768,
"gpt-4-32k-0613": 32768,
"gpt-3.5-turbo": 4096,
"gpt-3.5-turbo-0301": 4096,
"gpt-3.5-turbo-0613": 4096,
"gpt-3.5-turbo-16k": 16385,
"gpt-3.5-turbo-16k-0613": 16385,
"text-ada-001": 2049,
"ada": 2049,
"text-babbage-001": 2040,
Expand Down

1 comment on commit e0f468f

@vercel
Copy link

@vercel vercel bot commented on e0f468f Jun 21, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

langchain – ./

langchain-git-master-langchain.vercel.app
python.langchain.com
langchain-langchain.vercel.app

Please sign in to comment.