What are some of the better ways to have gptel help with writing code? #464
Replies: 2 comments
-
You probably want something like copilot.el, tabnine or codium. There's also the evedel and elysium packages, which you can check out. gptel's design is not suited for code completion at point. That said, I use gptel to generate code often. The most common way to use gptel to complete code is via the rewrite interface. Select a text region-- it can be an empty region, a region with code or even a region with only a comment -- and ask gptel to fill it in. See this section of the README. You can add buffers, files or regions to gptel's context with If you are using gptel regularly with |
Beta Was this translation helpful? Give feedback.
-
While gptel can certainly be used for code completion, I advise against it; not because it is bad at it, but because code generation is far superior (at least in my opinion), and I feel you will just be reimplementing a poorer version of copilot.el. Keep in mind though, that even using a decent model, you shouldn't be having problems with the model not completing in the manner you describe. Did you try with other models? |
Beta Was this translation helpful? Give feedback.
-
There is this previous announcement for code completion but the feature has been put on the back burner from the looks of it: #206
I am new to using LLMs and I was wondering what a good way to use gptel for help with coding would be. Currently I am using ollama to run a model called SuperNova-Medius locally. I open a code file and try using
M-x gptel-send
. I modify the system prompt to say something about how the LLM is supposed to complete code rather than have a conversation. But it doesn't work. The response is always in markdown and does not complete code.I might be doing everything wrong here. Maybe there are some models that are fine-tuned for code completion and I should use one of those.
Another way to use it for help is to just use
M-x gptel
but I was hoping for something smoother.Any advice is appreciated. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions