aboutsummaryrefslogblamecommitdiff
path: root/users/programs/emacs/site-lisp/init-llm.el
blob: 48346e6e4672fa3a7b16c82917e42520e27e5a5f (plain) (tree)
1
2
3
4
5
6
7
8
9







                                                             
            
 




                                                                    




                                
                                                                                        






                                                                
                                                          



                         
;;; init-llm.el --- Configure LLMs -*- lexical-binding: t -*-
;; Author: Franck Cuny <franck@fcuny.net>

;;; Commentary:

;; Configure completions

;;; Code:
(require 's)

(defun fcuny/read-anthropic-key ()
  "Read and return the API key for anthropic."
  (with-temp-buffer
    (insert-file-contents "~/.local/share/agenix/anthropic-api-key")
    (s-trim (buffer-string))))

(use-package gptel
  :custom
  (gptel-default-mode 'org-mode)
  :config
  (gptel-make-anthropic "Claude" :stream t :key (lambda () (fcuny/read-anthropic-key))))

(use-package aidermacs
  :bind ("C-c a" . aidermacs-transient-menu)
  :custom
  (aider-args '("--no-check-update" "--no-show-model-warnings"))
  (aidermacs-default-model "claude-3-7-sonnet-latest")
  :config
  (setenv "ANTHROPIC_API_KEY" (fcuny/read-anthropic-key)))

(provide 'init-llm)

;;; init-llm.el ends here