Einleitung
In der Welt der KI-gestützten Anwendungen und lokalen Large Language Models (LLMs) haben sich verschiedene Frameworks und Tools etabliert. Ollama ist eine benutzerfreundliche Plattform zum Ausführen von LLMs auf lokalen Systemen, während Hermes Agent ein intelligenter KI-Agent ist, der auf verschiedenen Sprachmodellen aufbaut. OpenClaw hingegen ist ein alternatives Framework für die Automatisierung und KI-Integration.
Dieses Tutorial zeigt Ihnen, wie Sie Ollama mit Hermes Agent einrichten und nutzen, welche Vorteile diese Kombination bietet und wie sie sich von OpenClaw unterscheidet. Sie lernen die praktische Implementierung auf Linux und Windows kennen und erhalten wichtige Einblicke in die Unterschiede der verschiedenen Ansätze.
Systemvoraussetzungen
| Komponente | Minimum | Empfohlen | Bemerkung |
|---|---|---|---|
| CPU | 4 Kerne, 2.0 GHz | 8+ Kerne, 3.0 GHz | AVX2-Unterstützung empfohlen |
| RAM | 8 GB | 16-32 GB | Je nach Modellgröße |
| Festplatte | 20 GB frei | 100+ GB SSD | Für mehrere Modelle |
| GPU (optional) | – | NVIDIA RTX 3060+ / AMD RX 6600+ | CUDA/ROCm-Unterstützung |
| Linux | Ubuntu 20.04+ | Ubuntu 22.04+ / RHEL 8+ | Kernel 5.4+ |
| Windows | Windows 10 (1909+) | Windows 11 | WSL2 für bessere Performance |
Benötigte Ports
- Port 11434: Ollama API Server (TCP, eingehend)
- Port 8080: Hermes Agent Web Interface (TCP, eingehend)
- Port 3000: Alternative Web-UI Port (TCP, eingehend)
- Ports 443/80: HTTPS/HTTP für Model Downloads (TCP, ausgehend)
Vorbereitung
Linux (Ubuntu/Debian)
System aktualisieren und grundlegende Abhängigkeiten installieren:
sudo apt update && sudo apt upgrade -y
sudo apt install -y curl wget git build-essential python3 python3-pip nodejs npm
sudo apt install -y software-properties-common apt-transport-https ca-certificates gnupg lsb-release
Linux (RHEL/CentOS/Fedora)
sudo dnf update -y
sudo dnf groupinstall -y "Development Tools"
sudo dnf install -y curl wget git python3 python3-pip nodejs npm
sudo dnf install -y ca-certificates gnupg
Windows
Installieren Sie zunächst die erforderlichen Tools:
- Windows Subsystem for Linux 2 (WSL2) für bessere Performance
- Windows Terminal aus dem Microsoft Store
- Git for Windows von der offiziellen Website
- Python 3.8+ von python.org
- Node.js 16+ von nodejs.org
# In PowerShell als Administrator
wsl --install -d Ubuntu-22.04
# System nach Installation neustarten
Installation
Schritt 1: Ollama Installation
Linux Installation
# Ollama herunterladen und installieren
curl -fsSL https://ollama.ai/install.sh | sh
# Ollama Dienst starten
sudo systemctl start ollama
sudo systemctl enable ollama
# Installation verifizieren
ollama --version
Windows Installation
# Download der Windows-Version
curl -L -o ollama-windows-amd64.exe https://ollama.ai/download/ollama-windows-amd64.exe
# Installation ausführen (als Administrator)
./ollama-windows-amd64.exe
# Umgebungsvariablen setzen
[Environment]::SetEnvironmentVariable("OLLAMA_HOST", "0.0.0.0:11434", "Machine")
Schritt 2: Hermes Agent Setup
Hermes Agent basiert auf verschiedenen LLMs und kann mit Ollama integriert werden:
# Repository klonen
git clone https://github.com/NousResearch/Hermes-Agent.git
cd Hermes-Agent
# Python Virtual Environment erstellen
python3 -m venv hermes-env
source hermes-env/bin/activate # Linux
# oder
hermes-env\Scripts\activate # Windows
# Abhängigkeiten installieren
pip install -r requirements.txt
pip install ollama-python requests fastapi uvicorn
Schritt 3: Hermes Modelle in Ollama laden
# Hermes 2.5 Mistral 7B installieren
ollama pull adrienbrault/nous-hermes2-mixtral:8x7b-dpo-q4_0
# Alternative: Kleineres Modell für schwächere Hardware
ollama pull nous-hermes2:10.7b-solar-q4_K_M
# Verfügbare Modelle auflisten
ollama list
Konfiguration
Ollama Konfiguration
Erstellen Sie eine Konfigurationsdatei für Ollama:
# /etc/ollama/config.env (Linux) oder %APPDATA%\Ollama\config.env (Windows)
OLLAMA_HOST=0.0.0.0:11434
OLLAMA_MAX_LOADED_MODELS=2
OLLAMA_NUM_PARALLEL=4
OLLAMA_MAX_QUEUE=512
OLLAMA_DEBUG=false
OLLAMA_FLASH_ATTENTION=true
Hermes Agent Konfiguration
# config/hermes-config.yaml
server:
host: "0.0.0.0"
port: 8080
debug: false
ollama:
base_url: "http://localhost:11434"
model: "nous-hermes2:10.7b-solar-q4_K_M"
timeout: 120
agent:
max_iterations: 10
temperature: 0.7
max_tokens: 2048
system_prompt: "You are Hermes, a helpful AI assistant."
logging:
level: "INFO"
file: "logs/hermes-agent.log"
Hermes Agent Startup Script
# hermes_server.py
import os
import asyncio
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
import ollama
app = FastAPI(title="Hermes Agent API")
class ChatRequest(BaseModel):
message: str
model: str = "nous-hermes2:10.7b-solar-q4_K_M"
class ChatResponse(BaseModel):
response: str
model: str
@app.post("/chat", response_model=ChatResponse)
async def chat(request: ChatRequest):
try:
response = ollama.generate(
model=request.model,
prompt=request.message,
stream=False
)
return ChatResponse(
response=response['response'],
model=request.model
)
except Exception as e:
raise HTTPException(status_code=500, detail=str(e))
@app.get("/models")
async def list_models():
try:
models = ollama.list()
return {"models": [model['name'] for model in models['models']]}
except Exception as e:
raise HTTPException(status_code=500, detail=str(e))
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=8080)
Firewall-Regeln setzen
Linux (UFW)
# UFW aktivieren (falls nicht bereits aktiv)
sudo ufw enable
# Ollama API Port öffnen
sudo ufw allow 11434/tcp comment "Ollama API"
# Hermes Agent Web Interface
sudo ufw allow 8080/tcp comment "Hermes Agent"
# Optional: Nur bestimmte IP-Bereiche zulassen
sudo ufw allow from 192.168.1.0/24 to any port 11434
sudo ufw allow from 192.168.1.0/24 to any port 8080
# Firewall Status prüfen
sudo ufw status verbose
Linux (Firewalld)
# Ports dauerhaft öffnen
sudo firewall-cmd --permanent --add-port=11434/tcp
sudo firewall-cmd --permanent --add-port=8080/tcp
# Rich Rules für erweiterte Kontrolle
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.1.0/24" port protocol="tcp" port="11434" accept'
# Konfiguration neu laden
sudo firewall-cmd --reload
# Status prüfen
sudo firewall-cmd --list-all
Windows
# In PowerShell als Administrator
# Eingehende Regel für Ollama
New-NetFirewallRule -DisplayName "Ollama API" -Direction Inbound -Protocol TCP -LocalPort 11434 -Action Allow
# Eingehende Regel für Hermes Agent
New-NetFirewallRule -DisplayName "Hermes Agent" -Direction Inbound -Protocol TCP -LocalPort 8080 -Action Allow
# Regeln für lokales Netzwerk beschränken
New-NetFirewallRule -DisplayName "Ollama Local" -Direction Inbound -Protocol TCP -LocalPort 11434 -RemoteAddress LocalSubnet -Action Allow
Dienst starten und beim Systemstart aktivieren
Linux Systemd Service für Hermes Agent
# /etc/systemd/system/hermes-agent.service
[Unit]
Description=Hermes Agent Service
After=network.target ollama.service
Requires=ollama.service
[Service]
Type=simple
User=hermes
Group=hermes
WorkingDirectory=/opt/hermes-agent
Environment=PATH=/opt/hermes-agent/hermes-env/bin
ExecStart=/opt/hermes-agent/hermes-env/bin/python hermes_server.py
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
# Service aktivieren und starten
sudo systemctl daemon-reload
sudo systemctl enable hermes-agent.service
sudo systemctl start hermes-agent.service
# Status prüfen
sudo systemctl status hermes-agent.service
sudo systemctl status ollama.service
Windows Service
Für Windows erstellen Sie eine Batch-Datei und nutzen NSSM (Non-Sucking Service Manager):
# start-hermes.bat
@echo off
cd /d "C:\hermes-agent"
call hermes-env\Scripts\activate.bat
python hermes_server.py
# NSSM installieren und Service erstellen
nssm install HermesAgent "C:\hermes-agent\start-hermes.bat"
nssm set HermesAgent Start SERVICE_AUTO_START
nssm start HermesAgent
Installation verifizieren
Ollama Test
# Einfacher Chat-Test
ollama run nous-hermes2:10.7b-solar-q4_K_M "Hello, who are you?"
# API-Test
curl -X POST http://localhost:11434/api/generate \
-H "Content-Type: application/json" \
-d '{
"model": "nous-hermes2:10.7b-solar-q4_K_M",
"prompt": "Explain quantum computing in simple terms",
"stream": false
}'
Hermes Agent Test
# API-Endpunkt testen
curl -X POST http://localhost:8080/chat \
-H "Content-Type: application/json" \
-d '{
"message": "What are your capabilities as Hermes Agent?",
"model": "nous-hermes2:10.7b-solar-q4_K_M"
}'
# Verfügbare Modelle abfragen
curl http://localhost:8080/models
Performance-Test
# performance_test.py
import time
import requests
import json
def test_response_time():
url = "http://localhost:8080/chat"
payload = {
"message": "Write a short poem about technology",
"model": "nous-hermes2:10.7b-solar-q4_K_M"
}
start_time = time.time()
response = requests.post(url, json=payload)
end_time = time.time()
print(f"Response Time: {end_time - start_time:.2f} seconds")
print(f"Status Code: {response.status_code}")
if response.status_code == 200:
result = response.json()
print(f"Response Length: {len(result['response'])} characters")
test_response_time()
Unterschiede zwischen Ollama/Hermes Agent und OpenClaw
Architektur und Fokus
| Aspekt | Ollama + Hermes Agent | OpenClaw |
|---|---|---|
| Primärer Fokus | Lokale LLM-Ausführung und KI-Assistenz | Automatisierung und Workflow-Management |
| Architektur | Model-Server + Agent-Framework | Plugin-basiertes Automatisierungsframework |
| Hauptzielgruppe | KI-Entwickler, Forscher | DevOps, Systemadministratoren |
| Komplexität | Mittel bis Hoch | Hoch |
Technische Unterschiede
Vorteile von Ollama + Hermes Agent:
- Datenschutz: Vollständig lokale Ausführung ohne Cloud-Abhängigkeiten
- Flexibilität: Unterstützung verschiedener LLM-Modelle
- Performance: Optimiert für moderne Hardware (GPU-Acceleration)
- Community: Aktive Entwicklung und große Modell-Bibliothek
- Integration: Einfache API für eigene Anwendungen
Vorteile von OpenClaw:
- Automatisierung: Spezialisiert auf komplexe Workflows
- Enterprise-Features: Erweiterte Logging- und Monitoring-Funktionen
- Skalierbarkeit: Cluster-fähige Architektur
- Security: Erweiterte Sicherheitsfeatures für Produktionsumgebungen
Anwendungsfälle im Vergleich
Ollama + Hermes Agent eignet sich für:
- Lokale KI-Assistenten und Chatbots
- Code-Generierung und -Review
- Dokumentenanalyse und Zusammenfassung
- Forschung und Entwicklung im KI-Bereich
- Privacy-focused AI-Anwendungen
OpenClaw eignet sich für:
- Komplexe Deployment-Pipelines
- Multi-System-Orchestrierung
- Enterprise-Automatisierung
- Compliance und Audit-Workflows
- Legacy-System-Integration
Troubleshooting
Häufige Ollama-Probleme
Problem: „Model not found“ Fehler
# Verfügbare Modelle prüfen
ollama list
# Modell explizit herunterladen
ollama pull nous-hermes2:10.7b-solar-q4_K_M
# Cache leeren
rm -rf ~/.ollama/models/cache
Problem: Hohe RAM-Nutzung
# Kleineres Modell verwenden
ollama pull nous-hermes2:7b-q4_0
# Modell-Parameter anpassen
export OLLAMA_NUM_PARALLEL=2
export OLLAMA_MAX_LOADED_MODELS=1
Problem: Langsame Performance
# GPU-Acceleration prüfen
nvidia-smi # Für NVIDIA
rocm-smi # Für AMD
# CPU-Optimierung
export OMP_NUM_THREADS=$(nproc)
export OLLAMA_FLASH_ATTENTION=true
Häufige Hermes Agent-Probleme
Problem: Connection refused zu Ollama
# Ollama-Status prüfen
systemctl status ollama
netstat -tlnp | grep 11434
# Konfiguration prüfen
curl http://localhost:11434/api/version
Problem: Python-Abhängigkeiten
# Virtual Environment neu erstellen
rm -rf hermes-env
python3 -m venv hermes-env
source hermes-env/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
Log-Analyse
# Ollama Logs
sudo journalctl -u ollama -f
# Hermes Agent Logs
tail -f logs/hermes-agent.log
# System-Ressourcen überwachen
htop
iotop
nvidia-smi -l 1 # GPU-Monitoring
Netzwerk-Debugging
# Port-Verfügbarkeit prüfen
ss -tlnp | grep -E "(11434|8080)"
# Firewall-Rules testen
sudo ufw status numbered
sudo iptables -L -n -v
# Verbindungstest von extern
telnet <server-ip> 11434
telnet <server-ip> 8080
Updates und Wartung
Ollama Updates
# Ollama auf neueste Version aktualisieren
curl -fsSL https://ollama.ai/install.sh | sh
# Alternative: Manuelle Installation
sudo systemctl stop ollama
wget https://ollama.ai/download/ollama-linux-amd64.tgz
sudo tar -C /usr -xzf ollama-linux-amd64.tgz
sudo systemctl start ollama
# Modelle aktualisieren
ollama pull nous-hermes2:10.7b-solar-q4_K_M
Hermes Agent Updates
# Repository aktualisieren
cd /opt/hermes-agent
git pull origin main
# Python-Abhängigkeiten aktualisieren
source hermes-env/bin/activate
pip install --upgrade -r requirements.txt
# Service neu starten
sudo systemctl restart hermes-agent
Wartungsaufgaben
# Log-Rotation einrichten
# /etc/logrotate.d/hermes-agent
/opt/hermes-agent/logs/*.log {
weekly
missingok
rotate 12
compress
delaycompress
create 644 hermes hermes
postrotate
systemctl reload hermes-agent
endscript
}
Backup-Strategie
# Backup-Script erstellen
#!/bin/bash
# backup-hermes.sh
BACKUP_DIR="/backup/hermes-agent/$(date +%Y%m%d)"
mkdir -p "$BACKUP_DIR"
# Konfigurationsdateien sichern
cp -r /opt/hermes-agent/config "$BACKUP_DIR/"
# Ollama-Modelle sichern (optional, sehr groß)
# cp -r ~/.ollama/models "$BACKUP_DIR/"
# Logs sichern
cp -r /opt/hermes-agent/logs "$BACKUP_DIR/"
# Komprimieren
tar -czf "$BACKUP_DIR.tar.gz" -C /backup/hermes-agent "$(basename $BACKUP_DIR)"
rm -rf "$BACKUP_DIR"
Monitoring-Setup
# Einfaches Health-Check-Script
#!/bin/bash
# health-check.sh
check_ollama() {
if curl -s http://localhost:11434/api/version > /dev/null; then
echo "✓ Ollama is running"
else
echo "✗ Ollama is not responding"
return 1
fi
}
check_hermes() {
if curl -s http://localhost:8080/models > /dev/null; then
echo "✓ Hermes Agent is running"
else
echo "✗ Hermes Agent is not responding"
return 1
fi
}
check_ollama && check_hermes
Fazit und nächste Schritte
Die Kombination aus Ollama und Hermes Agent bietet eine leistungsfähige Plattform für lokale KI-Anwendungen mit hohem Datenschutz und Flexibilität. Im Gegensatz zu OpenClaw, das sich auf Systemautomatisierung fokussiert, ermöglicht diese Lösung den Aufbau intelligenter, konversationeller AI-Systeme.
Wichtige Erkenntnisse:
- Ollama + Hermes Agent: Ideal für KI-Entwicklung, lokale LLM-Deployment und privacy-focused Anwendungen
- OpenClaw: Besser geeignet für komplexe Automatisierung und Enterprise-Workflows
- Ressourcenanforderungen: Erhebliche Hardware-Anforderungen für optimale Performance
- Flexibilität: Verschiedene Modelle je nach Anwendungsfall wählbar
Nächste Schritte:
- Experimentieren Sie mit verschiedenen Modellen um die beste Performance für Ihren Anwendungsfall zu finden
- Implementieren Sie Monitoring für Produktionsumgebungen
- Erweitern Sie die API um zusätzliche Funktionalitäten
- Integrieren Sie Sicherheitsmaßnahmen wie Authentication und Rate-Limiting
- Skalieren Sie horizontal mit Load Balancing für höhere Lasten