Ollama Setup Guide — AI lokal auf dem PC
Ollama macht lokale AI so einfach wie nie. Ein Befehl genügt, um ein LLM herunterzuladen und zu starten — keine Python-Umgebung, keine GPU-Konfiguration, keine Cloud. Dieser Guide zeigt alles.
Was ist Ollama?
Ollama ist ein Open-Source-Tool, das lokale LLMs (Large Language Models) so einfach macht wie Docker für Container:
``bash`
ollama run llama3.1
Das war's. Ollama lädt das Modell, startet es und bietet ein Chat-Interface. Im Hintergrund nutzt es llama.cpp für effiziente Inferenz auf CPU oder GPU.
Installation
macOS
`
bash
Via Homebrew
brew install ollamaOder Download der App
https://ollama.com/download/mac
`Linux
`bash
curl -fsSL https://ollama.com/install.sh | sh
`Windows
Download von ollama.com/download/windows.Docker
`bash
docker run -d --name ollama -p 11434:11434 -v ollama_data:/root/.ollama ollama/ollama
`GPU-Passthrough (Docker mit NVIDIA)
`bash
docker run -d --gpus=all --name ollama -p 11434:11434 -v ollama_data:/root/.ollama ollama/ollama
`Erste Schritte
Ein Modell laden und chatten
`bash
Llama 3.1 8B starten
ollama run llama3.1Alternativen:
ollama run qwen3 # Qwen 3 14B
ollama run mistral # Mistral 7B
ollama run phi4 # Phi-4 14B
ollama run llama3.1:70b # Llama 3.1 70B (braucht viel VRAM!)
ollama run deepseek-r1 # DeepSeek R1 Reasoning
`Verfügbare Modelle anzeigen
`bash
ollama list # Installierte Modelle
ollama search llama # Online nach Modellen suchen
`Modell entfernen
`bash
ollama rm llama3.1
`Custom Modelfiles
Wie Dockerfile, aber für AI-Modelle:
`
FROM llama3.1System-Prompt setzen
SYSTEM """
Du bist ein professioneller deutscher Assistent.
Antworte immer auf Deutsch, höflich und präzise.
"""Parameter anpassen
PARAMETER temperature 0.7
PARAMETER top_p 0.9
PARAMETER num_ctx 4096
`Speichern als
Modelfile und erstellen:
`bash
ollama create mein-assistent -f Modelfile
ollama run mein-assistent
`API-Nutzung
Ollama bietet eine REST-API auf
http://localhost:11434:Chat Completion
`bash
curl http://localhost:11434/api/chat -d '{
"model": "llama3.1",
"messages": [
{"role": "user", "content": "Erkläre Quantencomputing auf Deutsch."}
],
"stream": false
}'
`Generate (Single Prompt)
`bash
curl http://localhost:11434/api/generate -d '{
"model": "llama3.1",
"prompt": "Schreibe ein Python-Skript für FizzBuzz.",
"stream": false
}'
`Python-Client
`python
import requestsresponse = requests.post(
"http://localhost:11434/api/chat",
json={
"model": "llama3.1",
"messages": [{"role": "user", "content": "Hallo!"}],
"stream": False
}
)
print(response.json()["message"]["content"])
`Offizielle Python-Library
`python
from ollama import Clientclient = Client(host="http://localhost:11434")
response = client.chat(
model="llama3.1",
messages=[{"role": "user", "content": "Was ist KI?"}]
)
print(response["message"]["content"])
`Open-WebUI: ChatGPT-Erlebnis lokal
Open-WebUI ist ein ChatGPT-kompatibles Frontend für Ollama:
`bash
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
`Dann unter
http://localhost:3000 erreichbar. Features:
Chat-Interface (wie ChatGPT)
Multiple Modelle
Dokumente hochladen (RAG)
Code-Ausführung
Bild-Generierung (mit SD-Plugin) Empfohlene Modelle 2026
| Use-Case | Modell | Größe | VRAM |
|----------|--------|-------|------|
| Allround-Chat | Llama 3.1 8B | 5 GB | 8 GB |
| Bester Code | Qwen 3 Coder 14B | 9 GB | 12 GB |
| Reasoning | DeepSeek R1 14B | 9 GB | 12 GB |
| Deutsch-fokussiert | Leo LM 8B | 5 GB | 8 GB |
| Kleinst-Modell | Qwen 3 1.5B | 1 GB | 2 GB |
| Maximum Qualität | Llama 3.1 70B | 40 GB | 48+ GB |
| Uncensored | Dolphin Llama 3.1 8B | 5 GB | 8 GB |
Performance-Tipps
GPU-Auswahl erzwingen
`bash
OLLAMA_GPU_OVERHEAD=0 ollama serve # Standard
CUDA_VISIBLE_DEVICES=0 ollama serve # Spezifische GPU
`Kontextfenster erhöhen
`bash
OLLAMA_NUM_CTX=8192 ollama run llama3.1
`Parallel-Requests
`bash
OLLAMA_MAX_PARALLEL=4 ollama serve
`Multi-GPU
Ollama erkennt automatisch mehrere GPUs und verteilt das Modell.FAQ
Brauche ich eine GPU?
Nein. Ollama läuft auch auf CPU (langsam, aber funktional). Mit GPU 5-20× schneller.Kann ich meine eigenen Daten einbinden?
Ja, mit RAG (Retrieval-Augmented Generation). Open-WebUI unterstützt Dokumenten-Upload. Für eigene Implementationen: LangChain + ChromaDB + Ollama.Wie viel Speicherplatz brauchen Modelle?
Ein 8B-Modell: ca. 5 GB. Ein 70B-Modell: ca. 40 GB. Modelle werden in ~/.ollama/models/ gespeichert.Kann ich Ollama von anderen Geräten nutzen?
Ja. Ollama als Server starten (ollama serve), dann von anderen Geräten die API unter http://server-ip:11434` nutzen. Oder Open-WebUI für eine Web-Oberfläche.Fazit
Ollama ist die einfachste Art, lokale AI zu nutzen. Die Installation dauert 2 Minuten, die Modellauswahl ist riesig, und die Performance ist beeindruckend. Mit Open-WebUI als Frontend bekommen Sie ein lokales ChatGPT — kostenlos, privat und ohne Internet.