feat: Add embedding model and extraPackages to aichat
Some checks failed
Flake checker / Build Nix targets (push) Has been cancelled

This commit is contained in:
2026-01-27 16:37:57 +05:30
parent 3f1f23391a
commit 581fa74f19
3 changed files with 35 additions and 9 deletions

1
.ignore Normal file
View File

@@ -0,0 +1 @@
*.lock

View File

@@ -1,4 +1,8 @@
{config, ...}: { {
pkgs,
config,
...
}: {
sops = { sops = {
secrets."llama/api_key" = {}; secrets."llama/api_key" = {};
secrets."openai/api_key" = {}; secrets."openai/api_key" = {};
@@ -17,7 +21,7 @@
settings = { settings = {
save_session = true; save_session = true;
model = "ryu:qwen3:30b-a3b"; model = "ryu:qwen3:30b-a3b";
rag_embedding_model = "ollama:RobinBially/nomic-embed-text-8k"; rag_embedding_model = "ryu:RobinBially/nomic-embed-text-8k";
clients = [ clients = [
{ {
type = "openai-compatible"; type = "openai-compatible";
@@ -33,11 +37,13 @@
name = "qwen3:30b-a3b"; name = "qwen3:30b-a3b";
type = "chat"; type = "chat";
} }
# { {
# name = "RobinBially/nomic-embed-text-8k"; name = "RobinBially/nomic-embed-text-8k";
# type = "embedding"; type = "embedding";
# default_chunk_size = 8000; default_chunk_size = 1000;
# } max_tokens_per_chunk = 8192;
max_batch_size = 100;
}
# { # {
# name = "deepseek-r1:14b"; # name = "deepseek-r1:14b";
# type = "chat"; # type = "chat";
@@ -133,9 +139,16 @@
}; };
} }
]; ];
document_loaders = {
git =
/*
sh
*/
''sh -c "yek $1 --json | jq '[.[] | { path: .filename, contents: .content }]'"'';
};
}; };
roles = { roles = {
"%git-commit%" = "git-commit" =
/* /*
md md
*/ */
@@ -146,5 +159,9 @@
Your task is to generate a concise and informative commit message based on the provided diff. Use the conventional commit format, which includes a type (feat, fix, chore, docs, style, refactor, perf, test) and an optional scope. The message should be in the imperative mood and should not exceed 72 characters in the subject line. Do not under any circumstance include any additional text or explanations, just add the commit message. Your task is to generate a concise and informative commit message based on the provided diff. Use the conventional commit format, which includes a type (feat, fix, chore, docs, style, refactor, perf, test) and an optional scope. The message should be in the imperative mood and should not exceed 72 characters in the subject line. Do not under any circumstance include any additional text or explanations, just add the commit message.
''; '';
}; };
extraPackages = with pkgs; [
jq
yek
];
}; };
} }

View File

@@ -81,6 +81,14 @@ in {
type = lib.types.attrsOf lib.types.str; type = lib.types.attrsOf lib.types.str;
description = "Roles for the AI chat clients"; description = "Roles for the AI chat clients";
}; };
extraPackages = mkOption {
type = lib.types.listOf lib.types.package;
default = [];
example = literalExpression "with pkgs; [ jq yek ];";
description = ''
Additional packages to install.
'';
};
}; };
}; };
@@ -99,7 +107,7 @@ in {
''; '';
}; };
in { in {
home.packages = mkIf cfg.enable [aichat-wrapped]; home.packages = mkIf cfg.enable ([aichat-wrapped] ++ cfg.extraPackages);
programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration fishIntegration; programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration fishIntegration;
programs.bash.initExtra = mkIf cfg.enableBashIntegration bashIntegration; programs.bash.initExtra = mkIf cfg.enableBashIntegration bashIntegration;