diff --git a/public/img/nanogpt.svg b/public/img/nanogpt.svg new file mode 100644 index 000000000..945d9c2e8 --- /dev/null +++ b/public/img/nanogpt.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + diff --git a/public/index.html b/public/index.html index 8a05bf447..f30707522 100644 --- a/public/index.html +++ b/public/index.html @@ -2601,6 +2601,7 @@ + @@ -3083,6 +3084,22 @@ +
+

NanoGPT API Key

+
+ + +
+
+ For privacy reasons, your API key will be hidden after you reload the page. +
+
+

NanoGPT Model

+ +
+

Perplexity API Key

diff --git a/public/scripts/RossAscends-mods.js b/public/scripts/RossAscends-mods.js index ca9affb7b..32e4fdcb4 100644 --- a/public/scripts/RossAscends-mods.js +++ b/public/scripts/RossAscends-mods.js @@ -388,6 +388,7 @@ function RA_autoconnect(PrevApi) { || (secret_state[SECRET_KEYS.GROQ] && oai_settings.chat_completion_source == chat_completion_sources.GROQ) || (secret_state[SECRET_KEYS.ZEROONEAI] && oai_settings.chat_completion_source == chat_completion_sources.ZEROONEAI) || (secret_state[SECRET_KEYS.BLOCKENTROPY] && oai_settings.chat_completion_source == chat_completion_sources.BLOCKENTROPY) + || (secret_state[SECRET_KEYS.NANOGPT] && oai_settings.chat_completion_source == chat_completion_sources.NANOGPT) || (isValidUrl(oai_settings.custom_url) && oai_settings.chat_completion_source == chat_completion_sources.CUSTOM) ) { $('#api_button_openai').trigger('click'); diff --git a/public/scripts/openai.js b/public/scripts/openai.js index f3289293a..5fc904c2c 100644 --- a/public/scripts/openai.js +++ b/public/scripts/openai.js @@ -182,6 +182,7 @@ export const chat_completion_sources = { GROQ: 'groq', ZEROONEAI: '01ai', BLOCKENTROPY: 'blockentropy', + NANOGPT: 'nanogpt', }; const character_names_behavior = { @@ -251,6 +252,7 @@ const default_settings = { cohere_model: 'command-r-plus', perplexity_model: 'llama-3.1-70b-instruct', groq_model: 'llama-3.1-70b-versatile', + nanogpt_model: 'gpt-4o-mini', zerooneai_model: 'yi-large', blockentropy_model: 'be-70b-base-llama3.1', custom_model: '', @@ -327,6 +329,7 @@ const oai_settings = { cohere_model: 'command-r-plus', perplexity_model: 'llama-3.1-70b-instruct', groq_model: 'llama-3.1-70b-versatile', + nanogpt_model: 'gpt-4o-mini', zerooneai_model: 'yi-large', blockentropy_model: 'be-70b-base-llama3.1', custom_model: '', @@ -1480,6 +1483,8 @@ function getChatCompletionModel() { return oai_settings.zerooneai_model; case chat_completion_sources.BLOCKENTROPY: return oai_settings.blockentropy_model; + case chat_completion_sources.NANOGPT: + return oai_settings.nanogpt_model; default: throw new Error(`Unknown chat completion source: ${oai_settings.chat_completion_source}`); } @@ -1637,6 +1642,24 @@ function saveModelList(data) { } } } + + if (oai_settings.chat_completion_source == chat_completion_sources.NANOGPT) { + $('#model_nanogpt_select').empty(); + model_list.forEach((model) => { + $('#model_nanogpt_select').append( + $('