karthink / gptel

A simple LLM client for Emacs
GNU General Public License v3.0
1.03k stars 111 forks source link

Ollama as default backend #297

Closed asanchez75 closed 2 months ago

asanchez75 commented 2 months ago

Hello,

Here is a snippet for the init.el file to set Ollama as default backend. It might be useful for someone.

(use-package gptel
 :config
 (setq gptel-default-mode 'org-mode)
 ;; default backend
 (setq gptel-backend (gptel-make-ollama "Ollama"             
  :host "localhost:11434"               
  :stream t                             
  :models '("llama3" 
            "mistral:v0.2" 
            "phi3"
            "gemma"
            "biomistral"
            )))        
 ;(setq! gptel-api-key "your key")
 )
karthink commented 2 months ago

@asanchez75 Thank you. Note that the README already contains snippets like the above to set each backend as the default, including Ollama.