Once a Maintainer: Alex Rudall
how a pandemic project became a gateway into the OpenAI platform for Rubyists
Welcome to Once a Maintainer, where each week we interview an open source maintainer and tell their story.
This week we’re talking to Alex Rudall, creator of the ruby-openai gem. Ruby-openai is a wrapper around the OpenAI API making it easy to use APIs like GPT without leaving Ruby. We use it ourselves at Infield, where we use GPT to read and categorize open source changelogs. We spoke with Alex from Bali where he was enjoying a much warmer and sunnier climate than that of his usual home in East London.
How did you get into programming?
When I was really little my family lived in a remote village in Nepal, in the Himalayas. My parents were working out there. This was in the mid 90’s, and we had an early laptop that my dad ran off solar power and a truck battery, and it had a couple of video games on it which I liked to play. Those games where you're basically driving a car on an endless road and one where you're piloting a fighter jet. My granddad also used to send me floppy disks of kids games that he got from his weekly newspaper. And I really loved getting that. Back in the UK when I was a bit older I got into building computers for playing video games, which kind of gave me a bit more of a technical background I think, and started to get me interested in how computers actually work.
I originally wanted to be a sci-fi writer. I was kind of a nerd, but I hated writing, so I worked in sales for a while. I built a lot of sales dashboards in Excel during that time. And then I eventually forced myself to write this sci-fi novel called Inkers, which is actually about an AI destroying the world. Once I finished that, I thought, you know, AI was probably going to become pretty transformational and I wanted to be a part of it in some way.
So then I started learning to code. I had some really good mentors. The first one who hired me happened to be a Ruby dev, and he really encouraged me. He got me involved in the Ruby community and took me to Ruby conferences and stuff. So I just ended up learning Ruby on Rails and I've been a Rails dev for ten years.
Wow, so do you have any formal degree in computer science? Or you got into it after your writing stint and basically just started working?
Yes. So I ended up doing a computer science degree in the evenings. I’ve lived in London for most of the past ten years, and there's this university called Birkbeck where you can study while working full time.
My first job helped pay to put me through that, which was really good of them. I ended up learning Java and getting, like, a good computer science background. But I still really loved Ruby as a language. I have basically been writing Ruby ever since. And JavaScript as well.
What made you decide to write ruby-openai?
I’d been wanting to pivot my career a bit more in the AI direction for a while now and I'd been following a lot of stuff around DeepMind and OpenAI. But I hadn't quite figured out how to do that. My job was very much writing Ruby on Rails apps, and I did a bit of stuff in my spare time. But I'm very online, on Hacker News and Twitter. Way too much to be honest. And at one point back in 2020, it was when the pandemic started so I was probably even more online at that point, I saw Greg Brockman, the CTO of OpenAI, he posted a comment on Hacker News asking if anyone wanted to test out GPT-3 or the very first version of the API.
So yeah, I just wrote him an e-mail saying that I'd love to have a go with it and he e-mailed back sure and he gave me access, which was nice of them. Then I started building a project which was a Rails app. The idea was that you could upload a load of documents and then you could use GPT-3 to answer questions about those documents. It was something that ChatGPT can just do now. But while I was doing that, I kind of realized that there wasn't really a Ruby gem for people to access the API and OpenAI hadn't released their own like they have with Python, their own library.
So I sort of separated that stuff out and stuck it on GitHub and I wanted to make sure that it was done in a way that was good and wasn't annoying for me to use. And that ended up being way more fun and more useful to people than my document project. I just ended up working on it through the pandemic when I had a lot more spare time and ever since have been gradually working on it.
What’s your favorite Ruby package and why?
I love rubocop. I really think consistency and tidiness is the most important thing in building maintainable software and having strict rules around that is really helpful. Ruby is such a friendly, flexible language but I think having a linter with it with a set of rules that you make as a team lets you make a culture that can last in your codebase.
When I work at companies, especially smaller companies where I have bigger influence, I always try to build using open source projects as much as possible rather than rolling your own. You save so much time and if it’s a maintained project, you get the benefit of people working on it over time. They've already solved all the problems or most of the problems that you're going to face, and then you can actually spend your time on the part of the problem you're solving where you can actually add business value. I think there's just this huge thing of, you know, “not invented here” syndrome and you can just waste so much time writing your own stuff when there's all this amazing free open source software out there.
How can we get more people into open source?
I’m going to give a wishy washy answer and a more technical one. One reason I think I’ve stayed with the Ruby community for 10 years is it felt way friendlier and a bit more human than the other communities. I think that's probably changed these days, but 10-12 years ago if you went on the forums, the Ruby ones just seemed to be nicer. There was this whole thing, Matz, the guy who wrote Ruby, “Matz is nice so we are nice.” I don’t really see people say that anymore, but it really worked. If you went to Ruby conferences it always seemed to be more diverse than other languages, different kinds of people, some interesting personalities. There was someone called _Why who wrote a guide to Ruby that was really weird and funny. So I think having good principles for being nice to people in the community as a whole is really important.
On the more technical side, test-driven development (TDD) really helped me to be able to grow as a coder and understand what was going wrong when I didn't really know how to code. And I feel like having more comprehensive test suites and linters could really help more junior people feel more comfortable making contributions. Like with ruby-openai, I've tried to have a really good test suite. We use this library called vcr to record API responses. It's actually a really old project, but I like it because it's quite simple to use. It just literally records API responses. So it’s quite easy to test your work, I think.
Who’s someone you think is doing really interesting work?
Greg Brockman and the team at OpenAI, starting a new industrial revolution, quite interesting work. I also really love the Tailwind project, Tailwind UI. I’m terrible at CSS and it’s allowed me to not really think about that anymore. They’ve solved web UIs.
Once a Maintainer is written by the team at Infield, an app that helps dev teams keep their open source dependencies up to date. To suggest a maintainer doing awesome work in the community, find us on Twitter at @infieldai. To share this post, hit the button below: