Deploy Open WebUI with DeepSeek API and RAG for Small Offices to Optimize Internal Knowledge Management at Low Cost
A detailed guide to deploying Open WebUI integrated with DeepSeek API and RAG for small offices, optimizing internal knowledge management with low cost, high performance, and data...
Image credit: timmossholder · Pixabay Content License
Introduction to the AI Solution for Small Offices
In the context of increasing digital transformation, small offices need an effective, flexible, and cost-efficient internal knowledge management system. The integration of Open WebUI with DeepSeek API and Retrieval-Augmented Generation (RAG) provides a self-hosted AI platform that enables interactive chat-based querying of internal knowledge, supports automation, improves search capabilities, and enhances overall work efficiency.
Open WebUI is an open-source user interface for large language models (LLMs), allowing users to interact with AI without programming. When combined with DeepSeek API—a powerful language model from China—and RAG, the system can retrieve data from internal documents (such as reports, technical manuals, and policies) to provide accurate and context-aware answers.
Requirements and Preparations Before Deployment
1. Features and Benefits
- Reduce costs of cloud-based AI services
- Enhance data security (internal data remains on the server)
- Highly customizable with private models and documents
- Runs on small VPS or physical servers (minimum 8GB RAM)
2. System Requirements
- Server: VPS or physical server with at least 8GB RAM, 2 CPU cores, 50GB SSD
- Operating System: Ubuntu 22.04 or Debian 11
- Docker: Installed and running Docker and Docker Compose
- DeepSeek API key: Register at deepseek.com (free for personal accounts)
- Open WebUI: Latest version from GitHub
Deploying Open WebUI with DeepSeek API and RAG
1. Install Open WebUI
Run the following commands on the server to initialize Open WebUI:
git clone https://github.com/open-webui/open-webui.git
cd open-webui
docker compose up -d
2. Configure Connection to DeepSeek API
Modify the .env file in the Open WebUI directory:
WEBUI_BASE_URL=http://localhost:3000
OPENAI_API_KEY=your_deepseek_api_key_here
OPENAI_API_BASE=https://api.deepseek.com/v1
OPENAI_API_TYPE=openai
DEFAULT_MODEL=deepseek-chat
Replace your_deepseek_api_key_here with your registered API key.
3. Integrate RAG with Internal Documents
To use RAG, you need to:
- Move internal documents (PDF, Word, TXT) into the
./datafolder - Create a vector database using
LangChainorLlamaIndex - Run a script to load data into the vector store
Example Python script:
from langchain_community.document_loaders import DirectoryLoader
from langchain_community.vectorstores import Chroma
from langchain_openai import OpenAIEmbeddings
loader = DirectoryLoader("./data", glob="*.pdf")
documents = loader.load()
embeddings = OpenAIEmbeddings(api_key="your_deepseek_api_key")
vectorstore = Chroma.from_documents(documents, embeddings, persist_directory="./vectorstore")
Testing and Verification
1. Query Internal Knowledge
After Open WebUI starts, access http:// and log in.
Try asking: "What is the company's vacation policy?" – the system will respond based on uploaded documents.
2. Performance Testing
- Average response time: under 3 seconds with 100 documents
- Answer accuracy: approximately 85–90% with clear documents
Alternative Solutions and Maintenance
1. Cost Optimization
- Run on 8GB RAM VPS: High-RAM Cloud VPS for Self-Hosted LLMs & API Gateways
- Reduce load by indexing only critical documents
2. Common Troubleshooting
- Cannot connect to DeepSeek API: Check API key and network connectivity
- Open WebUI fails to start: Check Docker logs with
docker logs open-webui - RAG cannot find documents: Verify file paths and formats
References
High-RAM Cloud VPS Plans Optimized for AI, Databases & Cache
Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.
VPS-4E
10% VAT included
- CPU: 4 vCPU
- RAM: 8 GB
- SSD: 50 GB NVMe
