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

前言

首先安装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可以给个假的都行。
在这里插入图片描述
在这里插入图片描述
点击建立管理员
在这里插入图片描述
点击开始以后,就可以去问问题
在这里插入图片描述

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

在这里插入图片描述

Command: "D:\sd-webui-aki-v4\py310\python.exe" -m pip install insightface==0.7.3 --prefer-binary --index-url https://mirror.baidu.com/pypi/simple Error code: 1 stdout: Looking in indexes: https://mirror.baidu.com/pypi/simple, https://mirrors.aliyun.com/pypi/simple Looking in links: https://mirror.sjtu.edu.cn/pytorch-wheels/torch_stable.html stderr: WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000018CC7A94EE0>, 'Connection to 192.168.0.16 timed out. (connect timeout=8.0)')': /pytorch-wheels/torch_stable.html WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000018CC7A94400>, 'Connection to 192.168.0.16 timed out. (connect timeout=8.0)')': /pypi/simple/insightface/ WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000018CC7A956F0>, 'Connection to 192.168.0.16 timed out. (connect timeout=8.0)')': /pypi/simple/insightface/ ERROR: Could not find a version that satisfies the requirement insightface==0.7.3 (from versions: none) ERROR: No matching distribution found for insightface==0.7.3 Launching Web UI with arguments: --theme dark --xformers --api --autolaunch
07-17
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值