plugins/model: init
This commit is contained in:
parent
7addac6d11
commit
3c27e1b35c
2 changed files with 76 additions and 0 deletions
30
plugins/by-name/model/default.nix
Normal file
30
plugins/by-name/model/default.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{ lib, ... }:
|
||||
lib.nixvim.plugins.mkNeovimPlugin {
|
||||
name = "model";
|
||||
package = "model-nvim";
|
||||
|
||||
maintainers = [ lib.maintainers.GaetanLepage ];
|
||||
|
||||
settingsExample = {
|
||||
prompts = {
|
||||
zephyr = {
|
||||
provider.__raw = "require('model.providers.llamacpp')";
|
||||
options.url = "http:localhost:8080";
|
||||
|
||||
builder.__raw = ''
|
||||
function(input, context)
|
||||
return {
|
||||
prompt =
|
||||
'<|system|>'
|
||||
.. (context.args or 'You are a helpful assistant')
|
||||
.. '\n</s>\n<|user|>\n'
|
||||
.. input
|
||||
.. '</s>\n<|assistant|>',
|
||||
stop = { '</s>' }
|
||||
}
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
46
tests/test-sources/plugins/by-name/model/default.nix
Normal file
46
tests/test-sources/plugins/by-name/model/default.nix
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
empty = {
|
||||
plugins.model.enable = true;
|
||||
};
|
||||
|
||||
example = {
|
||||
plugins.model = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
prompts = {
|
||||
zephyr = {
|
||||
provider.__raw = "require('model.providers.llamacpp')";
|
||||
options.url = "http:localhost:8080";
|
||||
|
||||
builder.__raw = ''
|
||||
function(input, context)
|
||||
return {
|
||||
prompt =
|
||||
'<|system|>'
|
||||
.. (context.args or 'You are a helpful assistant')
|
||||
.. '\n</s>\n<|user|>\n'
|
||||
.. input
|
||||
.. '</s>\n<|assistant|>',
|
||||
stop = { '</s>' }
|
||||
}
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
defaults = {
|
||||
plugins.model = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
default_prompt.__raw = "require('model.providers.openai').default_prompt";
|
||||
prompts.__raw = "require('model.prompts.starters')";
|
||||
chats.__raw = "require('model.prompts.chats')";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue