Add Mistral Nemo and Codestral Mamba models

b9e03e9cb1a2547911ba692159c2ee767f351600

Cohee <18619528+Cohee1207@users.noreply.github.com>

2 files changed, +11 -1Ignore whitespace
public/index.html+5 -0
@@ -2821,15 +2821,19 @@
28212821 <h4 data-i18n="MistralAI Model">MistralAI Model</h4>
28222822 <select id="model_mistralai_select">
28232823 <optgroup label="Latest">
2824+ <option value="open-mistral-nemo">open-mistral-nemo</option>
28242825 <option value="open-mistral-7b">open-mistral-7b</option>
28252826 <option value="open-mixtral-8x7b">open-mixtral-8x7b</option>
28262827 <option value="open-mixtral-8x22b">open-mixtral-8x22b</option>
2828+ <option value="open-codestral-mamba">open-codestral-mamba</option>
28272829 <option value="mistral-small-latest">mistral-small-latest</option>
28282830 <option value="mistral-medium-latest">mistral-medium-latest</option>
28292831 <option value="mistral-large-latest">mistral-large-latest</option>
28302832 <option value="codestral-latest">codestral-latest</option>
2833+ <option value="codestral-mamba-latest">codestral-mamba-latest</option>
28312834 </optgroup>
28322835 <optgroup label="Sub-versions">
2836+ <option value="open-mistral-nemo-2407">open-mistral-nemo-2407</option>
28332837 <option value="open-mixtral-8x22b-2404">open-mixtral-8x22b-2404</option>
28342838 <option value="mistral-tiny-2312">mistral-tiny-2312</option>
28352839 <option value="mistral-small-2312">mistral-small-2312</option>
@@ -2837,6 +2841,7 @@
28372841 <option value="mistral-medium-2312">mistral-medium-2312</option>
28382842 <option value="mistral-large-2402">mistral-large-2402</option>
28392843 <option value="codestral-2405">codestral-2405</option>
2844+ <option value="codestral-mamba-2407">codestral-mamba-2407</option>
28402845 </optgroup>
28412846 </select>
28422847 </div>
public/scripts/openai.js+6 -1
@@ -125,6 +125,7 @@ const max_32k = 32767;
125125const max_64k = 65535;
126126const max_128k = 128 * 1000;
127127const max_200k = 200 * 1000;
128+const max_256k = 256 * 1000;
128129const max_1mil = 1000 * 1000;
129130const scale_max = 8191;
130131const claude_max = 9000; // We have a proper tokenizer, so theoretically could be larger (up to 9k)
@@ -3992,7 +3993,7 @@ async function onModelChange() {
39923993 if ($(this).is('#model_mistralai_select')) {
39933994 // Upgrade old mistral models to new naming scheme
39943995 // would have done this in loadOpenAISettings, but it wasn't updating on preset change?
39953996 if (value === 'mistral-medium' || value === 'mistral-small' || value === 'mistral-tiny') {
39963997 value = value + '-latest';
39973998 } else if (value === '') {
39983999 value = default_settings.mistralai_model;
@@ -4139,6 +4140,10 @@ async function onModelChange() {
41394140 if (oai_settings.chat_completion_source === chat_completion_sources.MISTRALAI) {
41404141 if (oai_settings.max_context_unlocked) {
41414142 $('#openai_max_context').attr('max', unlocked_max);
4143+ } else if (oai_settings.mistralai_model.includes('codestral-mamba')) {
4144+ $('#openai_max_context').attr('max', max_256k);
4145+ } else if (oai_settings.mistralai_model.includes('mistral-nemo')) {
4146+ $('#openai_max_context').attr('max', max_128k);
41424147 } else if (oai_settings.mistralai_model.includes('mixtral-8x22b')) {
41434148 $('#openai_max_context').attr('max', max_64k);
41444149 } else {