Bernd Wachter

Bernd Wachter

@bernd.wachter.fi

Random ramblings, and writing about my toy projects - Emacs stuff, RFID, remote control, LLM, in any combination. Interested in some of what I'm playing with? I may be available for contracting through my company (https://bsky.app/profile/aardsoft.fi)

32 followers57 following317 posts

And here it is: github.com/aard-fi/elneo Logging in from a new device for the first time in a while to improve the verification workflow, and there almost centainly still are some links to my .emacs.d, but mostly it should work.

github.comGitHub - aard-fi/elneoContribute to aard-fi/elneo development by creating an account on GitHub.
Bernd Wachter@bernd.wachter.fi

About a year ago I was wondering if the "no matrix client with encryption for emacs" could be solved by emulating telegas architecture. I've used matrix rust sdk to get encryption bits working, and eventually built a full client on top. Anonymised screenshot here. I've been using it as my main

About a year ago I was wondering if the "no matrix client with encryption for emacs" could be solved by emulating telegas architecture. I've used matrix rust sdk to get encryption bits working, and eventually built a full client on top. Anonymised screenshot here. I've been using it as my main

client for a while, and in the last few days switched to moving it as my only client on most devices. Problem now is just that I didn't really expect it to become useful, so I developed it inside .emacs.d, and called it matrix.el - so next up would be renaming that thing, and stripping out any hard

I've been trying to guide LLMs into interactive Emacs usage for a while, but so far they always refused. Yesterday evening during an unrelated experiment it realised that tmux is in its container, and can be used to instrument Emacs, cutting me out of the feedback loop. Asked it to document it.

Pointing another session at the document indeed makes it set up a tmux session, tells me how to attach to it so I can watch, and can navigate in there. The instruction for the screenshot was "place cursor on the t of .git, and press RET"

Shim around freerdp to render to an emacs canvas, with matching bindings on the lisp side. Not very useful yet, but as you can see on the blinking terminal cursor, it is live.

I've been using someone else's page for my daily feeds for more than two decades now, but recently had a need to add more custom stuff. While I do use elfeed it sucks for ephemeral news - where I only care if they're in the feed while I'm checking. So here's my easy to consume feed in emacs:

Seems feeds nowadays are also reasonably well formed - last time I was doing manual feed parsing in perl about 20 years ago more than 50% of the feeds needed special handling as they contained bad data. This thing now just pulls headlines from atom or rss, displays up to 12, allows showing

everything in the feed, and keeps no state apart from me explicitly marking a headline as "seen that, don't show that again". Fully async - but a full refresh is done in 1-3 seconds anyway, so that's mostly a "good to have when travelling".

So what I was doing there was trying to have a way to do inference from Emacs, with multiple backends. I've started with llama.cpp, and initially added sd.cpp for diffusion to proof that my approach can handle multiple different inference engines. For a lot of things sd.cpp and llama.cpp are

Bernd Wachter@bernd.wachter.fi

Here's a screenshot of a working prototype for a comfyui style node workflow for stable diffusion implemented via org headings and properties, with the diffusion happening in sd.cpp in a separate process, but controlled via emacs.

View full thread

rust bit I was originally playing with a segment loaded via the .so, and using remote objects to where the actual work happens to emulate in-process behavior while protecting Emacs from crashes and memory ballooning. So far it looks more practical to have a simpler "daemon to talk to via sockets"

So what I was doing there was trying to have a way to do inference from Emacs, with multiple backends. I've started with llama.cpp, and initially added sd.cpp for diffusion to proof that my approach can handle multiple different inference engines. For a lot of things sd.cpp and llama.cpp are

Bernd Wachter@bernd.wachter.fi

Here's a screenshot of a working prototype for a comfyui style node workflow for stable diffusion implemented via org headings and properties, with the diffusion happening in sd.cpp in a separate process, but controlled via emacs.

probably fine - very good performance, decent model support, so we can do a lot of things with minimal effort. For testing new stuff or more obscure models that's not sufficient, though. So the next addition would be a rust bit exposing a bunch of candle methods as elisp. Adding that lead to a

detour - Emacs can't unload .so extensions, I want to develop in my main instance without restarting all the time, and obviously that changes a lot. So now I have a shim loaded into Emacs that hopefully doesn't change, and handles loading and unloading of the bits where the magic happens. For the

Here's a screenshot of a working prototype for a comfyui style node workflow for stable diffusion implemented via org headings and properties, with the diffusion happening in sd.cpp in a separate process, but controlled via emacs.

View full thread

I'm guessing that by offering number ranges for it to judge, and then pretty much doing binary search we should be able to reliable get to the correct number pretty fast - so that'll be the next experiment.

View full thread

Here's one run with all of that fixed. Which now leads to the next problem: If the result is <= 18 it seems to be able to do math just fine, with bigger numbers goes off the rails. But on checking it'll know the result is wrong. So for generic math another approach is needed.

View full thread

flags the result as incorrect in the end - but re-try will just generate 9 again. So we now clearly need different strategies depending on what we want to be generated - which again is where it shines. So before we do anything we give it a bunch of options what type of content it thinks is wanted.

That allows us to kick the fancy sentence generation into math generation mode for those questions. But our "does this word/char fit" judge ends up sabotaging it: Model goes 1 8, judge goes "naah, next to 1 the 8 doesn't look good". And we end up with 19. So now we need to add a check where

View full thread

judging the sentence so far including backtracking, and adding in mechanisms to pretty much feed in complete dictionaries by letting it judge letter groups the next word should start with. While that improves text output a lot it ends up breaking some other stuff, like, the math bits.

Initially that lead to the model just not attempting individual characters/numbers at all anymore (even though it had the option, but confidence in partial words was too high). Highest number available was 9, so the answer always became 9. Alphabet mode still does math correctly, and a judge

View full thread

fallback to char level generation (I can give it at most 255 candidates for judging). That indeed does produce better results, and we can improve it a lot by adding judges in again: it doesn't have high confidence when it is forced to generate stuff, but it has very high confidence when judging it.

So we can let it generate 5 words, and then go "any of those really fits in the sentence at this position?". That got us from gibberish with some English words to almost sane sentences (well, at least the first few words). So we can improve on that by adding in wort type classification, allow

First a short explanation what I'm doing there: yev just judges probabilities. So for the above screenshot it just judged the probability of the next character (it has a-z and 0-9 as inputs) - and got the math right that way, but messed up with the "is". Everything pretty much expected so far.

Now for more open ended question this breaks down (again, pretty much expected). It'll still try to get a sentence structure out, but might do stuff like "a aaa aa aaaaa a aaaaaaa". We can work around that in several ways. Simple approach would be to have ~250 common words as dict, and allow

And that'd be Anthropics Sonnet 4.6. Extremely fast, but costs $2.71, and is not very impressive, so unless @anthropic.com is in the business of sponsoring tokens for weird stuff I'll stick to other models.

Bernd Wachter@bernd.wachter.fi

To compensate for each step reinterpreting the latent from scratch we now allow it to pass some composition notes, which makes the composition quite a bit tighter. Also, glm-5.3-flash seems to be quite a bit better at this than the previously used kimi-k2.6.

I think - unlike most of the other models - this may have benefited from additional steps, but as the vision bit is what makes it so expensive, and that's performed every single step trying that would get quite expensive very quickly.

To compensate for each step reinterpreting the latent from scratch we now allow it to pass some composition notes, which makes the composition quite a bit tighter. Also, glm-5.3-flash seems to be quite a bit better at this than the previously used kimi-k2.6.

Bernd Wachter@bernd.wachter.fi

Your stable diffusion toolchain delivers too good results in too little time? I can help. unhinged diffusion provides the harness needed to make any vision enabled, tool using LLM cosplay as stable diffusion in a canvas enabled Emacs.

Your stable diffusion toolchain delivers too good results in too little time? I can help. unhinged diffusion provides the harness needed to make any vision enabled, tool using LLM cosplay as stable diffusion in a canvas enabled Emacs.

View full thread

Now it entered refining phase. As it needs to rely on text, and do image recognition in each step (unlike sd, which only does conversion at the very end) we allow it to draw circles, rectangles and lines to compensate a bit for the disadvantage.

And finally step 10, with the image just before the final result from the top of this post. It'll apply a few minor adjustments, but overall it judges the result as reasonably good. At least kimi is always surprisingly fond of its results.

Your stable diffusion toolchain delivers too good results in too little time? I can help. unhinged diffusion provides the harness needed to make any vision enabled, tool using LLM cosplay as stable diffusion in a canvas enabled Emacs.

View full thread

Now here for step 6 we see a big limitation of the current PoC: only rectangular regions are supported. So pretty much all denoise or sharpening will overshoot by quite a bit.

Your stable diffusion toolchain delivers too good results in too little time? I can help. unhinged diffusion provides the harness needed to make any vision enabled, tool using LLM cosplay as stable diffusion in a canvas enabled Emacs.

View full thread

Your stable diffusion toolchain delivers too good results in too little time? I can help. unhinged diffusion provides the harness needed to make any vision enabled, tool using LLM cosplay as stable diffusion in a canvas enabled Emacs.

I guess being referred to as "beautifully unhinged" by google AI when using it to research something for an idea I've been working on for a few days is a compliment?

At least it gave me an idea for the project name - what I've been using so far wasn't great. No idea yet if that'll even work out in the end, though. So just a small teaser screenshot with the new canvas in emacs.

(packaging is different from dist packaging to allow easy installation of multiple emacs versions on the same system, with default emacs selection via alternatives)