Introduction to the llm-python Project
The llm-python project is a comprehensive collection of instructional resources, code samples, and Python scripts that leverage Large Language Models (LLMs) such as GPT through various interfaces including llamaindex, LangChain, Chroma (Chromadb), and Pinecone. This initiative primarily serves as a repository for reference code utilized in LangChain tutorials available on YouTube.
Learn LangChain on YouTube
A series of LangChain tutorials is available on YouTube, encompassing approximately 8 hours of hands-on lessons for building with LLMs. Each tutorial is self-contained, focusing on key concepts in the development and tooling of LLMs. The corresponding code for these lessons is available in the llm-python repository. Learners can select specific lessons according to their goals, benefiting from a structured learning path.
Tutorial Breakdown
The tutorials are divided into multiple parts, each accessible via distinct YouTube videos:
- Part 1: An introduction to OpenAI and walkthrough video (26:56)
- Part 2: Building a Q&A system using LangChain and OpenAI with personal text data (20:00)
- Part 3: Interaction with databases/CSV files using LangChain + OpenAI (19:30)
- Part 4: Utilizing HuggingFace's Inference API in place of OpenAI credits (24:36)
- Part 5: Understanding embeddings in LLMs (29:22)
- Part 6: Querying websites with LLamaIndex and GPT3 (11:11)
- Part 7: Offline LLM hosting with LlamaIndex + OPT (32:27)
- Part 8: Constructing an AI language tutor using Pinecone, LlamaIndex, and GPT-3 (51:08)
- Part 9: Developing a queryable journal using OpenAI and markdown (40:29)
- Part 10: Crafting a Sci-Fi game with Cohere LLM and Stability.ai (1:02:20)
- Part 11: Building a full-fledged app with GPT from a simple prompt (41:33)
- Part 12: Language for LLM prompt design (43:15)
- Part 13: Using LangChain's caching capabilities (25:37)
- Part 14: Creating Chat AI apps with Streamlit + LangChain (32:11)
The complete lesson playlist can be accessed here.
Getting Started
- Cloning the Repository: Start by cloning the llm-python repository.
- Installation Requirements: Install the required packages with
pip install -r requirements.txt
. - Data Usage: Sample data is available in the
news
folder, although users can replace or augment this with their own text files. - Create a
.env
File: Include your OpenAI API key in the.env
file. Optional keys for HuggingFace and Pinecone can also be inserted for additional functionalities in certain lessons.
Example .env
configuration:
OPENAI_API_KEY=your_api_key_here
# Optional (not mandatory for most lessons)
HUGGINGFACEHUB_API_TOKEN=your_api_token_here
PINECONE_API_KEY=your_api_key_here
- Running Examples: Execute any example script as needed. For instance,
python 6_team.py
demonstrates a website Q&A scenario utilizing GPT-3.
Dependencies Update
The llm-python project was updated as of June 30, 2023, to include the latest versions of LlamaIndex (0.6.31) and LangChain (0.0.209). Installing dependencies is straightforward using pip install -r requirements.txt
. For those watching YouTube tutorials, note that minor code discrepancies might exist owing to version differences during recordings. Always refer to this repository for the most up-to-date code.
Mentorship and Support
The project leader offers a mentorship program via Supertype Fellowship. This self-paced, free program includes a community of English-speaking learners and professionals. Optional 1-on-1 sessions with mentors are available for further guidance and code reviews.
Licensing
This project is licensed under the MIT License by Supertype, 2024.