Skip to content
karthink edited this page Dec 6, 2024 · 1 revision

Mode line indicators

Each buffer can have its own value of gptel-model, gptel-backend and other settings. (You can set these parameters buffer-locally using gptel's transient menu.)

Chat buffers indicate the active model in the header line (or the mode line if you unset gptel-use-header-line). But regular buffers don't. If you want a reminder when a buffer has a different value of gptel-model, you can display it in the mode line:

screenshot_20241206T031556

(add-to-list
 'mode-line-misc-info
 '(:eval
   (unless gptel-mode
    (when (and (local-variable-p 'gptel-model)
               (not (eq gptel-model (default-value 'gptel-model))))
     (concat "[" (gptel--model-name gptel-model) "]")))))

Nothing will display in buffers that don't have a buffer-local value of gptel-model.


Alternatively, you might want to always see the active gptel-model, especially if you use the tab bar:

screenshot_20241206T032533

;; If using the tab-bar, make sure `tab-bar-format-global' is included:
(add-to-list 'tab-bar-format 'tab-bar-format-align-right 'append)
(add-to-list 'tab-bar-format 'tab-bar-format-global      'append)

;; Add `gptel-model' to the global mode string
(add-to-list 'global-mode-string
             '(:eval (concat "[" (gptel--model-name gptel-model) "]")))
Clone this wiki locally