“βIdeas are cheap. The real magic happens when those ideas survive YAML, GitOps, and Grafana dashboards.β”
Intro
In my last post, I talked about my intent. In this post I will document what I am actually doing (and seeing if intent matches reality)
First up is understanding Open-WebUI
Open Web UI
Website | Github | Documentation
Open WebUI lets you run and talk to AI models locally from your browser β no internet or cloud required. It connects to model backends like Ollama or anything OpenAI-compatible, and comes with advanced features like smart document search (RAG) built-in.
This will be our front end (website) that lets us interact with both local models (hosted in our k8s cluster) and remote models (like ChatGPT). This is the ideal place to start before rolling our your own models.
What is RAG?
Retrieval-Augmented Generation (RAG) is a way of helping AI models give better answers by letting them search through documents or notes you provide β like giving the AI a memory or reference book it can read from before responding.
Reading the documentation and looking for ENV Vars
One of the first things I want to do is read through the documentation and check that the default values for things are set in the way I would want them to be, and pulling out the ones that are not so I can change them in my deployment.
Values I need to set and settings I need to change
Some of these I will set in the helmrelease.yaml
and others in the externalsecrets.yaml
conventionally our would just store secrets in the external secret file but you can also store other ENV VARS there too if you dont want to bloat our your helm release too much.
externalsecrets.yaml
|
|
helmrelease.yaml
|
|
Open-WebUI ENV Var Notes
ENABLE_LOGIN_FORM
- Type:
bool
- Default:
True
- Description: Toggles email, password, sign in and “or” (only when
ENABLE_OAUTH_SIGNUP
is set to True) elements. - Persistence: This environment variable is a
PersistentConfig
variable.
β οΈ DANGER
This should only ever be set toFalse
whenENABLE_OAUTH_SIGNUP
is also being used and set toTrue
.
Failure to do so will result in the inability to login.
ENABLE_OAUTH_SIGNUP
- Type:
bool
- Default:
False
- Description: Enables account creation when signing up via OAuth. Distinct from
ENABLE_SIGNUP
. - Persistence: This environment variable is a
PersistentConfig
variable.
β οΈ DANGER
ENABLE_LOGIN_FORM
must be set toFalse
whenENABLE_OAUTH_SIGNUP
is set toTrue
. Failure to do so will result in the inability to login.
RAG_WEB_SEARCH_ENGINE
- Type:
str
(enum)
π RAG_WEB_SEARCH_ENGINE
Options: Comparison Table
Engine | Description | Pros | Cons |
---|---|---|---|
searxng |
Uses the SearXNG engine | β Self-hostable, privacy-friendly, highly customizable | β May require setup and maintenance |
google_pse |
Google Programmable Search Engine | β Accurate, well-indexed, powerful relevance ranking | β API limits, requires API key |
brave |
Brave Search | β Independent index, private, fast | β May lack depth compared to Google |
kagi |
Kagi Search | β Human-curated results, privacy-respecting | β Paid subscription required for full access |
mojeek |
Mojeek | β Independent crawler, no tracking | β Results less relevant for niche topics |
serpstack |
Serpstack | β Easy API for Google results | β Commercial service, requires API key |
serper |
Serper | β Google-like output, simple API | β API limits, free tier capped |
serply |
Serply | β Tailored for AI + LLM use cases | β Smaller user base, may have reliability issues |
searchapi |
SearchAPI | β Multiple engines supported, flexible | β May introduce latency depending on config |
duckduckgo |
DuckDuckGo | β Privacy-first, no tracking | β No real API (scraped or proxied, limited metadata) |
tavily |
Tavily | β AI-tuned search for RAG, fast | β Still new, smaller index |
jina |
Jina AI | β Vector-aware search options | β Focused more on enterprise & vector DBs |
bing |
Microsoft Bing search engine | β Wide coverage, high-quality results | β Requires API key, tracking concerns |
Note
I will be using Searxng which will require me to deploy that BEFORE I can proceed.
Deploying SearXNG
As is tradition, I will be walking on the shoulders of giants and taking advantage of kubesearch.dev, an amazing website that:
Search Flux HelmReleases through awesome k8s-at-home projects, check it out at https://kubesearch.dev/. We index Flux HelmReleases from Github and Gitlab repositories with the k8s-at-home topic and kubesearch topic. To include your repository in this search it must be public and then add the topic k8s-at-home or kubesearch to your GitHub Repository topics.
My Deployment of SearXNG can be found in my home-ops repo on github
There were a couple of interesting learnings from this deployment
In the settings.yaml
file I wanted to set it up so I could do some regionalised searches so that I could get results for different countries but that, by default, I would get NZ results.
Here are the things I did:
|
|
This allows me to (by default) get localised NZ searches and then just change the language drop down to switch to Canadian, United Kindom, United States or Australian searches
Deploying Open-WebUI
This was a wild ride. Here are the things I wanted to achieve intially.
- Open-WebUI deployed in a basic fashion
- Connected to my paid OpenAI ChatGPT account
- Login handled by PocketID OIDC
- Sharing of OpenAI Model across users in my instance of Open-WebUI
There was some fenagling and misinterpreting of environment variables (there are soo many) But, I got there in the end. You can see my initial (working) deployment here and my current state here
Gaining access to OpenAI (chatGPT models from a free or paid account)
- Browse to https://openai.com/ and Click
Log In
followed byAPI Platform
- If this is your first time here, you will likely need to set an Organization name. I chose to call mine after my cluster
- Once logged in, in the left menu, click
API keys
and in the top right clickCreate new secret key
- Give the secret a name e.g.
Open-WebUI
and assign it to a project (if you have not set any up, then default is fine) - Click
Create Secret key
and copy the value that shows up and store it in your secrets manager under the valueOPENAI_API_KEY
(See myexternalsecrets.yaml
example below)
Deployment Learnings
helmrelease.yaml
|
|
- Make sure you set the Log Level to Debug, it makes deployment and troubleshooting much easier π€£
ENABLE_LOGIN_FORM: "false"
This need to be false if you are using OIDCENABLE_OAUTH_SIGNUP: "true"
If you don’t have this set, then your OIDC provider (PocketID in my case), can’t create an account inside Open-WebUI
externalsecret.yaml
|
|
PROVIDER_URL
andDISCOVERY-URL
are the same damn thing, but different tools call them different things. This should be set to:https://{your OIDC url}/.well-known/openid-configuration
OPENID_REDIRECT_URI
Make sure that the path for this is:https://{Open-WebUI URL}/oauth/oidc/callback
. This needs to be set BOTH in your OIDC config AND your ENV Var in externalsecrets
Configuration learnings
Setting up Groups
If you plan to have more than one user then you should probably setup groups.
- Ensure the other users have logged in via OIDC at least once to have their accounts created
- Navigate to
https://{Open-WebUI URL}/admin/users
and click on Groups. - Click the Plus in the top right to create a new group and give it a name (and a description if needed) and click
Create
- Viewing your new group Click the βοΈ pencil in the top right to edit it
- Click Permissions and reivew them, defaults are likely fine but you may want to make some adjustments
- Click on users and check the box next to each user you want to add to the group
Allowing model access
If like me, you configured OPENAI_API_KEY
in your externalsecret then you will have access to ALL the OpenAI (ChatGPT) models that you plan allows…There is a lot
If you did not (and want to) you will need to go through the process of generating an API Key and adding it to your externalsecret.yaml
see above
- Navigate to your admin settings
https://{Open-WebUI URL}/admin/settings
- In the left manu click on
models
- Here you will see a massive list, feel free to disable as many of these as you see fit. I only retained the following:
gpt-3.5-turbo
gpt-4
gpt-4-turbo
gpt-4o
gpt-4o-mini
- Once you have your list, for each one click on the βοΈ pencil
- Under
Visibility
clickSelect a group
and select the group you created earlier. - Click
Save & Update
- Your other users now have access to use that model
- Repeat this process for the other models.
Chat History
If you are wanting your chat history from ChatGPT you will need to find a way import it directly into the Open-WebUI Database, There is no sync function between Open-WebUI and chat.openai.com
Next Steps
Next steps will be looking to deploy my own models locally so that long term I have no reliance on paid external tools like OpenAI’s ChatGPT