|
4081 | 4081 |
|
4082 | 4082 | const default_openrouter_base = "https://openrouter.ai/api/v1";
|
4083 | 4083 | const default_mistralai_base = "https://api.mistral.ai/v1";
|
| 4084 | + const default_featherless_base = "https://api.featherless.ai/v1"; |
4084 | 4085 | const default_oai_base = "https://api.openai.com";
|
4085 | 4086 | const default_claude_base = "https://api.anthropic.com";
|
4086 | 4087 | const default_palm_base = "https://generativelanguage.googleapis.com/v1beta2/models/text-bison-001:generateText?key=";
|
|
4214 | 4215 | saved_dalle_url: (default_oai_base + "/v1" + default_oai_image_endpoint),
|
4215 | 4216 | saved_openrouter_key: "",
|
4216 | 4217 | saved_mistralai_key: "",
|
| 4218 | + saved_featherless_key: "", |
4217 | 4219 | saved_claude_key: "", //do not ever share this in save files!
|
4218 | 4220 | saved_claude_addr: default_claude_base, //do not ever share this in save files!
|
4219 | 4221 | saved_palm_key: "", //do not ever share this in save files!
|
|
5891 | 5893 | new_save_storyobj.savedsettings.saved_kai_key = "";
|
5892 | 5894 | new_save_storyobj.savedsettings.saved_openrouter_key = "";
|
5893 | 5895 | new_save_storyobj.savedsettings.saved_mistralai_key = "";
|
| 5896 | + new_save_storyobj.savedsettings.saved_featherless_key = ""; |
5894 | 5897 | new_save_storyobj.savedsettings.saved_palm_key = "";
|
5895 | 5898 | new_save_storyobj.savedsettings.saved_cohere_key = "";
|
5896 | 5899 |
|
|
6221 | 6224 | let tmp_oai4 = localsettings.saved_dalle_url;
|
6222 | 6225 | let tmp_or1 = localsettings.saved_openrouter_key;
|
6223 | 6226 | let tmp_mai = localsettings.saved_mistralai_key;
|
| 6227 | + let tmp_fai = localsettings.saved_featherless_key; |
6224 | 6228 | let tmp_claude1 = localsettings.saved_claude_key;
|
6225 | 6229 | let tmp_claude2 = localsettings.saved_claude_addr;
|
6226 | 6230 | let tmp_palm1 = localsettings.saved_palm_key;
|
|
6257 | 6261 | localsettings.saved_dalle_url = tmp_oai4;
|
6258 | 6262 | localsettings.saved_openrouter_key = tmp_or1;
|
6259 | 6263 | localsettings.saved_mistralai_key = tmp_mai;
|
| 6264 | + localsettings.saved_featherless_key = tmp_fai; |
6260 | 6265 | localsettings.saved_claude_key = tmp_claude1;
|
6261 | 6266 | localsettings.saved_claude_addr = tmp_claude2;
|
6262 | 6267 | localsettings.saved_palm_key = tmp_palm1;
|
|
8066 | 8071 | return document.getElementById("custom_openrouter_model");
|
8067 | 8072 | case "7":
|
8068 | 8073 | return document.getElementById("custom_mistralai_model");
|
| 8074 | + case "8": |
| 8075 | + return document.getElementById("custom_featherless_model"); |
8069 | 8076 | default:
|
8070 | 8077 | return document.getElementById("custom_oai_model");
|
8071 | 8078 | }
|
8072 | 8079 | }
|
8073 | 8080 | function ep_should_always_use_chat_completions()
|
8074 | 8081 | {
|
8075 | 8082 | let epchoice = document.getElementById("customapidropdown").value;
|
8076 |
| - return (epchoice==3 || epchoice==7); |
| 8083 | + return (epchoice==7); |
8077 | 8084 | }
|
8078 | 8085 |
|
8079 | 8086 | function select_custom_oai_model()
|
|
8141 | 8148 | }
|
8142 | 8149 | }
|
8143 | 8150 |
|
| 8151 | + let isOpenrouter = (document.getElementById("customapidropdown").value==3); |
| 8152 | + let dropdown = get_oai_model_dropdown(); |
8144 | 8153 | fetch((desired_oai_ep + oai_models_endpoint), {
|
8145 | 8154 | method: 'GET',
|
8146 | 8155 | headers: oaiheaders,
|
|
8159 | 8168 |
|
8160 | 8169 | if (!data.error && data.data && data.data.length > 0)
|
8161 | 8170 | {
|
8162 |
| - let isOpenrouter = (document.getElementById("customapidropdown").value==3); |
8163 |
| - let dropdown = get_oai_model_dropdown(); |
8164 | 8171 | var lastOption = dropdown.lastElementChild;
|
8165 | 8172 | for (var i = dropdown.options.length - 1; i >= 0; i--) {
|
8166 | 8173 | var option = dropdown.options[i];
|
|
8222 | 8229 | document.getElementById("custom_oai_model").classList.add("hidden");
|
8223 | 8230 | document.getElementById("custom_openrouter_model").classList.add("hidden");
|
8224 | 8231 | document.getElementById("custom_mistralai_model").classList.add("hidden");
|
| 8232 | + document.getElementById("custom_featherless_model").classList.add("hidden"); |
8225 | 8233 | document.getElementById("hordeloadmodelcontainer").classList.add("hidden");
|
8226 | 8234 | document.getElementById("coherecustom").classList.add("hidden");
|
8227 | 8235 |
|
|
8239 | 8247 | document.getElementById("customkoboldkey").value = localsettings.saved_kai_key;
|
8240 | 8248 | }
|
8241 | 8249 | }
|
8242 |
| - else if(epchoice==2 || epchoice==3 || epchoice==7) |
| 8250 | + else if(epchoice==2 || epchoice==3 || epchoice==7 || epchoice==8) |
8243 | 8251 | {
|
8244 | 8252 | document.getElementById("oaicustom").classList.remove("hidden");
|
| 8253 | + document.getElementById("openrouterdesc").classList.add("hidden"); |
| 8254 | + document.getElementById("mistralaidesc").classList.add("hidden"); |
| 8255 | + document.getElementById("featherlessdesc").classList.add("hidden"); |
| 8256 | + document.getElementById("oaidesc").classList.add("hidden"); |
8245 | 8257 | if(epchoice==2)
|
8246 | 8258 | {
|
8247 | 8259 | document.getElementById("oaidesc").classList.remove("hidden");
|
8248 | 8260 | document.getElementById("custom_oai_model").classList.remove("hidden");
|
8249 |
| - document.getElementById("openrouterdesc").classList.add("hidden"); |
8250 |
| - document.getElementById("mistralaidesc").classList.add("hidden"); |
8251 | 8261 | document.getElementById("custom_oai_endpoint").classList.remove("hidden");
|
8252 | 8262 | document.getElementById("custom_oai_key").value = localsettings.saved_oai_key;
|
8253 | 8263 | if (localflag) {
|
|
8258 | 8268 | }
|
8259 | 8269 | else if(epchoice==7)
|
8260 | 8270 | {
|
8261 |
| - document.getElementById("oaidesc").classList.add("hidden"); |
8262 | 8271 | document.getElementById("custom_mistralai_model").classList.remove("hidden");
|
8263 |
| - document.getElementById("openrouterdesc").classList.add("hidden"); |
8264 | 8272 | document.getElementById("mistralaidesc").classList.remove("hidden");
|
8265 | 8273 | document.getElementById("custom_oai_endpoint").classList.add("hidden");
|
8266 | 8274 | document.getElementById("custom_oai_key").value = localsettings.saved_mistralai_key;
|
8267 | 8275 | document.getElementById("custom_oai_endpoint").value = default_mistralai_base;
|
8268 | 8276 | }
|
| 8277 | + else if(epchoice==8) |
| 8278 | + { |
| 8279 | + document.getElementById("custom_featherless_model").classList.remove("hidden"); |
| 8280 | + document.getElementById("featherlessdesc").classList.remove("hidden"); |
| 8281 | + document.getElementById("custom_oai_endpoint").classList.add("hidden"); |
| 8282 | + document.getElementById("custom_oai_key").value = localsettings.saved_featherless_key; |
| 8283 | + document.getElementById("custom_oai_endpoint").value = default_featherless_base; |
| 8284 | + } |
8269 | 8285 | else //openrouter supports autofetch
|
8270 | 8286 | {
|
8271 |
| - document.getElementById("oaidesc").classList.add("hidden"); |
8272 | 8287 | document.getElementById("openrouterdesc").classList.remove("hidden");
|
8273 |
| - document.getElementById("mistralaidesc").classList.add("hidden"); |
8274 | 8288 | document.getElementById("custom_openrouter_model").classList.remove("hidden");
|
8275 | 8289 | document.getElementById("custom_oai_endpoint").value = default_openrouter_base;
|
8276 | 8290 | document.getElementById("custom_oai_endpoint").classList.add("hidden");
|
|
8634 | 8648 | });
|
8635 | 8649 | }
|
8636 | 8650 | }
|
8637 |
| - else if(epchoice==2 || epchoice==3 || epchoice==7) //connect to OAI / OpenRouter / MistralAI Endpoint |
| 8651 | + else if(epchoice==2 || epchoice==3 || epchoice==7 || epchoice==8) //connect to OAI / OpenRouter / MistralAI / Featherless Endpoint |
8638 | 8652 | {
|
8639 | 8653 | let desired_oai_key = document.getElementById("custom_oai_key").value.trim();
|
8640 | 8654 | let desired_oai_ep = document.getElementById("custom_oai_endpoint").value.trim();
|
|
8677 | 8691 | {
|
8678 | 8692 | localsettings.saved_mistralai_key = custom_oai_key;
|
8679 | 8693 | }
|
| 8694 | + else if(epchoice==8) |
| 8695 | + { |
| 8696 | + localsettings.saved_featherless_key = custom_oai_key; |
| 8697 | + } |
8680 | 8698 | else
|
8681 | 8699 | {
|
8682 | 8700 | localsettings.saved_openrouter_key = custom_oai_key;
|
|
12140 | 12158 | }
|
12141 | 12159 |
|
12142 | 12160 | }
|
12143 |
| - else { |
| 12161 | + else |
| 12162 | + { |
12144 | 12163 | //apply custom logit bias for official OAI only
|
12145 |
| - |
12146 | 12164 | let needbaneos = (custom_oai_endpoint.toLowerCase().includes("api.openai.com") && determine_if_ban_eos(input_was_empty));
|
12147 | 12165 |
|
12148 | 12166 | if(needbaneos)
|
|
12155 | 12173 | }
|
12156 | 12174 | }
|
12157 | 12175 | oai_payload.prompt = submit_payload.prompt;
|
| 12176 | + |
| 12177 | + //lets try adding stop sequences, limit to first 4 |
| 12178 | + oai_payload.stop = get_stop_sequences().slice(0, 4); |
12158 | 12179 | }
|
12159 | 12180 |
|
12160 | 12181 | last_request_str = JSON.stringify(oai_payload);
|
|
17182 | 17203 | <option value="5">PaLM/Gemini By Google API</option>
|
17183 | 17204 | <option value="6">Cohere API</option>
|
17184 | 17205 | <option value="7">MistralAI API</option>
|
| 17206 | + <option value="8">Featherless API</option> |
17185 | 17207 | </select>
|
17186 | 17208 | </div>
|
17187 | 17209 |
|
|
17251 | 17273 | Note that KoboldAI Lite takes no responsibility for your usage or consequences of this feature. Your API key is used directly with the MistralAI API and is not transmitted to us.<br>Only Temperature and Top-P samplers are used.<br><br>
|
17252 | 17274 | <span class="color_green" style="font-weight: bold;">Please input MistralAI Key.</span><br><br>
|
17253 | 17275 | </span>
|
| 17276 | + <span id="featherlessdesc" class="hidden"> |
| 17277 | + Entering your Featherless API key will allow you to use KoboldAI Lite with their API.<br><br> |
| 17278 | + Note that KoboldAI Lite takes no responsibility for your usage or consequences of this feature. Your API key is used directly with the Featherless API and is not transmitted to us.<br>Only Temperature, Top-P and Repetition Penalty samplers are used.<br><br> |
| 17279 | + <span class="color_green" style="font-weight: bold;">Please input Featherless Key.</span><br><br> |
| 17280 | + </span> |
17254 | 17281 |
|
17255 | 17282 | <input class="form-control" type="text" id="custom_oai_endpoint" placeholder="OpenAI API URL" value="">
|
17256 | 17283 | <input class="form-control" type="password" id="custom_oai_key" placeholder="OpenAI API Key (Required)" value="" onfocus="focus_api_keys()" onblur="blur_api_keys()"><br>
|
|
17273 | 17300 | <option value="mistralai/mistral-7b-instruct" selected="selected">mistralai/mistral-7b-instruct</option>
|
17274 | 17301 | <option value="gryphe/mythomax-l2-13b">gryphe/mythomax-l2-13b</option>
|
17275 | 17302 | <option value="huggingfaceh4/zephyr-7b-beta">huggingfaceh4/zephyr-7b-beta</option>
|
17276 |
| - <option value="anthropic/claude-2">anthropic/claude-2</option> |
| 17303 | + <option value="anthropic/claude-2.0">anthropic/claude-2.0</option> |
17277 | 17304 | <option style="display:none;" class="custom_model_option" value="custom">[Custom]</option>
|
17278 | 17305 | </select>
|
17279 | 17306 | <select style="padding:4px;display:inline;width:calc(100% - 220px)" class="form-control hidden" id="custom_mistralai_model" onchange="oai_model_change(true)">
|
|
17286 | 17313 | <option value="mistral-large-latest">mistral-large-latest</option>
|
17287 | 17314 | <option style="display:none;" class="custom_model_option" value="custom">[Custom]</option>
|
17288 | 17315 | </select>
|
| 17316 | + <select style="padding:4px;display:inline;width:calc(100% - 220px)" class="form-control hidden" id="custom_featherless_model" onchange="oai_model_change(true)"> |
| 17317 | + <option value="Sao10K/L3-8B-Lunaris-v1">Sao10K/L3-8B-Lunaris-v1</option> |
| 17318 | + <option value="Sao10K/L3-8B-Stheno-v3.2">Sao10K/L3-8B-Stheno-v3.2</option> |
| 17319 | + <option value="unsloth/llama-3-8b-Instruct">unsloth/llama-3-8b-Instruct</option> |
| 17320 | + <option value="beomi/Llama-3-Open-Ko-8B">beomi/Llama-3-Open-Ko-8B</option> |
| 17321 | + <option value="Sao10K/Fimbulvetr-11B-v2">Sao10K/Fimbulvetr-11B-v2</option> |
| 17322 | + <option value="HuggingFaceH4/zephyr-7b-beta">HuggingFaceH4/zephyr-7b-beta</option> |
| 17323 | + <option value="upstage/SOLAR-10.7B-Instruct-v1.0">upstage/SOLAR-10.7B-Instruct-v1.0</option> |
| 17324 | + <option value="alpindale/magnum-72b-v1">alpindale/magnum-72b-v1</option> |
| 17325 | + <option value="Sao10K/L3-70B-Euryale-v2.1">Sao10K/L3-70B-Euryale-v2.1</option> |
| 17326 | + <option value="alpindale/WizardLM-2-8x22B">alpindale/WizardLM-2-8x22B</option> |
| 17327 | + <option value="meta-llama/Meta-Llama-3.1-405B-Instruct">meta-llama/Meta-Llama-3.1-405B-Instruct</option> |
| 17328 | + <option style="display:none;" class="custom_model_option" value="custom">[Custom]</option> |
| 17329 | + </select> |
17289 | 17330 | <button type="button" class="btn btn-primary" style="display:inline;width:105px;" id="oaifetchlist" onclick="oai_fetch_models()">Fetch List</button>
|
17290 | 17331 | <button type="button" class="btn btn-primary" style="display:inline;width:105px;" id="oaiusecustom" onclick="select_custom_oai_model()">Use Custom</button>
|
17291 | 17332 | <div style="display:inline-flex">
|
|
0 commit comments