gptel icon indicating copy to clipboard operation
gptel copied to clipboard

feature request: additional curl arguments

Open xeechou opened this issue 10 months ago • 5 comments

Hello, great package, however my proxy setup(out of my control) requires curl arguments like -k or --ssl-no-revoske to work. Would you be able to add additional user argument to curl. Thanks.

xeechou avatar Apr 08 '24 13:04 xeechou

This is available via the :curl-args slot of a gptel backend definition.

For example:

(gptel-make-openai "ChatGPT-no-ssl-check"
   :key 'gptel-api-key
   :stream t
   :models '("gpt-3.5-turbo" "gpt-3.5-turbo-16k" "gpt-4"
             "gpt-4-turbo-preview" "gpt-4-32k" "gpt-4-1106-preview"
             "gpt-4-0125-preview")
   :curl-args '("--ssl-no-revoke" "-k"))

If you want this globally, you can add it to gptel-curl--common-args instead, which see.

karthink avatar Apr 08 '24 17:04 karthink

hi thanks. I can't change gptel-curl--common-args though. it's a constant.

xeechou avatar Apr 09 '24 13:04 xeechou

hi thanks. I can't change gptel-curl--common-args though. it's a constant.

Does adding :curl-args to the backend definition not work for you?

karthink avatar Apr 09 '24 14:04 karthink

On second thought I don't want to make gptel-curl--common-args customizable, since removing things from it will break gptel. I suggest adding :curl-args to the gptel backend you want to use.

For ChatGPT in particular, you can use the code I provided above, OR add it to the pre-defined backend using:

(setf (gptel-backend-curl-args gptel--openai)
      '("--ssl-no-revoke" "-k"))

For any other LLM provider you can add :curl-args to the setup code provided in the README.

karthink avatar Apr 09 '24 18:04 karthink

yes it did work with :curl-args however I have to add it to every backend I use..

xeechou avatar Apr 12 '24 18:04 xeechou