In this episode of the Elixir Mentor Podcast, your go-to source for All Things Elixir, I sit down with Thomas Millar, the creator of "instructor_ex." This tool is taking Elixir into the future of AI by structuring LLM outputs to match Ecto schemas. We'll delve into the development process, explore Thomas's background in machine learning and Python, and discuss the possibilities for Elixir in AI. This talk is a must-attend for anyone interested in the intersection of Elixir and machine learning. Don't miss this chance to gain insights into the future of tech with one of the innovative developers in this space. Whether you're a seasoned Elixir developer, a machine learning enthusiast, or simply curious about the next big thing in tech, this conversation promises to be enlightening. Take advantage of this opportunity to learn from one of the forefront thinkers in the field. #ElixirLang #MachineLearning #AI #ElixirMentor #InstructorEx #OpenAI #TechTalk #Programming #SoftwareDevelopment #ElixirProgramming #DataEngineering #PythonCoding #ArtificialIntelligence #TechInnovation #developercommunity Connect with Thomas: X: Follow Thomas on X (Twitter) Instructor: Explore instructor_ex on GitHub Upcoming Event: "Let's Talk Elixir" Meetup - Feb 5, 2024 @6PM MST SUPPORT ELIXIR MENTOR 🌐 My website: Visit Elixir Mentor Website 🎙 Check out my podcast: Listen to Hired Gun Apps Podcast 🆘 NEED HELP?? Join our Discord Server 🔗 All my Links: Connect with Jacob on Linktree Join this channel to get access to perks: YouTube Channel Membership
Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.
Transcript
From the show. Tap a time to play from there.
Testing What's up, everyone? Welcome to another exciting live stream on Elixir Mentor, where we dive into all things Elixir. I'm stoked to have another special guest with us today, Thomas Millar Thomas's the brain behind Instructor, a Tool transforming Elixir and AI integration. He also has extensive background in machine learning, Python And data engineering. So grab your coffee, join the chat and feel free to ask any questions. Thomas, thank you so much for joining me today.
Let's go ahead and just kick this off with a quick introduction of who you are and what your background is. Yeah, for sure. Thanks for having me on. So yeah, for As for me, I I originally come from the Python world. I've been working and doing data science and data engineering at Stitch Fix for the past 10 years and did some big data stuff before that, working on Hadoop and whatnot. And I got pulled into the Elixir
community. I I started paying attention maybe about a year or two years ago and then really actually jumped in in the last year. It's kind of borne out of a lot of the the operational issues that I was finding in the Python world. And and like we we've we've done a lot of stuff in the AI and Python world and it works, but it it's not really cohesively designed and it was in my research of how to solve some of these problems that I came
across Elixir. And yeah, I really appreciate the aesthetics of it, and that's what I do every day now. That that's awesome. That I didn't realize you were in Elixirs for only a year. Elixir was kind of the same thing for me. I had a buddy in my ear telling me, dude, you have to check it out. You have to check it out. And I just kept putting it off. And now I've been obsessed with it for probably three years now, so oh. Nice, nice.
Yeah, it's great. It's it's a it's a good language. What ended up getting you into like the machine learning and and like the large language model stuff. Yeah, so I've been doing machine learning stuff in Python for the last 10 years at Stitch Fix. So I I'm, I'm not new to that aspect of it, but it was actually one of the reasons why I jumped into Elixir specifically last year is because all of the machine
learning ecosystem around Elixir really kind of got off the ground. And I said, OK, well, I, I love Elixir for all of these. All the reasons that everyone espouses, you know, good scalability, you know, great web for everyone, loves Live View and all these sorts of things. But I knew that the types of products that I work on are ultimately powered by recommendations and algorithms, and that's where a lot of my interest was. And so once an X came along, it, you know, made Elixir A viable option for me to start using. And then the LLM specifically,
obviously, that's kind of new in the last year, my friend Jason Liu, who created the instructor Python library, he was the original guy who had all these ideas. I just kind of stole them and brought them to Elixir. We worked together. We went to college together. We were roommates. So we're just, we have an iMessage thread going on and he's like, oh, check out what I did with this. Look how look how simple this code is. Like look how nice these abstractions are. Because we both came from the Python world. We both worked at Stitch Fix together. And so it's just kind of that
that it's that little little teaser. And I was like, oh, this would be great in Elixir because then we could do XYZ and he's like, dude, you should do it. You should port it. And so maybe like six weeks ago or something like that, I started the new library and started working on it. And and just really the motivation is that LLMS are kind of a a little bit of a cheat code for machine learning, like classical machine learning is, is it's not like it's not that complicated, but it's daunting
to the average engineer. Whereas prompting an LLM is actually really conceptually simple. And so you're like, oh, OK, I want to write an app with like a text classifier. You know, if this was like 2017, it's like, cool, Now you got to learn how to, like, train a model with LLMS. Super easy. So I'm going to be that engineer, right? I am super interested in this topic but I haven't really made the time so I feel like there's a lot I don't know. If you were to like explain the concept of like structured
prompting in like layman's terms and the like sick significance of developers using it for LLMS, can you kind of go start there? Yeah, yeah, for sure. So most people's experience with LLMS is through chat bot interfaces. In fact all the companies that you go and see that release their like new AI thing, it's always in the form of a chat bot And that's doing a lot of us a disservice because you know,
well actually sorry before I get there the the the reason why everything is a chat bot is because you know we have these models that have built a world model that ostensibly you can query and it's just like it's it's kind of a new paradigm in computing and says like we don't no longer have to implement the function. We just have to write the signature right. Ask the question and the LLM will give you the answer. The problem is that the type signature for it is text in, text out, and so like we can generate text pretty easily as programmers write templates.
String interpolation like easy, take a data structure, create a string, create a prompt. But the output and and we know that the output that we're getting from the LLM is meaningful, but it's a string and parsing strings is really hard, especially when it's not following like a formal language spec or anything like this. And. So This is why every every LLM is a chat bot, because it says. I don't know how to write the code to interpret the response of the LLM, so I'm just going to delegate that to my user, right?
Just output the LM direct to the user, The user can interpret it, right? We're humans, we can we speak English, you know that, that sort of stuff. But the problem is that leaves a whole set of the solution space of what you can leverage this technology for it. It doesn't let you access those things because we still don't have functions that can take text and get data structures out of it in a reliable way. So this is, this is where structured prompting comes in. So structured prompting is the
realization that says OK, we need an interop layer between this AI software two point O world with software one point O. Because all of our systems that you know 50 years of writing code APIs, all these things, you can't renegotiate those boundaries, right. You can't just go and like you don't necessarily have control over those boundaries. So that was the motivation for instructor. It's this kind of interop layer between those two and and that's what it is, is it's structured prompting.
So it says let's change the type signature of the LLM. Instead of text in, text out, let's do text in some schema and you get that schema out. And then once you have that as the interface, tons of like traditional software. One point O opportunities rise up where you can start using LLMS but never actually expose it to the user. Or you could backfill a database, right, and say like, well, I have my database schema. I'm building like a cooking app, right? I want all my recipes, right? You can build AC dot EXS file that uses an instructor and says
like, OK, enumerate every cuisine and for every cuisine enumerate recipes in the format that I want. Yeah, and save that to. The database. That's really awesome. So you're essentially taking this string and creating structured data that you can actually organize and make relative or you know, important projects with outside of a chat bot. Yeah, yeah, totally. Because it just turns out it just it circumvents the string parsing problem, which is probably the biggest hang up why people don't use LL Ms. more.
I love that and I was about to ask you what inspired you to start instructor, but I think we just hit that. So no, that's really awesome. That's cool. Are there any like specific leverages that you get using Elixir or is it just kind of fill in a gap that you saw that Elixir didn't have? I mean right now as it stands it's mostly just filling a gap but there is some leverage that you're going to get soon We're we we've been chatting in the
what is it the EFF or yeah EFF Slack machine learning channel with Sean Moriarty and and Jose to get instructor integrated with Bumblebee to to use. So that's when you can start running the LLM. You can use instructor as your query interface but you're actually running the LLM within the beam as well. So your marginal cost of compute goes to 0 because you're just like paying for the hardware, you don't pay, you're not paying by token anymore, you're just paying for like you know for the servers there's leverage there
in terms of reducing operational complexity. But I think that a cooler example of where you get the leverage there is we there's a lot of work in Bumblebee to support streaming. And because we can have different Gen. servers running kind of concurrently and making like stream messages back and forth, you can very easily build kind of streaming interfaces that that plug multiple different kinds of models together. So here's an example. We're chatting right now.
We're on the live stream. You could have the audio being piped into one NX server that's running, whisper transcribes, right? And then you can stream those tokens into an LLM that's running in a different NX server that's running kind of continuously running a query against it with instructor that says like, hey, anytime you do some like entity recognition, right, like hey, we mentioned the instructor. And then it can spawn off another agent that goes and looks up for the docs and maybe
pulls up relevant information, puts in a little sidebar or like injects it into chat or something. That's something that like, yeah, you could do that in other languages, that's a pain to get that to be done reliably. But with with a lot of the concurrency primitives that you have with OTP, this would this I think starts to become. These types of applications start to become much simpler to implement in Elixir compared to doing it in something like. Python. Yeah, that's really cool.
That's not here today, but that's coming. No, that's really cool because you can just dynamically spawn processes or Gen. servers to do unlimited amount of work that you want. Really. So that's really awesome. I love that. Let's see here. I'm trying to know or have good questions to ask 'cause this stuff is so over my head. If people are interested in like going down this Ave. and maybe
even contributing to instructor, are there like good resources that you recommend to get started? Or like where should someone that doesn't know anything about you know large language models or any of that get started? Yeah, so Jason, like really emphasizes the documentation in the Python library. If you actually look at the the Python library, the documentation's like 10 to 20 times larger than the actual code base.
It's actually a remarkably simple library to implement. So he goes over, he has a bunch of, he calls them cookbooks. I've ported a bunch of them to the election documentation so you can find them in the instructor EX. But if you're unsure, like this is a new paradigm, like you're used to solving problems and you say, OK, I'll decompose it, This is how I grade the function and whatnot. With LMS, you know kind of implements the function for you. And that kind of is like an inversion of thinking that you you're not going to. It's it's like a new skill that you need to develop to think of like how to use this.
So the cookbooks are really good examples because what they document is examples of people successfully using it in different ways that you might not have considered. So those are in the instructor documentation we got here we have tons of live books and it goes through it explains not only you know the code, how it's set up, but why it's that way. All the various features of instructor and how we use them to get these these examples. So that that's probably a good way to like go through the introduction live book.
It explains the features. It's a very very simple library And then go over to the cookbooks and see how people use it so that you can start to get inspiration. You say, oh, I could do that in my app here, maybe I could like mutate that a little bit. But it's really does actually it's it's the most people are mostly bounded by their creativity with it. That makes a lot of sense. I'll I'll make sure to link all those all those docs in the description after this live stream too, because it's mostly
for myself. I'm interested. I need to make time because I feel like we're at that point. If we don't start jumping on this technology, we're going to kind of be left behind as software developers. Yeah, for sure. So what do you, what is your like overall like envision like with rapidly changing AI and technology with like keeping instructor relevant and moving
with it versus just building a set of tools now, but then you know it's irrelevant in eight months. Yeah the when I worked so at Stitch Fix the vast majority of time that I spent there was a as a platform engineer and we had to design like internal tools and frameworks and this is like a skill that needs to be developed like how do you build
something that doesn't get left behind with you know changing underlying assumptions. I think instructor did a very like Jason did a very good job with the design of instructor where you'll see things you'll see libraries like Lang chain in the Python world you go look at the documentation. It's just like they just keep on anytime there's something new they have to like slap on a new class and what not because they they created the API layer a little too, a little too high
and so basically they they every change breaks the assumptions of the library so they came off to adding stuff Whereas like instructor it's like you know it's been around just as long as lane chain ish doesn't really change that much, doesn't doesn't need to because it's it's operating at a little bit of lower level complexity and gives you gives the user the building blocks to customize them themselves. So things that I foresee coming that like might be an issue are supporting vision. So a lot of these models now let
you not just put text but send up photos as well. So we might need to change the interface a little bit for that. But instructor, how the API is really designed is that it's designed to be whatever Open AI has plus one parameter. And so it just gets to evolve naturally with whatever the Open AI library and there's not much work that you have to do in the library itself. So that was like an intentional design choice. We didn't, we didn't wrap Open AI. It's like you're just making an open AI call and we just like add one extra parameter that
does a little bit of post processing and pre processing of the of the query. Yes, I feel like that that's smart for sure. What do you think some of the like most exciting opportunities in machine learning and AI will be for Elixir developers in the like the near future of this year? Next year? Nothing too far off. Yeah, yeah. Well, I I think there's one part that's tricky where the new
models are coming out so fast. You're in a little bit of a rat's race to, you know, make sure that you're still supporting the state-of-the-art. So it's a it's a tricky it's a tricky position to be in for any language that's not Python because the default implementation of all the researchers is naturally in in Python. So that that's going to be a a little bit tricky. But there are huge benefits to doing it in Elixir that it's a little bit scattershot in the Python world.
So getting a little bit into like the technical bits for a second here. When you use NX, so all these machine learning libraries are are using NX and they you you get there's a an additional macro that you get when you use NX or you do like the def at. I don't know if you've seen this yet but you can like it's a subset of Elixir so it's just like a def. You're creating a function, but it's just for numerical operations and it supports like 80% of the syntax of Elixir, but like it's constrained in a
specific way that allows it to compile down to efficient machine code like do the operations fast. Then what also it can do is that if you have like a def N calling another def N that gets like fused together and like compiled down and like it, they're not necessarily making like function calls when it's actually down a layer, it might get inlined. So this is called operate, what's called like tensor operation, fusion or whatever. I think is the the the term and
there are some libraries in Python that do this but it's like built into the fundamentals of NX. So Sean actually has like a post from using NX serving for I think from like September or something like that where he just took a model and he re implemented it in Elixir or in NX using Axon and set up an NX serving for it. And like it was 30% faster and running on Python, which is surprising like you wouldn't you wouldn't expect that you'd be like OK, machine learning in Python is always going to be
like Python but like a little bit worse because it's always going to use not the state-of-the-art models and it's going to be a little bit slower because it's like the beam. That's actually not true, at least on the performance benefit. And then in terms of on the like being behind on the models, I think there's a really interesting opportunity to figure out how to maybe like build up a good community in Elixir that is porting these models. I know we already do have a bunch, but there's there's so many models out there. It's not just LOMS. There's good text to speech models, speech to text There's, I mean, you just go on a hugging
face. There's like they 10,000 new models every day. Oh, I'm sure. Yeah. Yeah. So, yeah. So I I think, I think that there is like, I don't know if I really answered your question there, but it's just more of riffing on machine learning in Elixir. Like it's it's not just you got to use it in your favorite language, like there are real benefits that make it better than doing it in Python. Yeah. I mean, I think you answered my question. I think it was like such an open question. Any answer was good, right.
What are, let's see, how so I know you kind of touched on this that you're that instructor's not a rapper to open AI, right? What do you have like a plan in place to stay on top of trends as like you have to build on models or add anything to it Like what is the implementation behind it?
Yeah, we're we're kind of lucky in that sense. We're. So Jason does this full time well almost full time in the Python world. So he developed this library as a result of doing contracting work. So he contracts with all the top AI companies on the side like rewind AI notion a few other companies that are that are using like shipping AI in in their apps and he his road map for the Python version of
instructor is directly informed for that and he's being paid as a contractor and basically do this. So I got a benefit from that where we just got to go and have some text message thread with Jason and he's just tweeting new stuff and he's messaging me and he's like he's like oh hey for example he just revamped how they do retries in a in a cool way and he just sent it to me. He's like I think you could do this easily with this Elixir library And I was like cool I'll get on that. So he's like almost the PM for it indirectly and but you get a lot of benefits from that
because it's not like I say that a little tongue in cheek, but like I'm serious about it in the sense that it's not just speculation, it's going to be ideas that are vetted against paying contract clients that are using instructor, like the Python version of instructor in production. Real world we're. Just going to port that. Real world production cases. That's awesome. So don't lose Jason at all costs. Yeah, yeah, yeah, yeah. Jason is a national treasure. Keep him around. I love that.
What So, have you managed other open source projects in the past, or is instructor one of your first? And what kind of learning curves or organization skills have you had to learn with starting this project? Yeah, yeah, I mean I I've written plenty of libraries before but never managed this, never managed seriously an open source project. Most of the time I just like throw it out into the ether if people use it. You know, I've had a few things over the years that, you know,
people used and brought into their companies or forked it or whatever. So yeah, this is in terms of like managing open source project. This is a a first for me in in one sense. So I don't know I'm all, I'm all ears. You know I I'm just going around talking about it and trying to write better docs and getting people to submit issues and join the Discord. I think we're doing it right. But you know, hey, you let me know. Oh, I I have no idea. The only reason I ask is the a
current project that I'm building on my YouTube channel is just a Gist clone. OK but after I hit like all the major features like after I teach it and have like you know an MVP version. My goal is to open source it and I like one of the. My major questions is always like how do you properly manage like future, future features, UI implementations and all that. And I was looking at yours and like currently it looks like you just kind of have a checklist. Can people kind of just grab something that they want to work
on and kind of claim it or how? How is that working for you? Yeah. So we we most of the contributions so far have just been around like documentation stuff. That checklist was actually more for just me. That's how I start. That's how all my projects to read me at the bottom of it is just a checklist of like get it out of my head onto the paper so to speak and then and then I I clean it up. So it's not it's not a very serious back or sorry it is a serious backlog but it's not designed it's not there to be
like hey contributors, this random chicken scratch that I wrote because I had an idea in the middle of code or something like that. So I I should really properly probably clean that up. What I will say is that like the definite road map is to just chase down features that you see in Python because like I have the core of it but the Python stuff's adding more. So I would I would would recommend people to go and look at the Python library. The interface is very is very similar so it shouldn't be too
unfamiliar reading through it. And then if you see something in there that like isn't in the instructor version or sorry, in the Elixir version, open up, open up here or open an issue, you know, and we can prioritize that way. I'm I'm, I'm all yours. It's use. It's it's working for what I'm using it for. So I don't have any like definite needs for for new features. But if there's no prior, if there's no signal coming into me through GitHub issues, then the
next features are going to be the ones that I personally want. So, you know, yeah. That's just. What it's going to be otherwise? So if people want to get involved, is the best way to reach out to you on like Twitter or do you prefer GitHub issues? What What is your preference if people want to help out and contribute? Yeah, really anywhere. Twitter is great. I'm totally, I'm on Twitter all the time. GitHub issues is definitely like more permanent. Once you have like you know, code samples or something a little more concrete, definitely catalog it there, 'cause you
know Twitter, the half life of a tweet is like 36 hours, so like, it might get lost. And then we also have a Discord server that's for instructor. It's linked to in the read me so you can get invite there. And that has not just Elixir Discord, but it has the Python one. It has general questions, There's a TypeScript version of the library. There's a they're actively working on a review version of the library and and good conversations about forward thinking things or forward
thinking things are there as well as inspiration. Like people are posting like kind of showcases of like, oh hey, I'm using it for this. I ran, you know, so those those three, Discord, Twitter and GitHub. I'm going to have to join. I'm going to be that noob. I think this is a topic I need to Start learning because it just the the power and all the cool projects behind it. I just love the idea. Can you talk about any of the projects you work on that you're using instructor for?
Yeah, yeah. So this was one I was I'm writing a Twitter bot right now just out of like kind of a a curiosity to see if I could build my own recommendation algorithm for Twitter like externally. So what it does right now is it it's it's actually all just in a live book. It's not even like that sophisticated, but it uses Wallaby which is like the browser automation. Like it's really for like browser testing, but like fundamentally it just automates
the browser. So it's a little bot that goes and just like sits on my Twitter in a background window and just goes, reads tweets throughout the day and clicks on people's profiles. And what it uses is instructor to basically do entity extraction, extraction. Like what? Does this user like? Tweet a lot about better elixir things? Or is there are they like you know, 80% football and 20% elixir or or whatever. So I use instructor for that part to like do some entity extraction and then I want to go
and surface things like. One of the fundamental things in the recommendation is that Twitter's recommender optimizes for time on site. So naturally, I just get like all these videos that just like hijack my brain and are like, you know, check out this, like fight that happened behind Walmart. And I'm like, I don't want that. But like, I'm gonna watch it, you know? Like I'm only a man, You know that. Dangerous cycle of scrolling, right? You're like, oh, a fight video. You have to. Watch exactly, exactly so my the little app that I'm working on.
It's just something that goes in and browses tweets, tries to go and create a candidate set, uses instructor to determine like, what these tweets are actually about. And then what it's also going to do is it's going to catalog all of the things that I tweet about. Not that I like, go and view and like, like, but like I tweet about and then we'll try to do a match there. It says like, oh, this person's chatting about. For instance, I tweeted, I think like a week ago about upgrading my Phoenix from cowboy to bandit. Got huge performance gains. Like, you know, people are
talking about that, but that's not showing up in my feed. And so it's going to go and it's going to say like, oh, hey, there's all these interesting tweets that are not not only about Elixir, but also about this thing that you've also been talking about. Do you want to like hop in the conversation? That's really. So that's an example of where I'm using instructor and that's really just as like a text classifier really. It's a very actually simple use case of Elixir. Most of the code is around like browser automation of Twitter, but it's been a fun one. It's it's been. It's been, yeah, it's been good to be able to use use both and
kind of time together instead of just these instructor examples kind of in isolation. Yeah, that's awesome. Are there any community projects that you find super cool too that people are building right now? So I know a lot of people are just getting started out with the Elixir version, so there there aren't tons of Elixir apps that I've seen so far. But in the wider ecosystem there's some really cool demos from the TypeScript version of
the application that leverages streaming. So one of the things that we implement in in instructor is that you can actually like partially stream the Jason as it's being like outputted. So you can just imagine like you have a a structure and all the keys are set to nil and then like as each key comes in like we hydrate it and as a result you can get this like kind of live streaming feedback. I have a demo on this I I I posted on Twitter and there's some really cool examples of them doing that in JavaScript
where they'll create like it's still a chat bot interface but like the bot will start responding with text and then it will like stop and it will start hydrating like recipe cards or like different kind of cards And it's not like you make the call and you wait 60 seconds for the response. You get this streamed in live and it's a really cool flashy like UI demo. So the TypeScript always love that stuff. They're using it all. They love the streaming. So we have that in electric too. Like we someone just needs to hook it up to a live view and
you can get some like killer killer demos out of that. But yeah, some of the some of the flashy stuff is around part. It's called partial streaming, is what we call it. That sounds awesome. I'm going to have to figure out a good use case and maybe add a feature to my gist clone project. Yeah, yeah. Yeah. We'll there's, yeah, there's probably probably some. It could find like similar code written by other users to connect with them or something, I don't know. Yeah, well, you could even use
it for like language detection. I mean, that'd be a really easy, simple one to do, you know? I don't know if you have that in there. I don't right now I'm just pulling the extension off the file name that you have to manually add, so language detection would be an awesome feature to add. Right, because like you think about how GitHub does it. Like they have that that open source one that does the regex. I forgot what it's called like a scholar or something. And there's GitHub built one like in like 2011 that you know, basically looks at strings and
tries to guess the programming language. But like now you can just use an LLN for that, it will know. That that would be awesome. Yeah. You know, I'm going to have to do that. Because as a really easy way to get your like feet wet without it's and it's conceptually very simple. OK, awesome. And I I know who to harass now if I need. Help. Yeah, yeah, yeah, perfect. Yeah, you know. Yeah, perfect. What are like, what are some of the most exciting things you look forward in the future with this stuff that isn't currently available yet, but you you know
it's on its way? Yeah, I think, I feel like it's the addiction of everyone who plays in this AI space to create like, an automated agent that, like, operates your computer for you. And so you you saw stuff like, I don't know, maybe six months ago, eight months ago, where there's like auto GPT and baby GPT. And I don't know if you're on Twitter, you saw those things and they're like, once again, super flashy demos.
But like, you never actually saw a product ship, right? There's even startups that are like, oh, we run AI agents that will just do the thing for you. But there's no buy now link, right? It's just join the wait list, join the wait list. Whenever someone said join the wait list because they don't have anything, you know it's like the people who have stuff have a buy now link. So it's the temptation of everyone because they see these things and you're like oh, if it can just write the function, just control my computer. So the new image models that are
coming out right now I think make this sort of kind of computer automation and agent based work flows a lot easier to do because sometimes you can't really express the complexity of the world just in text but you kind of images write an images worth 1000 works this sort of this sort of motivation. So I think there's some cool stuff to do in Elixir there. Once again, also because of like Gen. servers and whatnot. Like, it's like the actor model is like really well suited to having like a a team of autonomous agents kind of
working, coordinating to solve a larger problem. So who knows, maybe I'll change my Twitter recommendation spot to be like an actual agent. So instead of like manually scripting the automation around the web page, maybe I'll use instructor to like get it to control where the mouse goes and clicks and finds the tweets that way instead of a bunch of manual code. But yeah, I think there's some cool stuff there, I think, you know. But, you know, the skeptic in me also says we've been on the edge of that, on the precipice of that for like, you know, it's
oh, just in two weeks, you know, some new AI, right, for eight months now. So maybe not, but I don't know. I'm I'm still a believer. Well, I also feel like we went through a huge wave of just it being the coolest thing. It's going to end the world, but you know, it'll do everything for everyone. And I feel like that little like hype wave is settling a little bit and now it's more realistic projects and kind of more useful stuff underway.
Yeah, it's kind of like NFT hype, you know? Yeah, yeah, well I one of the things that why I think that happened was because you can get all these really cool demos where you're just doing like string in, string out like with baby AGI. This actually kind of leads to like why instructor was built. This is OK. When you try to ship it, it only works 60% of the time or 40% of the time or whatever, right? And so, like, when it does work, it's like, Oh my God, you know, the future's here, But you're like, you actually can't ship a product like that. And it's and it's actually, because there's there's there's
a lot of, like good software engineering best practices that you still want to use when you're coding around LLMS. It's not some magic bullet. The problem is, is that you couldn't, all the tools were not available to you because it was just putting text that you can interpret, right. That is the motivation for instructor like originally in Python. It says like, hey, how do we get the reliability of these things up? Well we need to get these parsing errors. Like we need to solve the parsing problem. So instructor solves the parsing problem. You never you will never get a parsing error. Well like almost never get a parsing error.
And then you can start moving on to like classical data science sort of validation for creating production algorithms, which is just like what's my error rate, right. How do I, what's my validation set? These sorts of things like all of this happens in classical LML and people kind of thought with LMS, oh, you don't really need to do it. Like once you're actually getting to production, that's the kind of stuff you want to start tracking, right? And you say, like, OK, put a thumbs up and thumbs down based on the result and then measure whether, like, did it do what you wanted it to do a thumbs
down. Then go and take your errors, cluster them. Like, just go look at your errors and be like, OK, anytime someone asks, like a recipe app, anytime we're talking about, like, bananas, the model messes up or something like that, maybe that shows up in the error set. And then you can do, like, the standard engineering practice of like, OK, here's our backlog, here's our set of errors, Here's the largest error by volume, right? Let's go fix that. Maybe it's through prompt engineering, maybe through a supplementing of data. Maybe it's creating a new model. There's different things that you can do. You just really couldn't do that before when the output was just like raw text and you didn't
have like you you you what do you what do you what is your metric when it's just raw text? I was going to say you can't really do it without manual intervention, right? Yeah, that makes sense. I feel like I'm opening up a can of worms with this now. Yeah, it it it's it is definitely like it is definitely one of those things where the most trivial thing to do with instructor is extremely easy.
And then as just the nature of LLMS, as you start pulling that thread and you start going deeper and deeper, you'll start naturally getting into like classical machine learning, validation an evaluation sorry issues which is, which is not that hard. It really is just like group like categorize your errors and count how many of each type of error you're getting and then try to solve them, right.
It's it's it's I think people overestimate the complexity that is actually there with machine learning. It's just. It's basically just that. I don't know. We're about to find out. We'll find out with. I can broadcast my learning curve so everyone knows how not smart I am. Well dude, if you're ever working on something and you want want some want some help, hit me up. I can. For sure. Well, I think, I think the language detection will be where
I start. I think that sounds like a good spot for me. Yeah, yeah. This would be, yeah. You know, I'm super curious to see if you get some stuff that people paste in. So like for example, if I just go and create a new gist in your clone and just paste in like, I don't know, CNN article, ACNN article, right. Like like what language is as it pops out English and you're going to be like wait, what? And that's not what I want, right. And so you're going to like that will be some good QA testing
that I think you'll go through in this process and you'll be like, Oh well how do I solve that problem, right. I only want it to be programming languages. So maybe you'll go and like prompt engineer that, or maybe an instructor. When you're defining the language output, you can use an echo ingam and say it can only be one of these 30 languages that I support. Or you can say you always provide an escape hatch and say like. If it's not that, you don't have to choose one of those options. You can also say I don't know or not a valid. Language or just make it like a text file and then done. Yeah, yeah, yeah. I mean there's plenty of different options you can use as
your catch all. Yeah, I like that. And then and then like if you have the catch all, so like you know, just pulling on this thread a little further, you say, OK, now you go and ship the feature, people start using it. You support, let's say, 12 languages that you could think of when you originally coded it. And then people come in and they're like, Oh yeah, yeah, I really love Perl, right? So I'm going to create all my gist of like, my Perl scripts because there isn't a package manager. Whatever, right, Say, oh, but that wasn't in the E NUM, right. And your catch all is just like, I don't know where we start logging that, right? And then you can go and say
maybe in like a background task, say for all the ones that were just text files, ask the question again of what language it is. But unconstrained, right? Not just the 12 languages. Just let the LLM output whatever it wants for that and then go and and you know, start grouping the logs based on that and then it will illuminate to you. This says like, oh, I have a lot of users who are using Pearl for instance. This is contrived, but like. For instance, or Why are people using Haskell? Yeah, yeah, yeah, exactly. I don't, you know, this is for
beam languages only, you know, I don't know. So that's what I mean in terms of like when you start pulling the thread, you say like you you just start doing QA on your application. You start using and you start looking at the failure cases. Look at the examples and you can even use instructor in more unconstrained ways to help you, you know more rigorously do an analysis on the errors. So there's other other options they were pulling on. The Yeah, I love that. Myself. Going down the rabbit hole that it'll be fun. I'm sure all my subscribers will would love a little like machine
learning or LLM example. So we'll see, we'll see, we'll see how it goes. I'll have to. You know. Oh, go ahead. One guy he gave a His name's Charlie Holtz. I think his Holtz, I think it is. He gave a talk at Elixir Con. He's another great person to follow who builds really cool like web demos. He leverages Replicate a lot but which basically lets you spin up these various models with an with like a REST API, so it's
like easy to integrate against them. If also if like looking for inspiration of how to slot all these kind of generative AI tools into web apps. He is a creative genius. He comes up with such funny, clever little ideas, so that's a great follow. I don't know if he's using instructor yet, but he uses a lot of other machine. Learning models. I'll definitely have to find him and and follow him. That's awesome. Let's see. Does anyone have any questions for Thomas?
This is the guy to ask for machine learning and all the hard smart people stuff. Yeah. I'll just defer to Jason, whatever the question is. What is a we'll? We'll just let that. It's a little delayed usually, but what is? What is your current day job? What do you do with most of your time? Yeah. So I I still work at Stitch Fix. We have you know I built the data platform out there. So we started off like the
business is is a retail clothing retailer where you don't like select your clothes, we select the clothes for you and you keep them if you like them and pay for them and whatever you don't like to send back to us. So like recommendations is like at the core of the business. So we built the a platform that made like doing research on recommendations very easy and then slowly over the years that skill set kind of proliferated out throughout the business into like operations research, right. It's like where do we put our inventory across these different warehouses, these sorts of things.
So what I do in my day job is I I work on that data platform and really work with our different teams around the company to figure out how that they, how can they better leverage machine learning and statistics to better operate the business instead of just instead of everything just being like you know, 1990s style, you know, just Windows form or not Windows Forms, but like you know web, web forms and whatnot where it's just always human operators and you do like maybe a little bit of aggregation. So it's like hey maybe we can do
like statistical approaches and like eliminate certain functions and delegate that to to machine learning. So that's what I do in my day job. Awesome. So you're always you're always in the weeds with it. Yeah, yeah, yeah, for sure. I love it. Let's see. I wish there was an AI app built into the Elixir ecosystem. Would chat with hex docs be a good app for NX Instructor or something else? Yeah, that would be good, I
know. I think it was some of the guys over at Fly dot IO built a like cross like a search index across all the hex stocks. So you have like usually you had a hex stocks and you have like search it but it's just for that one package right? They they had built one that indexed like all the packages but but it didn't have like as far as I know it was just did it just did like an embedding search like a kind of like a full text search esque thing across all of them. But then it didn't have like the
the chat with your doc sort of feature. So that would be a killer option actually if if that's open source, someone could probably go take that down, take the search results that come back from what it does today, then pipe that in to an LLM that says like, OK, answer this question based on the relevant docs that it found. That's for if people are wondering what that that's a red. If you see on Twitter and people are talking about RAG applications, RAG retrieval, augmented generation, that is what that is.
That's all it is. So it just says, like here are all the docs, here are all the paragraphs, text chunks of all the docs that are possibly, you know, or that are in the ecosystem. First, there's a first stage search that says, OK, pull up the 10 most relevant documents to the question that I'm asking and then give all of that to the LLM that says, given the context of these ten documents, answer this question and hopefully it comes up with like a reasonable response. So we already have the first bit
because fly dot IO guys did that. So someone could totally build, use instructor to build the other one and probably become like a hero in the community because like hex docks are great, but like man, if you had like an AI hex docks that would be. That would be awesome. So guys, whoever's listening. Yeah. Be a hero. That that that could be your after the the gist clone you know that can be your like your advanced course you know that. Would be. Instructor one O 2. Yeah, that would. That would actually be a lot of fun. I'll have to.
It it would be fun too because like you the I'm pretty sure that project is open source so you can like already start like the scraping and indexing and embedding that stuff's like not trivial. Being the instructor part is going to be pretty easy. It's just like take the 10 search results, put it into this little prompt and like get the response. Yeah, it could be a little fun project for someone. Yeah, I love that someone did
ask why Elixir and Machine Learning. I feel like you kind of covered that question throughout this whole chat though. Yeah, I mean there's there's one thing I didn't say on it which was kind of implied, but it's it's worth saying explicitly that there is, there is a lot of leverage being in one language ecosystem. Like you'll always have to learn new skills, but if you have to do that also in a different language and like kind of you
know, match them up together and when you're actually trying to ship your code, you're going to lose a lot of a lot of productivity. Most productivity gains come from familiarity with your tool set. And so you say like, OK, I just want to add text to speech or whatever to my app. Well, now I got to use Python. Well, how do I set up my editor for that? Like, how do I deploy that? How do I, how do I monitor it? All these sorts of things. Like, you think it's easy. It's like, oh, yeah, yeah, I just have the script, I run it, I take the results and I bring it back into my application.
But there's like this big underbelly of complexity that it actually comes from, that comes from shelling out to a different language that like you don't appreciate when you're first creating your prototype or demo. And so the fact that Elixir with NX has like really good primitives now for machine learning, the work is just like, let's just build all the stuff on top of it and you get the benefit of just being A1 tool chain. It's you're going to monitor it the same way you're used to monitoring your Phoenix app. There's no other stuff that you need to learn.
So it the cost of adoption is going to go down for a lot of developers. And why Elixir? Because you could do that with any language, to be fair, right? But all the other languages don't have the web benefits that you get with Elixir, right? Like you can't do that like the web ecosystem in Python, like it's there, it's like OK, like it, it's it's fine. I'm, I'm not actually not trying to knock it, but it's not Elixir. You know, like like Phoenix is awesome. So you know, you can say like, OK, am I going to, you know,
port one to the other or machine learning to Elixir right for me? I personally, yeah, I personally like being like, you know, A1 technology, one language person. Because before I started my Elixir game, I was all over the place, you know, JavaScript, TypeScript, Swift, Kotlin, all the nasty things that you can combine, right? And the last three years I've been trying to mostly bring my focus to Elixir, and just from
the standpoint of software engineering alone, you start to, I feel like you kind of double down on your skill set just because you're only concentrating in one ecosystem. Yeah, you know, I had a a funny thought the other day. I coming in as an outsider to this community, I noticed that there's like a big emphasis on helping each other find jobs in Elixir. And then it's like, you know,
there's a big emphasis on it because it's like it there's a an impression from the outside that it's like an uphill battle whether that's true or false. But I was like kind of thinking about like what the reason might be for that. It was like if you actually have a language that's like very productive and can like do it all and and and whatnot. Like you just don't need that many engineers. So you're actually going to like if the technology, like put simply, if the technology is so good, you're just they're not going to need that many Elixir engineers which is like a problem. Then for everyone who wants to get in, they're like well OK, you got to start creating the
companies because like the companies that do to exist are just happy with their like 8 engineers because they don't need a 300 person engineering team you know? Yeah, that is true. Well, I think the adoption of Elixir is slow because while changing your infrastructure, if you already have it built up, is extremely costly, right? So now it's just spreading the word of how amazing that like Elixir can be right? With like like Bleacher Report and all these things where they've cut their server costs.
You know, almost 100 X like crazy stories you hear, right? Yeah, yeah. Well, I just, I think about it as like I don't know if what I just said is actually like the fundamental dynamics going on. But if it is what it suggests is that the right strategy is not just evangelizing Elixir at big companies and trying to find the job. So really kind of doing like the AWS strategy, it's like AWS grows like reliably because they're like any start up you
get 100,000 free dollar or free Amazon credits. You don't have to pay for three years, right. And the hope is, is that like, yeah, yeah, it's insignificant, it's you know what, what are they? It's a start up. How much money are they really going to spend on AW s s Bill? But then like 5 years from now, they're going to be the next Airbnb and like, well, now you're locked in. Well, that's my I have a big gripe with like the micro service adoption of things because you get locked in and once AWS has you, it's so hard
to move. Yeah, And and that, and that's true about just even technology choice, it's, it's even true about Elixir, not on the infra layer, but like just on the language adoption. It's the same point that you just made. Right. And so you say like, Oh well, given that, like take take a page of their playbook, right? Like what we should be doing is advocating for people to start companies in Elixir and be focusing in the Elixir community on like the entrepreneurship side, not the, not the like. Where are the jobs at? Even though everyone is looking for the jobs, it's like you got
to go like one step upstream and solve it at like the source, which is like you just need new companies using Elixir because if you succeed in that within three years you're going to have a lot of Elixir jobs. I I'm trying to do my part so my good good my day. My day job is a dev shop called Hired Gun Apps and whenever we get a project our back end is. I usually am the back end engineer and it is built in Elixir. Oh, awesome. Awesome. That's great.
Yeah, so slowly, you know all these little small start-ups that that hire us for their apps, we can slowly integrate Elixir into their bloodline. That's perfect. And we start every the language starts off with a bunch of consulting agent or contracting agencies and then you know the next era of it is all those, all the companies that contracted, you know grow up and then you know create tons of jobs for everyone. Yeah, exactly. Exactly. I love that. That's awesome. Well, I I think this was
awesome, Tom. Whoa. We we hit like almost an hour here. That's pretty good. But it's this has been an awesome conversation and it was it was great meeting you. I I look forward to harassing you as I Start learning machine learning and start messing around with instructor because it is, yeah. For sure. It is going to be a path I go down because I also I think making content on it would be super beneficial as well.
Yeah, no, for sure. Yeah. Hit me up anytime. And yeah, thanks for thanks for having me on. Awesome. Oh, we should mention because what originally got me got you on my radar was I was talking with Michael Lubus from Proaxial and you have a meet up, a remote meet up on Monday. That's right. Yeah. The Denver Elixir meet up I'm calling in and we're doing. I have a a talk that I've been working on about the motivation. Some of some of the stuff I went over here, but I.
Yeah, awesome. So I can, I'll put that, I'll put that link in the description on here so maybe we can get you some more viewers on Monday. I'll be I'll be listening in as well, just because I'm interested in this subject and it's time to learn so. Yeah, yeah, yeah. I don't know for sure, but thanks. Yeah, everyone come out to the the Denver one, I think you can just call in. So it's. I think it's just if. You have questions that you
didn't get to, we didn't get to hear that you want answered then I think better over the weekend and I'll, I'll, I'll respond to them on Monday. Yeah, perfect. And again, dude, thank you so much for making the time. I know my little elixir mentor community appreciates it. And if you want to know, join another Discord server, jump on over. I'm sure people would love to hear from you, SO. For sure. For sure. Cool. But all right, man. It was great meeting you. Great discussion. Testing.
Francesco Cesarini, founder of Erlang Solutions, and Allen Wyma, hosts of BEAM There, Done That, join Jacob for a live crossover of both podcasts. They trade origin stories, compare what the Erlang and Elixir...
Jason Cohen, founder of WP Engine and Smart Bear, joins Jacob to talk about his new book Hidden Multipliers. They dig into why engineers avoid marketing, the onboarding math behind SaaS trials, finding your ideal...
Filipe Cabaço, team lead on Realtime at Supabase, returns after two years to talk about his side projects: Vitro, a browser for every AI agent with a replayable timeline of what each one did, and Ampoule, which packs an...
Peter Ullrich returns to talk about Pushin.eu, the European GitHub alternative he's building in Elixir. Five months in, it has about 700 confirmed registrations after going viral on Hacker News, and Peter walks through...
Nathan Hessler, organizer of ExMex and RBQ Conf, is back four weeks out from ExMex 2026 in Austin. We cover MCing Rails World, how he picks speakers and keynotes for a single track, what running a Ruby conference taught...