llm.rb is Ruby's most capable AI runtime
6 points by 0x1eef
6 points by 0x1eef
Nice, it like you've been hammering on this for the past month!
What parts are you most proud of, what are the trickiest and most interesting to implement?
Thanks for the interest :) I think I'm most proud of the architecture behind it. It does a lot but it does it all with Ruby's standard library. When I discovered Go, and how good its standard library is, it reassured me that a design choice made very early on was the right one.
The trickiest part is cancellation. It's a hard problem. I'm not sure it has a solid implementation and it tries to offload the hard parts to the caller. For example, when a request is cancelled, any running tools would have "on_interrupt" sent to them, and then the caller has to decide what to do. I'm still not very confident in cancellation, but it was inspired again by Go.
The most interesting part is hard to choose. A lot of it is interesting :) But MCP and agentic patterns would be in the top 5.