A

A Better LLM UI in Emacs

Hacker News

A Better LLM UI in Emacs

All LLM user interfaces I've seen so far are somewhat frustrating: * ChatGPT web requires a lot of copy-paste, it rewrites whole document even if you need to update a part of it, etc. * Github Copilot completions are rather unreliable and do not leave an option to specify what you want; Copilot's chat sidebar is little more than ChatGPT integrated into the IDE * Google Docs have right UI for non-code text, but they use really dumb model (not Gemini 1.5 Pro). Also won't work for code. So... I wrote a Emacs Lisp function which calls LLM with contents of the buffer to generate text according to the (optional) user's command. It can both insert new text and update selected text. In my twitter post I have two videos demonstrating the usage: https://x.com/killerstorm/status/1791840684208463940 I haven't been using Emacs for 10+ years (IntelliJ offers better ergonomics for Kotlin and TS), but it does seem like the easiest platform for this kind of stuff. Took me about 4 hours to implement this, largely because I knew almost nothing about Emacs Lisp, my Common Lisp is rusty (I've used it professionally 10+ years ago) and I decided to use CL server as a proxy for the LLM API. It's likely unnecessary, and it might be possible to achieve the same in pure Emacs Lisp. But I wanted to use more advanced prompting down the line (e.g. feed it adjacent files, chained prompts, etc) and for me it would be a lot easier to do it in CL. Regarding LLM models, OpenRouter offers quite a wide selection and they are easy to switch, so I tried >10 of them. I've got best results with google/gemini-flash-1.5 and openai/gpt-4o. Video demo uses Gemini. GPT-4o seems to be just as fast, and it handles formatting in a cleaner way (i.e. it keeps track of whitespace), also probably a bit smarter. Clause 3 Opus is a good model but it's slow. Llama 3 70B Instruct is fast but you lose some intelligence. Most other models, including 8B Llama 3 Instruct did not understand the prompt... It can be simplified, sure, but do I really want to use a model which cannot understand "You should return the text to be insert in between `before` and `after`?" I tried simpler prompts (i.e. without JSON), and they just struggle with understanding what they need to return. Pretty funny that people said that "mistralai/mixtral-8x7b-instruct" is "almost GPT-4", but it cannot even... Anyway, here's code which you might try at home: https://gist.github.com/killerstorm/0fddba22d778c871452213b1... CL server can trivially be replaced with Python.

Share card

Actual performance

8points
Made the leaderboard

Launch Intel predictions

Analyze your own launch →
Product HuntOn track for Day 1 leaderboard · Strong signals: mac, model, google · Missing: agents, macos, agent
98%98% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Indie HackersFits the IH revenue-focused audience · Strong signals: including, gemini · Missing: supports, reddit linkedin, podcasting
94%94% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
Hacker NewsStrong engagement from HN community · Strong signals: llama, ide, io · Missing: https docs, excited, just released
63%63% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
TrustMRRFits verified-revenue profile · Strong signals: video, google, way · Missing: mobile apps, ios, personal
53%53% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
AppSumoMay struggle as an AppSumo deal · Strong signals: platform, interface, calls · Missing: plus, intuitive, reviews
50%50% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
12%12% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Strong signals: chat, smart · Missing: web3, crypto, cryptocurrency
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

Vi
Visumonit, a Better UI for Monit61%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Visumonit, a Better UI for Monit

Hacker News2
Kn
Knit – A Better LLM Playground45%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Knit – A Better LLM Playground

Hacker News14
Re
Redis-LLM – Redis module integrates LLM with Redis45%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Redis-LLM – Redis module integrates LLM with Redis

Hacker News2
Li
LitLLM the Spiciest LLM Wrapper34%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

LitLLM the Spiciest LLM Wrapper

Hacker News1
LL
LLM Reasonsers46%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

LLM Reasonsers

Hacker News2
Re
Resilient LLM23%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Resilient LLM

Hacker News1
He
Hegelion – Force your LLM to argue with itself before answering58%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Hegelion – Force your LLM to argue with itself before answering

Hacker News1
I
I Stopped Hoping My LLM Would Cooperate49%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

I Stopped Hoping My LLM Would Cooperate

Hacker News3
Do
Doom Compiled into an LLM50%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Doom Compiled into an LLM

Hacker News2
LLM Hotkey
LLM Hotkey39%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.
TrustMRROther