Transcription
Over the past few years, I've been doing a lot of work with AI and building various AI applications. In this video, I'm going to share five AI frameworks that I wish I had learned earlier because they are incredibly useful. The best part is that I have a variety of free tutorials covering almost all of these frameworks. I'll keep the explanation brief, and if you want to learn more, you can check those out via the link in the description.
With that said, let's get into framework number one, which is LangChain.
LangChain is primarily a Python-based framework for working with LLMs and building generative applications. It allows you to easily use multiple LLM providers, like OpenAI, for example. You can do things like prompt templates, output parsing, buffer management, storing conversation history, and working with vector databases. All of the common tasks you'll perform with LLM apps are significantly easier with LangChain. As the name suggests, you can set up various chains of operations that you want to perform in Python with relative ease compared to doing this completely from scratch.
I have a few videos on my channel that walk through LangChain, and I've built various projects, from a simple AI Choose Your Own Adventure game to something more complex where multiple AI agents collaborate to produce a specific output. It's definitely worth checking out, especially if you're a Python developer, and I'll leave the link to it in the description.
Moving on, we go to framework number two, which is LangFlow.
LangFlow is a graphical or visual-based editor that's very similar to LangChain. It allows you to build LLM-based apps, but instead of writing all the code yourself, you can use a drag-and-drop or low-code tool to create different flows that you can then execute from an API.
Here, I'll show you a quick example on the computer to make it clearer.
Here's a project I built just a few days ago to help generate unique coding questions for my newsletter. By the way, I have a completely free coding newsletter that provides coding challenges, project ideas, tips, stories, and insights. You can check it out via the link in the description. As an incentive, I'll even provide a free guide on how to make money from coding. Simply sign up for that newsletter, and you'll get immediate access.
Now, this is something I added to generate some coding questions for that newsletter. You can see that this is what the flow looks like. I can have an input, put that into a prompt template, pass it to an LLM, and connect it to something like an Astra vector store database. This is where I store all the previous coding challenges to ensure they aren't too similar. I can pass it into multiple models, use if-else statements, and create directional branching.
This is just a simple flow I built to generate a unique coding question. There are all kinds of components available; you can build your own agents, store conversation memory, and call different tools. I have many tutorials on this channel showing you how to create some pretty cool and advanced apps using LangFlow.
Now, the next topic on my list is more of a tool than a framework, but it's still extremely useful: Olama.
Olama is a free, open-source tool that allows you to download and run LLMs locally on your own computer. This means you can download the best open-source models and, rather than paying for something like ChatGPT or trusting your data with a third party, you can do it all locally.
Of course, you need some high-end hardware to run the best models, but it supports both CPU and GPU. Let me show you a quick demo of how it works, and then we can discuss more details.
I have Olama on my computer right now. You can see that I'm running it in the terminal, and I just executed `olama run llama 3.2`, one of the newer models I downloaded recently. Now, I can do something like "hello world," and I can chat with it just like I would with any other LLM.
If you're a developer, this actually exposes a REST API server, allowing you to send requests to it. This means from your Python code, JavaScript code, C++ code, or whatever you want, you can send a request to the server, run a model, and get the response back. You can use this in your own applications completely locally, or you could deploy it to a server or use it with Docker. There are many great things you can do with it.
You can download multiple models. For example, I have three models downloaded: Llama 3.2, Mistral, and Llama 2. There are hundreds of other models you could download and use with this tool. It's definitely worth checking out, especially if you have high-end hardware and want to take advantage of using LLMs locally.
Moving on, the next framework on my list is LlamaIndex.
This is quite similar to LangChain, but it is again a Python-based framework with a heavier focus on documents and data, specifically for building AI apps around enterprise-grade data. You can connect it to multiple data sources and perform tasks like document extraction. It has better text chunking and splitting capabilities.
When I've used LlamaIndex in the past, I noticed it was more centered around handling large amounts of data for your AI agents and the AI apps you're building. There are many other features, and while it can be a bit difficult to distinguish between LangChain and LlamaIndex, it really has a higher focus on data. Many of the other products they offer, like LlamaParse, are focused on this as well.
I have a video on YouTube that walks through how to use LlamaIndex and build an AI agent that can call multiple tools and use various datasets, like a Pandas DataFrame, to grab relevant information. It's worth checking out, especially if you have a lot of data you want to analyze with AI. You can find that video link in the description.
Now we move on to the last framework on my list, which is Hugging Face Transformers.
This is an open-source Python module that makes it significantly easier to work with transformer-based models in areas like natural language processing, audio processing, video processing, etc. It's much easier to use than frameworks like PyTorch or TensorFlow. If you want to use pre-trained models that already exist to solve a specific task, this is definitely the way to go.
It's less intensive than using an entire LLM, and if you want to perform a simple classification task or sentiment analysis, you can probably find a model that's already quite good at that from Hugging Face and then bring it into Hugging Face Transformers for use in your local Python code.
There are many different transformers you can run completely for free on your own machine. Let me give you a quick demo of what some Hugging Face code might look like so you can see how easy it is to use in Python.
Here are a few simple demos. You can see that I've created a sentiment analysis pipeline directly from Transformers, and I can classify a string of text to see what it was labeled as and what its score was.
Continuing, I can create a multitask pipeline where I have a summarizer and a translator. We summarize some text and then translate it to French. All the strings you see here are pre-trained and provided by Transformers, so you don't need to write the code yourself; it's all there for you to use.
I have some text that describes what Hugging Face is, and then I create a summary. After that, I create the translation and return both the summary and the translation.
If I run the code, it will take a moment to load the models, and then we can see the results. In the highlighted section, it says "Sentiment: Positive, Score: 99.9%." If we look down, we can see the summary and the translation of that summary in French.
Obviously, there's a lot more you can do here, but I just wanted to show you how easy it is to utilize these pre-trained models.
Anyways, guys, that's going to wrap up this super short video. If you found this valuable, make sure to leave a like. Don't forget to join the newsletter for free via the link in the description, and I will see you in another video. [Music]