From b9485f5384d8e6e510dbe866655255a3931544b1 Mon Sep 17 00:00:00 2001 From: Floki Date: Mon, 22 Jun 2026 13:01:07 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=8A=20auto-update:=20system=20snapshot?= =?UTF-8?q?=202026-06-22?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 05-Dashboard/Ideen/LiteLLM-Integration.md | 88 ++++++++ .../Ideen/LiteLLM-Re-Implementation.md | 189 ++++++++++++++++++ 05-Dashboard/Offene-Tasks.md | 10 + 05-Dashboard/System-Memory.md | 14 +- .../snapshots/snapshot_2026-06-22.json | 6 +- README.md | 156 +++++++-------- 6 files changed, 373 insertions(+), 90 deletions(-) create mode 100644 05-Dashboard/Ideen/LiteLLM-Integration.md create mode 100644 05-Dashboard/Ideen/LiteLLM-Re-Implementation.md diff --git a/05-Dashboard/Ideen/LiteLLM-Integration.md b/05-Dashboard/Ideen/LiteLLM-Integration.md new file mode 100644 index 0000000..f957645 --- /dev/null +++ b/05-Dashboard/Ideen/LiteLLM-Integration.md @@ -0,0 +1,88 @@ +# LiteLLM Integration — Zukünftiger Plan + +> **Status:** Zurückgestellt ( Juni 2026 ) +> **Grund:** Aktuell wird alles direkt über Ollama (lokal) und OpenRouter (API) genutzt. LiteLLM als Proxy ist nicht notwendig solange wir nur 2-3 Provider haben. + +## Was ist LiteLLM? + +**LiteLLM** ist ein **OpenAI-kompatibler LLM Proxy / API Gateway**. + +``` +Dein Code → LiteLLM Proxy (:4000) → OpenRouter / Ollama / Anthropic / Google / ... +``` + +### Vorteile + +| Feature | Beschreibung | +|---------|-------------| +| **Einheitliche API** | OpenAI-kompatible API für ALLE Anbieter | +| **Multi-Provider Fallback** | Automatischer Wechsel bei Ausfall | +| **Kosten-Tracking** | Token-Nutzung pro Anbieter tracken | +| **Rate Limiting** | Zentrale Kontrolle | +| **Load Balancing** | Requests auf mehrere Keys verteilen | + +## Wann LiteLLM sinnvoll wird + +- **5+ AI-Provider** gleichzeitig +- **Automatisches Failover** zwischen Anbietern nötig +- **Kosten-Tracking** pro Team/User +- **Rate Limiting** für verschiedene User-Gruppen +- **Model-Routing** (einfache Anfragen → billiges Modell, komplexe → teures) + +## Konfiguration (für später) + +### docker-compose.yml +```yaml +litellm: + image: ghcr.io/berriai/litellm:latest + ports: + - "4000:4000" + volumes: + - ./litellm-config.yaml:/app/config.yaml + environment: + - OPENROUTER_API_KEY=${OPENROUTER_KEY_PRIMARY} + - OPENROUTER_FALLBACK_KEY=${OPENROUTER_KEY_FALLBACK1} + - OLLAMA_BASE_URL=http://ollama:11434 +``` + +### litellm-config.yaml +```yaml: +model_list: + - model_name: hermes-default + litellm_params: + model: openrouter/anthropic/claude-sonnet-4 + api_key: ${OPENROUTER_KEY_PRIMARY} + - model_name: hermes-fast + litellm_params: + model: openrouter/google/gemini-2.0-flash-001:free + api_key: ${OPENROUTER_KEY_FALLBACK1} + - model_name: hermes-local + litellm_params: + model: ollama/llama3.1:8b + api_base: http://ollama:11434 + +fallbacks: + - hermes-default: [hermes-fast, hermes-local] + - hermes-fast: [hermes-local] +``` + +### Nächste Schritte (wenn implementiert) + +1. LiteLLM Container in docker-compose.yml +2. Config mit allen Providern +3. Scripts auf `localhost:4000/v1/chat/completions` umstellen +4. Fallback-Konfiguration testen +5. Kosten-Tracking Dashboard + +## Aktueller Stand (Juni 2026) + +- ❌ LiteLLM Container läuft OHNE Konfiguration +- ✅ Ollama direkt: `http://localhost:11434` +- ✅ OpenRouter direkt: `https://openrouter.ai/api/v1` +- ✅ API Key Rotation: PRIMARY → FALLBACK1 → Ollama + +## Referenzen + +- Docs: https://docs.litellm.ai/ +- GitHub: https://github.com/BerriAI/litellm +- Docker: https://docs.litellm.ai/docs/proxy/docker diff --git a/05-Dashboard/Ideen/LiteLLM-Re-Implementation.md b/05-Dashboard/Ideen/LiteLLM-Re-Implementation.md new file mode 100644 index 0000000..0e197ba --- /dev/null +++ b/05-Dashboard/Ideen/LiteLLM-Re-Implementation.md @@ -0,0 +1,189 @@ +# LiteLLM Re-Implementierungsplan + +> Erstellt: 2026-06-22 +> Status: ⏳ Idee / Backlog + +## 🎯 Ziel + +LiteLLM als **LLM Proxy / API Gateway** wieder einfach nutzen — aber diesmal **richtig konfiguriert** und **optional** (Fallback auf direkte Ollama/OpenRouter-Calls). + +## 📋 Aktueller Stand (Juni 2026) + +- ❌ LiteLLM Container wurde entfernt +- ❌ Scanner, Memory (ChromaDB), Redis wurden entfernt +- ✅ Ollama läuft direkt auf localhost:11434 +- ✅ OpenRouter Keys sind in .env hinterlegt +- ✅ YouTube-Watcher nutzt Ollama direkt + +## 🔄 Warum LiteLLM wieder einführen? + +| Vorteil | Beschreibung | +|---------|--------------| +| **Einheitliche API** | OpenAI-kompatible API für ALLE Anbieter | +| **Multi-Provider Fallback** | Automatischer Wechsel bei 429/Outage | +| **Kosten-Tracking** | Token-Nutzung pro Anbieter tracken | +| **Rate Limiting** | Zentrale Kontrolle | +| **Model-Routing** | Automatisches Routing basierend auf Availability | + +## 🏗️ Architektur (geplant) + +``` +┌─────────────────────────────────────────────────────────┐ +│ KPT-LABS System │ +│ │ +│ Dashboard / Scripts / Bots │ +│ │ │ +│ ▼ │ +│ ┌─────────────┐ ┌──────────────┐ │ +│ │ LiteLLM │────▶│ OpenRouter │ (Primary) │ +│ │ Proxy │ └──────────────┘ │ +│ │ :4000 │ ┌──────────────┐ │ +│ │ │────▶│ Ollama │ (Local, Free) │ +│ │ │ │ :11434 │ │ +│ │ │ └──────────────┘ │ +│ │ │ ┌──────────────┐ │ +│ │ │────▶│ NVIDIA API │ (Backup) │ +│ └─────────────┘ └──────────────┘ │ +│ │ +│ Fallback-Kette: │ +│ OpenRouter PRIMARY → OpenRouter FALLBACK1 → Ollama │ +└─────────────────────────────────────────────────────────┘ +``` + +## 📝 Konfiguration (config.yaml) + +```yaml +model_list: + # === OpenRouter (Primary) === + - model_name: "openrouter/primary" + litellm_params: + model: "openrouter/anthropic/claude-sonnet-4" + api_key: "${OPENROUTER_KEY_PRIMARY}" + + # === OpenRouter (Fallback 1) === + - model_name: "openrouter/fallback1" + litellm_params: + model: "openrouter/anthropic/claude-sonnet-4" + api_key: "${OPENROUTER_KEY_FALLBACK1}" + + # === Ollama (Local, Free) === + - model_name: "ollama/llama3.1:8b" + litellm_params: + model: "ollama/llama3.1:8b" + api_base: "http://localhost:11434" + + - model_name: "ollama/gemma4:12b" + litellm_params: + model: "ollama/gemma4:12b" + api_base: "http://localhost:11434" + + # === NVIDIA (Backup) === + - model_name: "nvidia/backup" + litellm_params: + model: "nvidia/nemotron-3-ultra-550b" + api_key: "${NVIDIA_API_KEY}" + +# Router Settings +router_settings: + routing_strategy: "simple-shuffle" + fallbacks: + - ["openrouter/primary"]: ["openrouter/fallback1"] + - ["openrouter/fallback1"]: ["ollama/llama3.1:8b"] + - ["ollama/llama3.1:8b"]: ["ollama/gemma4:12b"] + +# General Settings +general_settings: + master_key: "${LITELLM_MASTER_KEY}" + database_url: "sqlite:///litellm.db" +``` + +## 🐳 Docker Compose (geplant) + +```yaml +services: + litellm: + image: ghcr.io/berriai/litellm:latest + ports: + - "4000:4000" + volumes: + - ./litellm/config.yaml:/app/config.yaml + env_file: .env + restart: unless-stopped + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:4000/health"] + interval: 30s + timeout: 10s + retries: 3 +``` + +## 🔧 Anpassungen im KPT-LABS Code + +### 1. YouTube-Watcher (`yt_pipeline_v8.py`) +```python +# Vorher (direkt Ollama): +OLLAMA_URL = "http://localhost:11434" + +# Nachher (über LiteLLM): +LITELLM_URL = "http://localhost:4000" +MODEL = "ollama/llama3.1:8b" # oder "openrouter/primary" +``` + +### 2. API Key Rotation (`api_key_monitor.py`) +```python +# Vorher: Direkte OpenRouter-Calls +# Nachher: LiteLLM Health-Check + Key-Rotation +LITELLM_URL = "http://localhost:4000" +``` + +### 3. Dashboard API +```python +# Vorher: Direkte Ollama-Calls +# Nachher: LiteLLM Proxy +``` + +## 📊 Kostenvergleich + +| Anbieter | Kosten | Geschwindigkeit | Verfügbarkeit | +|----------|--------|-----------------|---------------| +| Ollama (lokal) | $0 | ~3-15s | 24/7 | +| OpenRouter Primary | ~$1/Tag | ~1-3s | Rate-Limited | +| OpenRouter Fallback1 | ~$1/Tag | ~1-3s | Rate-Limited | +| NVIDIA | ~$0.50/Tag | ~2-5s | Rate-Limited | + +## 🚀 Implementierungsplan + +### Phase 1: LiteLLM Grundkonfiguration +- [ ] `litellm/config.yaml` erstellen +- [ ] Docker Compose Service hinzufügen +- [ ] Health-Check testen +- [ ] Model-Liste verifizieren + +### Phase 2: Fallback-Kette testen +- [ ] OpenRouter 429 simulieren +- [ ] Automatischer Wechsel zu Ollama testen +- [ ] Latenz messen + +### Phase 3: KPT-LABS Code anpassen +- [ ] YouTube-Watcher auf LiteLLM umstellen +- [ ] API Key Rotation anpassen +- [ ] Dashboard API anpassen + +### Phase 4: Monitoring +- [ ] LiteLLM Dashboard aktivieren +- [ ] Kosten-Tracking einrichten +- [ ] Alerts bei 429/Outage + +## ⚠️ Risiken + +- **Single Point of Failure**: Wenn LiteLLM down → kein LLM verfügbar + - **Mitigation**: Fallback auf direkte Ollama-Calls im Code +- **Komplexität**: Mehr Moving Parts + - **Mitigation**: Einfache Config, gutes Monitoring +- **Kosten**: LiteLLM selbst ist kostenlos, aber OpenRouter-Kosten bleiben + +## 📚 Referenzen + +- [LiteLLM Docs](https://docs.litellm.ai/) +- [LiteLLM Docker](https://docs.litellm.ai/docs/proxy/docker) +- [OpenRouter API](https://openrouter.ai/docs/api-reference/overview) +- [Ollama API](https://github.com/ollama/ollama/blob/main/docs/api.md) diff --git a/05-Dashboard/Offene-Tasks.md b/05-Dashboard/Offene-Tasks.md index 5b3e205..1e6e051 100644 --- a/05-Dashboard/Offene-Tasks.md +++ b/05-Dashboard/Offene-Tasks.md @@ -28,6 +28,16 @@ | 3 | YouTube-Watcher als Service | Business-Plan | | 4 | Custom AI-Lösungen | Business-Plan | | 5 | Dashboard-Templates & Plugins | Business-Plan | +| 6 | **LiteLLM Re-Implementation** | [Idee/Plan](Ideen/LiteLLM-Re-Implementation.md) | + +## ✅ Abgeschlossen (2026-06-22) + +- ✅ YouTube-Watcher v8 — volle Pipeline (Subs → Translate → Summary → Vault) +- ✅ Cron-Jobs auf standalone Python Scripts umgestellt (kein Next.js API mehr) +- ✅ Docker Container bereinigt (Scanner, Memory, Redis, LiteLLM entfernt) +- ✅ Ollama als primärer LLM Provider (llama3.1:8b) +- ✅ faster-whisper im System-Python installiert +- ✅ API Key Monitor Script erstellt ## ✅ Abgeschlossen (2026-06-21) diff --git a/05-Dashboard/System-Memory.md b/05-Dashboard/System-Memory.md index fdb3268..7f635f0 100644 --- a/05-Dashboard/System-Memory.md +++ b/05-Dashboard/System-Memory.md @@ -8,12 +8,14 @@ | Komponente | Port | Tech | Status | |-----------|------|------|--------| -| Dashboard | :5555 | Next.js + SQLite | ✅ Läuft | -| Hermes Gateway | :8787 | FastAPI | ✅ Läuft | -| LiteLLM Proxy | :4000 | Docker | ✅ Läuft | -| Redis | :6379 | Docker | ✅ Läuft | -| Ollama | :11434 | Lokal | ✅ Läuft | -| Gitea | intern | Docker | ✅ Läuft | +|| Dashboard | :3000 | Next.js + SQLite | ✅ Läuft | +|| Hermes Gateway | :8787 | FastAPI | ✅ Läuft | +|| Ollama | :11434 | Lokal | ✅ Läuft | +|| Gitea | intern | Docker | ✅ Läuft | + +> **Hinweis (2026-06-22)**: LiteLLM Proxy, Redis, Scanner und Memory (ChromaDB) wurden entfernt. +> KPT-LABS nutzt jetzt Ollama direkt + OpenRouter als Backup. +> Re-Implementierungsplan für LiteLLM: `05-Dashboard/Ideen/LiteLLM-Re-Implementation.md` ## 📂 Pfade diff --git a/05-Dashboard/snapshots/snapshot_2026-06-22.json b/05-Dashboard/snapshots/snapshot_2026-06-22.json index 98b8f82..fb157c3 100644 --- a/05-Dashboard/snapshots/snapshot_2026-06-22.json +++ b/05-Dashboard/snapshots/snapshot_2026-06-22.json @@ -1,5 +1,5 @@ { - "timestamp": "2026-06-22T09:10:22.618361", + "timestamp": "2026-06-22T13:01:06.823133", "version": "2.0.0", "tokenUsage24h": { "requests": 0, @@ -16,8 +16,8 @@ "failures": 0 }, "vault": { - "totalFiles": 34, - "totalSizeKB": 86 + "totalFiles": 36, + "totalSizeKB": 97 }, "scheduledTasks": { "total": 0, diff --git a/README.md b/README.md index cb5f47c..ff0c5af 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # 🚀 KPT-LABS Agent OS — System Recovery & Onboarding Guide -> **Letzte Aktualisierung:** 22.06.2026 09:10 | **Version:** 2.0.0 +> **Letzte Aktualisierung:** 22.06.2026 13:01 | **Version:** 2.0.0 > **Vault Hash:** `v1.0-20260619-1400` --- @@ -28,13 +28,15 @@ Das KPT-LABS Agent OS ist ein **Multi-Agent Dashboard** mit folgenden Kernkompon | Komponente | Beschreibung | Port/Ort | |------------|-------------|----------| -| **Dashboard** | Next.js Web-UI | `http://localhost:5555` | -| **Datenbank** | SQLite (better-sqlite3) | `dashboard/data/kptlabs.db` | -| **Obsidian Vault** | Wissensdatenbank | `E:\OpenCode_Projekte\obsidianVault` | -| **Hermes Gateway** | Telegram/Discord Bot | `localhost:8642` | -| **LiteLLM Proxy** | LLM API Proxy | `localhost:4000` | -| **Redis** | Cache/Session Store | `localhost:6379` | -| **Memory Service** | Agent Memory | `localhost:5002` | +|| **Dashboard** | Next.js Web-UI | `http://localhost:3000` | +|| **Datenbank** | SQLite (better-sqlite3) | `dashboard/data/kptlabs.db` | +|| **Obsidian Vault** | Wissensdatenbank | `E:\OpenCode_Projekte\obsidianVault` | +|| **Hermes Gateway** | Telegram/Discord Bot | `localhost:8642` | +|| **Ollama** | LLM API (lokal) | `localhost:11434` | + +> **Hinweis**: LiteLLM Proxy, Redis, Scanner und Memory (ChromaDB) wurden entfernt (2026-06-22). +> KPT-LABS nutzt jetzt **OpenRouter direkt** (Primary + Fallback) + **Ollama als lokalen Fallback**. +> Re-Implementierungsplan für LiteLLM: `05-Dashboard/Ideen/LiteLLM-Re-Implementation.md` ### Architektur-Diagramm @@ -45,22 +47,24 @@ Das KPT-LABS Agent OS ist ein **Multi-Agent Dashboard** mit folgenden Kernkompon │ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │ │ │ Dashboard │ │ Hermes │ │ Telegram/Discord │ │ │ │ (Next.js) │ │ Gateway │ │ Bots │ │ -│ │ Port 5555 │ │ Port 8642 │ │ │ │ +│ │ Port 3000 │ │ Port 8642 │ │ │ │ │ └──────┬───────┘ └──────┬──────┘ └──────────┬──────────┘ │ │ │ │ │ │ │ └─────────────────┼─────────────────────┘ │ │ │ │ │ ┌──────┴──────┐ │ -│ │ LLM APIs │ │ -│ │ (OpenRouter │ │ -│ │ Anthropic │ │ -│ │ OpenAI...) │ │ +│ │ Ollama │ ← LLM API (lokal, free) │ +│ │ :11434 │ │ +│ └─────────────┘ │ +│ ┌─────────────┐ │ +│ │ OpenRouter │ ← Backup (API Keys) │ +│ │ (direkt) │ │ │ └─────────────┘ │ │ │ -│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │ -│ │ SQLite DB │ │ Obsidian │ │ Docker │ │ -│ │ (kptlabs) │ │ Vault │ │ (LiteLLM,Redis) │ │ -│ └─────────────┘ └─────────────┘ └─────────────────────┘ │ +│ ┌─────────────┐ ┌─────────────┐ │ +│ │ SQLite DB │ │ Obsidian │ │ +│ │ (kptlabs) │ │ Vault │ │ +│ └─────────────┘ └─────────────┘ │ └─────────────────────────────────────────────────────────────┘ ``` @@ -71,7 +75,7 @@ Das KPT-LABS Agent OS ist ein **Multi-Agent Dashboard** mit folgenden Kernkompon ### Voraussetzungen - Node.js 18+ & npm - Git -- Docker & Docker Compose +- Ollama (optional, für lokale LLM) - Obsidian (optional, für Vault) ### Git Setup (bereits konfiguriert) @@ -112,15 +116,16 @@ npm install npm run build npm start -# 3. Docker Services (LiteLLM, Redis) -docker-compose up -d +# 3. Ollama (optional, für lokale LLM) +# Ollama installieren: https://ollama.com +ollama pull llama3.1:8b # 4. Hermes Gateway (optional) hermes setup hermes gateway start # 5. Öffne Dashboard -open http://localhost:5555 +open http://localhost:3000 ``` ### Erste Schritte @@ -219,23 +224,23 @@ SELECT * FROM tasks WHERE status != 'done'; --- ## 🔑 API-Keys & Credentials - ### Provider-Konfiguration + | Provider | API-Key env var | Status | |----------|----------------|--------| -| OpenRouter | `OPENROUTER_API_KEY` | ✅ Aktiv | -| Anthropic | `ANTHROPIC_API_KEY` | ⬜ Optional | -| OpenAI | `OPENAI_API_KEY` | ⬜ Optional | -| DeepSeek | `DEEPSEEK_API_KEY` | ⬜ Optional | - +| OpenRouter Primary | `OPENROUTER_KEY_PRIMARY` | ✅ Primär | +| OpenRouter Fallback1 | `OPENROUTER_KEY_FALLBACK1` | ✅ Fallback | +| NVIDIA | `OPENROUTER_KEY_FALLBACK2` | ⚠️ Inaktiv | +| Ollama (lokal) | — | ✅ Lokaler Fallback (llama3.1:8b, gemma4:12b) | ### Hermes Auth + ```bash # Credentials anzeigen hermes auth list -# Neuen Key hinzufügen -hermes auth add openrouter -hermes auth add anthropic +# API Keys in .env hinterlegen: +# OPENROUTER_KEY_PRIMARY=sk-or-... +# OPENROUTER_KEY_FALLBACK1=sk-or-... # Token-Status prüfen hermes status @@ -253,27 +258,12 @@ hermes status | Service | Port | Starten | Status | |---------|------|---------|--------| -| Dashboard | 5555 | `npm start` (in dashboard/) | 🟢 | +| Dashboard | 3000 | `npm start` (in dashboard/) | 🟢 | | Hermes Gateway | 8642 | `hermes gateway start` | 🟢 | -| LiteLLM Proxy | 4000 | `docker-compose up -d` | 🟢 | -| Redis | 6379 | `docker-compose up -d` | 🟢 | -| Memory Service | 5002 | `docker-compose up -d` | 🟢 | +| Ollama | 11434 | `ollama serve` | 🟢 | -### Docker Services -```bash -# Starten -cd KPT-LABS -docker-compose up -d - -# Stoppen -docker-compose down - -# Logs -docker-compose logs -f - -# Status -docker-compose ps -``` +> **Hinweis**: LiteLLM Proxy, Redis, Scanner und Memory (ChromaDB) wurden entfernt. +> Nutze stattdessen Ollama direkt (:11434) und OpenRouter als Backup. --- @@ -321,7 +311,7 @@ npm run build npm start # 3. Testen -curl http://localhost:5555/api/system +curl http://localhost:3000/api/system ``` --- @@ -373,13 +363,13 @@ docker-compose up -d ### Schritt 3: Verifizieren ```bash # Dashboard öffnen -open http://localhost:5555 +open http://localhost:3000 # System Status prüfen -curl http://localhost:5555/api/system | jq '.status' +curl http://localhost:3000/api/system | jq '.status' # Obsidian Sync prüfen -curl http://localhost:5555/api/obsidian/sync | jq '.vaultStats' +curl http://localhost:3000/api/obsidian/sync | jq '.vaultStats' ``` --- @@ -410,23 +400,15 @@ curl http://localhost:5555/api/obsidian/sync | jq '.vaultStats' ## 📅 Cron-Jobs -| Job | Zeit | API-Call | -|-----|------|----------| -| Daily Backup | 03:00 | `POST /api/cron/backup` | -| Weekly Report | Montag 09:00 | `POST /api/cron/weekly-report` | -| Obsidian Sync Check | Alle 6h | `GET /api/obsidian/sync` | +| Job | Zeit | Script | +|-----|------|--------| +| System Snapshot | Stündlich | `python system_snapshot_v2.py` | +| Daily Backup | 03:00 | `python daily_backup.py` | +| Obsidian Sync Check | Alle 6h | `python obsidian_sync_check.py` | +| Weekly Report | Montag 09:00 | `python weekly_report.py` | -### Cron-Jobs verwalten -```bash -# Liste -hermes cron list - -# Erstellen -hermes cron create "Name" "Prompt" "Schedule" - -# Manuell ausführen -hermes cron run -``` +> **Hinweis**: Alle Cron-Jobs laufen als **standalone Python Scripts** — keine Next.js API-Calls mehr. +> Das umgeht das Auth/Redirect Problem. --- @@ -439,7 +421,7 @@ cd dashboard npm run build 2>&1 | tail -20 # Port prüfen -netstat -ano | findstr :5555 +netstat -ano | findstr :3000 # Neu starten pkill -f next @@ -460,7 +442,7 @@ sqlite3 dashboard/data/kptlabs.db < backup.sql ### Obsidian Sync Fehler ```bash # Manuell synchronisieren -curl -X POST http://localhost:5555/api/obsidian/sync \ +curl -X POST http://localhost:3000/api/obsidian/sync \ -H "Content-Type: application/json" \ -d '{"action":"list-sessions"}' ``` @@ -468,7 +450,7 @@ curl -X POST http://localhost:5555/api/obsidian/sync \ ### API-Key Probleme ```bash # Testen -curl http://localhost:5555/api/system +curl http://localhost:3000/api/system # Neustart mit frischem Port pkill -f next && sleep 2 && npm start @@ -515,7 +497,7 @@ pkill -f next && sleep 2 && npm start ## 🔗 Nützliche Links -- **Dashboard**: http://localhost:5555 +- **Dashboard**: http://localhost:3000 - **Hermes Docs**: https://hermes-agent.nousresearch.com/docs - **OpenRouter**: https://openrouter.ai/keys - **Obsidian**: https://obsidian.md @@ -538,21 +520,33 @@ go install github.com/opencode-ai/opencode@latest ### Konfiguration für KPT-LABS -Opencode nutzt lokale Modelle via LiteLLM Proxy: +Opencode nutzt Ollama direkt oder OpenRouter als Backup: ```bash # ~/.config/opencode/config.yaml -model: "hermes-default" # LiteLLM Proxy Model -base_url: "http://localhost:4000/v1" -api_key: "dummy" # LiteLLM braucht keinen echten Key +# Option A: Ollama (lokal, kostenlos) +model: "llama3.1:8b" +base_url: "http://localhost:11434/v1" +api_key: "ollama" + +# Option B: OpenRouter (Backup) +# model: "openrouter/anthropic/claude-sonnet-4" +# base_url: "https://openrouter.ai/api/v1" +# api_key: "sk-or-..." ``` Oder als Umgebungsvariablen: ```bash -export OPENAI_BASE_URL=http://localhost:4000/v1 -export OPENAI_API_KEY=dummy -export MODEL=hermes-default +# Ollama +export OPENAI_BASE_URL=http://localhost:11434/v1 +export OPENAI_API_KEY=ollama +export MODEL=llama3.1:8b + +# OpenRouter (Backup) +# export OPENAI_BASE_URL=https://openrouter.ai/api/v1 +# export OPENAI_API_KEY=sk-or-... +# export MODEL=openrouter/anthropic/claude-sonnet-4 ``` ### Opencode starten @@ -627,7 +621,7 @@ opencode "Lies die Spec in 02-Projekte\Feature-X.md und implementiere Phase 1" - [ ] Dashboard geöffnet und Login getestet - [ ] Obsidian Vault Pfad geprüft - [ ] API-Keys vorhanden (`.env`) -- [ ] Docker Services laufend +- [ ] Ollama läuft (`ollama serve`) - [ ] Erste Chat-Nachricht gesendet - [ ] Token-Tracking geprüft - [ ] Backup getestet