refactor config for multi-machine support

Move gptel backend configuration to config-local.el (gitignored) so each
machine can have its own LLM setup. Add config-local.example.el as a
template with options for Ollama, remote llama.cpp, and local llama.cpp.

Also make OS-specific paths portable:
- Use ~ instead of hardcoded /Users/willem for elixir-ls
- Wrap macOS TeX path in system-type conditional

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Willem van den Ende
2025-12-15 00:53:34 -08:00
co-authored by Claude Opus 4.5
parent 435fcab6d7
commit 236c0e1c4f
3 changed files with 85 additions and 43 deletions
+72
View File
@@ -0,0 +1,72 @@
;;; config-local.example.el --- Template for machine-specific config -*- lexical-binding: t; -*-
;;
;; Copy this file to config-local.el and uncomment/modify the section for your setup.
;; config-local.el is gitignored, so each machine can have its own configuration.
;;; ============================================================================
;;; OPTION 1: Linux with Ollama (local models)
;;; ============================================================================
;; (setq gptel-backend (gptel-make-ollama "Ollama"
;; :host "localhost:11434"
;; :stream t
;; :models '(qwen2.5-coder:7b
;; qwen3:32b
;; llama3.2:latest))
;; gptel-model 'qwen2.5-coder:7b)
;;
;; (setq-default gptel-model 'qwen2.5-coder:7b)
;;
;; (gptel-make-preset 'explain
;; :system "Explain what this code does to a novice programmer."
;; :model 'qwen2.5-coder:7b
;; :backend "Ollama")
;;; ============================================================================
;;; OPTION 2: macOS connecting to remote Linux server
;;; ============================================================================
;; (setq gptel-backend (gptel-make-openai "remote-llama"
;; :host "linux-server.local:8000" ; your server's hostname
;; :protocol "http"
;; :stream t
;; :models '(Qwen3-30B-A3B-Thinking-2507-Q6_K.gguf))
;; gptel-model 'Qwen3-30B-A3B-Thinking-2507-Q6_K.gguf)
;;
;; (setq-default gptel-model 'Qwen3-30B-A3B-Thinking-2507-Q6_K.gguf)
;;
;; (gptel-make-preset 'explain
;; :system "Explain what this code does to a novice programmer."
;; :model 'Qwen3-30B-A3B-Thinking-2507-Q6_K.gguf
;; :backend "remote-llama")
;;; ============================================================================
;;; OPTION 3: Linux with local llama.cpp server
;;; ============================================================================
;; (setq gptel-backend (gptel-make-openai "llama.cpp"
;; :host "localhost:8000"
;; :protocol "http"
;; :stream t
;; :models '(Qwen3-30B-A3B-Thinking-2507-Q6_K.gguf))
;; gptel-model 'Qwen3-30B-A3B-Thinking-2507-Q6_K.gguf)
;;
;; (setq-default gptel-model 'Qwen3-30B-A3B-Thinking-2507-Q6_K.gguf)
;;
;; ;; Also add Ollama as secondary backend
;; (gptel-make-ollama "Ollama"
;; :host "localhost:11434"
;; :stream t
;; :models '(qwen2.5-coder:7b qwen3:0.6B))
;;
;; (gptel-make-preset 'explain
;; :system "Explain what this code does to a novice programmer."
;; :model 'Qwen3-Coder-30B-A3B-Instruct-Q6_K.gguf
;; :backend "llama.cpp")
;;
;; (gptel-make-preset 'elixir
;; :system "You are an expert programmer, specialising in Elixir and TDD, you live in Emacs"
;; :model 'Qwen3-Coder-30B-A3B-Instruct-Q6_K.gguf
;; :backend "llama.cpp")
;;; config-local.example.el ends here