diff --git a/compose.amd.yaml b/compose.amd.yaml index 95b3314..41fd024 100644 --- a/compose.amd.yaml +++ b/compose.amd.yaml @@ -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} diff --git a/ollama/entrypoint.sh b/ollama/entrypoint.sh index cefd72f..70ab5dd 100755 --- a/ollama/entrypoint.sh +++ b/ollama/entrypoint.sh @@ -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 diff --git a/ollama/modelfiles/qwen-coding.modelfile b/ollama/modelfiles/qwen-coding.modelfile new file mode 100644 index 0000000..485f57b --- /dev/null +++ b/ollama/modelfiles/qwen-coding.modelfile @@ -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. +""" diff --git a/openclaw/config/openclaw.json b/openclaw/config/openclaw.json index f113d80..2a82f9d 100644 --- a/openclaw/config/openclaw.json +++ b/openclaw/config/openclaw.json @@ -9,7 +9,7 @@ }, "agents": { "defaults": { - "model": "ollama/qwen3.6:35b-a3b-q4_K_M" + "model": "ollama/qwen-coding" } }, "mcp": {