AI创想

标题: 【LangChain入门 1】安装 [打印本页]

作者: TMy_专属你的t    时间: 2025-9-7 23:37
标题: 【LangChain入门 1】安装
文章目录



本学习系列以Ollama推理后端作为大语言模型,展开对LangChain框架的入门学习。 模型采用deepseek-r1:7b。
毕竟是免费开源的,下载过程耐心等待即可。
如果可以连接外网,也可以通过OpenAI,来建立LLM模型
一、安装LangChain

其中 langchain_chroma 是向量数据库,将转成的向量数据库存在Chroma里
  1. pip install langchain -i https://pypi.tuna.tsinghua.edu.cn/simple
  2. pip install langchain_community -i https://pypi.tuna.tsinghua.edu.cn/simple
  3. pip install langchain_ollama -i https://pypi.tuna.tsinghua.edu.cn/simple
  4. pip install langchain_chroma -i https://pypi.tuna.tsinghua.edu.cn/simple
  5. pip install"langserve[all]"-i https://pypi.tuna.tsinghua.edu.cn/simple
复制代码
二、安装Ollama

打开Ollama官网
https://ollama.com/download
找到Linux的下载链接


运行链接
  1. curl-fsSL https://ollama.com/install.sh |sh
复制代码
三、Ollama下载DeepSeekR1-7b模型

玩具版本,就用7b执行
  1. ollama run deepseek-r1
复制代码
下载过程可能会有点慢,耐心等待接口。




欢迎光临 AI创想 (http://llms-ai.com/) Powered by Discuz! X3.4