plugins/model: init

This commit is contained in:
Gaetan Lepage 2026-01-24 11:20:30 +01:00 committed by Gaétan Lepage
parent 7addac6d11
commit 3c27e1b35c
2 changed files with 76 additions and 0 deletions

View 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
'';
};
};
};
}

View 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')";
};
};
};
}