OP

OpenWebUI

55,000Python/TypeScriptWeb Interface

Open-source ChatGPT-like web interface for various LLM backends.

PythonTypeScriptOllamaSelf-hosted

Overview

OpenWebUI (formerly Ollama WebUI) is an open-source web interface providing a ChatGPT-like experience for various LLM backends. It supports multiple backends (Ollama, OpenAI, Anthropic, Google, Groq, DeepSeek), offering conversation management, knowledge base, code execution, file upload, and more.

Features

  • Multi-backend support
  • Conversation management
  • Knowledge base with RAG
  • Code execution sandbox
  • File upload and processing
  • Model management
  • Multi-user support
  • REST API
  • Docker deployment

Installation

docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data ghcr.io/open-webui/open-webui:main

Pros

  • +Supports multiple LLM backends
  • +ChatGPT-like interface
  • +Open-source and fully customizable
  • +Rich features (knowledge base, code execution)
  • +Simple Docker deployment
  • +Active community

Cons

  • Requires self-deployment and maintenance
  • Some advanced features need technical knowledge
  • Local models require GPU resources
  • Multi-user management relatively simple

Alternatives

Documentation

OpenWebUI

Overview

OpenWebUI(原 Ollama WebUI)是一个开源的 Web 界面,为各种 LLM 后端提供类 ChatGPT 的用户体验。它支持多种后端模型(Ollama、OpenAI、Anthropic、Google 等),提供对话管理、知识库、代码执行、文件上传等丰富功能。

OpenWebUI 的核心理念是让任何 LLM 后端都能拥有现代化的 Web 界面。无论你是本地运行 Ollama 模型,还是使用云端的 OpenAI API,OpenWebUI 都能提供一个统一、美观、功能丰富的交互界面。

Features

  • 多后端支持:Ollama、OpenAI、Anthropic、Google、Groq、DeepSeek 等
  • 对话管理:多对话标签、对话历史、搜索
  • 知识库:RAG 支持,上传文档进行问答
  • 代码执行:内置 Python 代码执行环境
  • 文件上传:支持 PDF、TXT、DOCX 等格式
  • 模型管理:多模型切换、模型下载(Ollama)
  • 用户管理:多用户支持、权限控制
  • API 支持:完整的 REST API
  • Docker 部署:一键部署,易于维护

Installation

Docker(推荐)

docker run -d -p 3000:8080 \
  --add-host=host.docker.internal:host-gateway \
  -v open-webui:/app/backend/data \
  --name open-webui \
  --restart always \
  ghcr.io/open-webui/open-webui:main

访问 http://localhost:3000

Docker Compose

version: '3.8'
services:
  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    ports:
      - "3000:8080"
    environment:
      - OLLAMA_BASE_URL=http://ollama:11434
    volumes:
      - open-webui:/app/backend/data
    depends_on:
      - ollama
    restart: always

  ollama:
    image: ollama/ollama:latest
    volumes:
      - ollama:/root/.ollama

volumes:
  open-webui:
  ollama:

pip 安装

pip install open-webui
open-webui serve

Quick Start

  1. 启动 OpenWebUI(Docker 或 pip)
  2. 在浏览器中打开 http://localhost:3000
  3. 创建第一个管理员账户
  4. 配置模型后端(Ollama、OpenAI 等)
  5. 开始对话

Core Concepts

后端集成

OpenWebUI 支持多种后端:

后端配置方式说明
OllamaOLLAMA_BASE_URL本地运行开源模型
OpenAIOPENAI_API_KEY使用 GPT 系列模型
AnthropicANTHROPIC_API_KEY使用 Claude 系列模型
GoogleGOOGLE_API_KEY使用 Gemini 系列模型
GroqGROQ_API_KEY高速推理 API
DeepSeekDEEPSEEK_API_KEYDeepSeek 模型

功能模块

┌─────────────────────────────────────────────┐
│              OpenWebUI                       │
├─────────────────────────────────────────────┤
│  对话界面                                    │
│  ├── 多对话标签                              │
│  ├── 对话历史                                │
│  └── 消息管理                                │
├─────────────────────────────────────────────┤
│  知识库                                      │
│  ├── 文档上传                                │
│  ├── 向量索引                                │
│  └── RAG 问答                                │
├─────────────────────────────────────────────┤
│  模型管理                                    │
│  ├── 模型切换                                │
│  ├── 模型下载(Ollama)                      │
│  └── 参数配置                                │
├─────────────────────────────────────────────┤
│  用户管理                                    │
│  ├── 多用户支持                              │
│  ├── 权限控制                                │
│  └── 使用统计                                │
└─────────────────────────────────────────────┘

Examples

示例 1:本地模型对话

# 1. 安装 Ollama
ollama pull llama3

# 2. 启动 OpenWebUI 并配置 Ollama
docker run -d -p 3000:8080 \
  --add-host=host.docker.internal:host-gateway \
  -v open-webui:/app/backend/data \
  -e OLLAMA_BASE_URL=http://host.docker.internal:11434 \
  ghcr.io/open-webui/open-webui:main

# 3. 在浏览器中选择 llama3 模型进行对话

示例 2:知识库问答

1. 在 OpenWebUI 中创建知识库
2. 上传 PDF/DOCX/TXT 文档
3. OpenWebUI 自动索引文档
4. 提问:"根据上传的文档,xxx 是什么?"
5. 系统基于文档内容回答

示例 3:代码执行

用户:请用 Python 写一个快速排序算法并运行测试

OpenWebUI:
1. 生成 Python 代码
2. 在内置沙箱中执行
3. 显示执行结果和输出
4. 可以修改后重新运行

Pros

  • ✅ 支持多种 LLM 后端,灵活选择
  • ✅ 类 ChatGPT 界面,用户体验好
  • ✅ 开源免费,完全可定制
  • ✅ 丰富的功能(知识库、代码执行等)
  • ✅ Docker 部署简单
  • ✅ 活跃的社区和频繁更新

Cons

  • ❌ 需要自行部署和维护
  • ❌ 某些高级功能需要技术知识
  • ❌ 本地模型需要 GPU 资源
  • ❌ 多用户管理功能相对简单

When to Use

  • 想要本地运行开源模型时
  • 需要统一的 Web 界面管理多个模型时
  • 需要知识库问答功能时
  • 想要自托管 ChatGPT 类界面时
  • 需要多用户支持时

Use Cases

Use CaseWhy OpenWebUI
Self-Hosted ChatGPTComplete data control with local deployment
Multi-Model ManagementUnified interface for Ollama, OpenAI, Anthropic, etc.
Knowledge Base Q&ABuilt-in RAG with document upload and indexing
Team CollaborationMulti-user support with role-based permissions

Comparison with Alternatives

FeatureOpenWebUIOllama WebUIChatUILangChain
Self-Hosted✅ Yes✅ Yes❌ No✅ Yes
Multi-Backend✅ 10+⚠️ Ollama focus❌ No✅ Yes
RAG Built-in✅ Yes❌ No⚠️ Limited⚠️ Manual
Code Execution✅ Yes❌ No❌ No⚠️ Via tools
Multi-User✅ Yes❌ No⚠️ Limited❌ No
Docker Deploy✅ Yes✅ Yes❌ No⚠️ Manual
Learning CurveLowLowLowHigh
Best forSelf-hosted UIOllama focusSimple chatDevelopers

Best Practices

  1. Use Docker for deployment — Simplest setup with one command
  2. Configure backends properly — Set environment variables for each LLM provider
  3. Enable RAG for knowledge — Upload documents for enhanced Q&A capabilities
  4. Set up multi-user access — Configure permissions for team collaboration
  5. Use code execution carefully — Sandboxed Python environment for safety

Troubleshooting

IssueSolution
Docker fails to startCheck port 3000/8080 availability and Docker permissions
Model not connectingVerify backend URL and API key configuration
RAG not returning resultsRe-index documents and check vector store settings
Code execution failsCheck sandbox permissions and Python environment

Resources