【AI】ubuntu平台docker部署open-webui,配置模型 中文 提示词

发布于:2025-02-17 ⋅ 阅读:(116) ⋅ 点赞:(0)

前提:

ollama本地部署的,采用内网地址通知到open-webui

调整ollama.service

配置监听地址

Environment="OLLAMA_HOST=:11434"

避免监听127.0.0.1:11434

[Unit]
Description=Ollama Service
After=network-online.target

[Service]
ExecStart=/usr/local/bin/ollama serve
User=ollama
Group=ollama
Restart=always
RestartSec=3
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
Environment="OLLAMA_HOST=:11434"
[Install]
WantedBy=default.target

安装

docker-compose.yml配置

version: '3.8'

services:
  open-webui:
    image: ghcr.nju.edu.cn/open-webui/open-webui:main
    container_name: open-webui
    ports:
      - "3000:8080"
    environment:
      - OLLAMA_BASE_URL=http://192.168.1.3:11434
    volumes:
      - open-webui_data:/app/backend/data    
    restart: always

volumes:
  open-webui_data:

注意采用 ghcr.nju.edu.cn 加速地址

启动服务

docker-compose up -d
yeqiang@yeqiang-Default-string:/usr/local/open-webui$ docker-compose up -d
Pulling open-webui (ghcr.nju.edu.cn/open-webui/open-webui:main)...
main: Pulling from open-webui/open-webui
c29f5b76f736: Pull complete
73c4bbda278d: Pull complete
acc53c3e87ac: Pull complete
ad3b14759e4f: Pull complete
b874b4974f13: Pull complete
4f4fb700ef54: Pull complete
dfcf69fcbc2b: Pull complete
e8bfaf4ee0e0: Pull complete
17b8c991f4f9: Pull complete
2d1f3e8f8037: Pull complete
9bc058e9f913: Pull complete
4ec78f0a5387: Pull complete
8362126344e9: Pull complete
8fbadd293f58: Pull complete
00f8bd1845fc: Pull complete
Digest: sha256:1623214ac0c180cc1f527df3c2cb2be69bd0911016a565edc15e91b4e6ab99dd
Status: Downloaded newer image for ghcr.nju.edu.cn/open-webui/open-webui:main
Creating open-webui ... done

日志

yeqiang@yeqiang-Default-string:/usr/local/open-webui$ docker logs -f b89
Loading WEBUI_SECRET_KEY from file, not provided as an environment variable.
Generating WEBUI_SECRET_KEY
Loading WEBUI_SECRET_KEY from .webui_secret_key
/app/backend/open_webui
/app/backend
/app
Running migrations
INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade  -> 7e5b5dc7342b, init
INFO  [alembic.runtime.migration] Running upgrade 7e5b5dc7342b -> ca81bd47c050, Add config table
INFO  [alembic.runtime.migration] Running upgrade ca81bd47c050 -> c0fbf31ca0db, Update file table
INFO  [alembic.runtime.migration] Running upgrade c0fbf31ca0db -> 6a39f3d8e55c, Add knowledge table
INFO  [alembic.runtime.migration] Running upgrade 6a39f3d8e55c -> 242a2047eae0, Update chat table
INFO  [alembic.runtime.migration] Running upgrade 242a2047eae0 -> 1af9b942657b, Migrate tags
INFO  [alembic.runtime.migration] Running upgrade 1af9b942657b -> 3ab32c4b8f59, Update tags
INFO  [alembic.runtime.migration] Running upgrade 3ab32c4b8f59 -> c69f45358db4, Add folder table
INFO  [alembic.runtime.migration] Running upgrade c69f45358db4 -> c29facfe716b, Update file table path
INFO  [alembic.runtime.migration] Running upgrade c29facfe716b -> af906e964978, Add feedback table
INFO  [alembic.runtime.migration] Running upgrade af906e964978 -> 4ace53fd72c8, Update folder table and change DateTime to BigInteger for timestamp fields
INFO  [alembic.runtime.migration] Running upgrade 4ace53fd72c8 -> 922e7a387820, Add group table
INFO  [alembic.runtime.migration] Running upgrade 922e7a387820 -> 57c599a3cb57, Add channel table
INFO  [alembic.runtime.migration] Running upgrade 57c599a3cb57 -> 7826ab40b532, Update file table
INFO  [alembic.runtime.migration] Running upgrade 7826ab40b532 -> 3781e22d8b01, Update message & channel tables
INFO  [open_webui.env] 'DEFAULT_LOCALE' loaded from the latest database entry
INFO  [open_webui.env] 'DEFAULT_PROMPT_SUGGESTIONS' loaded from the latest database entry
WARNI [open_webui.env] 

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
WARNI [langchain_community.utils.user_agent] USER_AGENT environment variable not set, consider setting it to identify your requests.
INFO:     Started server process [1]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit)
Creating knowledge table
Migrating data from document table to knowledge table
Converting 'chat' column to JSON
Renaming 'chat' column to 'old_chat'
Adding new 'chat' column of type JSON
Dropping 'old_chat' column
Primary Key: {'name': None, 'constrained_columns': []}
Unique Constraints: [{'name': 'uq_id_user_id', 'column_names': ['id', 'user_id']}]
Indexes: [{'name': 'tag_id', 'column_names': ['id'], 'unique': 1, 'dialect_options': {}}]
Creating new primary key with 'id' and 'user_id'.
Dropping unique constraint: uq_id_user_id
Dropping unique index: tag_id

  ___                    __        __   _     _   _ ___
 / _ \ _ __   ___ _ __   \ \      / /__| |__ | | | |_ _|
| | | | '_ \ / _ \ '_ \   \ \ /\ / / _ \ '_ \| | | || |
| |_| | |_) |  __/ | | |   \ V  V /  __/ |_) | |_| || |
 \___/| .__/ \___|_| |_|    \_/\_/ \___|_.__/ \___/|___|
      |_|


v0.5.12 - building the best open-source AI user interface.

https://github.com/open-webui/open-webui

注意,会在WARNING: CORS_ALLOW_ORIGIN IS SET TO '*' - NOT RECOMMENDED FOR PRODUCTION DEPLOYMENTS.卡上一段时间,估计下载资源。

使用

耐心等待一段时间(白屏),显示更新信息

左下角,用户名,打开管理员面板

设置,外部链接,关闭OpenAI API(没有梯子,避免卡界面)

切换到模型配置

点击模型,配置提示词,配置公开(其他用户就可以看到,如果只有自己,不用公开来)

你是一位经验丰富的高级程序员、架构师及项目经理,精通多种编程语言和技术框架。你的任务是为我提供专业的程序开发指导,包括但不限于项目架构设计、代码编写最佳实践、技术选型建议以及团队管理技巧。

请始终使用中文回答我的问题,并根据我的具体需求给出详细、清晰的解释和建议。例如,当我询问如何优化一段代码时,请从性能、可读性、维护性等多个角度进行分析,并提供具体的改进方案;当我咨询关于项目管理的问题时,请结合实际案例分享有效的管理策略和方法。

此外,请时刻关注最新的技术趋势和最佳实践,以便给我最前沿的指导。如果涉及到特定的技术或工具,请简要介绍其背景知识,以帮助我更好地理解你的建议。

现在,请准备好开始解答我的问题。


网站公告

今日签到

点亮在社区的每一天
去签到