开启左侧

【LangChain入门 1】安装

[复制链接]
TMy_专属你的t 发表于 2025-9-7 23:37:45 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题
文章目录



本学习系列以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
复制代码
下载过程可能会有点慢,耐心等待接口。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

发布主题
阅读排行更多+

Powered by Discuz! X3.4© 2001-2013 Discuz Team.( 京ICP备17022993号-3 )