#1309 Ollama text completion backend

This commit is contained in:
Cohee
2023-12-19 16:38:11 +02:00
parent edd737e8bd
commit 67dd52c21b
10 changed files with 508 additions and 185 deletions

View File

@ -173,6 +173,7 @@ const TEXTGEN_TYPES = {
KOBOLDCPP: 'koboldcpp',
TOGETHERAI: 'togetherai',
LLAMACPP: 'llamacpp',
OLLAMA: 'ollama',
};
// https://docs.together.ai/reference/completions
@ -187,6 +188,25 @@ const TOGETHERAI_KEYS = [
'stream',
];
// https://github.com/jmorganca/ollama/blob/main/docs/api.md#request-with-options
const OLLAMA_KEYS = [
'num_predict',
'stop',
'temperature',
'repeat_penalty',
'presence_penalty',
'frequency_penalty',
'top_k',
'top_p',
'tfs_z',
'typical_p',
'seed',
'repeat_last_n',
'mirostat',
'mirostat_tau',
'mirostat_eta',
];
const AVATAR_WIDTH = 400;
const AVATAR_HEIGHT = 600;
@ -201,4 +221,5 @@ module.exports = {
AVATAR_WIDTH,
AVATAR_HEIGHT,
TOGETHERAI_KEYS,
OLLAMA_KEYS,
};