当前位置: 首页 > news >正文

openwebUI访问vllm加载deepseek微调过的本地大模型

文章目录

  • 前言
  • 一、openwebui安装
  • 二、配置openwebui环境
  • 三、安装vllm
  • 四、启动vllm
  • 五、启动openwebui

前言

首先安装vllm,然后加载本地模型,会起一个端口好。
在安装openwebui,去访问这个端口号。下面具体步骤的演示。

一、openwebui安装

root@autodl-container-5fd249bc19-6ec28c15:~/autodl-tmp# mkdir open-webui
root@autodl-container-5fd249bc19-6ec28c15:~/autodl-tmp# cd open-webui/
root@autodl-container-5fd249bc19-6ec28c15:~/autodl-tmp/open-webui# git clone https://github.com/open-webui/open-webui.git
Cloning into 'open-webui'...
remote: Enumerating objects: 90389, done.
remote: Counting objects: 100% (121/121), done.
remote: Compressing objects: 100% (64/64), done.
remote: Total 90389 (delta 80), reused 57 (delta 57), pack-reused 90268 (from 2)
Receiving objects: 100% (90389/90389), 174.91 MiB | 16.20 MiB/s, done.
Resolving deltas: 100% (59438/59438), done.
root@autodl-container-5fd249bc19-6ec28c15:~/autodl-tmp/open-webui# conda create --name open-webui python=3.12
Channels:
 - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
 - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
 - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch
 - defaults
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

二、配置openwebui环境

在激活虚拟环境时候,下面提示错误,让先run init,但打这个也没啥用,只需要source activate一下即可。
进入虚拟环境就安装openwebui.

root@autodl-container-5fd249bc19-6ec28c15:~/autodl-tmp/open-webui# conda activate open-webui 

CondaError: Run 'conda init' before 'conda activate'

root@autodl-container-5fd249bc19-6ec28c15:~/autodl-tmp/open-webui# source activate
(base) root@autodl-container-5fd249bc19-6ec28c15:~/autodl-tmp/open-webui# conda activate open-webui 
(open-webui) root@autodl-container-5fd249bc19-6ec28c15:~/autodl-tmp/open-webui# pip install open-webui
Looking in indexes: http://mirrors.aliyun.com/pypi/simple
Collecting open-webui
  Downloading http://mirrors.aliyun.com/pypi/packages/76/f7/89777775051feb35049d70b9119e050b7830ed1eb07cfaa7159bd0c52cc0/open_webui-0.5.18-py3-none-any.whl (131.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 131.0/131.0 MB 17.1 MB/s eta 0:00:00
Collecting aiocache (from open-webui)

三、安装vllm

然后开始装vllm

(open-webui) root@autodl-container-5fd249bc19-6ec28c15:~/autodl-tmp/open-webui# pip install vllm
Looking in indexes: http://mirrors.aliyun.com/pypi/simple
Collecting vllm
  Downloading http://mirrors.aliyun.com/pypi/packages/4f/d2/18246f43ca730bb81918f87b7e886531eda32d835811ad9f4657c54eee35/sentencepiece-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.3/1.3 MB 15.0 MB/s eta 0:00:00
  Downloading http://mirrors.aliyun.com/pypi/packages/8d/cf/9b775a1a1f5fe2f6c2d321396ad41b9849de2c76fa46d78e6294ea13be91/vllm-0.7.3-cp38-abi3-manylinux1_x86_64.whl (264.6 MB)
     ━━━━━━━━━━━━━━━━━━━━╸━━━━━━━━━━━━━━━━━━━ 136.6/264.6 MB 14.5 MB/s eta 0:00:09

四、启动vllm

启动模型

(open-webui) root@autodl-container-5fd249bc19-6ec28c15:~/autodl-tmp/open-webui# vllm serve /root/autodl-tmp/llm/deepseek-ai/DeepSeek-R1-Distill-Qwen-1___5B-merged
INFO 03-02 10:00:20 __init__.py:207] Automatically detected platform cuda.
INFO 03-02 10:00:20 api_server.py:912] vLLM API server version 0.7.3
INFO 03-02 10:00:20 api_server.py:913] args: Namespace(subparser='serve', model_tag='/root/autodl-tmp/llm/deepseek-ai/DeepSeek-R1-Distill-Qwen-1___5B-merged', config='', host=None, port=8000, uvicorn_log_level='info', allow_credentials=False, allowed_origins=['*'], allowed_methods=['*'], allowed_headers=['*'], api

五、启动openwebui

调用的微调模型来源
https://blog.csdn.net/weixin_41688410/article/details/145948449
配置openUI环境,因为openwebUI是默认连ollama,所以要设置为false.设置vllm启动的端口号。

(open-webui) root@autodl-container-5fd249bc19-6ec28c15:~/autodl-tmp/open-webui# export HF_ENDPOINT=https://hf-mirror.com
(open-webui) root@autodl-container-5fd249bc19-6ec28c15:~/autodl-tmp/open-webui# export ENABLE_OLLAMA_API=False
(open-webui) root@autodl-container-5fd249bc19-6ec28c15:~/autodl-tmp/open-webui# export OPENAI_API_BASE_URL=http://127.0.0.1:8000/v1
(open-webui) root@autodl-container-5fd249bc19-6ec28c15:~/autodl-tmp/open-webui# 

上述环境配好后就可以启动open-webui

(open-webui) root@autodl-container-5fd249bc19-6ec28c15:~/autodl-tmp/open-webui# open-webui serve
Loading WEBUI_SECRET_KEY from file, not provided as an environment variable.
Converting 'chat' column to JSON
Renaming 'chat' column to 'old_chat'
Adding new 'chat' column of type JSON
Dropping 'old_chat' column
INFO  [alembic.runtime.migration] Running upgrade 242a2047eae0 -> 1af9b942657b, Migrate tags
INFO  [alembic.runtime.migration] Running upgrade 1af9b942657b -> 3ab32c4b8f59, Update tags
Primary Key: {'name': None, 'constrained_columns': []}
INFO  [alembic.runtime.migration] Running upgrade 3ab32c4b8f59 -> c69f45358db4, Add folder table
INFO  [alembic.runtime.migration] Running upgrade c69f45358db4 -> c29facfe716b, Update file table path
WARNING: CORS_ALLOW_ORIGIN IS SET TO '*' - NOT RECOMMENDED FOR PRODUCTION DEPLOYMENTS.
INFO  [open_webui.env] Embedding model set: sentence-transformers/all-MiniLM-L6-v2
/root/miniconda3/envs/open-webui/lib/python3.12/site-packages/pydub/utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
  warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)
WARNI [langchain_community.utils.user_agent] USER_AGENT environment variable not set, consider setting it to identify your requests.

 ██████╗ ██████╗ ███████╗███╗   ██╗    ██╗    ██╗███████╗██████╗ ██╗   ██╗██╗
██╔═══██╗██╔══██╗██╔════╝████╗  ██║    ██║    ██║██╔════╝██╔══██╗██║   ██║██║
██║   ██║██████╔╝█████╗  ██╔██╗ ██║    ██║ █╗ ██║█████╗  ██████╔╝██║   ██║██║
██║   ██║██╔═══╝ ██╔══╝  ██║╚██╗██║    ██║███╗██║██╔══╝  ██╔══██╗██║   ██║██║
╚██████╔╝██║     ███████╗██║ ╚████║    ╚███╔███╔╝███████╗██████╔╝╚██████╔╝██║
 ╚═════╝ ╚═╝     ╚══════╝╚═╝  ╚═══╝     ╚══╝╚══╝ ╚══════╝╚═════╝  ╚═════╝ ╚═╝

v0.5.18 - building the best open-source AI user interface.
https://github.com/open-webui/open-webui

gitattributes: 1.23kB [00:00, 9.08MB/s]                                                                                                          
1_Pooling%2Fconfig.json: 100%|███████████████████████████████████████████████████████████████████████████████████| 190/190 [00:00<00:00, 1.30MB/s]
data_config.json: 39.3kB [00:00, 120MB/s]                                                                               | 0.00/

启动起来后,弹出页面
在这里插入图片描述点击使用,出现下面,随笔写就行了,email可以给个假的都行。
在这里插入图片描述
在这里插入图片描述
点击建立管理员
在这里插入图片描述
点击开始以后,就可以去问问题
在这里插入图片描述

这里问题是本模型微调时使用的数据。

在这里插入图片描述

相关文章:

  • STaR(Self-Taught Reasoner)方法:让语言模型自学推理能力(代码实现)
  • 算法题(83):寄包柜
  • 【重构小程序】升级JDK1.8、SpringBoot2.x 到JDK17、Springboot 3.x(一)
  • nano 是 Linux 系统中的一个 命令行文本编辑器
  • 计算机网络-实验3拓扑结构
  • Unix Domain Socket和eventfd
  • 10.3 指针进阶_代码分析
  • Java 中如何创建多线程?
  • 2025年能源工作指导意见重点内容
  • fps项目总结:关于攻击与受击
  • 【医学影像 AI】使用血管特征量化自动诊断早产儿视网膜病变中的附加病变
  • C语言:结构体的内存对齐方式
  • vite+react+ts如何集成redux状态管理工具,实现持久化缓存
  • MATLAB中asManyOfPattern函数用法
  • 代理对象中使用this
  • anolis8.9-k8s1.32-系统基本配置
  • Linux--基本指令2
  • 使用Python简单自动地生成图文并茂的网页文件(WEB数据可视化)
  • C# 类库打包dll文件
  • 操作系统之文件系统
  • 电商网站运营团队建设方案/it培训学校
  • 淘宝客网站如何让做/网站软件开发
  • 做外贸电商网站/网络营销八大职能
  • 网站制作的收费/网站排名怎么做上去
  • 电子商务加盟网站建设/新网站怎么做优化
  • 58招聘网最新招聘信息/seo公司 彼亿营销