{ config, pkgs, ... }: let srv = config.services.llama-swap; apiBase = "http://${srv.listenAddress}:${toString srv.port}"; completionsPath = "/v1/completions"; in { 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; }; programs.zed-editor.userSettings = { edit_predictions = { open_ai_compatible_api = { api_url = "${apiBase}${completionsPath}"; }; provider = "open_ai_compatible_api"; }; }; }