mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Added featherless, connect button not working
This commit is contained in:
@ -2038,6 +2038,7 @@
|
|||||||
<option value="tabby">TabbyAPI</option>
|
<option value="tabby">TabbyAPI</option>
|
||||||
<option value="togetherai">TogetherAI</option>
|
<option value="togetherai">TogetherAI</option>
|
||||||
<option value="vllm">vLLM</option>
|
<option value="vllm">vLLM</option>
|
||||||
|
<option value="featherless">Featherless</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div data-tg-type="togetherai" class="flex-container flexFlowColumn">
|
<div data-tg-type="togetherai" class="flex-container flexFlowColumn">
|
||||||
@ -2182,6 +2183,39 @@
|
|||||||
</div>
|
</div>
|
||||||
<input id="custom_model_textgenerationwebui" class="text_pole wide100p" maxlength="500" placeholder="Custom model (optional)" data-i18n="[placeholder]Custom model (optional)" type="text">
|
<input id="custom_model_textgenerationwebui" class="text_pole wide100p" maxlength="500" placeholder="Custom model (optional)" data-i18n="[placeholder]Custom model (optional)" type="text">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div data-tg-type="featherless" class="flex-container flexFlowColumn">
|
||||||
|
<div class="flex-container flexFlowColumn">
|
||||||
|
<a href="https://featherless.ai/models/" target="_blank">
|
||||||
|
featherless.ai
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<h4 data-i18n="API key (optional)">API key</h4>
|
||||||
|
<div class="flex-container">
|
||||||
|
<input id="api_key_featherless" name="api_key_featherless" class="text_pole flex1 wide100p" maxlength="500" size="35" type="text" autocomplete="off">
|
||||||
|
<div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_featherless">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div data-for="api_key_featherless" class="neutral_warning" data-i18n="For privacy reasons, your API key will be hidden after you reload the page.">
|
||||||
|
For privacy reasons, your API key will be hidden after you reload the page.
|
||||||
|
</div>
|
||||||
|
<div class="flex1">
|
||||||
|
<h4 data-i18n="Server url">Server URL</h4>
|
||||||
|
<small data-i18n="Example: 127.0.0.1:5000">Try: Api.Featherless.ai/v1</small>
|
||||||
|
<input id="featherless_api_url_text" name="featherless_api_url" class="text_pole wide100p" maxlength="500" value="" autocomplete="off" data-server-history="ooba_blocking">
|
||||||
|
</div>
|
||||||
|
<input id="custom_model_featherless" class="text_pole wide100p" maxlength="500" placeholder="Custom model (optional)" data-i18n="[placeholder]Custom model (optional)" type="text">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div data-tg-type="vllm">
|
<div data-tg-type="vllm">
|
||||||
<div class="flex-container flexFlowColumn">
|
<div class="flex-container flexFlowColumn">
|
||||||
<a href="https://github.com/vllm-project/vllm" target="_blank" data-i18n="vllm-project/vllm">
|
<a href="https://github.com/vllm-project/vllm" target="_blank" data-i18n="vllm-project/vllm">
|
||||||
|
@ -22,7 +22,7 @@ import {
|
|||||||
parseTabbyLogprobs,
|
parseTabbyLogprobs,
|
||||||
} from './scripts/textgen-settings.js';
|
} from './scripts/textgen-settings.js';
|
||||||
|
|
||||||
const { MANCER, TOGETHERAI, OOBA, VLLM, APHRODITE, TABBY, OLLAMA, INFERMATICAI, DREAMGEN, OPENROUTER } = textgen_types;
|
const { MANCER, TOGETHERAI, OOBA, VLLM, APHRODITE, TABBY, OLLAMA, INFERMATICAI, DREAMGEN, OPENROUTER, FEATHERLESS} = textgen_types;
|
||||||
|
|
||||||
import {
|
import {
|
||||||
world_info,
|
world_info,
|
||||||
@ -222,7 +222,7 @@ import {
|
|||||||
import { getBackgrounds, initBackgrounds, loadBackgroundSettings, background_settings } from './scripts/backgrounds.js';
|
import { getBackgrounds, initBackgrounds, loadBackgroundSettings, background_settings } from './scripts/backgrounds.js';
|
||||||
import { hideLoader, showLoader } from './scripts/loader.js';
|
import { hideLoader, showLoader } from './scripts/loader.js';
|
||||||
import { BulkEditOverlay, CharacterContextMenu } from './scripts/BulkEditOverlay.js';
|
import { BulkEditOverlay, CharacterContextMenu } from './scripts/BulkEditOverlay.js';
|
||||||
import { loadMancerModels, loadOllamaModels, loadTogetherAIModels, loadInfermaticAIModels, loadOpenRouterModels, loadVllmModels, loadAphroditeModels, loadDreamGenModels } from './scripts/textgen-models.js';
|
import { loadFeatherlessModels, loadMancerModels, loadOllamaModels, loadTogetherAIModels, loadInfermaticAIModels, loadOpenRouterModels, loadVllmModels, loadAphroditeModels, loadDreamGenModels } from './scripts/textgen-models.js';
|
||||||
import { appendFileContent, hasPendingFileAttachment, populateFileAttachment, decodeStyleTags, encodeStyleTags, isExternalMediaAllowed, getCurrentEntityId } from './scripts/chats.js';
|
import { appendFileContent, hasPendingFileAttachment, populateFileAttachment, decodeStyleTags, encodeStyleTags, isExternalMediaAllowed, getCurrentEntityId } from './scripts/chats.js';
|
||||||
import { initPresetManager } from './scripts/preset-manager.js';
|
import { initPresetManager } from './scripts/preset-manager.js';
|
||||||
import { evaluateMacros } from './scripts/macros.js';
|
import { evaluateMacros } from './scripts/macros.js';
|
||||||
@ -1122,6 +1122,8 @@ async function getStatusTextgen() {
|
|||||||
} else if (textgen_settings.type === APHRODITE) {
|
} else if (textgen_settings.type === APHRODITE) {
|
||||||
loadAphroditeModels(data?.data);
|
loadAphroditeModels(data?.data);
|
||||||
online_status = textgen_settings.aphrodite_model;
|
online_status = textgen_settings.aphrodite_model;
|
||||||
|
} else if (textgen_settings.type === FEATHERLESS) {
|
||||||
|
loadFeatherlessModels(data?.data);
|
||||||
} else {
|
} else {
|
||||||
online_status = data?.result;
|
online_status = data?.result;
|
||||||
}
|
}
|
||||||
@ -9322,6 +9324,7 @@ jQuery(async function () {
|
|||||||
{ id: 'api_key_openrouter-tg', secret: SECRET_KEYS.OPENROUTER },
|
{ id: 'api_key_openrouter-tg', secret: SECRET_KEYS.OPENROUTER },
|
||||||
{ id: 'api_key_koboldcpp', secret: SECRET_KEYS.KOBOLDCPP },
|
{ id: 'api_key_koboldcpp', secret: SECRET_KEYS.KOBOLDCPP },
|
||||||
{ id: 'api_key_llamacpp', secret: SECRET_KEYS.LLAMACPP },
|
{ id: 'api_key_llamacpp', secret: SECRET_KEYS.LLAMACPP },
|
||||||
|
{ id: 'api_key_featherless', secret: SECRET_KEYS.FEATHERLESS },
|
||||||
];
|
];
|
||||||
|
|
||||||
for (const key of keys) {
|
for (const key of keys) {
|
||||||
|
@ -28,6 +28,7 @@ export const SECRET_KEYS = {
|
|||||||
PERPLEXITY: 'api_key_perplexity',
|
PERPLEXITY: 'api_key_perplexity',
|
||||||
GROQ: 'api_key_groq',
|
GROQ: 'api_key_groq',
|
||||||
AZURE_TTS: 'api_key_azure_tts',
|
AZURE_TTS: 'api_key_azure_tts',
|
||||||
|
FEATHERLESS: 'api_key_featherless',
|
||||||
};
|
};
|
||||||
|
|
||||||
const INPUT_MAP = {
|
const INPUT_MAP = {
|
||||||
|
@ -9,6 +9,7 @@ let infermaticAIModels = [];
|
|||||||
let dreamGenModels = [];
|
let dreamGenModels = [];
|
||||||
let vllmModels = [];
|
let vllmModels = [];
|
||||||
let aphroditeModels = [];
|
let aphroditeModels = [];
|
||||||
|
let featherlessModels = [];
|
||||||
export let openRouterModels = [];
|
export let openRouterModels = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -231,6 +232,35 @@ export async function loadAphroditeModels(data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function loadFeatherlessModels(data) {
|
||||||
|
if (!Array.isArray(data)) {
|
||||||
|
console.error('Invalid Featherless models data', data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
featherlessModels = data;
|
||||||
|
|
||||||
|
if (!data.find(x => x.id === textgen_settings.featherless_model)) {
|
||||||
|
textgen_settings.featherless_model = data[0]?.id || '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#featherless_model').empty();
|
||||||
|
for (const model of data) {
|
||||||
|
const option = document.createElement('option');
|
||||||
|
option.value = model.id;
|
||||||
|
option.text = model.id;
|
||||||
|
option.selected = model.id === textgen_settings.featherless_model;
|
||||||
|
$('#featherless_model').append(option);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onFeatherlessModelSelect() {
|
||||||
|
const modelId = String($('#featherless_model').val());
|
||||||
|
textgen_settings.featherless_model = modelId;
|
||||||
|
$('#api_button_textgenerationwebui').trigger('click');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function onMancerModelSelect() {
|
function onMancerModelSelect() {
|
||||||
const modelId = String($('#mancer_model').val());
|
const modelId = String($('#mancer_model').val());
|
||||||
textgen_settings.mancer_model = modelId;
|
textgen_settings.mancer_model = modelId;
|
||||||
@ -505,6 +535,7 @@ jQuery(function () {
|
|||||||
$('#ollama_download_model').on('click', downloadOllamaModel);
|
$('#ollama_download_model').on('click', downloadOllamaModel);
|
||||||
$('#vllm_model').on('change', onVllmModelSelect);
|
$('#vllm_model').on('change', onVllmModelSelect);
|
||||||
$('#aphrodite_model').on('change', onAphroditeModelSelect);
|
$('#aphrodite_model').on('change', onAphroditeModelSelect);
|
||||||
|
$('#featherless_model').on('change', onFeatherlessModelSelect);
|
||||||
|
|
||||||
const providersSelect = $('.openrouter_providers');
|
const providersSelect = $('.openrouter_providers');
|
||||||
for (const provider of OPENROUTER_PROVIDERS) {
|
for (const provider of OPENROUTER_PROVIDERS) {
|
||||||
|
@ -38,9 +38,10 @@ export const textgen_types = {
|
|||||||
INFERMATICAI: 'infermaticai',
|
INFERMATICAI: 'infermaticai',
|
||||||
DREAMGEN: 'dreamgen',
|
DREAMGEN: 'dreamgen',
|
||||||
OPENROUTER: 'openrouter',
|
OPENROUTER: 'openrouter',
|
||||||
|
FEATHERLESS: 'featherless',
|
||||||
};
|
};
|
||||||
|
|
||||||
const { MANCER, VLLM, APHRODITE, TABBY, TOGETHERAI, OOBA, OLLAMA, LLAMACPP, INFERMATICAI, DREAMGEN, OPENROUTER, KOBOLDCPP } = textgen_types;
|
const { MANCER, VLLM, APHRODITE, TABBY, TOGETHERAI, OOBA, OLLAMA, LLAMACPP, INFERMATICAI, DREAMGEN, OPENROUTER, KOBOLDCPP, FEATHERLESS } = textgen_types;
|
||||||
|
|
||||||
const LLAMACPP_DEFAULT_ORDER = [
|
const LLAMACPP_DEFAULT_ORDER = [
|
||||||
'top_k',
|
'top_k',
|
||||||
@ -75,6 +76,7 @@ let TOGETHERAI_SERVER = 'https://api.together.xyz';
|
|||||||
let INFERMATICAI_SERVER = 'https://api.totalgpt.ai';
|
let INFERMATICAI_SERVER = 'https://api.totalgpt.ai';
|
||||||
let DREAMGEN_SERVER = 'https://dreamgen.com';
|
let DREAMGEN_SERVER = 'https://dreamgen.com';
|
||||||
let OPENROUTER_SERVER = 'https://openrouter.ai/api';
|
let OPENROUTER_SERVER = 'https://openrouter.ai/api';
|
||||||
|
let FEATHERLESS_SERVER = 'https://api.featherless.ai/v1';
|
||||||
|
|
||||||
const SERVER_INPUTS = {
|
const SERVER_INPUTS = {
|
||||||
[textgen_types.OOBA]: '#textgenerationwebui_api_url_text',
|
[textgen_types.OOBA]: '#textgenerationwebui_api_url_text',
|
||||||
@ -84,6 +86,7 @@ const SERVER_INPUTS = {
|
|||||||
[textgen_types.KOBOLDCPP]: '#koboldcpp_api_url_text',
|
[textgen_types.KOBOLDCPP]: '#koboldcpp_api_url_text',
|
||||||
[textgen_types.LLAMACPP]: '#llamacpp_api_url_text',
|
[textgen_types.LLAMACPP]: '#llamacpp_api_url_text',
|
||||||
[textgen_types.OLLAMA]: '#ollama_api_url_text',
|
[textgen_types.OLLAMA]: '#ollama_api_url_text',
|
||||||
|
[textgen_types.FEATHERLESS]: '#featherless_api_url_text',
|
||||||
};
|
};
|
||||||
|
|
||||||
const KOBOLDCPP_ORDER = [6, 0, 1, 3, 4, 2, 5];
|
const KOBOLDCPP_ORDER = [6, 0, 1, 3, 4, 2, 5];
|
||||||
@ -265,6 +268,8 @@ export function validateTextGenUrl() {
|
|||||||
|
|
||||||
export function getTextGenServer() {
|
export function getTextGenServer() {
|
||||||
switch (settings.type) {
|
switch (settings.type) {
|
||||||
|
case FEATHERLESS:
|
||||||
|
return FEATHERLESS_SERVER;
|
||||||
case MANCER:
|
case MANCER:
|
||||||
return MANCER_SERVER;
|
return MANCER_SERVER;
|
||||||
case TOGETHERAI:
|
case TOGETHERAI:
|
||||||
|
@ -212,6 +212,7 @@ const TEXTGEN_TYPES = {
|
|||||||
INFERMATICAI: 'infermaticai',
|
INFERMATICAI: 'infermaticai',
|
||||||
DREAMGEN: 'dreamgen',
|
DREAMGEN: 'dreamgen',
|
||||||
OPENROUTER: 'openrouter',
|
OPENROUTER: 'openrouter',
|
||||||
|
FEATHERLESS: 'featherless',
|
||||||
};
|
};
|
||||||
|
|
||||||
const INFERMATICAI_KEYS = [
|
const INFERMATICAI_KEYS = [
|
||||||
@ -226,6 +227,49 @@ const INFERMATICAI_KEYS = [
|
|||||||
'stop',
|
'stop',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const FEATHERLESS_KEYS = [
|
||||||
|
'model',
|
||||||
|
'prompt',
|
||||||
|
'best_of',
|
||||||
|
'echo',
|
||||||
|
'frequency_penalty',
|
||||||
|
'logit_bias',
|
||||||
|
'logprobs',
|
||||||
|
'max_tokens',
|
||||||
|
'n',
|
||||||
|
'presence_penalty',
|
||||||
|
'seed',
|
||||||
|
'stop',
|
||||||
|
'stream',
|
||||||
|
'suffix',
|
||||||
|
'temperature',
|
||||||
|
'top_p',
|
||||||
|
'user',
|
||||||
|
|
||||||
|
'use_beam_search',
|
||||||
|
'top_k',
|
||||||
|
'min_p',
|
||||||
|
'repetition_penalty',
|
||||||
|
'length_penalty',
|
||||||
|
'early_stopping',
|
||||||
|
'stop_token_ids',
|
||||||
|
'ignore_eos',
|
||||||
|
'min_tokens',
|
||||||
|
'skip_special_tokens',
|
||||||
|
'spaces_between_special_tokens',
|
||||||
|
'truncate_prompt_tokens',
|
||||||
|
|
||||||
|
'include_stop_str_in_output',
|
||||||
|
'response_format',
|
||||||
|
'guided_json',
|
||||||
|
'guided_regex',
|
||||||
|
'guided_choice',
|
||||||
|
'guided_grammar',
|
||||||
|
'guided_decoding_backend',
|
||||||
|
'guided_whitespace_pattern',
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
// https://dreamgen.com/docs/api#openai-text
|
// https://dreamgen.com/docs/api#openai-text
|
||||||
const DREAMGEN_KEYS = [
|
const DREAMGEN_KEYS = [
|
||||||
'model',
|
'model',
|
||||||
@ -366,4 +410,5 @@ module.exports = {
|
|||||||
OPENROUTER_HEADERS,
|
OPENROUTER_HEADERS,
|
||||||
OPENROUTER_KEYS,
|
OPENROUTER_KEYS,
|
||||||
VLLM_KEYS,
|
VLLM_KEYS,
|
||||||
|
FEATHERLESS_KEYS,
|
||||||
};
|
};
|
||||||
|
@ -126,6 +126,9 @@ router.post('/status', jsonParser, async function (request, response) {
|
|||||||
case TEXTGEN_TYPES.OLLAMA:
|
case TEXTGEN_TYPES.OLLAMA:
|
||||||
url += '/api/tags';
|
url += '/api/tags';
|
||||||
break;
|
break;
|
||||||
|
case TEXTGEN_TYPES.FEATHERLESS:
|
||||||
|
url += '/v1/models';
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,7 +138,7 @@ router.post('/status', jsonParser, async function (request, response) {
|
|||||||
console.log('Models endpoint is offline.');
|
console.log('Models endpoint is offline.');
|
||||||
return response.status(400);
|
return response.status(400);
|
||||||
}
|
}
|
||||||
|
console.log("url for models", url)
|
||||||
let data = await modelsReply.json();
|
let data = await modelsReply.json();
|
||||||
|
|
||||||
if (request.body.legacy_api) {
|
if (request.body.legacy_api) {
|
||||||
|
Reference in New Issue
Block a user