[Kali Linux] Building a Local LLM Agent for Pentesting



This time, to save as much time as possible on penetration testing practice

and bug hunting in bug bounty programs,

I’m going to build a local LLM, which is still a hot topic (?) right now.

The setup is as follows.

1. Update the Package List and Install Docker

1
$ sudo apt update && sudo apt install -y docker.io

If you see the output below, the installation was successful.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
┌──(root💀kali)-[/home/kali/H■■n■/■■■ls]
└─# sudo apt update && sudo apt install -y docker.io
Get:1 http://mirror.keiminem.com/kali kali-rolling InRelease [34.0 kB]
Get:2 http://mirror.keiminem.com/kali kali-rolling/main amd64 Packages [21.9 MB]
Get:3 http://mirror.keiminem.com/kali kali-rolling/main amd64 Contents (deb) [53.9 MB]
Get:4 http://mirror.keiminem.com/kali kali-rolling/contrib amd64 Packages [104 kB]
Get:5 http://mirror.keiminem.com/kali kali-rolling/contrib amd64 Contents (deb) [171 kB]
Get:6 http://mirror.keiminem.com/kali kali-rolling/non-free amd64 Packages [170 kB]
Get:7 http://mirror.keiminem.com/kali kali-rolling/non-free amd64 Contents (deb) [878 kB]
Get:8 http://mirror.keiminem.com/kali kali-rolling/non-free-firmware amd64 Packages [17.3 kB]
Get:9 http://mirror.keiminem.com/kali kali-rolling/non-free-firmware amd64 Contents (deb) [44.4 kB]
Fetched 77.2 MB in 22s (3,567 kB/s)
178 packages can be upgraded. Run 'apt list --upgradable' to see them.
The following packages were automatically installed and are no longer required:
chromium-sandbox libfmt10 libopenjph0.28
gcc-15-base libfyaml0 libsimdutf33
gnome-accessibility-themes libgcc-15-dev libstdc++-15-dev
gnome-themes-extra libgumbo3 libstemmer0d
libaccountsservice0 libhdf4-0 libunibreak7
libappstream5 libmupdf27.0 libxmlb2
libavfilter11 libntfs-3g90 python3-unicodedata2
libflashrom1 libobjc-15-dev
Use 'sudo apt autoremove' to remove them.

Installing:
docker.io

Installing dependencies:
containerd libintl-xs-perl python3-protobuf
criu libmodule-find-perl python3-pycriu
docker-buildx libproc-processtable-perl runc
docker-cli libsort-naturally-perl tini-static
libcompel1 libterm-readkey-perl
libintl-perl needrestart

Suggested packages:
containernetworking-plugins debootstrap xfsprogs
docker-doc rinse zfs-fuse
btrfs-progs rootlesskit | zfsutils-linux

Summary:
Upgrading: 0, Installing: 17, Removing: 0, Not Upgrading: 178
Download size: 80.1 MB
Space needed: 338 MB / 60.1 GB available

Get:1 http://http.kali.org/kali kali-rolling/main amd64 runc amd64 1.3.6+ds1-1 [6,708 kB]
Get:6 http://http.kali.org/kali kali-rolling/main amd64 docker-cli amd64 28.5.2+dfsg4-5 [8,260 kB]
Get:7 http://http.kali.org/kali kali-rolling/main amd64 tini-static amd64 0.19.0-6+b3 [280 kB]
...<omission>...
Get:13 http://mirror.krfoss.org/kali kali-rolling/main amd64 libsort-naturally-perl all 1.03-4 [13.1 kB]
Get:16 http://mirror.zzunipark.com/kali kali-rolling/main amd64 python3-protobuf amd64 3.21.12-17 [156 kB]
Get:4 https://mirror5.krfoss.org/kali kali-rolling/main amd64 criu amd64 4.2.1-1 [557 kB]
Get:10 http://http.kali.org/kali kali-rolling/main amd64 libintl-xs-perl amd64 1.37-1+b1 [15.2 kB]
Fetched 80.1 MB in 14s (5,777 kB/s)
Preconfiguring packages ...
Selecting previously unselected package runc.
(Reading database… 486585 files and directories currently installed.)
Preparing to unpack …/00-runc_1.3.6+ds1-1_amd64.deb…
Unpacking runc (1.3.6+ds1-1)…
Selecting previously unselected package containerd.
Preparing to unpack …/01-containerd_2.1.9+ds1-5_amd64.deb…
...<omission>...
Setting up python3-pycriu (4.2.1-1)…
Setting up docker.io (28.5.2+dfsg4-5)…
Creating group 'docker' with GID 963.
update-rc.d: We have no instructions for the docker init script.
update-rc.d: It looks like a non-network service, we enable it.
Created symlink '/etc/systemd/system/multi-user.target.wants/docker.service' → '/usr/lib/systemd/system/docker.service'.
Created symlink '/etc/systemd/system/sockets.target.wants/docker.socket' → '/usr/lib/systemd/system/docker.socket'.
Setting up libintl-xs-perl (1.37-1+b1)…
Processing triggers for libc-bin (2.43-7)…
Processing triggers for man-db (2.13.1-1)…
Processing triggers for kali-menu (2026.3.4)…

1. Installation Double-Check

1
$ sudo docker run hello-world

If you see the output below, the installation is complete

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
┌──(root💀kali)-[/home/kali/H■■k■■■/■■■ls]
└─# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
4f55086f7dd0: Pull complete
Digest: sha256:1e4c0■■■9■a■5■■■■■ce85c■■■■■■■■■■3514e■■■■■■■■■■■■753c9e949b2bfa
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/

For more examples and ideas, visit:
https://docs.docker.com/get-started/


3. Pull the Open WebUI Image

1
$ docker pull ghcr.io/open-webui/open-webui:main

If you see the output below, it was successful

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
┌──(root💀kali)-[/home/kali/H■■■■■g/■■■ls]
└─# docker pull ghcr.io/open-webui/open-webui:main
main: Pulling from open-webui/open-webui
37fb86c2a767: Pull complete
68bced9e0afa: Pull complete
2dc99d2d0a39: Pull complete
05e0eee5572e: Pull complete
8256bae1088f: Pull complete
4f4fb700ef54: Pull complete
932d385caefa: Pull complete
b80f7e5c4408: Pull complete
267e0cecf559: Pull complete
7666df87d8a3: Pull complete
5b1f677463bd: Pull complete
d285f281f10c: Pull complete
8025a5e9fda1: Pull complete
25a7f111789f: Pull complete
e374c235d988: Pull complete
Digest: sha256:d6c■■■■■■■■■■f4■■■■■■■■■■■■31cb■■■■■■■■■■■■de25■■■■■■■■■■■■■■255
Status: Downloaded newer image for ghcr.io/open-webui/open-webui:main
ghcr.io/open-webui/open-webui:main

3-1. Verify the Image

1
$ ddocker ps -a

4. Run the Container

1
$ docker run -d -p 3000:8080 -v open-webui:/app/backend/data --name open-webui ghcr.io/open-webui/open-webui:main

4-1. Enable GPU Support

To support an Nvidia GPU, add the --gpus all option to the docker run command

1
2
# Ex)
$ docker run -d -p 3000:8080 -v --gpus all open-webui:/app/backend/data --name open-webui ghcr.io/open-webui/open-webui:main

5. Install Ollama

This command line is official, so you can type it in and run it with confidence

1
$ curl -fsSL https://ollama.com/install.sh | sh

If you see the output below, the installation was successful.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
┌──(root💀kali)-[/home/kali/H■■■■■■/■■■ls]
└─# curl -fsSL https://ollama.com/install.sh | sh
>>> Installing ollama to /usr/local
>>> Downloading ollama-linux-amd64.tar.zst
########################################################################## 100.0%
>>> Creating ollama user...
>>> Adding ollama user to render group...
>>> Adding ollama user to video group...
>>> Adding current user to ollama group...
>>> Creating ollama systemd service...
>>> Enabling and starting ollama service...
Created symlink '/etc/systemd/system/default.target.wants/ollama.service' → '/etc/systemd/system/ollama.service'.
>>> The Ollama API is now available at 127.0.0.1:11434.
>>> Install complete. Run "ollama" from the command line.
WARNING: No NVIDIA/AMD GPU detected. Ollama will run in CPU-only mode.

Start the Service

1
$ systemctl start ollama

6. How to Run a Model (The Most Important Part)

[1]. [Recommended] Download a Low-Spec Model

$ ollama run qwen2.5-coder:3b

[2]. Download + Run a Model (All in One Go)

ollama run llama3.1:8b```
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
     ```$ ollama run deepseek-r1:7b # Most recommended```

[3]. Popular Model Examples <br>
```$ ollama run gemma3:12b``` <br>
```$ ollama run qwen2.5:14b``` <br>
```$ ollama run phi4``` <br>
```$ ollama run mistral:7b``` <br>
```$ ollama run deepseek-r1:8b``` <br>

[4]. Korean-Specialized Model <br>
```$ ollama run EEVE-Korean-Instruct-10.8B``` <br>

[5]. Japanese-Specialized Model (Japanese-English Translation) <br>
```$ ollama pull 7shi/gemma-2-jpn-translate:2b-instruct-q8_0``` <br>
```$ ollama run 7shi/gemma-2-jpn-translate:2b-instruct-q8_0``` <br>

[5-1]. Japanese-Specialized Model [Coding] <br>
A classic model for coding<br>
- Model: ```qwen2.5-coder(0.5B ~ 32B)```<br>
. Points<br>
&nbsp;&nbsp;&nbsp;- Supports a large number of programming languages and is strong at code completion,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;refactoring, test generation, and more.<br>
&nbsp;&nbsp;&nbsp;- Without a GPU, 3B or smaller; with a GPU, 7B ~ 14B is realistic for a laptop<br>
```$ ollama pull qwen2.5-coder:3b```<br>
```$ ollama run qwen2.5-coder:3b```<br>

[6-1]. Tips for Speeding Up Low-Spec CPU Environments <br>
- Secure swap memory: If your physical RAM is 8GB or less,<br>
make sure a swap file of at least 4GB is enabled<br>
on the Linux host (free -h). This prevents the container<br>
from dying during momentary memory spikes.<br>
- Auxiliary model for bypassing censorship (optional): If qwen2.5-coder:3b<Br>
refuses to write a particular attack payload, among 3B-class lightweight models,<br>
instead of the uncensored dolphin-mistral, pull the ultra-lightweight<br>
mannix/llama3.2-3b-abliterated tag as well<br>
and use it as a secondary model; it runs without trouble even in an 8GB environment.<br>

Additionally, if you tell me the CPU core count of the host Linux<br>
or the Linux distribution (Kali, Ubuntu, etc.),<br>
I can also put together thread optimization (num_thread) settings or<br>
a one-liner shell function that automates scanning tools (for registering in ```~/.bashrc```)<br>
as well


[7]. 🔧Frequently Used Commands <br>

``` bash
$ ollama list # List of Installed Models
$ ollama pull llama3 # Model download
$ ollama run llama3 # Model execution
$ ollama rm llama3 # Model deletion
$ ollama ps # Check running models
$ ollama show llama3 # Model Details


[8]. Running via the API (the OpenAI format can be used as is)

1
2
3
4
5
6
7
8
9
10
# Basics Generate API
$ - curl http://localhost:11434/api/generate \
-H "Content-Type: application/json" \
-d '{ "model": "llama3.1:8b", "prompt": "Hi!", "stream": false }'

# OpenAI compatibility Chat API
$ - curl http://localhost:11434/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{ "model": "llama3.1:8b",
"messages": [{"role":"user","content":"Hi"}] }'

[9]. Things to Check When It Won’t Run

Windoes

  -Install with administrator privileges

  -Check that Ollama is running in the background

  -Test ollama --version in PowerShell

Linux

  -Check the service status

     $ &nbsp;&nbsp;

  -Change the port if there is a conflict

     $ OLLAMA_HOST=0.0.0.0:11435 ollama serve

Extras

👉 Click to expand

🧩 1. GPU Usage Settings (Ollama)

✔️ Conditions for Using an NVIDIA GPU

• Windows: CUDA is not required; Ollama uses the GPU on its own

• Linux: CUDA Toolkit + NVIDIA Driver required

• You must choose a model according to your GPU memory (VRAM)

• DeepSeek-R1 7B → requires about 6GB of VRAM

• DeepSeek-R1 14B → requires about 9GB of VRAM

• DeepSeek-R1 32B → requires about 20GB of VRAM (RTX 3090/4090 recommended)

​

✔️ Verify GPU Activation

1
$ ollama run llama3 "nvidia-smi Show me the output."

→ If the GPU is detected, everything is working.

✔️ Setting a GPU Memory Limit (When VRAM Is Insufficient)

1
2
$ set OLLAMA_GPU_MEMORY=6GB
$ ollama run deepseek-r1:7b

🧠2. Optimizing DeepSeek-R1 (Speed·Quality·VRAM)

✔️ 1) Choosing Quantization (Q4 recommended)

• Q4_K_M: Best balance of speed and quality (officially recommended by DeepSeek)

• Q8 if you have VRAM to spare

• FP16 only when you have plenty of VRAM
​

✔️ 2) Model Selection Strategy

• 7B Distill: Optimal for laptops and 8GB GPUs

• 14B Distill: Stable on a 12GB GPU

• 32B Distill: Best quality on a 24GB GPU (stronger than o1-mini)
​

✔️ 3) Performance Tuning Points

Based on the DeepSeek optimization guide:

• Reduce TTFT (time to first token) → shorten the prompt length, use Q4

• Improve TPOT (speed per token) → keep GPU utilization at 70% or higher

• Optimize the KV Cache → avoid using an overly long context length (VRAM spikes above 8K)

​

✔️ 4) Running DeepSeek-R1 in Ollama

1
2
$ ollama pull deepseek-r1:7b
$ ollama run deepseek-r1:7b

3. Installing & Running Open WebUI (The Easiest Method)

Open WebUI is the best local LLM UI, with automatic integration with Ollama.

3-1. How to Download

✔️ Common to Windows / macOS / Linux

Official site:​

📥 https://openwebui.com → Click “Download”

✔️ Docker Installation (Most Stable)

1
$ docker pull ghcr.io/open-webui/open-webui:latest

3-2. Installation Method (Docker-based)

✔️ 1) Basic Run

1
2
3
4
$ docker run -d -p 3000:8080 \
-v openwebui:/app/data \
--name openwebui \
ghcr.io/open-webui/open-webui:latest

✔️ 2) Ollama Integration

If Ollama is running on the default port (11434), it connects automatically.

If manual configuration is needed:

Open WebUI → Settings → LLM Providers → Enter the Ollama URL

1
$ http://localhost:11434

4. Optimizing Open WebUI + DeepSeek-R1

✔️ 1) Preloading the Model (Speed Improvement)

Open WebUI → Settings → Models → Preload Model

→ Select deepseek-r1:7b

✔️ 2) Enable Chain-of-Thought(COT)

Since DeepSeek-R1 is a COT-based model,

add the following to the Prompt:

1
2
3
# DeepSeek-R1 Reasoning Mode

$ Please think step-by-step and show reasoning.

✔️ 3) GPU Memory-Saving Options

Open WebUI → Settings → Performance

• Enable KV Cache

• Reduce Context Length (4096 recommended)

🧱 5. Overall Configuration Summary

Item Recommendation
GPU RTX 3060/4060 or higher
Model DeepSeek-R1 7B or 14B
Quantization Q4_K_M
UI Open WebUI (Docker)
API Ollama(OpenAI-compatible)

open-webui

🟦 1. Installing Open WebUI on Windows Without Docker (Python Method)

The most stable official way to run Open WebUI on Windows

without Docker is a standalone Python-based run (pip installation).

🧩 1-1. What You Need

   • Windows 10/11

   • Install Python 3.11

   • Install Ollama (assuming it is already installed)

    Install: https://ollama.com/download

🧩 1-2. Create a Python Virtual Environment

In PowerShell or CMD, move to the folder you want, then:

1
$ python -m venv openwebui-env

Activate the virtual environment

1
$ openwebui-env\Scripts\activate

🧩 1-3. Install Open WebUI

With the virtual environment active:

1
$ pip install open-webui

🧩 1-4. Run Open WebUI

1
$ open-webui serve

The default port is 8080

🧩 1-5. Accessing It

In your browser:

1
$ http://localhost:8080

The first time you connect, the Sign Up screen appears,

and the account information you enter is stored only on your PC

🟦 2. Connecting Ollama + Open WebUI on Windows

Open WebUI automatically detects the API server (http://localhost:11434) provided by Ollama.

🧩 2-1. Verify That Ollama Is Running

In PowerShell:

1
$ ollama serve

Or check whether it is running:

1
$ ollama --version

🧩 2-2. Verify the Ollama Connection in Open WebUI

After accessing Open WebUI:

Settings → Models → Ollama Models

The models installed in Ollama appear here automatically.

Example:

1
2
$ ollama pull llama3
$ ollama pull qwen2.5

🧩 2-3. When the Models Don’t Show Up

Manually specify the Ollama API address in Open WebUI:

Settings → LLM Providers → Ollama → API Base URL

Enter:

1
$ http://localhost:11434

On Windows, since this is not Docker, use localhost instead of host.docker.internal.

📌 Flow Summary (Reconstructed Based on the Exact Structure)

① Install Ollama

• Download the Windows installer

• Test a model with ollama run llama3, etc.

② Install Open WebUI

• Choose between the Docker and Python methods

• On Windows, the Python method is the lightest and conflict-free

③ Run Open WebUI

• open-webui serve

• Go to localhost:8080 in your browser

• Create the first account

④ Automatic Integration with Ollama

• Open WebUI automatically detects the Ollama API (11434)

• Check the installed models under Settings → Models

⑤ Download a Model

• In the terminal, run ollama pull llama3

• Can be used right away in Open WebUI

⑥ Troubleshooting

• Models not showing → check the API Base URL

• Port conflict → open-webui serve –port 9000

• Ollama not running → re-run ollama serve

Component Recommendation
Installation method Python method (Open WebUI)
Ollama Standard installation (Windows EXE)
Model llama3 / qwen2.5 / mistral
GPU NVIDIA RTX 3060 or higher
Run open-webui serve + ollama serve

🟦 5. Overall Installation Flow Summary (Windows, Without Docker)

1
2
3
4
5
6
7
8
1) Python Install
2) Ollama Install
3) python -m venv openwebui-env
4) openwebui-env\Scripts\activate
5) pip install open-webui
6) open-webui serve
7) In the browser localhost:8080 access
8) Settings → Models → Ollama Verify connection

Resolving GPU (VRAM) Shortages, Installing Plugins, and Using RAG

Below, for a Windows + Ollama + Open WebUI environment, is a guide covering

everything from resolving GPU (VRAM) shortages → installing Open WebUI plugins → setting up RAG (document upload),

written as a practical, detailed guide that you can apply right away.

It is organized in the following order:

  1. How to Fix GPU (VRAM) Shortages (for Ollama + Open WebUI)

  2. How to Install Open WebUI Plugins (Extensions / Pip Plugins)

  3. Setting Up the RAG (Document Upload) Feature (Vector DB + Document Management + Search)

🟦 1. How to Fix GPU (VRAM) Shortages

VRAM shortages are the most common problem when using

large models such as DeepSeek-R1, Llama3.1, Qwen2.5.

Ways to resolve VRAM shortages in a Windows + Ollama environment, organized by priority

✅ 1) Lowering Quantization — Most Effective

A way to make the model lighter.

Running a Model at Q4 in Ollama

1
$ ollama run deepseek-r1:7b-q4

When Creating a Model Yourself

Specify it in the Modelfile like this:

1
2
FROM deepseek-r1:7b
PARAMETER quantize q4_K_M
Component Recommendation Quality Recommendation
Q4_K_M Very low Good ⭐ Optimal
Q5_K_M Medium Better When you have VRAM to spare
Q8 High Best GPU with 24GB or more

✅ 2) Reducing the Context Length (Open WebUI Setting)

A long context length eats up a lot of VRAM.

Open WebUI → Settings → Models → Advanced → Context Length

• Default: 4096

• When VRAM is insufficient: reduce it to 2048 or 1024

✅ 3) Disable or Reduce the KV Cache

The KV Cache increases speed but uses a lot of VRAM.

Open WebUI → Settings → Performance

• Enable KV Cache → Turn off

• Or reduce the KV Cache Size

✅ 4) Setting a GPU Memory Limit (Windows)

Ollama can limit GPU usage through an environment variable.

PowerShell:

1
$ setx OLLAMA_GPU_MEMORY 6GB

Example:

• 8GB GPU → 5~6GB

• 6GB GPU → 4GB

• 4GB GPU → 3GB

✅ 5) Force CPU Mode (Almost No VRAM Used)

It gets slower, but the VRAM problem is completely resolved.

1
$ ollama run deepseek-r1:7b --cpu

🟩 Summary of Fixes for VRAM Shortages

  1. Use Q4 quantization

  2. Reduce the context length

  3. Reduce the KV Cache

  4. Limit GPU memory

  5. Use CPU mode

🟧 2. How to Install Open WebUI Plugins

Open WebUI is extended in two ways: Extensions(Extension Features) and Pip plugins.

✔️ 2-1. Installing Extensions (Easiest)

Open WebUI → Settings → Extensions

A list of plugins you can install right away appears here.

Example plugins:

Image Generation ```(Stable Diffusion integration)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

```• Speech-to-Text```

```• Text-to-Speech```

```• RAG Tools```

```• Code Interpreter```

```• Web Search```

#### Installation Method

1. Select the plugin you want from the Extensions menu

2. Click Install

3. It is activated automatically


## ✔️ 2-2. Installing Pip Plugins (For Advanced Users)
Since Open WebUI is Python-based, you can install plugins with pip.

### Installation Path

In the Open WebUI backend virtual environment:
```bash
$ pip install open-webui-plugin-xxxx

Example:

1
2
$ pip install open-webui-plugin-rag
$ pip install open-webui-plugin-websearch

Activating the Plugin

Open WebUI → Settings → Extensions → Installed
→ Plugin ON

✔️ 2-3. Installing Custom Plugins

You can also pull a plugin directly from GitHub.

1
2
3
4
$ git clone https://github.com/Username/pluginname.git
$ cd plugin_name
$ pip install .

🟪 3. Setting Up the RAG (Document Upload) Feature

RAG is a feature that takes PDF, Word,
and text files you upload → embeds them in a vector DB →

and gives document-based answers when you ask a question.

Open WebUI has the RAG feature built in by default.

✔️ 3-1. Enabling RAG

Open WebUI → Settings → RAG

Turn on the following items:

• Enable RAG

• Enable Document Upload

• Enable Embeddings

✔️ 3-2. Choosing a Vector DB

Open WebUI uses ChromaDB by default

Settings path:

1
$ Settings → RAG → Vector Database

Available options:

• ChromaDB (default)

• Milvus

• Weaviate

• Qdrant

On Windows, ChromaDB is the most stable.

✔️ 3-3. Uploading Documents

Open WebUI left menu → Documents

Supported files:

• PDF

• DOCX

• TXT

• Markdown

• HTML

Once uploaded, embeddings are generated automatically.

✔️ 3-4. How to Use RAG

When asking a question in the chat window:

1
2
#RAG
Extract the most important takeaways from this document.

Or you can just ask a question, and a document-based answer comes out automatically.

✔️ 3-5. Advanced RAG Settings

Settings → RAG → Advanced

• Chunk Size: 512~1024 recommended

• Chunk Overlap: 50~100

• Embedding Model:

• nomic-embed-text

• bge-large

• sentence-transformers

🟩 Overall Summary (Windows + Ollama + Open WebUI)

✔️ Resolving VRAM Shortages

• Q4 quantization

• Reduce the context length

• Reduce the KV Cache

• Limit GPU memory

• CPU mode

✔️ Installing Plugins

• Settings → Extensions → Install

• Or pip install

✔️ RAG Setup

• Settings → RAG → Enable

• Upload files from the Documents menu

• ChromaDB used by default