Skip to content

Commit 78f5023

Browse files
ConcedoConcedo
Concedo
authored and
Concedo
committed
added featherless api
1 parent 8e143d7 commit 78f5023

File tree

1 file changed

+55
-14
lines changed

1 file changed

+55
-14
lines changed

index.html

+55-14
Original file line numberDiff line numberDiff line change
@@ -4081,6 +4081,7 @@
40814081

40824082
const default_openrouter_base = "https://openrouter.ai/api/v1";
40834083
const default_mistralai_base = "https://api.mistral.ai/v1";
4084+
const default_featherless_base = "https://api.featherless.ai/v1";
40844085
const default_oai_base = "https://api.openai.com";
40854086
const default_claude_base = "https://api.anthropic.com";
40864087
const default_palm_base = "https://generativelanguage.googleapis.com/v1beta2/models/text-bison-001:generateText?key=";
@@ -4214,6 +4215,7 @@
42144215
saved_dalle_url: (default_oai_base + "/v1" + default_oai_image_endpoint),
42154216
saved_openrouter_key: "",
42164217
saved_mistralai_key: "",
4218+
saved_featherless_key: "",
42174219
saved_claude_key: "", //do not ever share this in save files!
42184220
saved_claude_addr: default_claude_base, //do not ever share this in save files!
42194221
saved_palm_key: "", //do not ever share this in save files!
@@ -5891,6 +5893,7 @@
58915893
new_save_storyobj.savedsettings.saved_kai_key = "";
58925894
new_save_storyobj.savedsettings.saved_openrouter_key = "";
58935895
new_save_storyobj.savedsettings.saved_mistralai_key = "";
5896+
new_save_storyobj.savedsettings.saved_featherless_key = "";
58945897
new_save_storyobj.savedsettings.saved_palm_key = "";
58955898
new_save_storyobj.savedsettings.saved_cohere_key = "";
58965899

@@ -6221,6 +6224,7 @@
62216224
let tmp_oai4 = localsettings.saved_dalle_url;
62226225
let tmp_or1 = localsettings.saved_openrouter_key;
62236226
let tmp_mai = localsettings.saved_mistralai_key;
6227+
let tmp_fai = localsettings.saved_featherless_key;
62246228
let tmp_claude1 = localsettings.saved_claude_key;
62256229
let tmp_claude2 = localsettings.saved_claude_addr;
62266230
let tmp_palm1 = localsettings.saved_palm_key;
@@ -6257,6 +6261,7 @@
62576261
localsettings.saved_dalle_url = tmp_oai4;
62586262
localsettings.saved_openrouter_key = tmp_or1;
62596263
localsettings.saved_mistralai_key = tmp_mai;
6264+
localsettings.saved_featherless_key = tmp_fai;
62606265
localsettings.saved_claude_key = tmp_claude1;
62616266
localsettings.saved_claude_addr = tmp_claude2;
62626267
localsettings.saved_palm_key = tmp_palm1;
@@ -8066,14 +8071,16 @@
80668071
return document.getElementById("custom_openrouter_model");
80678072
case "7":
80688073
return document.getElementById("custom_mistralai_model");
8074+
case "8":
8075+
return document.getElementById("custom_featherless_model");
80698076
default:
80708077
return document.getElementById("custom_oai_model");
80718078
}
80728079
}
80738080
function ep_should_always_use_chat_completions()
80748081
{
80758082
let epchoice = document.getElementById("customapidropdown").value;
8076-
return (epchoice==3 || epchoice==7);
8083+
return (epchoice==7);
80778084
}
80788085

80798086
function select_custom_oai_model()
@@ -8141,6 +8148,8 @@
81418148
}
81428149
}
81438150

8151+
let isOpenrouter = (document.getElementById("customapidropdown").value==3);
8152+
let dropdown = get_oai_model_dropdown();
81448153
fetch((desired_oai_ep + oai_models_endpoint), {
81458154
method: 'GET',
81468155
headers: oaiheaders,
@@ -8159,8 +8168,6 @@
81598168

81608169
if (!data.error && data.data && data.data.length > 0)
81618170
{
8162-
let isOpenrouter = (document.getElementById("customapidropdown").value==3);
8163-
let dropdown = get_oai_model_dropdown();
81648171
var lastOption = dropdown.lastElementChild;
81658172
for (var i = dropdown.options.length - 1; i >= 0; i--) {
81668173
var option = dropdown.options[i];
@@ -8222,6 +8229,7 @@
82228229
document.getElementById("custom_oai_model").classList.add("hidden");
82238230
document.getElementById("custom_openrouter_model").classList.add("hidden");
82248231
document.getElementById("custom_mistralai_model").classList.add("hidden");
8232+
document.getElementById("custom_featherless_model").classList.add("hidden");
82258233
document.getElementById("hordeloadmodelcontainer").classList.add("hidden");
82268234
document.getElementById("coherecustom").classList.add("hidden");
82278235

@@ -8239,15 +8247,17 @@
82398247
document.getElementById("customkoboldkey").value = localsettings.saved_kai_key;
82408248
}
82418249
}
8242-
else if(epchoice==2 || epchoice==3 || epchoice==7)
8250+
else if(epchoice==2 || epchoice==3 || epchoice==7 || epchoice==8)
82438251
{
82448252
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");
82458257
if(epchoice==2)
82468258
{
82478259
document.getElementById("oaidesc").classList.remove("hidden");
82488260
document.getElementById("custom_oai_model").classList.remove("hidden");
8249-
document.getElementById("openrouterdesc").classList.add("hidden");
8250-
document.getElementById("mistralaidesc").classList.add("hidden");
82518261
document.getElementById("custom_oai_endpoint").classList.remove("hidden");
82528262
document.getElementById("custom_oai_key").value = localsettings.saved_oai_key;
82538263
if (localflag) {
@@ -8258,19 +8268,23 @@
82588268
}
82598269
else if(epchoice==7)
82608270
{
8261-
document.getElementById("oaidesc").classList.add("hidden");
82628271
document.getElementById("custom_mistralai_model").classList.remove("hidden");
8263-
document.getElementById("openrouterdesc").classList.add("hidden");
82648272
document.getElementById("mistralaidesc").classList.remove("hidden");
82658273
document.getElementById("custom_oai_endpoint").classList.add("hidden");
82668274
document.getElementById("custom_oai_key").value = localsettings.saved_mistralai_key;
82678275
document.getElementById("custom_oai_endpoint").value = default_mistralai_base;
82688276
}
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+
}
82698285
else //openrouter supports autofetch
82708286
{
8271-
document.getElementById("oaidesc").classList.add("hidden");
82728287
document.getElementById("openrouterdesc").classList.remove("hidden");
8273-
document.getElementById("mistralaidesc").classList.add("hidden");
82748288
document.getElementById("custom_openrouter_model").classList.remove("hidden");
82758289
document.getElementById("custom_oai_endpoint").value = default_openrouter_base;
82768290
document.getElementById("custom_oai_endpoint").classList.add("hidden");
@@ -8634,7 +8648,7 @@
86348648
});
86358649
}
86368650
}
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
86388652
{
86398653
let desired_oai_key = document.getElementById("custom_oai_key").value.trim();
86408654
let desired_oai_ep = document.getElementById("custom_oai_endpoint").value.trim();
@@ -8677,6 +8691,10 @@
86778691
{
86788692
localsettings.saved_mistralai_key = custom_oai_key;
86798693
}
8694+
else if(epchoice==8)
8695+
{
8696+
localsettings.saved_featherless_key = custom_oai_key;
8697+
}
86808698
else
86818699
{
86828700
localsettings.saved_openrouter_key = custom_oai_key;
@@ -12140,9 +12158,9 @@
1214012158
}
1214112159

1214212160
}
12143-
else {
12161+
else
12162+
{
1214412163
//apply custom logit bias for official OAI only
12145-
1214612164
let needbaneos = (custom_oai_endpoint.toLowerCase().includes("api.openai.com") && determine_if_ban_eos(input_was_empty));
1214712165

1214812166
if(needbaneos)
@@ -12155,6 +12173,9 @@
1215512173
}
1215612174
}
1215712175
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);
1215812179
}
1215912180

1216012181
last_request_str = JSON.stringify(oai_payload);
@@ -17182,6 +17203,7 @@
1718217203
<option value="5">PaLM/Gemini By Google API</option>
1718317204
<option value="6">Cohere API</option>
1718417205
<option value="7">MistralAI API</option>
17206+
<option value="8">Featherless API</option>
1718517207
</select>
1718617208
</div>
1718717209

@@ -17251,6 +17273,11 @@
1725117273
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>
1725217274
<span class="color_green" style="font-weight: bold;">Please input MistralAI Key.</span><br><br>
1725317275
</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>
1725417281

1725517282
<input class="form-control" type="text" id="custom_oai_endpoint" placeholder="OpenAI API URL" value="">
1725617283
<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,7 +17300,7 @@
1727317300
<option value="mistralai/mistral-7b-instruct" selected="selected">mistralai/mistral-7b-instruct</option>
1727417301
<option value="gryphe/mythomax-l2-13b">gryphe/mythomax-l2-13b</option>
1727517302
<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>
1727717304
<option style="display:none;" class="custom_model_option" value="custom">[Custom]</option>
1727817305
</select>
1727917306
<select style="padding:4px;display:inline;width:calc(100% - 220px)" class="form-control hidden" id="custom_mistralai_model" onchange="oai_model_change(true)">
@@ -17286,6 +17313,20 @@
1728617313
<option value="mistral-large-latest">mistral-large-latest</option>
1728717314
<option style="display:none;" class="custom_model_option" value="custom">[Custom]</option>
1728817315
</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>
1728917330
<button type="button" class="btn btn-primary" style="display:inline;width:105px;" id="oaifetchlist" onclick="oai_fetch_models()">Fetch List</button>
1729017331
<button type="button" class="btn btn-primary" style="display:inline;width:105px;" id="oaiusecustom" onclick="select_custom_oai_model()">Use Custom</button>
1729117332
<div style="display:inline-flex">

0 commit comments

Comments
 (0)