all repos — nixfiles @ 21dbbf8b280beb2f3f2d8fa6cc38d3e8412f643a

System and user configuration, managed by nix and home-manager

user/settings/local-llm.nix (view raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{
  config,
  ...
}:
let
  srv = config.services.llama-swap;
  apiBase = "http://${srv.listenAddress}:${toString srv.port}";
  completionsPath = "/v1/completions";
in
{
  imports = [
    ../modules/llama-swap.nix
  ];

  services.llama-swap = {
    enable = true;
    listenAddress = "[::1]";
    port = 11343;
  };

  programs.zed-editor.userSettings = {
    edit_predictions = {
      open_ai_compatible_api = {
        api_url = "${apiBase}${completionsPath}";
      };
      provider = "open_ai_compatible_api";
    };
  };
}