I understand it's a Ruby thing, `chat = RubyLLM.chat` looks odd. How do I know whether it's a function call returning an object or just an assignment? Why not just use `RubyLLM.chat()` and eliminate the ambiguity?
RubyLLM: A delightful Ruby way to work with AI
171–180 of 182 posts
Re: RubyLLM: A delightful Ruby way to work with AI
#172Love this project!
Re: RubyLLM: A delightful Ruby way to work with AI
#173Earlier quoted context omitted.
Rails is a hot ball of global mutable state. Good luck with threads.
The default rails application server is puma and it uses threads
Re: RubyLLM: A delightful Ruby way to work with AI
#174Re: RubyLLM: A delightful Ruby way to work with AI
#175Oh just beautiful. Ruby is so expressive and concise. If you see the typescript options it's like giving yourself a water boarding session through your own volition.
Is it really Ruby or they just made a nice interface? I don't see why a hypothetical TypeScript example would be all that different. // Just ask questions const chat: Chat = LLM.chat; chat.ask("What's the best way to learn TypeScript?"); // Analyze images chat.ask("What's in this image?", { image: "ts_conf.jpg" }); // Generate images LLM.paint("a sunset over mountains in watercolor style"); // Create vector embedding…
Re: RubyLLM: A delightful Ruby way to work with AI
#176Oh just beautiful. Ruby is so expressive and concise. If you see the typescript options it's like giving yourself a water boarding session through your own volition.
Is it really Ruby or they just made a nice interface? I don't see why a hypothetical TypeScript example would be all that different. // Just ask questions const chat: Chat = LLM.chat; chat.ask("What's the best way to learn TypeScript?"); // Analyze images chat.ask("What's in this image?", { image: "ts_conf.jpg" }); // Generate images LLM.paint("a sunset over mountains in watercolor style"); // Create vector embedding…
Re: RubyLLM: A delightful Ruby way to work with AI
#177Re: RubyLLM: A delightful Ruby way to work with AI
#178Earlier quoted context omitted.
As a general rule of thumb, don’t yuck someone else’s yum. Plenty of people like the trade offs Ruby makes. And plenty of absolutely huge businesses use it quite successfully (e.g., Shopify, GitHub, GitLab, Airbnb, Stripe). If you don’t like it, don’t use it.
I'll yuck whatever yum I please. I'm not here for your approval. I did 10 years of Ruby. I have some authority on the matter.
Re: RubyLLM: A delightful Ruby way to work with AI
#179Earlier quoted context omitted.
The default rails application server is puma and it uses threads
Yes, it does. Ruby has a global interpreter lock (GIL) that prevents multiple threads to be executed by the interpreter at the same time, so Puma does have threads, they just can’t run Ruby code at the same time. They can hide IO though.
Re: RubyLLM: A delightful Ruby way to work with AI
#180I run engineering for a venture backed AI-first startup and we use Ruby/Rails. For us, it made sense to leverage one of the best domain modeling and ORM frameworks out there. Most of our inference is http calls to foundational models, but we can still fine tune and host models on GPUs using Python. Inference matters, but part of building an effective user platform are the same old SaaS problems we’ve had before, and…