Add: Modelfile feature.

This commit is contained in:
2026-06-05 15:13:32 +02:00
parent b16f4754b0
commit 07abff2b2f
4 changed files with 40 additions and 1 deletions
+1
View File
@@ -19,6 +19,7 @@ services:
- label=disable
volumes:
- ./storage/ollama_models:/root/.ollama
- ./ollama/modelfiles:/etc/ollama/modelfiles:ro
environment:
- OLLAMA_HOST=0.0.0.0:11434
- MODEL_LIST=${MODEL_LIST}
+18
View File
@@ -52,5 +52,23 @@ else
echo "--- Alle Modelle sind bereit ---"
fi
# --- NEU: SCHRITT 3.5: Custom Modelfiles bauen ---
echo "--- Suche nach Custom Modelfiles ---"
MODELFILE_DIR="/etc/ollama/modelfiles"
if [ -d "$MODELFILE_DIR" ]; then
for file in "$MODELFILE_DIR"/*.modelfile; do
# Falls keine Dateien matchen, bricht die Schleife ab
[ -e "$file" ] || continue
# Extrahiert den reinen Dateinamen ohne Pfad und Endung als Modellnamen
custom_model_name=$(basename "$file" .modelfile)
echo "Baue Custom Modell: $custom_model_name aus $file..."
ollama create "$custom_model_name" -f "$file"
done
echo "--- Alle Custom Modelle erfolgreich gebaut ---"
fi
# --- SCHRITT 4: Hauptprozess halten ---
wait $OLLAMA_PID
+20
View File
@@ -0,0 +1,20 @@
# Basis-Modell aus der Registry laden
FROM qwen3.6:27b
# VRAM- und Kontext-Parameter direkt einbacken
PARAMETER num_ctx 32768
PARAMETER num_predict 4096
PARAMETER temperature 0.2
# --- Stop-Token für saubere Agenten-Kommunikation ---
PARAMETER stop <|im_end|>
PARAMETER stop <|im_start|>
# Dem Modell seine primäre Identität verpassen
SYSTEM """
Du bist ein hochentwickelter, autonomer KI-Coding-Agent innerhalb des OpenClaw-Frameworks.
Deine Aufgaben:
- Schreibe sauberen, performanten und fehlerfreien Python- und C#-Code.
- Analysiere Code-Strukturen tiefgehend und halte dich strikt an Best Practices.
- Gib präzise Antworten und vermeide unnötiges Blabla.
"""
+1 -1
View File
@@ -9,7 +9,7 @@
},
"agents": {
"defaults": {
"model": "ollama/qwen3.6:35b-a3b-q4_K_M"
"model": "ollama/qwen-coding"
}
},
"mcp": {