From b3824f4a3c7e1ea6bc0af7247ade5659a283660e Mon Sep 17 00:00:00 2001 From: farshad68 Date: Mon, 6 Jul 2026 13:41:07 +0200 Subject: [PATCH] add offline Ollama and model setup tutorial (EN/DE) --- .gitignore | 1 + de/basic/administrator/README.md | 4 ++ de/basic/administrator/offline-ollama.md | 58 ++++++++++++++++++++++ en/basic/administrator/index.md | 3 ++ en/basic/administrator/offline-ollama.md | 63 ++++++++++++++++++++++++ 5 files changed, 129 insertions(+) create mode 100644 .gitignore create mode 100644 de/basic/administrator/offline-ollama.md create mode 100644 en/basic/administrator/offline-ollama.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a09c56d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.idea diff --git a/de/basic/administrator/README.md b/de/basic/administrator/README.md index 875707d..ddba1ef 100644 --- a/de/basic/administrator/README.md +++ b/de/basic/administrator/README.md @@ -50,6 +50,10 @@ Eine kurze Liste empfohlener Sprachmodelle zum Herunterladen wird für einen sch #### Externe Sprachmodelle Ein externes (lokales oder Remote-) Sprachmodell kann verwendet werden, wenn es über eine OpenAI- oder Ollama-kompatible API verfügbar ist. Sie benötigen eine API-URL und (falls erforderlich) ein Zugriffstoken. + +##### Air-Gapped- / Offline-Umgebungen +Wenn der Zielrechner keinen Internetzugang hat, können Sie Modelle nicht über den integrierten Assistenten herunterladen. Sie müssen Ollama und die Modelldateien manuell übertragen. Eine Schritt-für-Schritt-Anleitung finden Sie im [Leitfaden zur Offline-Einrichtung von Ollama](offline-ollama.md). + ##### OpenAI's ChatGPT API-Typ : ChatOpenAI diff --git a/de/basic/administrator/offline-ollama.md b/de/basic/administrator/offline-ollama.md new file mode 100644 index 0000000..4cc74a8 --- /dev/null +++ b/de/basic/administrator/offline-ollama.md @@ -0,0 +1,58 @@ +--- +layout: default +title: Offline-Einrichtung von Ollama & Modellen +nav_order: 2 +permalink: /de/basic/administrator/offline-ollama/ +parent: Administrator-Dokumentation +--- + +# Offline-Einrichtung von Ollama und Modellen + +Diese Anleitung führt Sie durch die Bereitstellung von Ollama und Ihrem gewählten Sprachmodell auf einem Air-Gapped-Rechner (ohne Internetverbindung). + +## Voraussetzungen +* Ein **Online-PC** (zum Herunterladen der initialen Dateien). +* Ein **USB-Stick** oder eine Netzwerkübertragungsmethode, um die Dateien auf den Offline-Ziel-PC zu verschieben. + +--- + +## Schritt-für-Schritt-Anleitung + +1. Laden Sie die Ollama Linux-Binärdatei direkt herunter: + + ```sh + curl -L https://ollama.com/download/ollama-linux-amd64.tar.zst -o ollama-linux-amd64.tar.zst + ``` + +2. Modellgewichte herunterladen: + Navigieren Sie zu einem Modell-Repository wie HuggingFace und laden Sie die .gguf-Datei für Ihr gewünschtes Modell herunter (z. B. nach gemma-3-27b-it-GGUF suchen). Speichern Sie diese Datei lokal (z. B. gemma-3-27b.gguf). + +3. Dateien übertragen: + Kopieren Sie sowohl `ollama-linux-amd64.tar.zst` als auch die `.gguf`-Datei auf Ihr tragbares Speichermedium. + +4. Ollama installieren (Offline-PC): + Verschieben Sie die Dateien von Ihrem Speichermedium auf den Offline-Rechner. + * Entpacken Sie die Binärdatei systemweit: + *(Hinweis: Stellen Sie sicher, dass auf Ihrer Offline-Linux-Distribution `zstd` installiert ist. Falls nicht, entpacken Sie das Archiv auf Ihrem Online-Rechner und packen es als standardmäßiges `.tar.gz` neu, bevor Sie es übertragen).* + ```sh + sudo tar --zstd -xf ollama-linux-amd64.tar.zst -C /usr + ``` + * Starten Sie den Ollama-Daemon: + ```sh + ollama serve & + ``` + +5. Modell importieren (Offline-PC): + Erstellen Sie ein Modelfile: + Erstellen Sie im exakt selben Verzeichnis, in dem Sie Ihre übertragene `.gguf`-Datei abgelegt haben, eine Textdatei namens `Modelfile`. Fügen Sie eine einzelne Zeile hinzu, die auf die Modelldatei verweist: + ```text + FROM ./[Dateiname].gguf + ``` + Modell in Ollama erstellen und registrieren: +6. ``` + ollama create gemma3-offline -f ./Modelfile + ``` + + + API-URL: http://localhost:11434 + diff --git a/en/basic/administrator/index.md b/en/basic/administrator/index.md index 538a3b8..c40a9a2 100644 --- a/en/basic/administrator/index.md +++ b/en/basic/administrator/index.md @@ -63,6 +63,9 @@ Learn2RAG can download and deploy a language model. That is done with Ollama which is automatically started. An overview of available models: . +##### Air-gapped / Offline Environments +If your deployment machine has no internet access, you cannot download models via the built-in wizard. You must manually transfer Ollama and the model files. See the [Offline Ollama Setup Guide](offline-ollama.md) for step-by-step instructions. + ##### Suggested language models A short list of suggested language models to download is provided for a quick start. diff --git a/en/basic/administrator/offline-ollama.md b/en/basic/administrator/offline-ollama.md new file mode 100644 index 0000000..d9c6d55 --- /dev/null +++ b/en/basic/administrator/offline-ollama.md @@ -0,0 +1,63 @@ +--- +layout: default +title: Offline Ollama & Model Setup +nav_order: 2 +permalink: /en/basic/administrator/offline-ollama/ +parent: Administrator Documentation +--- + +# Setting Up Ollama and Models Offline + +This guide walks you through deploying Ollama and your chosen Language Model on an air-gapped machine with no internet connection. + +## Prerequisites +* An **online PC** (to download the initial files). +* A **USB drive** or network transfer method to move files to the offline target PC. + +--- + +## Step-by-Step Procedure + + + +1. Download the Ollama Linux binary directly: + + ```sh + curl -L https://ollama.com/download/ollama-linux-amd64.tar.zst -o ollama-linux-amd64.tar.zst + + ``` + +2. Download the model weights: + Navigate to a model repository like HuggingFace and download the .gguf file for your desired model (e.g., search for gemma-3-27b-it-GGUF). Save this file locally (e.g., gemma-3-27b.gguf). + +3. Transfer the Files + Copy both ollama-linux-amd64.tar.zst and the .gguf file to your portable storage drive. + +4. Install Ollama (Offline PC) + Move the files from your storage drive to the offline machine. + * Extract the binary system-wide: + (Note: Ensure your offline Linux distribution has zstd installed. If it does not, unpack and repack the archive as a standard .tar.gz on your online machine before transferring). + ``` + sudo tar --zstd -xf ollama-linux-amd64.tar.zst -C /usr + ``` + * Start the Ollama daemon: + ``` + ollama serve & + ``` +5. Import the Model (Offline PC) + Create a Modelfile: + In the exact same directory where you placed your transferred .gguf file, create a text file named "Modelfile". Add a single line pointing to the model file: + ``` + FROM ./[filename].gguf + + ``` + +6. Build and register the model in Ollama: + ``` + ollama create gemma3-offline -f ./Modelfile + + ``` + + +API URL: http://localhost:11434 +