# openai-quickstart **Repository Path**: geektime-geekbang_admin/openai-quickstart ## Basic Information - **Project Name**: openai-quickstart - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2025-05-19 - **Last Updated**: 2025-07-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 大模型(LLMs)应用开发快速入门指南 ![GitHub stars](https://img.shields.io/github/stars/DjangoPeng/openai-quickstart?style=social) ![GitHub forks](https://img.shields.io/github/forks/DjangoPeng/openai-quickstart?style=social) ![GitHub watchers](https://img.shields.io/github/watchers/DjangoPeng/openai-quickstart?style=social) ![GitHub repo size](https://img.shields.io/github/repo-size/DjangoPeng/openai-quickstart) ![GitHub language count](https://img.shields.io/github/languages/count/DjangoPeng/openai-quickstart) ![GitHub top language](https://img.shields.io/github/languages/top/DjangoPeng/openai-quickstart) ![GitHub last commit](https://img.shields.io/github/last-commit/DjangoPeng/openai-quickstart?color=red)


English | 中文

本项目旨在为所有对大型语言模型及其在生成式人工智能(AIGC)场景中应用的人们提供一站式学习资源。通过提供理论基础,开发基础,和实践示例,该项目对这些前沿主题提供了全面的指导。 ## 特性 - **大语言模型的理论和开发基础**:深入探讨BERT和GPT系列等大型语言模型的内部工作原理,包括它们的架构、训练方法、应用等。 - **基于OpenAI的二次开发**:OpenAI的Embedding、GPT-3.5、GPT-4模型的快速上手和应用,以及函数调用(Function Calling)和ChatGPT插件等最佳实践 - **使用LangChain进行GenAI应用开发**:通过实例和教程,利用LangChain开发GenAI应用程序,展示大型语言模型(AutoGPT、RAG-chatbot、机器翻译)的实际应用。 - **LLM技术栈与生态**:数据隐私与法律合规性,GPU技术选型指南,Hugging Face快速入门指南,ChatGLM的使用。 ## 拉取代码 你可以通过克隆此仓库到你的本地机器来开始: ```shell git clone https://github.com/DjangoPeng/openai-quickstart.git ``` 然后导航至目录,并按照单个模块的指示开始操作。 ## 搭建开发环境 本项目使用 Python v3.10 开发,完整 Python 依赖软件包见[requirements.txt](requirements.txt)。 关键依赖的官方文档如下: - Python 环境管理 [Miniconda](https://docs.conda.io/projects/miniconda/en/latest/) - Python 交互式开发环境 [Jupyter Lab](https://jupyterlab.readthedocs.io/en/stable/getting_started/installation.html) - 大模型应用开发框架 [LangChain](https://python.langchain.com/docs/get_started/installation) - [OpenAI Python SDK ](https://github.com/openai/openai-python?tab=readme-ov-file#installation) **以下是详细的安装指导(以 Ubuntu 操作系统为例)**: ### 安装 Miniconda ```shell mkdir -p ~/miniconda3 wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3 rm -rf ~/miniconda3/miniconda.sh ``` 安装完成后,建议新建一个 Python 虚拟环境,命名为 `langchain`。 ```shell conda create -n langchain python=3.10 # 激活环境 conda activate langchain ``` 之后每次使用需要激活此环境。 ### 安装 Python 依赖软件包 ```shell pip install -r requirements.txt ``` ### 配置 OpenAI API Key 根据你使用的命令行工具,在 `~/.bashrc` 或 `~/.zshrc` 中配置 `OPENAI_API_KEY` 环境变量: ```shell export OPENAI_API_KEY="xxxx" ``` ### 安装和配置 Jupyter Lab 上述开发环境安装完成后,使用 Miniconda 安装 Jupyter Lab: ```shell conda install -c conda-forge jupyterlab ``` 使用 Jupyter Lab 开发的最佳实践是后台常驻,下面是相关配置(以 root 用户为例): ```shell # 生成 Jupyter Lab 配置文件, jupyter lab --generate-config ``` 打开上面执行输出的`jupyter_lab_config.py`配置文件后,修改以下配置项: ```python c.ServerApp.allow_root = True # 非 root 用户启动,无需修改 c.ServerApp.ip = '*' ``` 使用 nohup 后台启动 Jupyter Lab ```shell $ nohup jupyter lab --port=8000 --NotebookApp.token='替换为你的密码' --notebook-dir=./ & ``` Jupyter Lab 输出的日志将会保存在 `nohup.out` 文件(已在 .gitignore中过滤)。 ## 课程大纲 完整文档请移步:[大模型(LLMs)应用开发快速入门指南课程大纲](docs/schedule.md#课程表) ## 贡献 贡献是使开源社区成为学习、激励和创造的惊人之处。非常感谢你所做的任何贡献。如果你有任何建议或功能请求,请先开启一个议题讨论你想要改变的内容。 Github ## 许可证 该项目根据Apache-2.0许可证的条款进行许可。详情请参见[LICENSE](LICENSE)文件。 ## 联系 Django Peng - pjt73651@email.com 项目链接: https://github.com/DjangoPeng/openai-quickstart ## ⭐️⭐️ Star History Chart