Skip to content

ZTF666/ORICHALCUM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NEA — Ollama & Open WebUI Manager

Tested on Raspberry Pi 5 16 GB Platform Shell License

A terminal-based control panel for managing Ollama (local AI models) and Open WebUI (a ChatGPT-like web interface that runs locally). Written in Bash, no installation needed beyond the dependencies.

Developed and tested on a Raspberry Pi 5 (16 GB RAM). Works on any Linux system, but the model recommendations and default paths in this README are tuned for that hardware.

 ██████╗ ██████╗ ██╗ ██████╗██╗  ██╗ █████╗ ██╗      ██████╗██╗   ██╗███╗   ███╗
██╔═══██╗██╔══██╗██║██╔════╝██║  ██║██╔══██╗██║     ██╔════╝██║   ██║████╗ ████║
██║   ██║██████╔╝██║██║     ███████║███████║██║     ██║     ██║   ██║██╔████╔██║
██║   ██║██╔══██╗██║██║     ██╔══██║██╔══██║██║     ██║     ██║   ██║██║╚██╔╝██║
╚██████╔╝██║  ██║██║╚██████╗██║  ██║██║  ██║███████╗╚██████╗╚██████╔╝██║ ╚═╝ ██║
 ╚═════╝ ╚═╝  ╚═╝╚═╝ ╚═════╝╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝     ╚═╝

NEA demo screenshot


Table of Contents

  1. What does this do?
  2. Recommended hardware
  3. Requirements
  4. Installation
  5. Running the script
  6. Main Menu
  7. Managing Docker Containers
  8. Managing Ollama Models
  9. How to change or add AI models
  10. Fixing connection issues
  11. Networking explained
  12. Customizing paths
  13. Troubleshooting
  14. Contributors
  15. License

What does this do?

Running AI models locally means juggling two separate services:

  • Ollama — the engine that downloads and runs AI models on your machine
  • Open WebUI — a browser-based chat interface (think local ChatGPT) that talks to Ollama via Docker

Getting these two to talk to each other can be frustrating, especially when Ollama binds to localhost only and Docker can't reach it. NEA handles all of that automatically — it starts Ollama with the right network settings, launches Open WebUI pointed at the correct address, and gives you a simple menu to manage everything.


Recommended hardware

This script was built and runs daily on a Raspberry Pi 5 (16 GB RAM). That's enough headroom to run medium-sized models comfortably while Open WebUI and the OS run alongside them.

RAM What you can run
4 GB Small models only — llama3.2:3b, gemma2:2b, phi3:mini
8 GB Mid-range models — llama3.2:latest, mistral:latest, qwen2.5:7b
16 GB Comfortable headroom for 7B–14B models — qwen2.5:14b, llama3.1:8b, deepseek-r1:7b
32 GB+ Large models — llama3.1:70b (quantized), qwen2.5:32b

Pi 5 16 GB sweet spot models:

  • qwen2.5:14b — best quality you can run without hitting swap
  • llama3.1:8b — fast responses, great all-rounder
  • deepseek-r1:7b — excellent for reasoning and step-by-step tasks
  • mistral:latest — very fast, good for quick lookups and summarizing

Cooling matters. Running a 14B model continuously will push the Pi 5 CPU hard. An active cooler (the official Pi 5 case fan or a heatsink + fan) is strongly recommended to avoid thermal throttling.


Requirements

You need these four tools installed before running the script:

Tool What it's for Install
docker Runs Open WebUI in a container docs.docker.com/get-docker
ollama Downloads and runs AI models ollama.com/download
curl Checks if Ollama is reachable Usually pre-installed
ss Checks which ports are open Usually pre-installed (iproute2 package)
python3 Parses JSON responses safely Usually pre-installed

The script checks for all of these when it starts and will tell you exactly which ones are missing if any are not found.

Note for Raspberry Pi / ARM users: Docker and Ollama both have ARM-compatible versions. Make sure you install the correct builds for your architecture.


Installation

  1. Download the script

    git clone https://github.com/YOUR_USERNAME/nea.git
    cd nea

    Or just download the file directly:

    curl -O https://raw.githubusercontent.com/YOUR_USERNAME/nea/main/nea.sh
  2. Make it executable

    chmod +x nea.sh

That's it. No package manager, no virtual environment, no build step.


Running the script

./nea.sh

Or from anywhere if you put it on your PATH:

sudo cp nea.sh /usr/local/bin/nea
nea

When it starts, the script will:

  1. Check that all required tools are installed
  2. Detect whether Ollama is running — and start it automatically if it isn't
  3. Make sure Ollama is listening on the correct network interface so Docker can reach it
  4. Drop you into the main menu

Why does it ask for sudo? Configuring the Ollama systemd service (so it survives reboots) requires root. If you don't have a systemd service, it runs Ollama as a background process without sudo. You can run the script as a regular user — it will only call sudo when it needs to write to /etc/systemd/system/.


Main Menu

[✓] Ollama Status: Running
[✓] Network: Accessible to Docker (0.0.0.0:11434)

[i] Options:
  [1] Show Docker Images / Containers
  [2] Show Ollama Models
  [3] Fix Ollama Service (if WebUI can't see models)
  [4] Restart Open WebUI
  [5] Exit

The two status lines at the top tell you at a glance whether everything is working:

  • Ollama Status: Running — the model engine is up
  • Network: Accessible to Docker — Ollama is bound to 0.0.0.0 so Docker containers can reach it; if this shows yellow it means Open WebUI won't be able to see your models (use option 3 to fix it)

Managing Docker Containers

Option 1 from the main menu opens the Docker panel.

It lists every container on your system (running or stopped) along with its image name and a clickable localhost URL if it has an exposed port.

[i] Docker Containers:
  [1] ghcr.io/open-webui/open-webui:main -> open-webui -> Running -> http://localhost:3000
  [2] postgres:15 -> my-db -> Stopped

  [s] Stop all running containers
  [b] Back to Main Menu

Selecting a container by number gives you four actions:

Action What it does
Start Starts a stopped container
Stop Stops a running container (asks for confirmation first)
Restart Stops then starts the container
View Logs Streams the last 50 lines of logs live (press Ctrl+C to exit)

[s] Stop all — lists every running container and asks you to confirm before stopping them all.


Managing Ollama Models

Option 2 from the main menu opens the Ollama models panel.

It shows every model you have installed along with its size and quantization info:

[i] Ollama Models:
  [1] llama3.2:latest    -> Installed (3.2 GB Q4_K_M)
  [2] qwen2.5:7b         -> Installed (4.7 GB Q4_K_M)
  [3] mistral:latest     -> Installed (4.1 GB Q4_0)

  [p] Pull a new model
  [t] Test Ollama API connection
  [r] Refresh model list
  [b] Back to Main Menu

Selecting a model by number gives you three actions:

Action What it does
Test with a prompt Sends a prompt to the model and prints the response right in the terminal
Show model info Displays the model card (parameters, license, system prompt if any)
Delete this model Removes the model files from disk (frees up storage, asks for confirmation)

How to change or add AI models

Finding models

Browse the full library at ollama.com/library.

Popular starting points:

Model Size Good for Pi 5 16 GB
llama3.2:latest ~2 GB General chat, fast on CPU
llama3.2:3b ~2 GB Lightweight, runs on 4 GB RAM
llama3.1:8b ~4.7 GB Better quality, good all-rounder ✓ Sweet spot
qwen2.5:7b ~4.7 GB Multilingual, coding
qwen2.5:14b ~9 GB High quality, best for Pi 5 16 GB ✓ Sweet spot
mistral:latest ~4.1 GB Fast, good for summarizing
codellama:7b ~3.8 GB Code generation
phi3:mini ~2.2 GB Microsoft's small model, very fast
gemma2:2b ~1.6 GB Google's smallest model
deepseek-r1:7b ~4.7 GB Reasoning / chain-of-thought ✓ Sweet spot
qwen2.5:32b ~20 GB Very high quality ✗ Too large

How much RAM do I need? A rough rule: the model file size + ~20% overhead. A 4 GB model needs about 5 GB of free RAM. If you're tight on memory, pick a smaller variant (e.g. :3b instead of :7b). On a Pi 5 16 GB, anything up to ~14B parameters runs well.

Pulling (downloading) a new model

  1. Open NEA: ./nea.sh
  2. Press 2 (Ollama Models)
  3. Press p (Pull a new model)
  4. Type the model name, for example: llama3.2:latest
  5. Wait for the download to finish (progress is shown in the terminal)

The model is now available in Open WebUI automatically — no restart needed.

You can also pull from outside the menu at any time:

ollama pull llama3.2:latest

Switching models in Open WebUI

Open WebUI shows all installed Ollama models in a dropdown at the top of the chat interface. Just select the one you want — no configuration needed.

Removing a model

  1. Open NEA → Option 2 (Ollama Models)
  2. Select the model by number
  3. Choose option 3 (Delete this model)
  4. Confirm when prompted

Or from the terminal directly:

ollama rm llama3.2:latest

Changing the model storage location

By default the script stores models at /usr/share/ollama/.ollama/models. To use a different path, open nea.sh and change the two lines that reference this path:

# Around lines 80, 89, and 108 — change this path to wherever you want models stored:
Environment="OLLAMA_MODELS=/usr/share/ollama/.ollama/models"
# and
OLLAMA_MODELS=/usr/share/ollama/.ollama/models OLLAMA_HOST=0.0.0.0:11434 nohup ollama serve ...

For example, to store models on an external drive:

Environment="OLLAMA_MODELS=/mnt/external/ollama/models"

Make sure the directory exists and is writable before changing this:

mkdir -p /mnt/external/ollama/models

Fixing connection issues

If Open WebUI opens in your browser but shows "Could not connect to Ollama" or the model list is empty:

  1. Open NEA: ./nea.sh
  2. The status line at the top will tell you the problem:
    • [!] Network: Only localhost — Ollama isn't reachable by Docker
  3. Press 3 (Fix Ollama Service)

This restarts Ollama with OLLAMA_HOST=0.0.0.0:11434 so Docker can reach it, and if you have a systemd service it writes a persistent override so the fix survives reboots.

You can also run the connection test to see a full diagnostic:

  1. Option 2 → Ollama Models
  2. Press t (Test Ollama API connection)

This checks three things and tells you exactly what's broken:

  • Can the host reach Ollama at localhost:11434?
  • Can the Open WebUI container reach Ollama through the Docker bridge?
  • What interface is Ollama actually listening on?

Networking explained

Skip this if everything is working — it's background knowledge for when things go wrong.

Ollama by default only listens on 127.0.0.1:11434 (localhost). That's fine if you're using it directly on your machine, but Docker containers live in their own network namespace and can't reach 127.0.0.1 on the host.

The fix is to make Ollama listen on 0.0.0.0:11434 (all interfaces). Docker's bridge network gateway is typically 172.17.0.1 — the script detects this automatically and passes the correct address to Open WebUI when it starts:

Open WebUI (Docker container)
        |
        | http://172.17.0.1:11434   ← Docker bridge gateway
        |
      Host machine
        |
      Ollama (listening on 0.0.0.0:11434)

Security note: Binding to 0.0.0.0 means Ollama is reachable by other machines on your local network (not just Docker). If you're on an untrusted network (public Wi-Fi, shared office network), be aware that others could send requests to your Ollama instance. On a home network this is generally fine.


Customizing paths

Two paths are hardcoded and may need changing depending on your setup:

Model storage path

Default: /usr/share/ollama/.ollama/models

This is where Ollama stores downloaded model files. Change it if:

  • You want models on a larger or external drive
  • Your system uses a different Ollama install path
  • You're running as a different user

See Changing the model storage location above.

Ollama log path (non-systemd only)

Default: /tmp/ollama.log

When Ollama is started without systemd, logs go here. To read them:

tail -f /tmp/ollama.log

Troubleshooting

"Missing required tools: ollama"

Ollama isn't installed. Download it from ollama.com/download.

On Linux:

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

"Missing required tools: docker"

Docker isn't installed. Follow the guide at docs.docker.com/engine/install.

After installing, make sure your user can run Docker without sudo:

sudo usermod -aG docker $USER
# Log out and back in for this to take effect

Open WebUI shows a blank page or won't load

The container may still be starting. Wait 10–15 seconds and refresh. If it still doesn't load:

docker logs open-webui

Open WebUI loads but has no models

  1. Run NEA → Option 3 (Fix Ollama Service)
  2. Then NEA → Option 4 (Restart Open WebUI)
  3. Refresh your browser

Ollama is slow / crashing

Large models need a lot of RAM. If the model file is 4 GB, you need at least 5 GB of free RAM. Check usage with:

free -h

Try a smaller model variant (e.g. llama3.2:3b instead of llama3.1:8b).

"Failed to start Ollama service"

Check the Ollama log:

tail -50 /tmp/ollama.log

Common causes: port 11434 already in use by another process, or a permissions issue on the model directory.

Port 3000 already in use

If something else is running on port 3000, the Open WebUI container will fail to start. Edit nea.sh line 197 and change -p 3000:8080 to a free port, e.g. -p 3001:8080. Then access it at http://localhost:3001.


Accessing Open WebUI

Once everything is running, open your browser and go to:

http://localhost:3000

The first time you visit, you'll be asked to create a local admin account (username + password). This account is stored on your machine only — nothing is sent online.



Contributors

Contributor Role
ZTF666 Creator & maintainer
Claude Sonnet 4.6 (Anthropic) AI pair programmer — code review, documentation, security analysis

License

This project is licensed under the MIT License — see the LICENSE file for details.


Crafted by ZTF — Ad astra per algorithmum

About

Little helper script for my local pi setup

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages