diff --git a/config-mac.el b/config-mac.el index 54cce00..f75d1f9 100644 --- a/config-mac.el +++ b/config-mac.el @@ -13,9 +13,11 @@ :host "localhost:8000" :protocol "http" :stream t - :models '(Qwen3-Coder-30B-A3B-Instruct-Q6_K - Qwen3-30B-A3B-Thinking-2507-Q6_K - qwen3-coder-80b + :models '(Qwen3.6-27B-Q4_K_M.gguf + Qwen3.6-35B-A3B-MXFP4_MOE.gguf + unsloth/Qwen3-Coder-Next-GGUF:UD-IQ3_XXS + unsloth/Qwen3.5-9B-GGUF:UD-Q4_K_XL + Qwen3-Coder-Next-UD-Q4_K_XL ;; GLM models (reasoning handled globally via gptel-include-reasoning) (GLM-4.7-Flash-Q4_K_M @@ -24,11 +26,25 @@ (GLM-4.7-Flash-UD-Q6_K_XL :description "GLM-4.7-Flash 30B MoE Q6 XL (26GB)" :request-params (:max_tokens 8192)))) - gptel-model 'Qwen3-Coder-30B-A3B-Instruct-Q6_K) + gptel-model 'Qwen3.6-35B-A3B-MXFP4_MOE.gguf) ;; Prevent ChatGPT from being used as default (setq-default gptel-model 'Qwen3-Coder-30B-A3B-Instruct-Q6_K) +(setq gptel-backend (gptel-make-openai "mlx-lm" + :host "localhost:8000" + :protocol "http" + :stream t + :models '(mlx-community/Qwen3.6-27B-4bit)) + gptel-model 'mlx-community/Qwen3.6-27B-4bit) + + +(setq gptel-backend (gptel-make-openai "mlx-studio" + :host "localhost:8080" + :protocol "http" + :stream t + :models '(inferencerlabs/Qwen3.5-35B-A3B-MLX-5.5bit)) + gptel-model 'inferencerlabs/Qwen3.5-35B-A3B-MLX-5.5bit) ;; Additional backend: Ollama for smaller models (gptel-make-ollama "Ollama" :host "localhost:11434" @@ -40,15 +56,6 @@ :capabilities (tools media) :mime-types ("image/jpeg" "image/png" "image/svg")))) -;; Backend for GLM thinking models (uses DeepSeek parser for reasoning_content) -(gptel-make-deepseek "GLM-think" - :host "localhost:8000" - :protocol "http" - :stream t - :key "not-needed" - :models '((GLM-4.7-Flash-UD-Q6_K_XL - :description "GLM-4.7-Flash Q6 XL with thinking" - :request-params (:max_tokens 4096)))) ;; Presets (these reference the backends defined above) (gptel-make-preset 'explain @@ -88,6 +95,30 @@ :request-params '(:max_tokens 2048 :stop ["<|user|>" "<|observation|>" "<|endoftext|>"])) + +(gptel-make-tool + :name "projectile-search" + :function (lambda (pattern) + (require 'projectile) + (projectile-find-file (projectile-guess-project-root)) + (let* ((root (projectile-project-root)) + (default-directory root) + (grep-command (concat "grep -r --exclude-dir={.git,node_modules,vendor} -I '" + pattern + " --include={'*.el','*.py','*.js','*.java','*.c','*.cpp','*.h','*.hs','*.rb','*.go','*.jsx','*.ts','*.tsx','*.scala','*.php','*.sh','*.yaml','*.yml','*.json'}" + )) + (output (shell-command-to-string grep-command))) + (if (string-empty-p output) + (format "No results found for pattern: %s in project %s" pattern (or (projectile-project-name) "current")) + (if (> (length output) 3000) + (concat (substring output 0 3000) "\n... (truncated)") + output)))) + :description "Search the current project using projectile. Sets working directory to project root and searches for a pattern in common source files." + :args (list '(:name "pattern" + :type "string" + :description "Search pattern to find in project files")) + :category "project") + ;; GLM search tool - searches org-roam notes via ripgrep (gptel-make-tool :name "search_notes" diff --git a/custom.el b/custom.el index e310a1b..ee57c68 100644 --- a/custom.el +++ b/custom.el @@ -3,63 +3,12 @@ ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. - '(ansi-color-names-vector - ["#282c34" "#ff6c6b" "#98be65" "#ECBE7B" "#51afef" "#c678dd" "#46D9FF" "#bbc2cf"]) - '(custom-safe-themes - '("a138ec18a6b926ea9d66e61aac28f5ce99739cf38566876dc31e29ec8757f6e2" - "636b135e4b7c86ac41375da39ade929e2bd6439de8901f53f88fde7dd5ac3561" - "cf922a7a5c514fad79c483048257c5d8f242b21987af0db813d3f0b138dfaf53" - "1d5e33500bc9548f800f9e248b57d1b2a9ecde79cb40c0b1398dec51ee820daf" - "4f1d2476c290eaa5d9ab9d13b60f2c0f1c8fa7703596fa91b235db7f99a9441b" default)) - '(elfeed-feeds - '("https://www.htmhell.dev/feed_tips.xml" - "https://www.drcathicks.com/blog-feed.xml" "https://pluralistic.net/feed/" - "https://www.qwan.eu/feed.xml")) - '(exwm-floating-border-color "#191b20") - '(fci-rule-color "#5B6268") - '(highlight-tail-colors - ((("#333a38" "#99bb66" "green") . 0) (("#2b3d48" "#46D9FF" "brightcyan") . 20))) - '(ignored-local-variable-values + '(safe-local-variable-values '((eval setq-local org-roam-db-location (expand-file-name "org-roam.db" org-roam-directory)) (eval setq-local org-roam-directory (expand-file-name - (locate-dominating-file default-directory ".dir-locals.el"))))) - '(jdee-db-active-breakpoint-face-colors (cons "#1B2229" "#51afef")) - '(jdee-db-requested-breakpoint-face-colors (cons "#1B2229" "#98be65")) - '(jdee-db-spec-breakpoint-face-colors (cons "#1B2229" "#3f444a")) - '(objed-cursor-color "#ff6c6b") - '(org-agenda-files '("~/MyDocuments/qwan/essays/willem/daily/2023-01-16.org")) - '(package-selected-packages '(gptel magit-delta mise vterm)) - '(pdf-view-midnight-colors (cons "#bbc2cf" "#282c34")) - '(rustic-ansi-faces - ["#282c34" "#ff6c6b" "#98be65" "#ECBE7B" "#51afef" "#c678dd" "#46D9FF" "#bbc2cf"]) - '(safe-local-variable-values - '((elisp-lint-indent-specs (describe . 1) (it . 1) (thread-first . 0) - (cl-flet . 1) (cl-flet* . 1) - (org-element-map . defun) - (org-roam-dolist-with-progress . 2) - (org-roam-with-temp-buffer . 1) - (org-with-point-at . 1) - (magit-insert-section . defun) - (magit-section-case . 0) (org-roam-with-file . 2)) - (elisp-lint-ignored-validators "byte-compile" "package-lint") - (eval setq-local org-roam-db-location - (expand-file-name "org-roam.db" org-roam-directory)) - (eval setq-local org-roam-directory - (expand-file-name - (locate-dominating-file default-directory ".dir-locals.el"))))) - '(vc-annotate-background "#282c34") - '(vc-annotate-color-map - (list (cons 20 "#98be65") (cons 40 "#b4be6c") (cons 60 "#d0be73") - (cons 80 "#ECBE7B") (cons 100 "#e6ab6a") (cons 120 "#e09859") - (cons 140 "#da8548") (cons 160 "#d38079") (cons 180 "#cc7cab") - (cons 200 "#c678dd") (cons 220 "#d974b7") (cons 240 "#ec7091") - (cons 260 "#ff6c6b") (cons 280 "#cf6162") (cons 300 "#9f585a") - (cons 320 "#6f4e52") (cons 340 "#5B6268") (cons 360 "#5B6268"))) - '(vc-annotate-very-old-color nil) - '(warning-suppress-types - '((org-element-cache) (org-element-cache) (org-element-cache) (defvaralias)))) + (locate-dominating-file default-directory ".dir-locals.el")))))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful.