Revert "Powers of 2 for token context limits. No -1 offset." This reverts commit 2d77fb3e3094a1440640de1f0381d1e87edb0939.

2040c43371a73c97e127bc47ec1b8905e4f16fc6

Gness Erquint <gness.na@gmail.com>

1 files changed, +15 -15Ignore whitespace
public/scripts/openai.js+15 -15
@@ -117,17 +117,17 @@ const default_bias_presets = {
117117 ],
118118};
119119
120120const max_2k = 20482047;
121121const max_4k = 40964095;
122122const max_8k = 81928191;
123123const max_16k = 1638416383;
124124const max_32k = 3276832767;
125125const max_64k = 65535;
126126const max_128k = 131072128 * 1000;
127127const max_200k = 204800200 * 1000;
128128const max_256k = 262144256 * 1000;
129129const max_1mil = 10485761000 * 1000;
130130const max_2mil = 20971522000 * 1000;
131131const scale_max = 8191;
132132const claude_max = 9000; // We have a proper tokenizer, so theoretically could be larger (up to 9k)
133133const claude_100k_max = 99000;
@@ -4431,16 +4431,16 @@ async function onModelChange() {
44314431 if (oai_settings.max_context_unlocked) {
44324432 $('#openai_max_context').attr('max', unlocked_max);
44334433 } else if (["codestral-2411-rc5", "codestral-2412", "codestral-2501", "codestral-latest", "codestral-mamba-2407", "codestral-mamba-latest", "open-codestral-mamba"].includes(oai_settings.mistralai_model)) {
44344434 $('#openai_max_context').attr('max', max_256k262144);
44354435 } else if (["ministral-3b-2410", "ministral-3b-latest", "ministral-8b-2410", "ministral-8b-latest", "mistral-large-2407", "mistral-large-2411", "mistral-large-latest", "mistral-large-pixtral-2411", "mistral-tiny-2407", "mistral-tiny-latest", "open-mistral-nemo", "open-mistral-nemo-2407", "pixtral-12b", "pixtral-12b-2409", "pixtral-12b-latest", "pixtral-large-2411", "pixtral-large-latest"].includes(oai_settings.mistralai_model)) {
44364436 $('#openai_max_context').attr('max', max_128k131072);
44374437 } else if (["open-mixtral-8x22b", "open-mixtral-8x22b-2404"].includes(oai_settings.mistralai_model)) {
44384438 $('#openai_max_context').attr('max', max_64k65536);
44394439 } else if (oai_settings.mistralai_model.includes('ministral')) {
44404440 } else if (["codestral-2405", "mistral-embed", "mistral-large-2402", "mistral-medium", "mistral-medium-2312", "mistral-medium-latest", "mistral-moderation-2411", "mistral-moderation-latest", "mistral-ocr-2503", "mistral-ocr-latest", "mistral-saba-2502", "mistral-saba-latest", "mistral-small", "mistral-small-2312", "mistral-small-2402", "mistral-small-2409", "mistral-small-2501", "mistral-small-2503", "mistral-small-latest", "mistral-tiny", "mistral-tiny-2312", "open-mistral-7b", "open-mixtral-8x7b"].includes(oai_settings.mistralai_model)) {
44414441 $('#openai_max_context').attr('max', max_32k32768);
44424442 } else {
44434443 $('#openai_max_context').attr('max', max_32k32768);
44444444 }
44454445 oai_settings.openai_max_context = Math.min(oai_settings.openai_max_context, Number($('#openai_max_context').attr('max')));
44464446 $('#openai_max_context').val(oai_settings.openai_max_context).trigger('input');