← 开源
onlyphantom

llm-python

Large Language Models (LLMs) tutorials & sample scripts, ft. langchain, openai, llamaindex, gpt, chromadb & pinecone

TutorialsTool-specific tutorialsJupyter Notebook
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
930
Star
314
Fork
+-1
本周
6
贡献者
创建于 2023-04-06 · 更新于 2026-10-13 · 今日第 12572 名
主要开发者
onlyphantomAndreChristiantovitoghif

onlyphantom/llm-python 排名第 12,572,有 930 个星标。

同类别比较

onlyphantom/llm-python 排名第 12,572,此处有 8 个同类条目;empathy87/The-Elements-of-Statistical-Learning-Python-Notebooks 排名第 12,568。

同类别比较
名称排名指标
philtabor/Youtube-Code-Repository12,549
语言:
Python
星标数:
933
分叉数:
488
简介:
Repository for most of the code from my YouTube channel
shervinea/cheatsheet-translation12,552
星标数:
933
分叉数:
333
简介:
Translation of VIP cheatsheets for Machine Learning Deep Learning, and Artificial Intelligence
the-full-stack/course-gitbook12,558
星标数:
932
分叉数:
193
简介:
Full Stack Deep Learning Online Course
empathy87/The-Elements-of-Statistical-Learning-Python-Notebooks12,568
语言:
Jupyter Notebook
星标数:
930
分叉数:
284
简介:
A series of Python Jupyter notebooks that help you better understand "The Elements of Statistical Learning" book
PacktPublishing/Modern-Computer-Vision-with-PyTorch12,596
语言:
Jupyter Notebook
星标数:
925
分叉数:
380
简介:
Modern Computer Vision with PyTorch, published by Packt
moemen95/Pytorch-Project-Template12,610
语言:
Python
星标数:
923
分叉数:
186
简介:
A scalable template for PyTorch projects, with examples in Image Segmentation, Object classification, GANs and Reinforcement Learning.
lukaemon/Coursera-ML-AndrewNg12,615
语言:
Jupyter Notebook
星标数:
922
分叉数:
353
简介:
use numpy, scipy, and tensorflow to implement these basic ML model and learning algorithm
huggingface/mcp-course12,623
语言:
MDX
星标数:
921
分叉数:
261
关键参数与规格
关键参数与规格
参数值
语言Jupyter Notebook
类别Tutorials
子类别Tool-specific tutorials
关键词RAG
星标数930
分叉数314
贡献者6
创建日期2023-04-06
更新日期2026-10-13
1 天星标数0
7 天星标数-1
排名12,572
上次排名12,491
排名变化-81
7 天星标排名17,435
上次 7 天星标排名17,403
7 天星标排名变化-32
总星标排名11,776
上次总星标排名11,762
总星标排名变化-14
国家Indonesia
README 摘录

llm-python A set of instructional materials, code samples and Python scripts featuring LLMs (GPT etc) through interfaces like llamaindex, LangChain, OpenAI's Agent SDK, Chroma (Chromadb), Pinecone etc. The code examples are aimed at helping you learn how to build LLM applications and Agents using Python. The code is designed to be self-contained and singularly focused, so you can pick and choose the usage patterns most relevant to your needs. Many examples have accompanying videos on my YouTube channel

. ) | Tutorial Video | 24:36 | | 5 | Understanding Embeddings in LLMs | Tutorial Video | 29:22 | | 6 | Query any website with LLamaIndex + GPT3 (ft. Chromadb, Trafilatura) | Tutorial Video | 11:11 | | 7 | Locally-hosted, offline LLM w/LlamaIndex + OPT (open source, instruction-tuning LLM) | Tutorial Video | 32:27 | | 8 | Building an AI Language Tutor: Pinecone + LlamaIndex + GPT-3 + BeautifulSoup | Tutorial Video | 51:08 | | 9 | Building a queryable journal 💬 w/ OpenAI, markdown & LlamaIndex 🦙 | Tutorial Video | 40:29 | | 10 | Making a Sci-Fi game w/ Cohere

LLM + Stability. ai: Generative AI tutorial | Tutorial Video | 1:02:20 | | 11 | GPT builds entire party invitation app from prompt (ft. SMOL Developer) | Tutorial Video | 41:33 | | 12 | A language for LLM prompt design: Guidance | Tutorial Video | 43:15 | | 13 | You should use LangChain's Caching! | Tutorial Video | 25:37 | | 14 | Build Chat AI apps with Steamlit + LangChain | Tutorial Video | 32:11 | The full lesson playlist can be found here. Updates Multi-Agent and Agentic Patterns Update: May 3rd 2025 I've

pushed 6 new scripts to the repo, to , intended to be used as code reference to this public course: Agentic Patterns: two day workshop These additions to the repo illustrates 6 key patterns in building AI Agents (especially multi-agent systems) and use the latest version of OpenAI's Agent SDK ( ) as of May 2025. These 6 Agentic Patterns are (in order of appearance in this repo): 1 The Hand-off and Delegation Pattern ( ) 2 The Tool-Use and Function Calling

Pattern ( ) 3 The Deterministic and Sequential Chain Pattern ( ) 4 The Judge and Critic Pattern ( ) 5 The Parallelization Pattern ( ) 6 The Guardrails Pattern ( ) Update: Feb 5th 2025 I've pushed 4 new scripts to the repo, to , which are intended to be used as code reference to this public course: Building search engines in the age of AI: full course materials (free) Building search engines in the age of AI: two day workshop Additionally, I'm now also hosting example code in this

repo for the following Generative AI Series by Sectors. Generative AI for Finance: An overview of designing Generative AI systems for the finance industry and the motivation for retrieval-augmented generation (RAG) systems. Tool-Use Retrieval Augmented Generation (RAG): Practical guide to building RAG systems leveraging on information retrieval tools (known as "tool-use" or "function-calling" in LLM) 3. Structured Output from AIs: From using Generative AI to extract from unstructured data or perform actions like database queries, API

calls, JSON parsing and more, we need schema and structure in the AI's output. Tool-use ReAct Agents w/ Streaming

常见问题

记录了多少星标和分叉?

onlyphantom/llm-python 有 930 个星标和 314 个分叉。

仓库排名是多少?

onlyphantom/llm-python 排名第 12,572。

记录的语言和类别是什么?

onlyphantom/llm-python 有 930 个星标,语言为 Jupyter Notebook,类别为 Tutorials。

哪个仓库排名最接近?

onlyphantom/llm-python 与 empathy87/The-Elements-of-Statistical-Learning-Python-Notebooks 比较,后者排名第 12,568,有 930 个星标。

README

llm-python

A set of instructional materials, code samples and Python scripts featuring LLMs (GPT etc) through interfaces like llamaindex, LangChain, OpenAI's Agent SDK, Chroma (Chromadb), Pinecone etc.

The code examples are aimed at helping you learn how to build LLM applications and Agents using Python. The code is designed to be self-contained and singularly focused, so you can pick and choose the usage patterns most relevant to your needs.

Many examples have accompanying videos on my YouTube channel.

Learn LangChain from my YouTube channel (~9 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 26:56
2 LangChain + OpenAI tutorial: Building a Q&A system w/ own text data Tutorial Video 20:00
3 LangChain + OpenAI to chat w/ (query) own Database / CSV Tutorial Video 19:30
4 LangChain + HuggingFace's Inference API (no OpenAI credits required!) Tutorial Video 24:36
5 Understanding Embeddings in LLMs Tutorial Video 29:22
6 Query any website with LLamaIndex + GPT3 (ft. Chromadb, Trafilatura) Tutorial Video 11:11
7 Locally-hosted, offline LLM w/LlamaIndex + OPT (open source, instruction-tuning LLM) Tutorial Video 32:27
8 Building an AI Language Tutor: Pinecone + LlamaIndex + GPT-3 + BeautifulSoup Tutorial Video 51:08
9 Building a queryable journal 💬 w/ OpenAI, markdown & LlamaIndex 🦙 Tutorial Video 40:29
10 Making a Sci-Fi game w/ Cohere LLM + Stability.ai: Generative AI tutorial Tutorial Video 1:02:20
11 GPT builds entire party invitation app from prompt (ft. SMOL Developer) Tutorial Video 41:33
12 A language for LLM prompt design: Guidance Tutorial Video 43:15
13 You should use LangChain's Caching! Tutorial Video 25:37
14 Build Chat AI apps with Steamlit + LangChain Tutorial Video 32:11

The full lesson playlist can be found here.

Updates

Multi-Agent and Agentic Patterns Update: May 3rd 2025

I've pushed 6 new scripts to the repo, 19_agents_handsoff.py to 24_agents_guardrails.py, intended to be used as code reference to this public course:

These additions to the repo illustrates 6 key patterns in building AI Agents (especially multi-agent systems) and use the latest version of OpenAI's Agent SDK (openai-agents) as of May 2025.

These 6 Agentic Patterns are (in order of appearance in this repo):

  • 1 The Hand-off and Delegation Pattern (19_agents_handsoff.py)
  • 2 The Tool-Use and Function Calling Pattern (20_agents_tooluse.py)
  • 3 The Deterministic and Sequential Chain Pattern (21_agents_deterministic.py)
  • 4 The Judge and Critic Pattern (22_agents_critic.py)
  • 5 The Parallelization Pattern (23_agents_parallelization.py)
  • 6 The Guardrails Pattern (24_agents_guardrails.py)

Update: Feb 5th 2025

I've pushed 4 new scripts to the repo, 15_sql.py to 18_chroma.py, which are intended to be used as code reference to this public course:

Additionally, I'm now also hosting example code in this repo for the following Generative AI Series by Sectors.

  1. Generative AI for Finance: An overview of designing Generative AI systems for the finance industry and the motivation for retrieval-augmented generation (RAG) systems.

  2. Tool-Use Retrieval Augmented Generation (RAG): Practical guide to building RAG systems leveraging on information retrieval tools (known as "tool-use" or "function-calling" in LLM)

  3. Structured Output from AIs: From using Generative AI to extract from unstructured data or perform actions like database queries, API calls, JSON parsing and more, we need schema and structure in the AI's output.

  4. Tool-use ReAct Agents w/ Streaming: Updated for LangChain v0.3.2, we explore streaming, LCEL expressions and ReAct agents following the most up-to-date practices for creating conversational AI agents.

  5. Conversational Memory AI Agents: Updated for LangChain v0.2.3, we dive into Creating AI Agents with Conversational Memory

Both of these series are public and free to access. The code in this repo is intended to be used as a reference for these courses.

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. HUGGINGFACEHUB_API_TOKEN and PINECONE_API_KEY are optional, but they are used in some of the lessons.
    • Lesson 10 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.
    • Some of the most advanced examples that feature tool-use, function-calling Agents will require you working with a real-world financial data API. My team at Supertype and I built a LLM-first financial API platform called Sectors. You can register for a free account, read our API documentation and Generative AI 5-course series to learn how to use the API to build sophisticated LLM application. Examples of these applications are all in the repo.

Your .env file should look like this:

# recommended
OPENAI_API_KEY=...

# optionals but useful
SECTORS_API_KEY=...
GROQ_API_KEY=...

# completely optional (pick and choose based on your needs)
HUGGINGFACEHUB_API_TOKEN=...
PINECONE_API_KEY=...
DEEPSEEK_API_KEY=...
COHERE_API_KEY=...
STABILITY_API_KEY=...

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.

  1. 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. 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. 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 2024

排名相邻
同类项目