Langroid: Chat to a CSV file using Mixtral (via Ollama)

preview_player
Показать описание
In this video, we'll learn about Langroid, an interesting LLM library that amongst other things, lets us query tabular data, including CSV files! It delegates part of the work to an LLM of your choice under the hood, and I decided to take it for a spin using Kaggle's world population dataset. We give it three different questions to answer and then I write Pandas code to check the results. The results are sometimes good, sometimes downright hallucinations!

#pandas #llm #mixtral #litellm #ollama

Resources
Рекомендации по теме
Комментарии
Автор

This kind of pandas test looks like a great way to look at and compare various models, for example comparing the same automated test and collecting results to compare.

geoffreygordonashbrook
Автор

Nice video (as always!)

Shame it was hallucinating results - would be interesting to get to the bottom of that, perhaps with other csv datasets and/or debugging what langdroid is actually doing.

nmstoker
Автор

Another issue i think is code readability, the code for calculating population change generated by LLM is a bit unnecessarily complex, maybe because its trying to fit the whole operation in a single its impressive how its actually able to understand Column/feature meaning 👏

AshishBangwal
Автор

works good just cant get the doc chat agent working with a local llm any ideas on how i could fix that

TruthFearless
Автор

Which of the many do you recommend? Langgraph?

wryltxw
Автор

import langroid.language_models as lm → ModuleNotFoundError: No module named 'langroid.language_models'; 'langroid' is not a package
:(

philippechassany
Автор

Is langroid only good for querying data? Surely, you can define new tools, so that it can do anything any of the other frameworks can do? Generating code etc.

nickmills
Автор

🎯 Key Takeaways for quick navigation:

00:00 📚 *Introduction to Langroid*
- Langroid is an LLM library for querying tabular data like CSV files.
- Setting up Langroid involves configuring the LLM, initializing the agent, and creating a task.
- Quick check with a question about pandas to ensure Langroid is working.
01:11 🗃️ *Loading and Exploring CSV Data*
- Importing a world population dataset from Kaggle using pandas.
- Displaying and exploring the dataset columns and content.
- Configuring Langroid to query the CSV file for specific information.
02:22 ⚙️ *Running Langroid Tasks and Analyzing Results*
- Creating a task to find the top five countries by population.
- Discussing the iteration limit and the time it takes for Mixt to load.
- Analyzing Langroid's generated code and results for the top countries.
03:30 📈 *Comparing Langroid's Answers with Pandas*
- Comparing Langroid's answer for the biggest population increase with a manual pandas approach.
- Highlighting discrepancies in the results and questioning Langroid's accuracy.
- Discussing potential reasons for incorrect Langroid answers.
04:53 🌐 *Grouping and Aggregating Data with Langroid*
- Formulating a complex question about the average, minimum, and maximum area for each continent.
- Running Langroid to answer the question and examining the results.
- Contrasting Langroid's answers with manually obtained accurate results using pandas.

Made with HARPA AI

onhazrat