|
| 1 | +# AI 相关工具 |
| 2 | + |
| 3 | +## 大语言模型平台 |
| 4 | + |
| 5 | +### OpenAI |
| 6 | +- **GPT-4**: 最先进的大语言模型 |
| 7 | +- **GPT-3.5-turbo**: 性价比高的对话模型 |
| 8 | +- **DALL-E**: 图像生成模型 |
| 9 | +- **Whisper**: 语音转文字模型 |
| 10 | +- **API 文档**: https://platform.openai.com/docs |
| 11 | + |
| 12 | +### Anthropic |
| 13 | +- **Claude**: 安全、有帮助的 AI 助手 |
| 14 | +- **Claude Instant**: 快速响应版本 |
| 15 | +- **API 文档**: https://docs.anthropic.com/ |
| 16 | + |
| 17 | +### Google |
| 18 | +- **PaLM**: Google 的大语言模型 |
| 19 | +- **Bard**: Google 的对话 AI |
| 20 | +- **Vertex AI**: 企业级 AI 平台 |
| 21 | + |
| 22 | +## 开发框架 |
| 23 | + |
| 24 | +### LangChain |
| 25 | +- **简介**: 大语言模型应用开发框架 |
| 26 | +- **功能**: 链式调用、记忆管理、工具集成 |
| 27 | +- **特点**: 模块化设计、丰富的集成 |
| 28 | +- **GitHub**: https://github.com/langchain-ai/langchain |
| 29 | +- **文档**: https://python.langchain.com/ |
| 30 | + |
| 31 | +### LlamaIndex |
| 32 | +- **简介**: 数据框架,用于 LLM 应用 |
| 33 | +- **功能**: 文档加载、索引、查询 |
| 34 | +- **特点**: 专注于数据集成 |
| 35 | +- **GitHub**: https://github.com/jerryjliu/llama_index |
| 36 | + |
| 37 | +### AutoGPT |
| 38 | +- **简介**: 自主 AI 代理框架 |
| 39 | +- **功能**: 任务分解、工具使用、自主执行 |
| 40 | +- **特点**: 实验性项目,展示 AI 代理潜力 |
| 41 | + |
| 42 | +## 向量数据库 |
| 43 | + |
| 44 | +### ChromaDB |
| 45 | +- **简介**: 开源向量数据库 |
| 46 | +- **特点**: 易用、轻量级、Python 原生 |
| 47 | +- **用途**: 文档检索、语义搜索 |
| 48 | +- **GitHub**: https://github.com/chroma-core/chroma |
| 49 | + |
| 50 | +### Pinecone |
| 51 | +- **简介**: 云原生向量数据库 |
| 52 | +- **特点**: 高性能、可扩展、托管服务 |
| 53 | +- **用途**: 生产环境向量搜索 |
| 54 | + |
| 55 | +### Weaviate |
| 56 | +- **简介**: 向量搜索引擎 |
| 57 | +- **特点**: GraphQL API、多模态支持 |
| 58 | +- **GitHub**: https://github.com/weaviate/weaviate |
| 59 | + |
| 60 | +## 模型社区 |
| 61 | + |
| 62 | +### Hugging Face |
| 63 | +- **简介**: AI 模型和数据集的中心 |
| 64 | +- **功能**: 模型托管、数据集分享、社区协作 |
| 65 | +- **特点**: 开源友好、资源丰富 |
| 66 | +- **网址**: https://huggingface.co/ |
| 67 | + |
| 68 | +### ModelScope |
| 69 | +- **简介**: 阿里巴巴的模型社区 |
| 70 | +- **特点**: 中文模型丰富、国内访问快 |
| 71 | +- **网址**: https://modelscope.cn/ |
| 72 | + |
| 73 | +## 快速原型工具 |
| 74 | + |
| 75 | +### Gradio |
| 76 | +- **简介**: 快速创建 AI Web 界面 |
| 77 | +- **特点**: 简单易用、支持多种输入输出 |
| 78 | +- **GitHub**: https://github.com/gradio-app/gradio |
| 79 | +- **文档**: https://gradio.app/ |
| 80 | + |
| 81 | +### Streamlit |
| 82 | +- **简介**: 数据科学 Web 应用框架 |
| 83 | +- **特点**: Python 原生、快速开发 |
| 84 | +- **GitHub**: https://github.com/streamlit/streamlit |
| 85 | + |
| 86 | +### Replicate |
| 87 | +- **简介**: 云平台,运行开源 AI 模型 |
| 88 | +- **特点**: 一键部署、API 调用 |
| 89 | +- **网址**: https://replicate.com/ |
| 90 | + |
| 91 | +## 提示工程工具 |
| 92 | + |
| 93 | +### Promptfoo |
| 94 | +- **简介**: 提示测试和评估工具 |
| 95 | +- **功能**: A/B 测试、批量评估 |
| 96 | +- **GitHub**: https://github.com/promptfoo/promptfoo |
| 97 | + |
| 98 | +### LangSmith |
| 99 | +- **简介**: LangChain 的调试和监控平台 |
| 100 | +- **功能**: 提示调试、性能监控 |
| 101 | +- **网址**: https://smith.langchain.com/ |
| 102 | + |
| 103 | +## 模型微调工具 |
| 104 | + |
| 105 | +### LoRA |
| 106 | +- **简介**: 低秩适应微调方法 |
| 107 | +- **特点**: 参数高效、资源需求低 |
| 108 | +- **实现**: PEFT 库 |
| 109 | + |
| 110 | +### QLoRA |
| 111 | +- **简介**: 量化 LoRA 微调 |
| 112 | +- **特点**: 内存效率更高 |
| 113 | +- **论文**: https://arxiv.org/abs/2305.14314 |
| 114 | + |
| 115 | +## 评估工具 |
| 116 | + |
| 117 | +### HELM |
| 118 | +- **简介**: 语言模型评估基准 |
| 119 | +- **特点**: 全面评估、标准化 |
| 120 | +- **GitHub**: https://github.com/stanford-crfm/helm |
| 121 | + |
| 122 | +### OpenLLM |
| 123 | +- **简介**: 开源 LLM 服务框架 |
| 124 | +- **功能**: 模型服务化、API 标准化 |
| 125 | +- **GitHub**: https://github.com/bentoml/OpenLLM |
| 126 | + |
| 127 | +## 学习资源 |
| 128 | + |
| 129 | +- [LangChain 教程](https://python.langchain.com/docs/tutorials/) |
| 130 | +- [Hugging Face 课程](https://huggingface.co/course) |
| 131 | +- [OpenAI Cookbook](https://github.com/openai/openai-cookbook) |
| 132 | +- [Prompt Engineering Guide](https://www.promptingguide.ai/) |
| 133 | + |
| 134 | +## 实用技巧 |
| 135 | + |
| 136 | +### 提示工程 |
| 137 | +```python |
| 138 | +# 基础提示模板 |
| 139 | +template = """ |
| 140 | +你是一个专业的{role}。 |
| 141 | +请{task}。 |
| 142 | +
|
| 143 | +输入: {input} |
| 144 | +输出: |
| 145 | +""" |
| 146 | + |
| 147 | +# 少样本学习 |
| 148 | +few_shot_prompt = """ |
| 149 | +示例1: |
| 150 | +输入: "今天天气怎么样?" |
| 151 | +输出: "今天天气晴朗,温度25度。" |
| 152 | +
|
| 153 | +示例2: |
| 154 | +输入: "明天会下雨吗?" |
| 155 | +输出: "明天可能有小雨,建议带伞。" |
| 156 | +
|
| 157 | +现在请回答: |
| 158 | +输入: "{user_input}" |
| 159 | +输出: |
| 160 | +""" |
| 161 | +``` |
| 162 | + |
| 163 | +### 向量检索 |
| 164 | +```python |
| 165 | +import chromadb |
| 166 | +from chromadb.config import Settings |
| 167 | + |
| 168 | +# 创建客户端 |
| 169 | +client = chromadb.Client(Settings( |
| 170 | + chroma_db_impl="duckdb+parquet", |
| 171 | + persist_directory="./chroma_db" |
| 172 | +)) |
| 173 | + |
| 174 | +# 创建集合 |
| 175 | +collection = client.create_collection("documents") |
| 176 | + |
| 177 | +# 添加文档 |
| 178 | +collection.add( |
| 179 | + documents=["文档内容1", "文档内容2"], |
| 180 | + metadatas=[{"source": "file1"}, {"source": "file2"}], |
| 181 | + ids=["id1", "id2"] |
| 182 | +) |
| 183 | + |
| 184 | +# 查询 |
| 185 | +results = collection.query( |
| 186 | + query_texts=["查询内容"], |
| 187 | + n_results=2 |
| 188 | +) |
| 189 | +``` |
0 commit comments