在linux上部署本地的deerflow--希望我顺利

linux版本:ubuntu 20.04

https://github.com/bytedance/deer-flow/blob/main/README_zh.md

推荐工具。uv: 简化 Python 环境和依赖管理。uv会自动在根目录创建虚拟环境并为您安装所有必需的包—无需手动安装 Python 环境。nvm: 轻松管理多个 Node.js 运行时版本。pnpm: 安装和管理 Node.js 项目的依赖。

前期准备

uv安装

参考:Installation | uv

curl -LsSf https://astral.sh/uv/install.sh | sh

yang@ubuntu:~/01-tools$ curl -LsSf https://astral.sh/uv/install.sh | sh
downloading uv 0.7.5 x86_64-unknown-linux-gnu
no checksums to verify
installing to /home/yang/.local/bin
  uv
  uvx
everything's installed!

pip install uv

yang@ubuntu:~/01-tools$ pip install uv
Defaulting to user installation because normal site-packages is not writeable
Collecting uv
  Downloading uv-0.7.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (11 kB)
Downloading uv-0.7.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.4 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 17.4/17.4 MB 3.6 MB/s eta 0:00:00
Installing collected packages: uv
Successfully installed uv-0.7.5

[notice] A new release of pip is available: 24.3.1 -> 25.0.1
[notice] To update, run: python3 -m pip install --upgrade pip

安装nvm

https://github.com/nvm-sh/nvm

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash

yang@ubuntu:~/01-tools$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 16631  100 16631    0     0  12608      0  0:00:01  0:00:01 --:--:-- 12608
=> Downloading nvm from git to '/home/yang/.nvm'
=> 正克隆到 '/home/yang/.nvm'...
remote: Enumerating objects: 382, done.
remote: Counting objects: 100% (382/382), done.
remote: Compressing objects: 100% (325/325), done.
remote: Total 382 (delta 43), reused 179 (delta 29), pack-reused 0 (from 0)
接收对象中: 100% (382/382), 385.06 KiB | 755.00 KiB/s, 完成.
处理 delta 中: 100% (43/43), 完成.
* (头指针分离于 FETCH_HEAD)
  master
=> Compressing and cleaning up git repository

=> Appending nvm source string to /home/yang/.bashrc
=> Appending bash_completion source string to /home/yang/.bashrc
=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

 

Verify Installation

To verify that nvm has been installed, do:

command -v nvm

which should output nvm if the installation was successful. Please note that which nvm will not work, since nvm is a sourced shell function, not an executable binary.

Note: On Linux, after running the install script, if you get nvm: command not found or see no feedback from your terminal after you type command -v nvm, simply close your current terminal, open a new terminal, and try verifying again.

安装nodejs

nvm install 22

参考「Linux」通过nvm安装npm和nodejs-CSDN博客

安装pnpm

https://pnpm.io/zh/installation

输入命令:curl -fsSL https://get.pnpm.io/install.sh | sh -

yang@ubuntu:~/01-tools$ curl -fsSL https://get.pnpm.io/install.sh | sh -
==> Downloading pnpm binaries 10.11.0
 WARN  using --force I sure hope you know what you are doing
Copying pnpm CLI from /tmp/tmp.GBZcjxTZV8/pnpm to /home/yang/.local/share/pnpm/pnpm
Appended new lines to /home/yang/.bashrc

Next configuration changes were made:
export PNPM_HOME="/home/yang/.local/share/pnpm"
case ":$PATH:" in
  *":$PNPM_HOME:"*) ;;
  *) export PATH="$PNPM_HOME:$PATH" ;;
esac

To start using pnpm, run:
source /home/yang/.bashrc

source /home/yang/.bashrc

安装deer-flow

克隆仓库:

# 克隆仓库
git clone https://github.com/bytedance/deer-flow.git
cd deer-flow

 安装依赖

# 安装依赖,uv将负责Python解释器和虚拟环境的创建,并安装所需的包
uv sync

配置环境变量

首先查看环境变量:

gedit .env.example

参考配置文档去配置。 

Tavily是一个为大型语言模型(LLMs)和检索增强生成(RAG)优化的搜索引擎,旨在提供高效、快速且持久的搜索结果。该产品由Tavily团队开发,目标用户是AI开发者、研究人员以及需要实时、准确、有根据的信息的企业。Tavily Search API通过连接LLMs和AI应用程序到可信赖的实时知识,减少了幻觉和整体偏见,帮助AI做出更好的决策。

核心功能:

  • 深度研究:通过单一的API调用,简化数据收集,提供来自可信来源的聚合和精选结果。
  • 智能查询建议和答案:装备AI以自动化的方式深化知识,通过细微的答案和后续查询。
  • 多源优化:与Bing、Google和SerpAPI等其他API相比,Tavily Search API会审查多个来源,从每个来源中找到最相关的内容,以优化LLM上下文。
  • 灵活性和成本效益:Tavily Search API提供更灵活的定价计划和更实惠的成本。

价格计费,Tavily提供不同的定价计划,以满足不同用户的需求:

  • Researcher计划:免费,每月1,000次API调用。
  • Project计划:$30/月,每月4,000次API调用。
  • Bootstrap计划:$100/月,每月15,000次API调用。
  • Startup计划:$220/月,每月38,000次API调用。
  • Growth计划:$500/月,每月100,000次API调用。
  • Add-On计划:$100一次性购买,额外8,000次API调用。
  • Enterprise计划:提供定制API调用、生产就绪的速率限制、定制的主题和来源以及企业级的安全和隐私。

Tavily AI 在这里面获取一个api-key,可以用谷歌账号或者是github账号登录。

 工具:Tavily搜索引擎 - 凫弥 - 博客园  这个博客里写了一些介绍,可以看一下。

复制这个api-key,然后写env.example中

接下来,

cp .env.example .env
cp conf.yaml.example conf.yaml

在conf.yaml中配置基础模型,暂时使用的是豆包,还可以根据偏好使用基础模型,具体的文档在这里:

Which models does DeerFlow support?

In DeerFlow, currently we only support non-reasoning models, which means models like OpenAI's o1/o3 or DeepSeek's R1 are not supported yet, but we will add support for them in the future.

Supported Models

doubao-1.5-pro-32k-250115gpt-4oqwen-max-latestgemini-2.0-flashdeepseek-v3, and theoretically any other non-reasoning chat models that implement the OpenAI API specification.

Note

The Deep Research process requires the model to have a longer context window, which is not supported by all models. A work-around is to set the Max steps of a research plan to 2 in the settings dialog located on the top right corner of the web page, or set max_step_num to 2 when invoking the API.

How to switch models?

You can switch the model in use by modifying the conf.yaml file in the root directory of the project, using the configuration in the litellm format.

 配置一个自己想要的api。

PPT生成环境安装

如果需要ppt的生成功能,还需要安装,这里我还没配置。

# 安装marp用于PPT生成
# https://github.com/marp-team/marp-cli?tab=readme-ov-file#use-package-manager
brew install marp-cli

Web UI:

cd deer-flow/web
pnpm install

如果pnpm显示要安装之类的,启动一下pnpm:source /home/yang/.bashrc。

 到此已经完成必要的配置和包的安装。

Deer-flow运行

有两种方式,控制台UI 和 WebUI

控制台 UI

运行项目的最快方法是使用控制台 UI。uv run main.py

# 在类bash的shell中运行项目
uv run main.py

Web UI

本项目还包括一个 Web UI,提供更加动态和引人入胜的交互体验。

[!注意] 您需要先安装 Web UI 的依赖。

# 在开发模式下同时运行后端和前端服务器
# 在macOS/Linux上
./bootstrap.sh -d

# 在Windows上
bootstrap.bat -d

打开浏览器并访问http://localhost:3000探索 Web UI。

web目录中探索更多详情。

如果要用UI界面的话:要保证安装了nodejs,可以用nvm ls检查一下

因为我编译了很多次,所以出现了端口被占用的问题,我们可以使用下面三个命令来kill掉进程,然后重新编译

查找被占用的端口:

netstat -tln | grep 8000

 查看被占用端口的PID:

sudo lsof -i:8000

kill掉该进程

sudo kill -9 850

但是有个悲伤的故事,我的API模型好像不太行,用的腾讯云的deepseek-V3 ,建议尝试gpt-4o的API

能打开,这是本地配置的和官网几乎一模一样的界面,但是api调用一直出错,不给回答、、

b站上有个别人的视频,讲的很清楚。 字节跳动开源深度研究框架 DeerFlow - Gemini Deep Research开源平替(LangChain力荐)_哔哩哔哩_bilibili

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值