Deprecate 01.ai chat completion source (#4327)

086f873f2f6c8c7f025b1d43f07912ce50ba7d71

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

Signed
17 files changed, +3 -153Showing whitespace changes
public/index.html+3 -21
@@ -691,7 +691,7 @@
691 </span>691 </span>
692 </div>692 </div>
693 </div>693 </div>
694 <div class="range-block" data-source="openai,claude,aimlapi,openrouter,ai21,makersuite,vertexai,mistralai,custom,cohere,perplexity,groq,01ai,nanogpt,deepseek,xai,pollinations">694 <div class="range-block" data-source="openai,claude,aimlapi,openrouter,ai21,makersuite,vertexai,mistralai,custom,cohere,perplexity,groq,nanogpt,deepseek,xai,pollinations">
695 <div class="range-block-title" data-i18n="Temperature">695 <div class="range-block-title" data-i18n="Temperature">
696 Temperature696 Temperature
697 </div>697 </div>
@@ -743,7 +743,7 @@
743 </div>743 </div>
744 </div>744 </div>
745 </div>745 </div>
746 <div class="range-block" data-source="openai,claude,aimlapi,openrouter,ai21,makersuite,vertexai,mistralai,custom,cohere,perplexity,groq,01ai,nanogpt,deepseek,xai,pollinations">746 <div class="range-block" data-source="openai,claude,aimlapi,openrouter,ai21,makersuite,vertexai,mistralai,custom,cohere,perplexity,groq,nanogpt,deepseek,xai,pollinations">
747 <div class="range-block-title" data-i18n="Top P">747 <div class="range-block-title" data-i18n="Top P">
748 Top P748 Top P
749 </div>749 </div>
@@ -1995,7 +1995,7 @@
1995 <strong data-i18n="enable_functions_desc_4">Not supported when Prompt Post-Processing with "no tools" is used!</strong>1995 <strong data-i18n="enable_functions_desc_4">Not supported when Prompt Post-Processing with "no tools" is used!</strong>
1996 </div>1996 </div>
1997 </div>1997 </div>
1998 <div class="range-block" data-source="openai,aimlapi,openrouter,mistralai,makersuite,vertexai,claude,custom,01ai,xai,pollinations">1998 <div class="range-block" data-source="openai,aimlapi,openrouter,mistralai,makersuite,vertexai,claude,custom,xai,pollinations">
1999 <label for="openai_image_inlining" class="checkbox_label flexWrap widthFreeExpand">1999 <label for="openai_image_inlining" class="checkbox_label flexWrap widthFreeExpand">
2000 <input id="openai_image_inlining" type="checkbox" />2000 <input id="openai_image_inlining" type="checkbox" />
2001 <span data-i18n="Send inline images">Send inline images</span>2001 <span data-i18n="Send inline images">Send inline images</span>
@@ -2788,7 +2788,6 @@
2788 <option value="custom" data-i18n="Custom (OpenAI-compatible)">Custom (OpenAI-compatible)</option>2788 <option value="custom" data-i18n="Custom (OpenAI-compatible)">Custom (OpenAI-compatible)</option>
2789 </optgroup>2789 </optgroup>
2790 <optgroup>2790 <optgroup>
2791 <option value="01ai">01.AI (Yi)</option>
2792 <option value="ai21">AI21</option>2791 <option value="ai21">AI21</option>
2793 <option value="aimlapi">AI/ML API</option>2792 <option value="aimlapi">AI/ML API</option>
2794 <option value="claude">Claude</option>2793 <option value="claude">Claude</option>
@@ -3572,23 +3571,6 @@
3572 <select id="model_custom_select" class="text_pole model_custom_select"></select>3571 <select id="model_custom_select" class="text_pole model_custom_select"></select>
3573 </div>3572 </div>
3574 </form>3573 </form>
3575 <div id="01ai_form" data-source="01ai">
3576 <h4>
3577 <a data-i18n="01.AI API Key" href="https://platform.lingyiwanwu.com/" target="_blank" rel="noopener noreferrer">
3578 01.AI API Key
3579 </a>
3580 </h4>
3581 <div class="flex-container">
3582 <input id="api_key_01ai" name="api_key_01ai" class="text_pole flex1" value="" type="text" autocomplete="off">
3583 <div title="Manage API keys" data-i18n="[title]Manage API keys" class="menu_button fa-solid fa-key fa-fw manage-api-keys" data-key="api_key_01ai"></div>
3584 </div>
3585 <div data-for="api_key_01ai" class="neutral_warning" data-i18n="For privacy reasons, your API key will be hidden after you click 'Connect'.">
3586 For privacy reasons, your API key will be hidden after you click 'Connect'.
3587 </div>
3588 <h4 data-i18n="01.AI Model">01.AI Model</h4>
3589 <select id="model_01ai_select">
3590 </select>
3591 </div>
3592 <div id="xai_form" data-source="xai">3574 <div id="xai_form" data-source="xai">
3593 <h4>3575 <h4>
3594 <a data-i18n="xAI API Key" href="https://console.x.ai/" target="_blank" rel="noopener noreferrer">3576 <a data-i18n="xAI API Key" href="https://console.x.ai/" target="_blank" rel="noopener noreferrer">
public/locales/fr-fr.json+0 -2
@@ -1426,8 +1426,6 @@
1426 "prompt_post_processing_merge": "Fusionner les rôles consécutifs",1426 "prompt_post_processing_merge": "Fusionner les rôles consécutifs",
1427 "prompt_post_processing_semi": "Semi-strict (rôles alternés)",1427 "prompt_post_processing_semi": "Semi-strict (rôles alternés)",
1428 "prompt_post_processing_strict": "Strict (l'utilisateur d'abord, rôles alternés)",1428 "prompt_post_processing_strict": "Strict (l'utilisateur d'abord, rôles alternés)",
1429 "01.AI API Key": "01.Clé IA API",
1430 "01.AI Model": "01.Modèle IA",
1431 "Additional Parameters": "Paramètres supplémentaires",1429 "Additional Parameters": "Paramètres supplémentaires",
1432 "Import Advanced Formatting settings": "Importer les paramètres de formatage avancé\n\nVous pouvez également fournir des fichiers hérités pour les modèles Instruct et Context..",1430 "Import Advanced Formatting settings": "Importer les paramètres de formatage avancé\n\nVous pouvez également fournir des fichiers hérités pour les modèles Instruct et Context..",
1433 "Master Import": "Master Import",1431 "Master Import": "Master Import",
public/locales/ru-ru.json+0 -2
@@ -1619,8 +1619,6 @@
1619 "Do not proceed if you do not agree to this!": "Не продолжайте, если не согласны с этими условиями!",1619 "Do not proceed if you do not agree to this!": "Не продолжайте, если не согласны с этими условиями!",
1620 "Relative (to other prompts in prompt manager) or In-chat @ Depth.": "Относительно других промтов в менеджере, либо на опред. глубину в чате.",1620 "Relative (to other prompts in prompt manager) or In-chat @ Depth.": "Относительно других промтов в менеджере, либо на опред. глубину в чате.",
1621 "prompt_manager_in_chat": "На глубине в чате",1621 "prompt_manager_in_chat": "На глубине в чате",
1622 "01.AI API Key": "Ключ от API 01.AI",
1623 "01.AI Model": "Модель 01.AI",
1624 "Load a custom asset list or select": "Загрузите набор внешних ресурсов или выберите",1622 "Load a custom asset list or select": "Загрузите набор внешних ресурсов или выберите",
1625 "Install Extension": "Установить расширение",1623 "Install Extension": "Установить расширение",
1626 "to install 3rd party extensions.": ", чтобы установить стороннее расширение.",1624 "to install 3rd party extensions.": ", чтобы установить стороннее расширение.",
public/locales/zh-cn.json+0 -2
@@ -460,8 +460,6 @@
460 "prompt_post_processing_merge": "合并相同角色连续的发言",460 "prompt_post_processing_merge": "合并相同角色连续的发言",
461 "prompt_post_processing_semi": "半严格(强制对话角色交替)",461 "prompt_post_processing_semi": "半严格(强制对话角色交替)",
462 "prompt_post_processing_strict": "严格(强制对话角色交替、用户最先)",462 "prompt_post_processing_strict": "严格(强制对话角色交替、用户最先)",
463 "01.AI API Key": "01.AI API密钥",
464 "01.AI Model": "01.AI 模型",
465 "Additional Parameters": "附加参数",463 "Additional Parameters": "附加参数",
466 "Verifies your API connection by sending a short test message. Be aware that you'll be credited for it!": "通过发送简短的测试消息验证您的API连接。请注意,您将因此消耗额度!",464 "Verifies your API connection by sending a short test message. Be aware that you'll be credited for it!": "通过发送简短的测试消息验证您的API连接。请注意,您将因此消耗额度!",
467 "Test Message": "发送测试消息",465 "Test Message": "发送测试消息",
public/locales/zh-tw.json+0 -2
@@ -1547,8 +1547,6 @@
1547 "Width of a node, in pixels at zoom level 1.0.": "縮放等級為 1.0 時,節點的像素寬度。",1547 "Width of a node, in pixels at zoom level 1.0.": "縮放等級為 1.0 時,節點的像素寬度。",
1548 "world_button_title": "角色背景設定\n「Shift+點選」可開啟「連結至世界資訊」彈窗",1548 "world_button_title": "角色背景設定\n「Shift+點選」可開啟「連結至世界資訊」彈窗",
1549 "# of Beams": "# of Beams",1549 "# of Beams": "# of Beams",
1550 "01.AI API Key": "01.AI API 金鑰",
1551 "01.AI Model": "01.AI 模型",
1552 "Additional Parameters": "其他參數",1550 "Additional Parameters": "其他參數",
1553 "All": "全部",1551 "All": "全部",
1554 "Allow fallback models": "允許回退模型",1552 "Allow fallback models": "允許回退模型",
public/scripts/RossAscends-mods.js+0 -1
@@ -406,7 +406,6 @@ function RA_autoconnect(PrevApi) {
406 || (secret_state[SECRET_KEYS.COHERE] && oai_settings.chat_completion_source == chat_completion_sources.COHERE)406 || (secret_state[SECRET_KEYS.COHERE] && oai_settings.chat_completion_source == chat_completion_sources.COHERE)
407 || (secret_state[SECRET_KEYS.PERPLEXITY] && oai_settings.chat_completion_source == chat_completion_sources.PERPLEXITY)407 || (secret_state[SECRET_KEYS.PERPLEXITY] && oai_settings.chat_completion_source == chat_completion_sources.PERPLEXITY)
408 || (secret_state[SECRET_KEYS.GROQ] && oai_settings.chat_completion_source == chat_completion_sources.GROQ)408 || (secret_state[SECRET_KEYS.GROQ] && oai_settings.chat_completion_source == chat_completion_sources.GROQ)
409 || (secret_state[SECRET_KEYS.ZEROONEAI] && oai_settings.chat_completion_source == chat_completion_sources.ZEROONEAI)
410 || (secret_state[SECRET_KEYS.NANOGPT] && oai_settings.chat_completion_source == chat_completion_sources.NANOGPT)409 || (secret_state[SECRET_KEYS.NANOGPT] && oai_settings.chat_completion_source == chat_completion_sources.NANOGPT)
411 || (secret_state[SECRET_KEYS.DEEPSEEK] && oai_settings.chat_completion_source == chat_completion_sources.DEEPSEEK)410 || (secret_state[SECRET_KEYS.DEEPSEEK] && oai_settings.chat_completion_source == chat_completion_sources.DEEPSEEK)
412 || (secret_state[SECRET_KEYS.XAI] && oai_settings.chat_completion_source == chat_completion_sources.XAI)411 || (secret_state[SECRET_KEYS.XAI] && oai_settings.chat_completion_source == chat_completion_sources.XAI)
public/scripts/extensions/caption/index.js+0 -1
@@ -435,7 +435,6 @@ jQuery(async function () {
435435
436 const chatCompletionApis = {436 const chatCompletionApis = {
437 'openrouter': SECRET_KEYS.OPENROUTER,437 'openrouter': SECRET_KEYS.OPENROUTER,
438 'zerooneai': SECRET_KEYS.ZEROONEAI,
439 'groq': SECRET_KEYS.GROQ,438 'groq': SECRET_KEYS.GROQ,
440 'cohere': SECRET_KEYS.COHERE,439 'cohere': SECRET_KEYS.COHERE,
441 'aimlapi': SECRET_KEYS.AIMLAPI,440 'aimlapi': SECRET_KEYS.AIMLAPI,
public/scripts/extensions/caption/settings.html+0 -2
@@ -17,7 +17,6 @@
17 <div class="flex1 flex-container flexFlowColumn flexNoGap">17 <div class="flex1 flex-container flexFlowColumn flexNoGap">
18 <label for="caption_multimodal_api" data-i18n="API">API</label>18 <label for="caption_multimodal_api" data-i18n="API">API</label>
19 <select id="caption_multimodal_api" class="flex1 text_pole">19 <select id="caption_multimodal_api" class="flex1 text_pole">
20 <option value="zerooneai">01.AI (Yi)</option>
21 <option value="aimlapi">AI/ML API</option>20 <option value="aimlapi">AI/ML API</option>
22 <option value="anthropic">Anthropic</option>21 <option value="anthropic">Anthropic</option>
23 <option value="cohere">Cohere</option>22 <option value="cohere">Cohere</option>
@@ -52,7 +51,6 @@
52 <option data-type="mistral" value="mistral-small-latest">mistral-small-latest</option>51 <option data-type="mistral" value="mistral-small-latest">mistral-small-latest</option>
53 <option data-type="mistral" value="mistral-medium-latest">mistral-medium-latest</option>52 <option data-type="mistral" value="mistral-medium-latest">mistral-medium-latest</option>
54 <option data-type="mistral" value="mistral-medium-2505">mistral-medium-2505</option>53 <option data-type="mistral" value="mistral-medium-2505">mistral-medium-2505</option>
55 <option data-type="zerooneai" value="yi-vision">yi-vision</option>
56 <option data-type="openai" value="gpt-4.1">gpt-4.1</option>54 <option data-type="openai" value="gpt-4.1">gpt-4.1</option>
57 <option data-type="openai" value="gpt-4.1-2025-04-14">gpt-4.1-2025-04-14</option>55 <option data-type="openai" value="gpt-4.1-2025-04-14">gpt-4.1-2025-04-14</option>
58 <option data-type="openai" value="gpt-4.1-mini">gpt-4.1-mini</option>56 <option data-type="openai" value="gpt-4.1-mini">gpt-4.1-mini</option>
public/scripts/extensions/shared.js+0 -4
@@ -163,10 +163,6 @@ function throwIfInvalidModel(useReverseProxy) {
163 throw new Error('Anthropic (Claude) API key is not set.');163 throw new Error('Anthropic (Claude) API key is not set.');
164 }164 }
165165
166 if (multimodalApi === 'zerooneai' && !secret_state[SECRET_KEYS.ZEROONEAI]) {
167 throw new Error('01.AI API key is not set.');
168 }
169
170 if (multimodalApi === 'groq' && !secret_state[SECRET_KEYS.GROQ]) {166 if (multimodalApi === 'groq' && !secret_state[SECRET_KEYS.GROQ]) {
171 throw new Error('Groq API key is not set.');167 throw new Error('Groq API key is not set.');
172 }168 }
public/scripts/openai.js+0 -88
@@ -178,7 +178,6 @@ export const chat_completion_sources = {
178 COHERE: 'cohere',178 COHERE: 'cohere',
179 PERPLEXITY: 'perplexity',179 PERPLEXITY: 'perplexity',
180 GROQ: 'groq',180 GROQ: 'groq',
181 ZEROONEAI: '01ai',
182 NANOGPT: 'nanogpt',181 NANOGPT: 'nanogpt',
183 DEEPSEEK: 'deepseek',182 DEEPSEEK: 'deepseek',
184 AIMLAPI: 'aimlapi',183 AIMLAPI: 'aimlapi',
@@ -271,7 +270,6 @@ export const settingsToUpdate = {
271 nanogpt_model: ['#model_nanogpt_select', 'nanogpt_model', false, true],270 nanogpt_model: ['#model_nanogpt_select', 'nanogpt_model', false, true],
272 deepseek_model: ['#model_deepseek_select', 'deepseek_model', false, true],271 deepseek_model: ['#model_deepseek_select', 'deepseek_model', false, true],
273 aimlapi_model: ['#model_aimlapi_select', 'aimlapi_model', false, true],272 aimlapi_model: ['#model_aimlapi_select', 'aimlapi_model', false, true],
274 zerooneai_model: ['#model_01ai_select', 'zerooneai_model', false, true],
275 xai_model: ['#model_xai_select', 'xai_model', false, true],273 xai_model: ['#model_xai_select', 'xai_model', false, true],
276 pollinations_model: ['#model_pollinations_select', 'pollinations_model', false, true],274 pollinations_model: ['#model_pollinations_select', 'pollinations_model', false, true],
277 custom_model: ['#custom_model_id', 'custom_model', false, true],275 custom_model: ['#custom_model_id', 'custom_model', false, true],
@@ -365,7 +363,6 @@ const default_settings = {
365 perplexity_model: 'sonar-pro',363 perplexity_model: 'sonar-pro',
366 groq_model: 'llama-3.3-70b-versatile',364 groq_model: 'llama-3.3-70b-versatile',
367 nanogpt_model: 'gpt-4o-mini',365 nanogpt_model: 'gpt-4o-mini',
368 zerooneai_model: 'yi-large',
369 deepseek_model: 'deepseek-chat',366 deepseek_model: 'deepseek-chat',
370 aimlapi_model: 'gpt-4o-mini-2024-07-18',367 aimlapi_model: 'gpt-4o-mini-2024-07-18',
371 xai_model: 'grok-3-beta',368 xai_model: 'grok-3-beta',
@@ -452,7 +449,6 @@ const oai_settings = {
452 perplexity_model: 'sonar-pro',449 perplexity_model: 'sonar-pro',
453 groq_model: 'llama-3.1-70b-versatile',450 groq_model: 'llama-3.1-70b-versatile',
454 nanogpt_model: 'gpt-4o-mini',451 nanogpt_model: 'gpt-4o-mini',
455 zerooneai_model: 'yi-large',
456 deepseek_model: 'deepseek-chat',452 deepseek_model: 'deepseek-chat',
457 aimlapi_model: 'gpt-4-turbo',453 aimlapi_model: 'gpt-4-turbo',
458 xai_model: 'grok-3-beta',454 xai_model: 'grok-3-beta',
@@ -1607,8 +1603,6 @@ export function getChatCompletionModel(source = null) {
1607 return oai_settings.perplexity_model;1603 return oai_settings.perplexity_model;
1608 case chat_completion_sources.GROQ:1604 case chat_completion_sources.GROQ:
1609 return oai_settings.groq_model;1605 return oai_settings.groq_model;
1610 case chat_completion_sources.ZEROONEAI:
1611 return oai_settings.zerooneai_model;
1612 case chat_completion_sources.NANOGPT:1606 case chat_completion_sources.NANOGPT:
1613 return oai_settings.nanogpt_model;1607 return oai_settings.nanogpt_model;
1614 case chat_completion_sources.DEEPSEEK:1608 case chat_completion_sources.DEEPSEEK:
@@ -1722,23 +1716,6 @@ function saveModelList(data) {
1722 }1716 }
1723 }1717 }
17241718
1725 if (oai_settings.chat_completion_source == chat_completion_sources.ZEROONEAI) {
1726 $('#model_01ai_select').empty();
1727 model_list.forEach((model) => {
1728 $('#model_01ai_select').append(
1729 $('<option>', {
1730 value: model.id,
1731 text: model.id,
1732 }));
1733 });
1734
1735 if (!oai_settings.zerooneai_model && model_list.length > 0) {
1736 oai_settings.zerooneai_model = model_list[0].id;
1737 }
1738
1739 $('#model_01ai_select').val(oai_settings.zerooneai_model).trigger('change');
1740 }
1741
1742 if (oai_settings.chat_completion_source == chat_completion_sources.AIMLAPI) {1719 if (oai_settings.chat_completion_source == chat_completion_sources.AIMLAPI) {
1743 $('#model_aimlapi_select').empty();1720 $('#model_aimlapi_select').empty();
1744 const chatModels = model_list.filter(m => m.type === 'chat-completion');1721 const chatModels = model_list.filter(m => m.type === 'chat-completion');
@@ -2057,7 +2034,6 @@ async function sendOpenAIRequest(type, messages, signal, { jsonSchema = null } =
2057 const isCohere = oai_settings.chat_completion_source == chat_completion_sources.COHERE;2034 const isCohere = oai_settings.chat_completion_source == chat_completion_sources.COHERE;
2058 const isPerplexity = oai_settings.chat_completion_source == chat_completion_sources.PERPLEXITY;2035 const isPerplexity = oai_settings.chat_completion_source == chat_completion_sources.PERPLEXITY;
2059 const isGroq = oai_settings.chat_completion_source == chat_completion_sources.GROQ;2036 const isGroq = oai_settings.chat_completion_source == chat_completion_sources.GROQ;
2060 const is01AI = oai_settings.chat_completion_source == chat_completion_sources.ZEROONEAI;
2061 const isDeepSeek = oai_settings.chat_completion_source == chat_completion_sources.DEEPSEEK;2037 const isDeepSeek = oai_settings.chat_completion_source == chat_completion_sources.DEEPSEEK;
2062 const isAimlapi = oai_settings.chat_completion_source == chat_completion_sources.AIMLAPI;2038 const isAimlapi = oai_settings.chat_completion_source == chat_completion_sources.AIMLAPI;
2063 const isXAI = oai_settings.chat_completion_source == chat_completion_sources.XAI;2039 const isXAI = oai_settings.chat_completion_source == chat_completion_sources.XAI;
@@ -2215,17 +2191,6 @@ async function sendOpenAIRequest(type, messages, signal, { jsonSchema = null } =
2215 delete generate_data.n;2191 delete generate_data.n;
2216 }2192 }
22172193
2218 // https://platform.01.ai/docs#request-body
2219 if (is01AI) {
2220 delete generate_data.logprobs;
2221 delete generate_data.logit_bias;
2222 delete generate_data.top_logprobs;
2223 delete generate_data.n;
2224 delete generate_data.frequency_penalty;
2225 delete generate_data.presence_penalty;
2226 delete generate_data.stop;
2227 }
2228
2229 // https://api-docs.deepseek.com/api/create-chat-completion2194 // https://api-docs.deepseek.com/api/create-chat-completion
2230 if (isDeepSeek) {2195 if (isDeepSeek) {
2231 generate_data.top_p = generate_data.top_p || Number.EPSILON;2196 generate_data.top_p = generate_data.top_p || Number.EPSILON;
@@ -3378,7 +3343,6 @@ function loadOpenAISettings(data, settings) {
3378 oai_settings.nanogpt_model = settings.nanogpt_model ?? default_settings.nanogpt_model;3343 oai_settings.nanogpt_model = settings.nanogpt_model ?? default_settings.nanogpt_model;
3379 oai_settings.deepseek_model = settings.deepseek_model ?? default_settings.deepseek_model;3344 oai_settings.deepseek_model = settings.deepseek_model ?? default_settings.deepseek_model;
3380 oai_settings.aimlapi_model = settings.aimlapi_model ?? default_settings.aimlapi_model;3345 oai_settings.aimlapi_model = settings.aimlapi_model ?? default_settings.aimlapi_model;
3381 oai_settings.zerooneai_model = settings.zerooneai_model ?? default_settings.zerooneai_model;
3382 oai_settings.xai_model = settings.xai_model ?? default_settings.xai_model;3346 oai_settings.xai_model = settings.xai_model ?? default_settings.xai_model;
3383 oai_settings.pollinations_model = settings.pollinations_model ?? default_settings.pollinations_model;3347 oai_settings.pollinations_model = settings.pollinations_model ?? default_settings.pollinations_model;
3384 oai_settings.custom_model = settings.custom_model ?? default_settings.custom_model;3348 oai_settings.custom_model = settings.custom_model ?? default_settings.custom_model;
@@ -3472,7 +3436,6 @@ function loadOpenAISettings(data, settings) {
3472 $(`#model_nanogpt_select option[value="${oai_settings.nanogpt_model}"`).prop('selected', true);3436 $(`#model_nanogpt_select option[value="${oai_settings.nanogpt_model}"`).prop('selected', true);
3473 $('#model_deepseek_select').val(oai_settings.deepseek_model);3437 $('#model_deepseek_select').val(oai_settings.deepseek_model);
3474 $(`#model_deepseek_select option[value="${oai_settings.deepseek_model}"`).prop('selected', true);3438 $(`#model_deepseek_select option[value="${oai_settings.deepseek_model}"`).prop('selected', true);
3475 $('#model_01ai_select').val(oai_settings.zerooneai_model);
3476 $('#model_aimlapi_select').val(oai_settings.aimlapi_model);3439 $('#model_aimlapi_select').val(oai_settings.aimlapi_model);
3477 $(`#model_aimlapi_select option[value="${oai_settings.aimlapi_model}"`).prop('selected', true);3440 $(`#model_aimlapi_select option[value="${oai_settings.aimlapi_model}"`).prop('selected', true);
3478 $('#model_xai_select').val(oai_settings.xai_model);3441 $('#model_xai_select').val(oai_settings.xai_model);
@@ -3748,7 +3711,6 @@ async function saveOpenAIPreset(name, settings, triggerUi = true) {
3748 cohere_model: settings.cohere_model,3711 cohere_model: settings.cohere_model,
3749 perplexity_model: settings.perplexity_model,3712 perplexity_model: settings.perplexity_model,
3750 groq_model: settings.groq_model,3713 groq_model: settings.groq_model,
3751 zerooneai_model: settings.zerooneai_model,
3752 xai_model: settings.xai_model,3714 xai_model: settings.xai_model,
3753 pollinations_model: settings.pollinations_model,3715 pollinations_model: settings.pollinations_model,
3754 aimlapi_model: settings.aimlapi_model,3716 aimlapi_model: settings.aimlapi_model,
@@ -4572,11 +4534,6 @@ async function onModelChange() {
4572 oai_settings.deepseek_model = value;4534 oai_settings.deepseek_model = value;
4573 }4535 }
45744536
4575 if (value && $(this).is('#model_01ai_select')) {
4576 console.log('01.AI model changed to', value);
4577 oai_settings.zerooneai_model = value;
4578 }
4579
4580 if (value && $(this).is('#model_custom_select')) {4537 if (value && $(this).is('#model_custom_select')) {
4581 console.log('Custom model changed to', value);4538 console.log('Custom model changed to', value);
4582 oai_settings.custom_model = value;4539 oai_settings.custom_model = value;
@@ -4773,30 +4730,6 @@ async function onModelChange() {
4773 $('#temp_openai').attr('max', oai_max_temp).val(oai_settings.temp_openai).trigger('input');4730 $('#temp_openai').attr('max', oai_max_temp).val(oai_settings.temp_openai).trigger('input');
4774 }4731 }
47754732
4776 if (oai_settings.chat_completion_source === chat_completion_sources.ZEROONEAI) {
4777 if (oai_settings.max_context_unlocked) {
4778 $('#openai_max_context').attr('max', unlocked_max);
4779 }
4780 else if (['yi-large'].includes(oai_settings.zerooneai_model)) {
4781 $('#openai_max_context').attr('max', max_32k);
4782 }
4783 else if (['yi-vision'].includes(oai_settings.zerooneai_model)) {
4784 $('#openai_max_context').attr('max', max_16k);
4785 }
4786 else if (['yi-large-turbo'].includes(oai_settings.zerooneai_model)) {
4787 $('#openai_max_context').attr('max', max_4k);
4788 }
4789 else {
4790 $('#openai_max_context').attr('max', max_16k);
4791 }
4792
4793 oai_settings.openai_max_context = Math.min(oai_settings.openai_max_context, Number($('#openai_max_context').attr('max')));
4794 $('#openai_max_context').val(oai_settings.openai_max_context).trigger('input');
4795
4796 oai_settings.temp_openai = Math.min(oai_max_temp, oai_settings.temp_openai);
4797 $('#temp_openai').attr('max', oai_max_temp).val(oai_settings.temp_openai).trigger('input');
4798 }
4799
4800 if (oai_settings.chat_completion_source === chat_completion_sources.NANOGPT) {4733 if (oai_settings.chat_completion_source === chat_completion_sources.NANOGPT) {
4801 if (oai_settings.max_context_unlocked) {4734 if (oai_settings.max_context_unlocked) {
4802 $('#openai_max_context').attr('max', unlocked_max);4735 $('#openai_max_context').attr('max', unlocked_max);
@@ -5094,19 +5027,6 @@ async function onConnectButtonClick(e) {
5094 }5027 }
5095 }5028 }
50965029
5097 if (oai_settings.chat_completion_source == chat_completion_sources.ZEROONEAI) {
5098 const api_key_01ai = String($('#api_key_01ai').val()).trim();
5099
5100 if (api_key_01ai.length) {
5101 await writeSecret(SECRET_KEYS.ZEROONEAI, api_key_01ai);
5102 }
5103
5104 if (!secret_state[SECRET_KEYS.ZEROONEAI]) {
5105 console.log('No secret key saved for 01.AI');
5106 return;
5107 }
5108 }
5109
5110 if (oai_settings.chat_completion_source === chat_completion_sources.XAI) {5030 if (oai_settings.chat_completion_source === chat_completion_sources.XAI) {
5111 const api_key_xai = String($('#api_key_xai').val()).trim();5031 const api_key_xai = String($('#api_key_xai').val()).trim();
51125032
@@ -5179,9 +5099,6 @@ function toggleChatCompletionForms() {
5179 else if (oai_settings.chat_completion_source == chat_completion_sources.NANOGPT) {5099 else if (oai_settings.chat_completion_source == chat_completion_sources.NANOGPT) {
5180 $('#model_nanogpt_select').trigger('change');5100 $('#model_nanogpt_select').trigger('change');
5181 }5101 }
5182 else if (oai_settings.chat_completion_source == chat_completion_sources.ZEROONEAI) {
5183 $('#model_01ai_select').trigger('change');
5184 }
5185 else if (oai_settings.chat_completion_source == chat_completion_sources.CUSTOM) {5102 else if (oai_settings.chat_completion_source == chat_completion_sources.CUSTOM) {
5186 $('#model_custom_select').trigger('change');5103 $('#model_custom_select').trigger('change');
5187 }5104 }
@@ -5281,8 +5198,6 @@ export function isImageInliningSupported() {
5281 'o1',5198 'o1',
5282 'o3',5199 'o3',
5283 'o4-mini',5200 'o4-mini',
5284 // 01.AI (Yi)
5285 'yi-vision',
5286 // Claude5201 // Claude
5287 'claude-3',5202 'claude-3',
5288 'claude-opus-4',5203 'claude-opus-4',
@@ -5324,8 +5239,6 @@ export function isImageInliningSupported() {
5324 return true;5239 return true;
5325 case chat_completion_sources.CUSTOM:5240 case chat_completion_sources.CUSTOM:
5326 return true;5241 return true;
5327 case chat_completion_sources.ZEROONEAI:
5328 return visionSupportedModels.some(model => oai_settings.zerooneai_model.includes(model));
5329 case chat_completion_sources.MISTRALAI:5242 case chat_completion_sources.MISTRALAI:
5330 return visionSupportedModels.some(model => oai_settings.mistralai_model.includes(model));5243 return visionSupportedModels.some(model => oai_settings.mistralai_model.includes(model));
5331 case chat_completion_sources.COHERE:5244 case chat_completion_sources.COHERE:
@@ -6120,7 +6033,6 @@ export function initOpenAI() {
6120 $('#model_groq_select').on('change', onModelChange);6033 $('#model_groq_select').on('change', onModelChange);
6121 $('#model_nanogpt_select').on('change', onModelChange);6034 $('#model_nanogpt_select').on('change', onModelChange);
6122 $('#model_deepseek_select').on('change', onModelChange);6035 $('#model_deepseek_select').on('change', onModelChange);
6123 $('#model_01ai_select').on('change', onModelChange);
6124 $('#model_aimlapi_select').on('change', onModelChange);6036 $('#model_aimlapi_select').on('change', onModelChange);
6125 $('#model_custom_select').on('change', onModelChange);6037 $('#model_custom_select').on('change', onModelChange);
6126 $('#model_xai_select').on('change', onModelChange);6038 $('#model_xai_select').on('change', onModelChange);
public/scripts/secrets.js+0 -3
@@ -48,7 +48,6 @@ export const SECRET_KEYS = {
48 GROQ: 'api_key_groq',48 GROQ: 'api_key_groq',
49 AZURE_TTS: 'api_key_azure_tts',49 AZURE_TTS: 'api_key_azure_tts',
50 FEATHERLESS: 'api_key_featherless',50 FEATHERLESS: 'api_key_featherless',
51 ZEROONEAI: 'api_key_01ai',
52 HUGGINGFACE: 'api_key_huggingface',51 HUGGINGFACE: 'api_key_huggingface',
53 STABILITY: 'api_key_stability',52 STABILITY: 'api_key_stability',
54 CUSTOM_OPENAI_TTS: 'api_key_custom_openai_tts',53 CUSTOM_OPENAI_TTS: 'api_key_custom_openai_tts',
@@ -92,7 +91,6 @@ const FRIENDLY_NAMES = {
92 [SECRET_KEYS.PERPLEXITY]: 'Perplexity',91 [SECRET_KEYS.PERPLEXITY]: 'Perplexity',
93 [SECRET_KEYS.GROQ]: 'Groq',92 [SECRET_KEYS.GROQ]: 'Groq',
94 [SECRET_KEYS.FEATHERLESS]: 'Featherless',93 [SECRET_KEYS.FEATHERLESS]: 'Featherless',
95 [SECRET_KEYS.ZEROONEAI]: '01.AI',
96 [SECRET_KEYS.HUGGINGFACE]: 'HuggingFace',94 [SECRET_KEYS.HUGGINGFACE]: 'HuggingFace',
97 [SECRET_KEYS.NANOGPT]: 'NanoGPT',95 [SECRET_KEYS.NANOGPT]: 'NanoGPT',
98 [SECRET_KEYS.GENERIC]: 'Generic (OpenAI-compatible)',96 [SECRET_KEYS.GENERIC]: 'Generic (OpenAI-compatible)',
@@ -143,7 +141,6 @@ const INPUT_MAP = {
143 [SECRET_KEYS.PERPLEXITY]: '#api_key_perplexity',141 [SECRET_KEYS.PERPLEXITY]: '#api_key_perplexity',
144 [SECRET_KEYS.GROQ]: '#api_key_groq',142 [SECRET_KEYS.GROQ]: '#api_key_groq',
145 [SECRET_KEYS.FEATHERLESS]: '#api_key_featherless',143 [SECRET_KEYS.FEATHERLESS]: '#api_key_featherless',
146 [SECRET_KEYS.ZEROONEAI]: '#api_key_01ai',
147 [SECRET_KEYS.HUGGINGFACE]: '#api_key_huggingface',144 [SECRET_KEYS.HUGGINGFACE]: '#api_key_huggingface',
148 [SECRET_KEYS.NANOGPT]: '#api_key_nanogpt',145 [SECRET_KEYS.NANOGPT]: '#api_key_nanogpt',
149 [SECRET_KEYS.GENERIC]: '#api_key_generic',146 [SECRET_KEYS.GENERIC]: '#api_key_generic',
public/scripts/slash-commands.js+0 -1
@@ -4801,7 +4801,6 @@ function getModelOptions(quiet) {
4801 { id: 'model_perplexity_select', api: 'openai', type: chat_completion_sources.PERPLEXITY },4801 { id: 'model_perplexity_select', api: 'openai', type: chat_completion_sources.PERPLEXITY },
4802 { id: 'model_groq_select', api: 'openai', type: chat_completion_sources.GROQ },4802 { id: 'model_groq_select', api: 'openai', type: chat_completion_sources.GROQ },
4803 { id: 'model_nanogpt_select', api: 'openai', type: chat_completion_sources.NANOGPT },4803 { id: 'model_nanogpt_select', api: 'openai', type: chat_completion_sources.NANOGPT },
4804 { id: 'model_01ai_select', api: 'openai', type: chat_completion_sources.ZEROONEAI },
4805 { id: 'model_deepseek_select', api: 'openai', type: chat_completion_sources.DEEPSEEK },4804 { id: 'model_deepseek_select', api: 'openai', type: chat_completion_sources.DEEPSEEK },
4806 { id: 'model_aimlapi_select', api: 'openai', type: chat_completion_sources.AIMLAPI },4805 { id: 'model_aimlapi_select', api: 'openai', type: chat_completion_sources.AIMLAPI },
4807 { id: 'model_xai_select', api: 'openai', type: chat_completion_sources.XAI },4806 { id: 'model_xai_select', api: 'openai', type: chat_completion_sources.XAI },
public/scripts/tokenizers.js+0 -4
@@ -708,10 +708,6 @@ export function getTokenizerModel() {
708 }708 }
709 }709 }
710710
711 if (oai_settings.chat_completion_source === chat_completion_sources.ZEROONEAI) {
712 return yiTokenizer;
713 }
714
715 // Default to Turbo 3.5711 // Default to Turbo 3.5
716 return turboTokenizer;712 return turboTokenizer;
717}713}
src/constants.js+0 -1
@@ -173,7 +173,6 @@ export const CHAT_COMPLETION_SOURCES = {
173 COHERE: 'cohere',173 COHERE: 'cohere',
174 PERPLEXITY: 'perplexity',174 PERPLEXITY: 'perplexity',
175 GROQ: 'groq',175 GROQ: 'groq',
176 ZEROONEAI: '01ai',
177 NANOGPT: 'nanogpt',176 NANOGPT: 'nanogpt',
178 DEEPSEEK: 'deepseek',177 DEEPSEEK: 'deepseek',
179 AIMLAPI: 'aimlapi',178 AIMLAPI: 'aimlapi',
src/endpoints/backends/chat-completions.js+0 -10
@@ -59,7 +59,6 @@ const API_PERPLEXITY = 'https://api.perplexity.ai';
59const API_GROQ = 'https://api.groq.com/openai/v1';59const API_GROQ = 'https://api.groq.com/openai/v1';
60const API_MAKERSUITE = 'https://generativelanguage.googleapis.com';60const API_MAKERSUITE = 'https://generativelanguage.googleapis.com';
61const API_VERTEX_AI = 'https://us-central1-aiplatform.googleapis.com';61const API_VERTEX_AI = 'https://us-central1-aiplatform.googleapis.com';
62const API_01AI = 'https://api.lingyiwanwu.com/v1';
63const API_AI21 = 'https://api.ai21.com/studio/v1';62const API_AI21 = 'https://api.ai21.com/studio/v1';
64const API_NANOGPT = 'https://nano-gpt.com/api/v1';63const API_NANOGPT = 'https://nano-gpt.com/api/v1';
65const API_DEEPSEEK = 'https://api.deepseek.com/beta';64const API_DEEPSEEK = 'https://api.deepseek.com/beta';
@@ -1197,10 +1196,6 @@ router.post('/status', async function (request, statusResponse) {
1197 apiUrl = API_COHERE_V1;1196 apiUrl = API_COHERE_V1;
1198 apiKey = readSecret(request.user.directories, SECRET_KEYS.COHERE);1197 apiKey = readSecret(request.user.directories, SECRET_KEYS.COHERE);
1199 headers = {};1198 headers = {};
1200 } else if (request.body.chat_completion_source === CHAT_COMPLETION_SOURCES.ZEROONEAI) {
1201 apiUrl = API_01AI;
1202 apiKey = readSecret(request.user.directories, SECRET_KEYS.ZEROONEAI);
1203 headers = {};
1204 } else if (request.body.chat_completion_source === CHAT_COMPLETION_SOURCES.NANOGPT) {1199 } else if (request.body.chat_completion_source === CHAT_COMPLETION_SOURCES.NANOGPT) {
1205 apiUrl = API_NANOGPT;1200 apiUrl = API_NANOGPT;
1206 apiKey = readSecret(request.user.directories, SECRET_KEYS.NANOGPT);1201 apiKey = readSecret(request.user.directories, SECRET_KEYS.NANOGPT);
@@ -1591,11 +1586,6 @@ router.post('/generate', function (request, response) {
1591 if (request.body.enable_web_search && !/:online$/.test(request.body.model)) {1586 if (request.body.enable_web_search && !/:online$/.test(request.body.model)) {
1592 request.body.model = `${request.body.model}:online`;1587 request.body.model = `${request.body.model}:online`;
1593 }1588 }
1594 } else if (request.body.chat_completion_source === CHAT_COMPLETION_SOURCES.ZEROONEAI) {
1595 apiUrl = API_01AI;
1596 apiKey = readSecret(request.user.directories, SECRET_KEYS.ZEROONEAI);
1597 headers = {};
1598 bodyParams = {};
1599 } else if (request.body.chat_completion_source === CHAT_COMPLETION_SOURCES.POLLINATIONS) {1589 } else if (request.body.chat_completion_source === CHAT_COMPLETION_SOURCES.POLLINATIONS) {
1600 apiUrl = API_POLLINATIONS;1590 apiUrl = API_POLLINATIONS;
1601 apiKey = 'NONE';1591 apiKey = 'NONE';
src/endpoints/openai.js+0 -8
@@ -61,10 +61,6 @@ router.post('/caption-image', async (request, response) => {
61 key = readSecret(request.user.directories, SECRET_KEYS.VLLM);61 key = readSecret(request.user.directories, SECRET_KEYS.VLLM);
62 }62 }
6363
64 if (request.body.api === 'zerooneai') {
65 key = readSecret(request.user.directories, SECRET_KEYS.ZEROONEAI);
66 }
67
68 if (request.body.api === 'aimlapi') {64 if (request.body.api === 'aimlapi') {
69 key = readSecret(request.user.directories, SECRET_KEYS.AIMLAPI);65 key = readSecret(request.user.directories, SECRET_KEYS.AIMLAPI);
70 }66 }
@@ -128,10 +124,6 @@ router.post('/caption-image', async (request, response) => {
128 apiUrl = `${request.body.server_url}/chat/completions`;124 apiUrl = `${request.body.server_url}/chat/completions`;
129 }125 }
130126
131 if (request.body.api === 'zerooneai') {
132 apiUrl = 'https://api.lingyiwanwu.com/v1/chat/completions';
133 }
134
135 if (request.body.api === 'aimlapi') {127 if (request.body.api === 'aimlapi') {
136 apiUrl = 'https://api.aimlapi.com/v1/chat/completions';128 apiUrl = 'https://api.aimlapi.com/v1/chat/completions';
137 Object.assign(headers, AIMLAPI_HEADERS);129 Object.assign(headers, AIMLAPI_HEADERS);
src/endpoints/secrets.js+0 -1
@@ -41,7 +41,6 @@ export const SECRET_KEYS = {
41 GROQ: 'api_key_groq',41 GROQ: 'api_key_groq',
42 AZURE_TTS: 'api_key_azure_tts',42 AZURE_TTS: 'api_key_azure_tts',
43 FEATHERLESS: 'api_key_featherless',43 FEATHERLESS: 'api_key_featherless',
44 ZEROONEAI: 'api_key_01ai',
45 HUGGINGFACE: 'api_key_huggingface',44 HUGGINGFACE: 'api_key_huggingface',
46 STABILITY: 'api_key_stability',45 STABILITY: 'api_key_stability',
47 CUSTOM_OPENAI_TTS: 'api_key_custom_openai_tts',46 CUSTOM_OPENAI_TTS: 'api_key_custom_openai_tts',