TL;DR — Kurzzusammenfassung
Führen Sie LLMs wie Llama 3, Mistral, Gemma und Phi lokal mit Ollama aus. Installationsanleitung, GPU-Beschleunigung, Docker-Deployment, REST-API und Open WebUI-Integration.
Was ist Ollama?
Ollama ist ein Open-Source-Tool, das das Herunterladen, Ausführen und Verwalten von Sprachmodellen (LLMs) auf Ihrer lokalen Maschine vereinfacht. Denken Sie an Docker für KI-Modelle.
Mit Ollama erhalten Sie:
- Downloads mit einem Befehl —
ollama pull llama3.2 - GPU-Beschleunigung — automatische NVIDIA CUDA und Apple Silicon Metal Unterstützung
- OpenAI-kompatible API — direkter Ersatz für viele Apps
- Vollständiger Datenschutz — Ihre Daten verlassen nie Ihr Netzwerk
- Keine API-Kosten — unbegrenzte Abfragen
- Docker-Support — als Container deployen
Voraussetzungen
- Linux, macOS (Apple Silicon empfohlen), oder Windows 10/11.
- 8 GB RAM Minimum.
- 20+ GB Festplattenspeicher für Modelle.
- Optional: NVIDIA-GPU mit 6+ GB VRAM.
Installation
curl -fsSL https://ollama.com/install.sh | sh
Docker
docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
Beliebte Modelle
| Modell | Größe | Parameter | Ideal Für |
|---|---|---|---|
llama3.2 | 4,7 GB | 8B | Allgemein |
mistral | 4,1 GB | 7B | Schnell und effizient |
gemma2 | 5,4 GB | 9B | Google-Qualitätsmodell |
phi3 | 2,2 GB | 3,8B | Klein und leistungsfähig |
codellama | 3,8 GB | 7B | Code-Generierung |
ollama pull llama3.2
ollama run llama3.2
REST-API
curl http://localhost:11434/api/generate -d '{
"model": "llama3.2",
"prompt": "Was ist ein Reverse Proxy?",
"stream": false
}'
Open WebUI
docker run -d -p 3000:8080 \
--add-host=host.docker.internal:host-gateway \
-v open-webui:/app/backend/data \
--name open-webui \
ghcr.io/open-webui/open-webui:main
Zugriff unter http://localhost:3000.
Zusammenfassung
Ollama ist der schnellste Weg, KI-Modelle lokal auszuführen. Eine curl | sh-Installation gefolgt von ollama pull llama3.2 gibt Ihnen eine funktionale, private lokale KI, die mit der OpenAI-API kompatibel ist.