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