Fuehren Sie KI-Modelle lokal aus. Keine API-Schluessel, keine Gebuehren, volle Kontrolle.
Was ist Ollama¶
Ollama = Docker fuer LLM-Modelle. Laedt herunter, richtet ein und fuehrt KI-Modelle lokal aus. Einfaches CLI + REST API.
Installation¶
Der vollstaendige Leitfaden zu Ollama + lokale KI¶
curl -fsSL https://ollama.com/install.sh | sh
Modell starten¶
ollama run llama3.2
Modell herunterladen¶
ollama pull nomic-embed-text
Verfuegbare Modelle¶
- llama3.2 (3B) – schnell, gut fuer Chat
- llama3.1 (8B/70B) – leistungsfaehiger
- mistral (7B) – gutes Verhaeltnis von Leistung zu Geschwindigkeit
- codellama (7B/34B) – fuer Code
- nomic-embed-text – Embeddings
- qwen2.5vl – Vision-Modell
REST API¶
Generate¶
curl http://localhost:11434/api/generate -d ‘{“model”:”llama3.2”,”prompt”:”Hello”}’
Chat¶
curl http://localhost:11434/api/chat -d ‘{“model”:”llama3.2”,”messages”:[{“role”:”user”,”content”:”Hi”}]}’
Embeddings¶
curl http://localhost:11434/api/embeddings -d ‘{“model”:”nomic-embed-text”,”prompt”:”Hello world”}’
Python-Integration¶
import ollama
response = ollama.chat(model=”llama3.2”, messages=[
{“role”: “user”, “content”: “Explain Docker in one sentence.”}
])
print(response[“message”][“content”])
Modelfile – Custom Model¶
FROM llama3.2
SYSTEM “You are a helpful coding assistant. Respond in German.”
PARAMETER temperature 0.7
Hardware-Anforderungen¶
- 3B Modell: 4 GB RAM
- 7B Modell: 8 GB RAM
- 13B Modell: 16 GB RAM
- 70B Modell: 48+ GB RAM
- Apple Silicon: Unified Memory = ideal fuer lokale KI
Anwendungsfaelle¶
- Coding-Assistent (offline)
- RAG (Retrieval Augmented Generation)
- Dokumentenanalyse
- Embeddings fuer Suche
- Experimente ohne API-Kosten
Warum lokale KI¶
Keine API-Gebuehren. Keine Latenz. Volle Kontrolle ueber die Daten. Und mit Apple Silicon ist es ueberraschend schnell.