mirror of
				https://github.com/larstvei/dot-emacs.git
				synced 2025-11-04 01:20:11 +00:00 
			
		
		
		
	Use llama3 with gptel
This commit is contained in:
		
							parent
							
								
									d51878b743
								
							
						
					
					
						commit
						ae8623f7ed
					
				
							
								
								
									
										14
									
								
								init.org
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								init.org
									
									
									
									
									
								
							@ -1248,7 +1248,7 @@
 | 
				
			|||||||
     mu4e-use-fancy-chars t))
 | 
					     mu4e-use-fancy-chars t))
 | 
				
			||||||
  #+end_src
 | 
					  #+end_src
 | 
				
			||||||
 | 
					
 | 
				
			||||||
* ChatGPT
 | 
					* LLM
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  The ChatGPT client [[https://github.com/karthink/gptel][gptel]] needs an API key from the OpenAI API. This key can
 | 
					  The ChatGPT client [[https://github.com/karthink/gptel][gptel]] needs an API key from the OpenAI API. This key can
 | 
				
			||||||
  be stored in your ~.authinfo~ file by adding a line like this:
 | 
					  be stored in your ~.authinfo~ file by adding a line like this:
 | 
				
			||||||
@ -1261,16 +1261,20 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  Then the ~gptel-api-key~ can be set using auth source.
 | 
					  Then the ~gptel-api-key~ can be set using auth source.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Default to using llama3, a local LLM.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  #+begin_src emacs-lisp
 | 
					  #+begin_src emacs-lisp
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ;; Interaction mode for ChatGPT
 | 
					 | 
				
			||||||
  (use-package gptel
 | 
					  (use-package gptel
 | 
				
			||||||
    :defer t
 | 
					    :defer t
 | 
				
			||||||
    :hook ((gptel-mode . (lambda () (visual-line-mode 1)))
 | 
					    :hook ((gptel-mode . (lambda () (visual-line-mode 1)))
 | 
				
			||||||
           (gptel-mode . (lambda () (auto-fill-mode 0))))
 | 
					           (gptel-mode . (lambda () (auto-fill-mode 0))))
 | 
				
			||||||
    :init
 | 
					    :config
 | 
				
			||||||
    (setq gptel-default-mode 'org-mode
 | 
					    (setq gptel-backend (gptel-make-ollama "Ollama"
 | 
				
			||||||
          gptel-model "gpt-4"
 | 
					                          :host "localhost:11434"
 | 
				
			||||||
 | 
					                          :stream t
 | 
				
			||||||
 | 
					                          :models '("llama3"))
 | 
				
			||||||
 | 
					          gptel-model "llama3"
 | 
				
			||||||
          gptel-api-key (auth-source-pick-first-password
 | 
					          gptel-api-key (auth-source-pick-first-password
 | 
				
			||||||
                         :host "api.openai.com")))
 | 
					                         :host "api.openai.com")))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user