🪙 refactor: Update tokens.js for Added Context Buffer from Max (#1573)

* Update tokens.js

* chore: linting previous PR

* chore: adjust token limits, add buffers

* chore: linting

* chore: adjust 32k gpt-4 limit
This commit is contained in:
Danny Avila 2024-01-17 08:13:46 -05:00 committed by GitHub
parent 963dbf3a1e
commit 638f9242e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 359 additions and 347 deletions

View file

@ -40,19 +40,19 @@ const models = [
];
const openAIModels = {
'gpt-4': 8191,
'gpt-4-0613': 8191,
'gpt-4-32k': 32767,
'gpt-4-32k-0314': 32767,
'gpt-4-32k-0613': 32767,
'gpt-3.5-turbo': 4095,
'gpt-3.5-turbo-0613': 4095,
'gpt-3.5-turbo-0301': 4095,
'gpt-3.5-turbo-16k': 15999,
'gpt-3.5-turbo-16k-0613': 15999,
'gpt-3.5-turbo-1106': 16380, // -5 from max
'gpt-4-1106': 127995, // -5 from max
'mistral-': 31995, // -5 from max
'gpt-4': 8187, // -5 from max
'gpt-4-0613': 8187, // -5 from max
'gpt-4-32k': 32758, // -10 from max
'gpt-4-32k-0314': 32758, // -10 from max
'gpt-4-32k-0613': 32758, // -10 from max
'gpt-3.5-turbo': 4092, // -5 from max
'gpt-3.5-turbo-0613': 4092, // -5 from max
'gpt-3.5-turbo-0301': 4092, // -5 from max
'gpt-3.5-turbo-16k': 16375, // -10 from max
'gpt-3.5-turbo-16k-0613': 16375, // -10 from max
'gpt-3.5-turbo-1106': 16375, // -10 from max
'gpt-4-1106': 127990, // -10 from max
'mistral-': 31990, // -10 from max
};
// Order is important here: by model series and context size (gpt-4 then gpt-3, ascending)