drop unused LLM stuff
9 files changed, 0 insertions(+), 403 deletions(-)
M system/hosts/prefect.nix → system/hosts/prefect.nix
@@ -24,7 +24,6 @@ ../settings/programs/docker.nix ../settings/gaming.nix ../roles/desktop.nix - ../roles/llm-server.nix ../roles/nix-remote-builder.nix ../roles/home.nix ../roles/syncthing.nix
D system/roles/llm-server.nix
@@ -1,92 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -let - inherit (config.networking) domain fqdn; - ls = config.services.llama-swap; -in -{ - environment.systemPackages = [ - pkgs.python3Packages.huggingface-hub - ]; - - services.llama-swap = { - enable = true; - listenAddress = "[::]"; - port = 11343; - settings = - let - llama-cpp = pkgs.llama-cpp.override { cudaSupport = true; }; - llama-server = lib.getExe' llama-cpp "llama-server"; - llama = "${llama-server} --port \${PORT}"; - next_edit = '' - --spec-type ngram-mod - --spec-ngram-mod-n-match 24 - --spec-ngram-mod-n-min 24 - --spec-ngram-mod-n-max 32 - --no-webui - ''; - in - { - healthCheckTimeout = 60; - models = { - sweep-next-edit = { - name = "Sweep Next Edit 1.5B"; - cmd = "${llama} ${next_edit} --hf-repo sweepai/sweep-next-edit-1.5B"; - aliases = [ "sweep-next-edit-1.5B" ]; - }; - sweep-next-edit-v2 = { - name = "Sweep Next Edit V2 7B"; - cmd = "${llama} ${next_edit} --hf-repo henrik3/sweep-next-edit-v2-7B-GGUF"; - aliases = [ "sweep-next-edit-v2-7B" ]; - }; - zeta20 = { - name = "Zeta 2.0"; - cmd = "${llama} ${next_edit} --hf-repo bartowski/zed-industries_zeta-2-GGUF"; - aliases = [ "zeta-2" ]; - }; - zeta21 = { - name = "Zeta 2.1"; - cmd = "${llama} ${next_edit} --hf-repo mradermacher/zeta-2.1-GGUF"; - aliases = [ "zeta-2.1" ]; - }; - }; - groups = { - edit_prediction = { - swap = true; - members = [ - "sweep-next-edit" - "sweep-next-edit-v2" - "zeta20" - "zeta21" - ]; - }; - }; - includeAliasesInList = true; - hooks.on_startup.preload = [ "sweep-next-edit" ]; - }; - }; - systemd.services.llama-swap = { - environment.XDG_CACHE_HOME = "/var/cache/llama-swap"; - serviceConfig.CacheDirectory = "llama-swap"; - }; - - services.caddy = { - enable = true; - - globalConfig = '' - acme_ca https://acme.${domain}/directory - ''; - - virtualHosts = { - "llama.${fqdn}" = { - extraConfig = '' - reverse_proxy ${ls.listenAddress}:${toString ls.port} - ''; - }; - }; - }; -}
M user/hosts/marvin.nix → user/hosts/marvin.nix
@@ -3,9 +3,6 @@ config, pkgs, ... }: -let - nixfiles = config.home.homeDirectory + "/projects/alin.ovh/nixfiles"; -in { imports = [ ../settings/base.nix@@ -23,16 +20,13 @@ ../settings/darwin.nix ../settings/emacs.nix ../settings/fish.nix ../settings/git.nix - ../settings/local-llm.nix ../settings/nixpkgs.nix - ../settings/mcp.nix ../settings/ssh.nix ../settings/workstation.nix ../settings/user-interface.nix ../settings/nix.nix ../settings/zed.nix ../../private/ssh.nix - ../../private/llm.nix ]; home.username = "alin";@@ -134,10 +128,5 @@ }; "com.apple.timemachine" = { DoNotOfferNewDisksForBackup = true; }; - }; - - services.llama-swap = { - configFile = "${nixfiles}/user/settings/llama/swap-config.yml"; - extraArgs = [ "--watch-config" ]; }; }
D user/modules/llama-swap.nix
@@ -1,165 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -let - cfg = config.services.llama-swap; - settingsFormat = pkgs.formats.yaml { }; - configFile = - if cfg.configFile != null then - cfg.configFile - else - settingsFormat.generate "config.yaml" cfg.settings; - - args = [ - "--listen=${cfg.listenAddress}:${toString cfg.port}" - "--config=${configFile}" - ] - ++ cfg.extraArgs; -in -{ - options.services.llama-swap = { - enable = lib.mkEnableOption "the llama-swap service"; - - package = lib.mkPackageOption pkgs "llama-swap" { }; - - packages = lib.mkOption { - default = lib.optionals (cfg.configFile != null) [ pkgs.llama-cpp ]; - defaultText = lib.literalExpression '' - lib.optionals (cfg.configFile != null) [ pkgs.llama-cpp ] - ''; - example = lib.literalExpression '' - [ - pkgs.llama-cpp-rocm - pkgs.vllm - ] - ''; - type = lib.types.listOf lib.types.package; - description = '' - Packages to add to llama-swap process's PATH. - Useful if using `configFile` instead of `settings`. - ''; - }; - - exposePackages = lib.mkOption { - default = cfg.configFile != null; - defaultText = lib.literalExpression "cfg.configFile != null"; - type = lib.types.bool; - description = '' - Whether to additionally add `packages` to user profile. - Useful when using `configFile` instead of `settings`. - ''; - }; - - listenAddress = lib.mkOption { - type = lib.types.str; - default = "localhost"; - example = "0.0.0.0"; - description = '' - Address that llama-swap listens on. - ''; - }; - - port = lib.mkOption { - default = 8080; - example = 11343; - type = lib.types.port; - description = '' - Port that llama-swap listens on. - ''; - }; - - configFile = lib.mkOption { - type = with lib.types; nullOr (either path str); - default = null; - description = '' - Optional configuration file path to use instead of - generating from settings - ''; - }; - - extraArgs = lib.mkOption { - type = with lib.types; listOf str; - default = [ ]; - description = '' - Additional arguments to pass on llama-swap startup - ''; - }; - - settings = lib.mkOption { - type = lib.types.submodule { freeformType = settingsFormat.type; }; - description = '' - llama-swap configuration. Refer to the [llama-swap example configuration](https://github.com/mostlygeek/llama-swap/blob/main/config.example.yaml) - for details on supported values. - ''; - example = lib.literalExpression '' - let - llama-cpp = pkgs.llama-cpp.override { rocmSupport = true; }; - llama-server = lib.getExe' llama-cpp "llama-server"; - in - { - healthCheckTimeout = 60; - models = { - "some-model" = { - cmd = "''${llama-server} --port ''${PORT} -m /var/lib/llama-cpp/models/some-model.gguf -ngl 0 --no-webui"; - aliases = [ - "the-best" - ]; - }; - "other-model" = { - proxy = "http://127.0.0.1:5555"; - cmd = "''${llama-server} --port 5555 -m /var/lib/llama-cpp/models/other-model.gguf -ngl 0 -c 4096 -np 4 --no-webui"; - concurrencyLimit = 4; - }; - }; - }; - ''; - }; - }; - config = lib.mkIf cfg.enable { - assertions = [ - { - assertion = cfg.configFile != null -> (builtins.attrNames cfg.settings) == [ ]; - message = "configFile is incompatible with non-empty settings"; - } - ]; - - # untested - systemd.user.services.llama-swap = { - description = "Model swapping for LLaMA C++ Server (or any local OpenAPI compatible server)"; - - serviceConfig = { - Type = "exec"; - ExecStart = "${lib.getExe cfg.package} ${lib.escapeShellArgs args}"; - Restart = "on-failure"; - RestartSec = 3; - - # for GPU acceleration - PrivateDevices = false; - }; - path = cfg.packages; - }; - - launchd.agents.llama-swap = { - enable = true; - config = { - ProgramArguments = [ (lib.getExe cfg.package) ] ++ args; - KeepAlive = { - Crashed = true; - SuccessfulExit = false; - }; - ProcessType = "Background"; - EnvironmentVariables = { - PATH = lib.makeBinPath cfg.packages; - }; - }; - }; - - home.packages = [ - cfg.package - ] - ++ (lib.optionals cfg.exposePackages cfg.packages); - }; -}
M user/settings/development/web/Caddyfile → user/settings/development/web/Caddyfile
@@ -23,10 +23,6 @@ hugo.localhost { reverse_proxy http://localhost:1313 } -llama.localhost, http://llama.localhost { - reverse_proxy http://localhost:11343 -} - searchix.localhost { handle_errors { rewrite * /error.html
D user/settings/llama/swap-config.yml
@@ -1,75 +0,0 @@ -macros: - llama: | - llama-server --port ${PORT} - mlx: | - mlx_lm.server --port ${PORT} - - # - small `n` are not recommended - # - MoEs require long drafts - # - dense models: can reduce `--draft-min` and `--draft-max` - next_edit: | - --spec-type ngram-mod - --spec-ngram-mod-n-match 24 - --spec-ngram-mod-n-min 24 - --spec-ngram-mod-n-max 32 - -models: - sweep-next-edit-1.5b: - name: Sweep Next-Edit 1.5B - unlisted: true - aliases: - - sweep-next-edit - cmd: | - ${llama} --hf-repo sweepai/sweep-next-edit-1.5B - ${next_edit} - sweep-next-edit-v2-7b: - name: Sweep Next-Edit v2 7B - unlisted: true - aliases: - - sweep-next-edit-v2 - cmd: | - ${llama} --hf-repo henrik3/sweep-next-edit-v2-7B-GGUF - ${next_edit} - gpt-oss-20b: - name: GPT OSS (20b) - cmd: | - ${llama} --hf-repo unsloth/gpt-oss-20b-GGUF - gpt-oss-120b: - name: GPT OSS (120b) - cmd: | - ${llama} --hf-repo unsloth/gpt-oss-120b-GGUF - qwen3.6-27b: - name: Qwen 3.6 27B - cmd: | - ${llama} --hf-repo unsloth/Qwen3.6-27B-MTP-GGUF:Q8_0 - --spec-type draft-mtp - --flash-attn on - --ctx-size 65536 - gemma-4-coder-fable5-composer2.5: - name: Gemma 4 Coder (Fable 5, Composer 2.5) - useModelName: yuxinlu1/gemma-4-12B-coder-fable5-composer2.5-v1-GGUF - cmd: | - ${llama} --hf-repo yuxinlu1/gemma-4-12B-coder-fable5-composer2.5-v1-GGUF:Q8_0 - -groups: - edit_prediction: - persistent: true # not unloaded by other groups - swap: true # only run one model from this group - exclusive: false - members: - - sweep-next-edit-1.5b - - sweep-next-edit-v2-7b - -hooks: - on_startup: - preload: - - sweep-next-edit-v2-7b - -peers: - prefect: - proxy: http://prefect:11343 - models: - - sweep-next-edit - - sweep-next-edit-v2 - - zeta20 - - zeta21
D user/settings/local-llm.nix
@@ -1,23 +0,0 @@ -{ - pkgs, - ... -}: -{ - imports = [ - ../modules/llama-swap.nix - ]; - - home.packages = [ - pkgs.python3Packages.huggingface-hub - ]; - - services.llama-swap = { - enable = true; - packages = with pkgs; [ - llama-cpp - python3Packages.mlx-lm - ]; - listenAddress = "[::1]"; - port = 11343; - }; -}
D user/settings/mcp.nix
@@ -1,31 +0,0 @@ -{ - lib, - pkgs, - ... -}: -{ - # servers with secrets should go in ../../private/llm.nix - programs.mcp = { - enable = true; - servers = { - nixos = { - command = "nix"; - args = [ - "run" - "github:utensils/mcp-nixos" - "--" - ]; - }; - } - // (lib.optionalAttrs pkgs.stdenv.isDarwin { - dash = { - command = "${pkgs.uv}/bin/uvx"; - args = [ - "--from" - "git+https://github.com/Kapeli/dash-mcp-server.git" - "dash-mcp-server" - ]; - }; - }); - }; -}
M user/settings/zed.nix → user/settings/zed.nix
@@ -6,7 +6,6 @@ }: { programs.zed-editor = { enable = true; - enableMcpIntegration = true; userSettings = { base_keymap = "Emacs"; vim_mode = true;