Add generic text completion API type (100% OAI compatible)

This commit is contained in:
Cohee
2024-12-13 01:12:10 +02:00
parent e7b53dcb46
commit 3167019faf
11 changed files with 100 additions and 3 deletions

View File

@@ -33,9 +33,11 @@ export const textgen_types = {
OPENROUTER: 'openrouter',
FEATHERLESS: 'featherless',
HUGGINGFACE: 'huggingface',
GENERIC: 'generic',
};
const {
GENERIC,
MANCER,
VLLM,
APHRODITE,
@@ -120,6 +122,7 @@ export const SERVER_INPUTS = {
[textgen_types.LLAMACPP]: '#llamacpp_api_url_text',
[textgen_types.OLLAMA]: '#ollama_api_url_text',
[textgen_types.HUGGINGFACE]: '#huggingface_api_url_text',
[textgen_types.GENERIC]: '#generic_api_url_text',
};
const KOBOLDCPP_ORDER = [6, 0, 1, 3, 4, 2, 5];
@@ -205,6 +208,7 @@ const settings = {
xtc_probability: 0,
nsigma: 0.0,
featherless_model: '',
generic_model: '',
};
export {
@@ -282,6 +286,7 @@ export const setting_names = [
'xtc_threshold',
'xtc_probability',
'nsigma',
'generic_model',
];
const DYNATEMP_BLOCK = document.getElementById('dynatemp_block_ooba');
@@ -1100,6 +1105,11 @@ export function getTextGenModel() {
return settings.custom_model;
}
break;
case GENERIC:
if (settings.generic_model) {
return settings.generic_model;
}
break;
case MANCER:
return settings.mancer_model;
case TOGETHERAI: