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 @@
2821 <h4 data-i18n="MistralAI Model">MistralAI Model</h4>2821 <h4 data-i18n="MistralAI Model">MistralAI Model</h4>
2822 <select id="model_mistralai_select">2822 <select id="model_mistralai_select">
2823 <optgroup label="Latest">2823 <optgroup label="Latest">
2824 <option value="open-mistral-nemo">open-mistral-nemo</option>
2824 <option value="open-mistral-7b">open-mistral-7b</option>2825 <option value="open-mistral-7b">open-mistral-7b</option>
2825 <option value="open-mixtral-8x7b">open-mixtral-8x7b</option>2826 <option value="open-mixtral-8x7b">open-mixtral-8x7b</option>
2826 <option value="open-mixtral-8x22b">open-mixtral-8x22b</option>2827 <option value="open-mixtral-8x22b">open-mixtral-8x22b</option>
2828 <option value="open-codestral-mamba">open-codestral-mamba</option>
2827 <option value="mistral-small-latest">mistral-small-latest</option>2829 <option value="mistral-small-latest">mistral-small-latest</option>
2828 <option value="mistral-medium-latest">mistral-medium-latest</option>2830 <option value="mistral-medium-latest">mistral-medium-latest</option>
2829 <option value="mistral-large-latest">mistral-large-latest</option>2831 <option value="mistral-large-latest">mistral-large-latest</option>
2830 <option value="codestral-latest">codestral-latest</option>2832 <option value="codestral-latest">codestral-latest</option>
2833 <option value="codestral-mamba-latest">codestral-mamba-latest</option>
2831 </optgroup>2834 </optgroup>
2832 <optgroup label="Sub-versions">2835 <optgroup label="Sub-versions">
2836 <option value="open-mistral-nemo-2407">open-mistral-nemo-2407</option>
2833 <option value="open-mixtral-8x22b-2404">open-mixtral-8x22b-2404</option>2837 <option value="open-mixtral-8x22b-2404">open-mixtral-8x22b-2404</option>
2834 <option value="mistral-tiny-2312">mistral-tiny-2312</option>2838 <option value="mistral-tiny-2312">mistral-tiny-2312</option>
2835 <option value="mistral-small-2312">mistral-small-2312</option>2839 <option value="mistral-small-2312">mistral-small-2312</option>
@@ -2837,6 +2841,7 @@
2837 <option value="mistral-medium-2312">mistral-medium-2312</option>2841 <option value="mistral-medium-2312">mistral-medium-2312</option>
2838 <option value="mistral-large-2402">mistral-large-2402</option>2842 <option value="mistral-large-2402">mistral-large-2402</option>
2839 <option value="codestral-2405">codestral-2405</option>2843 <option value="codestral-2405">codestral-2405</option>
2844 <option value="codestral-mamba-2407">codestral-mamba-2407</option>
2840 </optgroup>2845 </optgroup>
2841 </select>2846 </select>
2842 </div>2847 </div>
public/scripts/openai.js+6 -1
@@ -125,6 +125,7 @@ const max_32k = 32767;
125const max_64k = 65535;125const max_64k = 65535;
126const max_128k = 128 * 1000;126const max_128k = 128 * 1000;
127const max_200k = 200 * 1000;127const max_200k = 200 * 1000;
128const max_256k = 256 * 1000;
128const max_1mil = 1000 * 1000;129const max_1mil = 1000 * 1000;
129const scale_max = 8191;130const scale_max = 8191;
130const claude_max = 9000; // We have a proper tokenizer, so theoretically could be larger (up to 9k)131const claude_max = 9000; // We have a proper tokenizer, so theoretically could be larger (up to 9k)
@@ -3992,7 +3993,7 @@ async function onModelChange() {
3992 if ($(this).is('#model_mistralai_select')) {3993 if ($(this).is('#model_mistralai_select')) {
3993 // Upgrade old mistral models to new naming scheme3994 // Upgrade old mistral models to new naming scheme
3994 // would have done this in loadOpenAISettings, but it wasn't updating on preset change?3995 // would have done this in loadOpenAISettings, but it wasn't updating on preset change?
3995 if (value === 'mistral-medium' || value === 'mistral-small' || value === 'mistral-tiny') {3996 if (value === 'mistral-medium' || value === 'mistral-small') {
3996 value = value + '-latest';3997 value = value + '-latest';
3997 } else if (value === '') {3998 } else if (value === '') {
3998 value = default_settings.mistralai_model;3999 value = default_settings.mistralai_model;
@@ -4139,6 +4140,10 @@ async function onModelChange() {
4139 if (oai_settings.chat_completion_source === chat_completion_sources.MISTRALAI) {4140 if (oai_settings.chat_completion_source === chat_completion_sources.MISTRALAI) {
4140 if (oai_settings.max_context_unlocked) {4141 if (oai_settings.max_context_unlocked) {
4141 $('#openai_max_context').attr('max', unlocked_max);4142 $('#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);
4142 } else if (oai_settings.mistralai_model.includes('mixtral-8x22b')) {4147 } else if (oai_settings.mistralai_model.includes('mixtral-8x22b')) {
4143 $('#openai_max_context').attr('max', max_64k);4148 $('#openai_max_context').attr('max', max_64k);
4144 } else {4149 } else {