karthink / gptel

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

How to setup gptel to work with different ollama models like qwen2.5-coder ? #444

Open marcwebbie opened 3 weeks ago

marcwebbie commented 3 weeks ago

Setting up gptel with ollama local models is not working

Additional context Emacs version: 29 Operating system: OSX Sonoma

Ollama:

➜  ~ ollama list
NAME                            ID              SIZE      MODIFIED
qwen2.5-coder:latest            4a26c19c376e    4.7 GB    35 minutes ago
mistral:latest                  f974a74358d6    4.1 GB    2 hours ago
codegemma:latest                0c96700aaada    5.0 GB    2 hours ago
codellama:latest                8fdf8f752f6e    3.8 GB    2 hours ago
qwen2.5-coder:7b-instruct       4a26c19c376e    4.7 GB    11 days ago
qwen:32b                        26e7e8447f5d    18 GB     11 days ago
eramax/nxcode-cq-7b-orpo:q6     2784da3b3724    6.4 GB    12 days ago
deepseek-coder:6.7b-instruct    ce298d984115    3.8 GB    12 days ago
llama3.2:latest                 a80c4f17acd5    2.0 GB    2 weeks ago

init.el:

(use-package gptel
  :straight t
  :ensure t
  :config
  ;; OPTIONAL configuration
  (setq gptel-model 'qwen2.5-coder:latest
        gptel-backend (gptel-make-ollama "Ollama" :host "localhost:11434" :stream t :models '(qwen2.5-coder:latest))
        gptel-api-key "OPENAPI-API-KEY"
        )
  )

Messages:

Project root found: ~/.emacs.d/
Mark set [3 times]
Quit
previous-line: Beginning of buffer [4 times]
propertize: Wrong type argument: sequencep, qwen2.5-coder:latest
Error in post-command-hook (transient--post-command): (wrong-type-argument sequencep qwen2.5-coder:latest)
karthink commented 3 weeks ago
  1. Please update gptel to the latest commit.
  2. Can you produce a backtrace? It's hard to see what's going wrong without it.