Compare commits
3 Commits
main
...
chore/llm-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5317e40fe7 | ||
|
|
38a6851b46 | ||
|
|
72a902010a |
@@ -11,7 +11,7 @@
|
||||
# - Runner config must list /var/run/docker.sock and /mnt/external in valid_volumes
|
||||
# (set in ansible-eulernest roles/gitea_runner/templates/config.yaml.j2).
|
||||
# - Set org variable JETSON_OLLAMA_URL in conformallab → Actions → Variables:
|
||||
# value = http://192.168.178.103:11434/v1
|
||||
# value = http://jetson.local:11434/v1
|
||||
name: CD — ci-ai-bot
|
||||
|
||||
on:
|
||||
|
||||
@@ -31,7 +31,7 @@ jobs:
|
||||
AI_PROVIDER: ollama
|
||||
AI_MODEL: coder
|
||||
# JETSON_OLLAMA_URL: org variable in conformallab → Actions → Variables
|
||||
AI_BASE_URL: ${{ vars.JETSON_OLLAMA_URL || 'http://192.168.178.103:11434/v1' }}
|
||||
AI_BASE_URL: ${{ vars.JETSON_OLLAMA_URL || 'http://jetson.local:11434/v1' }}
|
||||
GITEA_TOKEN: ${{ github.token }}
|
||||
GITEA_API: https://git.eulernest.eu/api/v1
|
||||
run: python /opt/ci-ai/scripts/ai_review.py
|
||||
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
AI_PROVIDER: ollama
|
||||
AI_MODEL: coder
|
||||
# JETSON_OLLAMA_URL: org variable in conformallab → Actions → Variables
|
||||
AI_BASE_URL: ${{ vars.JETSON_OLLAMA_URL || 'http://192.168.178.103:11434/v1' }}
|
||||
AI_BASE_URL: ${{ vars.JETSON_OLLAMA_URL || 'http://jetson.local:11434/v1' }}
|
||||
GITEA_TOKEN: ${{ github.token }}
|
||||
GITEA_API: https://git.eulernest.eu/api/v1
|
||||
steps:
|
||||
|
||||
@@ -74,7 +74,7 @@ jobs:
|
||||
AI_PROVIDER: ollama
|
||||
AI_MODEL: coder
|
||||
# JETSON_OLLAMA_URL: org variable in conformallab → Actions → Variables
|
||||
AI_BASE_URL: ${{ vars.JETSON_OLLAMA_URL || 'http://192.168.178.103:11434/v1' }}
|
||||
AI_BASE_URL: ${{ vars.JETSON_OLLAMA_URL || 'http://jetson.local:11434/v1' }}
|
||||
GITEA_TOKEN: ${{ github.token }}
|
||||
GITEA_API: https://git.eulernest.eu/api/v1
|
||||
run: |
|
||||
|
||||
@@ -83,7 +83,7 @@ IPs — `[webhook] ALLOWED_HOST_LIST` muss den Bot-Host (`ci-ai-bot`) erlauben.
|
||||
| `WEBHOOK_SECRET` | — | HMAC-Secret, muss zum Gitea-Webhook passen (leer = Check aus) |
|
||||
| `GITEA_TOKEN` | — | Token fürs Kommentieren (`write:issue`) |
|
||||
| `GITEA_API` | `http://gitea:3000/api/v1` | Gitea-API (intern, kein Hairpin) |
|
||||
| `AI_PROVIDER` / `AI_MODEL` / `AI_BASE_URL` | `ollama` / `coder` / `http://192.168.178.103:11434/v1` | KI-Backend (Jetson) |
|
||||
| `AI_PROVIDER` / `AI_MODEL` / `AI_BASE_URL` | `ollama` / `coder` / `http://jetson.local:11434/v1` | KI-Backend (Jetson) |
|
||||
|
||||
## In ein Repo einbauen (CI-Workflows)
|
||||
|
||||
@@ -117,7 +117,7 @@ Kosten, kein Datenabfluss. In Workflows **und** Bot per Env gesetzt:
|
||||
```yaml
|
||||
AI_PROVIDER: ollama
|
||||
AI_MODEL: coder # qwen2.5-coder:7b
|
||||
AI_BASE_URL: http://192.168.178.103:11434/v1
|
||||
AI_BASE_URL: http://jetson.local:11434/v1
|
||||
```
|
||||
|
||||
Provider-Wechsel = **nur Env**, kein Code-Change (`scripts/llm.py`). Anthropic-Variante:
|
||||
@@ -134,7 +134,7 @@ Provider-Wechsel = **nur Env**, kein Code-Change (`scripts/llm.py`). Anthropic-V
|
||||
|---|---|---|
|
||||
| `AI_PROVIDER` | `ollama` | `ollama` |
|
||||
| `AI_MODEL` | `coder` (ollama) / `claude-3-5-haiku-latest` (anthropic) | `coder` |
|
||||
| `AI_BASE_URL` | `http://192.168.178.103:11434/v1` | `…178.103…` |
|
||||
| `AI_BASE_URL` | `http://jetson.local:11434/v1` | `…178.103…` |
|
||||
| `JETSON_API_KEY` | — | Bearer für Ollama (optional) |
|
||||
| `ANTHROPIC_API_KEY` | — | nur bei provider=anthropic |
|
||||
| `GITEA_API` | `https://git.eulernest.eu/api/v1` | Bot: intern `http://gitea:3000/api/v1` |
|
||||
|
||||
@@ -10,7 +10,7 @@ Umschalten zwischen Backends über Env-Vars:
|
||||
Weitere Env-Vars:
|
||||
AI_MODEL Modellname (Default je nach Provider; ollama: "coder" = qwen2.5-coder:7b)
|
||||
AI_BASE_URL OpenAI-kompatible Basis-URL (für ollama),
|
||||
Default http://192.168.178.103:11434/v1
|
||||
Default http://jetson.local:11434/v1
|
||||
JETSON_API_KEY Bearer-Token (für ollama, optional)
|
||||
ANTHROPIC_API_KEY (für anthropic)
|
||||
|
||||
@@ -88,7 +88,7 @@ def _anthropic(system: str, user: str, model: str, max_tokens: int) -> str:
|
||||
|
||||
|
||||
def _ollama_openai(system: str, user: str, model: str, max_tokens: int) -> str:
|
||||
base = os.environ.get("AI_BASE_URL", "http://192.168.178.103:11434/v1").rstrip("/")
|
||||
base = os.environ.get("AI_BASE_URL", "http://jetson.local:11434/v1").rstrip("/")
|
||||
headers = {"content-type": "application/json"}
|
||||
key = os.environ.get("JETSON_API_KEY", "")
|
||||
if key:
|
||||
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
env:
|
||||
AI_PROVIDER: ollama
|
||||
AI_MODEL: coder
|
||||
AI_BASE_URL: http://192.168.178.103:11434/v1
|
||||
AI_BASE_URL: http://jetson.local:11434/v1
|
||||
GITEA_TOKEN: ${{ github.token }}
|
||||
GITEA_API: https://git.eulernest.eu/api/v1
|
||||
run: python /opt/ci-ai/scripts/ai_review.py
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
# env:
|
||||
# AI_PROVIDER: ollama
|
||||
# AI_MODEL: coder
|
||||
# AI_BASE_URL: http://192.168.178.103:11434/v1
|
||||
# AI_BASE_URL: http://jetson.local:11434/v1
|
||||
# GITEA_TOKEN: ${{ github.token }}
|
||||
# GITEA_API: https://git.eulernest.eu/api/v1
|
||||
# run: |
|
||||
|
||||
@@ -55,7 +55,7 @@ jobs:
|
||||
env:
|
||||
AI_PROVIDER: ollama
|
||||
AI_MODEL: coder
|
||||
AI_BASE_URL: http://192.168.178.103:11434/v1
|
||||
AI_BASE_URL: http://jetson.local:11434/v1
|
||||
GITEA_TOKEN: ${{ github.token }}
|
||||
GITEA_API: https://git.eulernest.eu/api/v1
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user