2025-01-20正式发布 DeepSeek-R1,并同步开源模型权重。
DeepSeek-R1 遵循 MIT License,允许用户通过蒸馏技术借助 R1 训练其他模型。 DeepSeek-R1
上线API,对用户开放思维链输出,通过设置 model='deepseek-reasoner' 即可调用。 DeepSeek 官网与
App 即日起同步更新上线。
论文地址:https://github.com/deepseek-ai/DeepSeek-R1/blob/main/DeepSeek_R1.pdf
原文链接:https://blog.csdn.net/sexy19910923/article/details/145271916
使用ollama进行部署
不同版本下载不同的版本安装
linux使用命令行
curl -fsSL https://ollama.com/install.sh | sh
之后会根据不同的版本进行安装
在这里选一下deepseek r1
其中有1.5b,7b,8b等,32b以上的到671b基本就是普通用户用用不了的了。
安装ollama后运行
ollama run deepseek-r1:1.5b
ollama run deepseek-r1:7b
ollama run deepseek-r1:8b
就会自动运行了,另外如果觉得这个cmd的窗口交互太不美观,可以使用openwebui,用起来跟chatgpt的web差不多,可以使用docker 安装,下面介绍一下用pip 安装,需要安装
pip install open-webui
另外在安装这个包后,还会联网安装其它的组件,如语音识别等,需要设定代理才行
在cmd窗口中加入
set http_proxy=http://用户名:密码@代理地址:端口
set https_proxy=http://用户名:密码@代理地址:端口
set http_proxy=http://127.0.0.1:7897
set https_proxy=http://127.0.0.1:7897
export http_proxy=http://10.10.10.215:7897
export https_proxy=http://10.10.10.215:7897
再运行
open-webui serve
后面如果更新到最新使用如下命令
pip install --upgrade open-webui
linux 部署时也可以用相同的方法
pip install open-webui
./clash-linux-amd64 -d ./ &
export http_proxy="http://127.0.0.1:7897"
export https_proxy="http://127.0.0.1:7897"
使用别的机器上的代理
export http_proxy="http://10.10.10.251:7897"
export https_proxy="http://10.10.10.251:7897"
在下载完模型后要关闭代理,再重新运行openwebui
另外 使用docker 部署也可以,在rk3588上用docker 部署open-webui,注意docker 要指定本地ollama端口,另外
/var/snap/docker/current/config/daemon.json
"如果之前在 /etc/docker/daemon.json 下配置过文件,Snap 安装的 Docker 不会读取该路径,必须在 /var/snap/docker/current/config/daemon.json 下进行配置。
编辑 daemon.json 后,务必使用 sudo snap restart docker 重启服务,以使更改生效"
{
"registry-mirrors": [
"https://docker.m.daocloud.io",
"https://docker.kejilion.pro",
"https://ccr.ccs.tencentyun.com",
"https://hub.rat.dev",
"https://docker.1panel.live"
],
"insecure-registries": [],
"debug": false,
"experimental": false
}
sudo snap restart docker
sudo docker run hello-world
然后运行代码如下,然后本地http://localhost:3000端口就是openwebui的界面
sudo docker run -d -p 3000:8080 \
-v open-webui:/app/backend/data \
-e OLLAMA_BASE_URL=http://127.0.0.1:11434 \
--name open-webui \
--restart always \
ghcr.io/open-webui/open-webui:main
然后运行代码如下,然后本地http://localhost:8080端口就是openwebui的界面
sudo docker run -d --network=host \
-v open-webui:/app/backend/data \
-e OLLAMA_BASE_URL=http://127.0.0.1:11434 \
--name open-webui \
--restart always \
ghcr.io/open-webui/open-webui:main
sudo docker logs open-webui
进行查看日志,如果想更新版本
1. 停止 & 移除旧容器 | sudo docker stop open-webui && sudo docker rm open-webui |
2. 拉取最新 Open-WebUI 镜像 | sudo docker pull ghcr.io/open-webui/open-webui:main |
3. 运行最新容器 | sudo docker run -d --network=host -v open-webui:/app/backend/data -e OLLAMA_BASE_URL=http://127.0.0.1:11434 --name open-webui --restart always ghcr.io/open-webui/open-webui:main |
4. 验证版本 | `docker logs -f open-webui |
5. (可选) 自动更新 | docker run -d --name watchtower -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower open-webui |
多去参考下面网站
注意 OLLAMA_BASE_URL=http://127.0.0.1:11434 如果没有这个,那么他会去默认的
使用LMstudio 进行部署LM Studio - Discover, download, and run local LLMshttps://lmstudio.ai/https://lmstudio.ai/https://lmstudio.ai/https://lmstudio.ai/https://lmstudio.ai/https://lmstudio.ai/https://lmstudio.ai/
https://lmstudio.ai/
下载后,要更换一下源就是模型的下载地址,安装后进入安装目录
cd C:\LM Studio
C:\LM Studio>findstr /s /i /m /c:"huggingface.co" *.*
得到如下 :
将非exe文件中的huggingface.co字符串替换
为 hf-mirror.com
推荐vscode。然后就可以正常下载,不过我这边网不好,下载的慢
使用AnythingLLM ,这个可以对本地知识库进行加工,美中不足就是没有linux arm的版本,无法在rk3588上面部署。
Download AnythingLLM for Desktophttps://anythingllm.com/desktophttps://anythingllm.com/desktophttps://anythingllm.com/desktophttps://anythingllm.com/desktophttps://anythingllm.com/desktophttps://anythingllm.com/desktophttps://anythingllm.com/desktopGitHub - Mintplex-Labs/anything-llm: The all-in-one Desktop & Docker AI application with built-in RAG, AI agents, and more.The all-in-one Desktop & Docker AI application with built-in RAG, AI agents, and more. - Mintplex-Labs/anything-llmhttps://github.com/Mintplex-Labs/anything-llm/https://github.com/Mintplex-Labs/anything-llm/https://github.com/Mintplex-Labs/anything-llm/https://github.com/Mintplex-Labs/anything-llm/https://github.com/Mintplex-Labs/anything-llm/https://github.com/Mintplex-Labs/anything-llm/
https://github.com/Mintplex-Labs/anything-llm/
使用chatbox部署 ,这个版本啥都有,可以尝试
使用Cherry Studio
官网下载地址:https://cherry-ai.com
GitHub地址:https://github.com/kangfenmao/cherry-studio
在Android手机上编译一个离线版本的deepseek运行环境,使用termux安装一个虚拟的kail系统
apt install git cmake golang
git clone --depth 1 https://github.com/ollama/ollama.git
cd ollama
go generate .
go build .
等待构建完成后,目录下会有一个 Ollama的应用
运行
./Ollama server&
服务启动后运行
./Ollama run DeepSeek-r1:1.5b
注用1.5b吧,因为没有gpu加速好像慢得很一秒2个字吧
另外chatbox的arm64版本也可以运行起来
https://chatboxai.app/zh/install?download=linux-arm64
下载后
./Chatbox-1.9.8-arm64.AppImage --appimage-extract
cd squashfs-root
./AppRun --no-sandbox
使用npu加速
rknn-llm/examples/DeepSeek-R1-Distill-Qwen-1.5B_Demo at main · airockchip/rknn-llm · GitHub