# llm-python
A set of instructional materials, code samples and Python scripts featuring LLMs (GPT etc) through interfaces like llamaindex, langchain, Chroma (Chromadb), Pinecone etc. Mainly used to store reference code for my LangChain tutorials on YouTube.
<!-- <img src="assets/youtube.png" width="50%" alt="LangChain youtube tutorials" /> -->
![LangChain youtube tutorials](assets/llmseries.png)
Learn LangChain from my YouTube channel (~8 hours of LLM hands-on building tutorials); Each lesson is accompanied by the corresponding code in this repo and is designed to be self-contained -- while still focused on some key concepts in LLM (large language model) development and tooling.
Feel free to pick and choose your starting point based on your learning goals:
| Part | LLM Tutorial | Link | Video Duration |
| --- | --- | --- | --- |
| 1 | OpenAI tutorial and video walkthrough | [Tutorial Video](https://youtu.be/skw-togjY7Q) | 26:56 |
| 2 | LangChain + OpenAI tutorial: Building a Q&A system w/ own text data | [Tutorial Video](https://youtu.be/DYOU_Z0hAwo) | 20:00 |
| 3 | LangChain + OpenAI to chat w/ (query) own Database / CSV | [Tutorial Video](https://youtu.be/Fz0WJWzfNPI) | 19:30 |
| 4 | LangChain + HuggingFace's Inference API (no OpenAI credits required!) | [Tutorial Video](https://youtu.be/dD_xNmePdd0) | 24:36 |
| 5 | Understanding Embeddings in LLMs | [Tutorial Video](https://youtu.be/6uyBc0jm1xQ) | 29:22 |
| 6 | Query any website with LLamaIndex + GPT3 (ft. Chromadb, Trafilatura) | [Tutorial Video](https://youtu.be/6K1lyyzpxtk) | 11:11 |
| 7 | Locally-hosted, offline LLM w/LlamaIndex + OPT (open source, instruction-tuning LLM) | [Tutorial Video](https://youtu.be/qAvHs6UNb2k) | 32:27 |
| 8 | Building an AI Language Tutor: Pinecone + LlamaIndex + GPT-3 + BeautifulSoup | [Tutorial Video](https://youtu.be/k8G1EDZgF1E) | 51:08 |
| 9 | Building a queryable journal 馃挰 w/ OpenAI, markdown & LlamaIndex 馃 | [Tutorial Video](https://youtu.be/OzDhJOR5IfQ) | 40:29 |
| 10 | Making a Sci-Fi game w/ Cohere LLM + Stability.ai: Generative AI tutorial | [Tutorial Video](https://youtu.be/uR93yTNGtP4) | 1:02:20 |
| 11 | GPT builds entire party invitation app from prompt (ft. SMOL Developer) | [Tutorial Video](https://www.youtube.com/watch?v=Ll_VIsIjuFg) | 41:33 |
| 12 | A language for LLM prompt design: Guidance | [Tutorial Video](https://youtu.be/k4Ejc3bLQiU) | 43:15 |
| 13 | You should use LangChain's Caching! | [Tutorial Video](https://youtu.be/Uk_SJSnQRU8) | 25:37 |
| 14 | Build Chat AI apps with Steamlit + LangChain | [Tutorial Video](https://youtu.be/7QR6hXx_Nms) | 32:11 |
The full lesson playlist can be found [here](https://www.youtube.com/playlist?list=PLXsFtK46HZxUQERRbOmuGoqbMD-KWLkOS).
### Quick Start
1. Clone this repo
2. Install requirements: `pip install -r requirements.txt`
3. Some sample data are provided to you in the `news` foldeer, but you can use your own data by replacing the content (or adding to it) with your own text files.
4. Create a `.env` file which contains your OpenAI API key. You can get one from [here](https://beta.openai.com/). `HUGGINGFACEHUB_API_TOKEN` and `PINECONE_API_KEY` are optional, but they are used in some of the lessons.
- [Lesson 10](./11_worldbuilding.py) uses Cohere and Stability AI, both of which offers a free tier (no credit card required). You can add the respective keys as `COHERE_API_KEY` and `STABILITY_API_KEY` in the `.env` file.
The `.env` file should look like this:
```
OPENAI_API_KEY=your_api_key_here
# optionals (not required for most of the series)
HUGGINGFACEHUB_API_TOKEN=your_api_token_here
PINECONE_API_KEY=your_api_key_here
```
HuggingFace and Pinecone are optional but is recommended if you want to use the Inference API and explore those models outside of the OpenAI ecosystem. This is demonstrated in Part 3 of the tutorial series.
5. Run the examples in any order you want. For example, `python 6_team.py` will run the website Q&A example, which uses GPT-3 to answer questions about a company and the team of people working at Supertype.ai. Watch the corresponding video to follow along each of the examples.
### Dependencies
> 馃挕 Thanks to the work of @VanillaMacchiato, this project is updated as of **2023-06-30** to use the latest version of LlamaIndex (0.6.31) and LangChain (0.0.209). Installing the dependencies should be as simple as `pip install -r requirements.txt`. If you encounter any issues, please let me know.
>
If you're watching the LLM video tutorials, they may have very minor differences (typically 1-2 lines of code that needs to be changed) from the code in this repo since these videos have been released with the respective versions at the time of recording (LlamaIndex 0.5.7 and LangChain 0.0.157). Please refer to the code in this repo for the latest version of the code.
I will try to keep this repo up to date with the latest version of the libraries, but if you encounter any issues, please: (1) raise a discussion through Issues or (2) volunteer a PR to update the code.
NOTE: `triton` package is supported only for the **x86_64** architecture. If you have problems with installing it, see the [triton compatibility guide](https://github.com/openai/triton?tab=readme-ov-file#compatibility). Specifically, errors like ```ERROR: Could not find a version that satisfies the requirement triton (from versions: none)
ERROR: No matching distribution found for triton```.
`uname -p` should give you the processor's name.
### Mentorship and Support
I run a mentorship program under [Supertype Fellowship](https://fellowship.supertype.ai). The program is self-paced and free, with a community of other learners and practitioners around the world (English-speaking). You can optionally book a 1-on-1 session with my team of mentors to help you through video tutoring and code reviews.
### License
MIT 漏 [Supertype](https://supertype.ai) 2024
没有合适的资源?快使用搜索试试~ 我知道了~
大型语言模型 (LLM) 教程和示例脚本,ft. langchain、openai、llamaindex、gpt、chromad...
共43个文件
py:18个
txt:9个
json:7个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 201 浏览量
2024-11-24
17:21:44
上传
评论
收藏 1.73MB ZIP 举报
温馨提示
llm-python一组通过 llamaindex、langchain、Chroma(Chromadb)、Pinecone 等接口提供的具有 LLM(GPT 等)的教学材料、代码示例和 Python 脚本。主要用于存储我在 YouTube 上的 LangChain 教程的参考代码。从我的 YouTube 频道学习 LangChain(约 8 小时的 LLM 动手构建教程)每节课都附带此 repo 中的相应代码,并且设计为独立的 - 同时仍然专注于 LLM(大型语言模型)开发和工具中的一些关键概念。根据您的学习目标随意选择您的起点部分 法学硕士辅导 关联 视频时长1 OpenAI 教程和视频演练 教程视频 26:562 LangChain + OpenAI 教程使用自己的文本数据构建问答系统 教程视频 20:003 LangChain + OpenAI 使用自己的数据库/CSV 进行聊天(查询) 教程视频 19:304 LangChain + HuggingFace 的推理 API(无需 OpenAI 积分!) 教程视频 24:365 理解 LLM 中的嵌入 教
资源推荐
资源详情
资源评论
收起资源包目录
大型语言模型 (LLM) 教程和示例脚本,ft. langchain、openai、llamaindex、gpt、chromadb 和 pinecone.zip (43个子文件)
smol-prompt
prompt.md 1KB
11_worldbuilding.py 9KB
newspieces.json 491B
14_streamlit.py 899B
标签.txt 47B
assets
llmseries.png 466KB
youtube.png 334KB
10_journal.py 3KB
book
wanderer.html.txt 4KB
wande002.html.txt 3KB
wande004.html.txt 4KB
wande003.html.txt 3KB
12_guidance_roles.py 970B
LICENSE 1KB
03_db.py 633B
12_guidance_syntax.py 2KB
audio
donda.mp3 729KB
07_custom_opt.json 25KB
storage
index_store.json 1003B
docstore.json 29KB
vector_store.json 304KB
graph_store.json 18B
news
summary.txt 8KB
result.txt 14KB
资源内容.txt 963B
13_caching_sqlite.py 1KB
07_custom.py 4KB
01_qna.py 1KB
06_team.py 1019B
04_csv.py 705B
workshop
Generative_AI_Template_01.ipynb 50KB
Generative_AI_Template_02.ipynb 29KB
requirements.txt 3KB
02_llama.py 1KB
.gitignore 60B
00_start.py 438B
02b_llama_chroma.py 1KB
index.json 228KB
05_hf.py 1008B
README.md 6KB
13_caching_memory.py 874B
08_openai.py 910B
09_pinecone.py 4KB
共 43 条
- 1
资源评论
徐浪老师
- 粉丝: 8090
- 资源: 7772
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- (前端面试题+前端学习+面试指南) 一份涵盖大部分前端工程师所需要掌握的核心知识.zip
- 2023-04-06-项目笔记 - 第三百二十八阶段 - 4.4.2.326全局变量的作用域-326 -2025.11.25
- editor是由web前端研发部开发的所见即所得富文本web编辑器.zip
- Hybrid开发,基于h5+ API和mui前端框架,以及seajs模块化开发的一套跨平台APP开发框架.zip
- 计算机组成原理(COD)综合实验,带三级浮点流水的五级RISCV流水线.zip
- sm2解密出Invalid point encoding问题的解决办法
- 乐跑刷数据代码 (1).exe
- 计算机科学与工程学院15级大三短学期JAVA课设-虚拟校园系统.zip
- 备战2025电赛03-驱动1.8寸TFT-LCD屏幕
- 一个基于Java SE的跳跃忍者游戏.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功