karthink / gptel

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

Custom backend without setting global default #214

Closed vlad-isan closed 4 months ago

vlad-isan commented 4 months ago

Hi there and many thanks for this amazing package!

Is there a way to set bindings to open gptel with different specific backends / models selected, without setting the backend as a global default?

It works when I set the backend / model with setq-default, but I couldn't make it work per invocation.

Is there a way?

karthink commented 4 months ago

Have you tried using the transient menu to set the backend/model? (C-u M-x gptel-send)

vlad-isan commented 4 months ago

It works if I use the transient menu, was just wondering if it was possible to preset the backend and model on a keybinding, and open gptel with a specific backend & model, without using the transient menu.

This would serve as a shortcut to have predefined keybindings for different backends / models, one for gpt4-turbo, one for ppx online, without past messages / context for example.

karthink commented 4 months ago

It works if I use the transient menu, was just wondering if it was possible to preset the backend and model on a keybinding, and open gptel with a specific backend & model, without using the transient menu.

When you set the model/backend in the transient menu, it's persistent in that buffer. Do you often need to switch backends within a single buffer?

This would serve as a shortcut to have predefined keybindings for different backends / models, one for gpt4-turbo, one for ppx online, without past messages / context for example.

This is doable with some elisp. See #189.

vlad-isan commented 4 months ago

That was helpful, thank you. Thanks for the quick replies