Add initial implementation of noThinkProxy with Docker support and README documentation
This commit is contained in:
96
README.md
Normal file
96
README.md
Normal file
@@ -0,0 +1,96 @@
|
||||
# noThinkProxy
|
||||
|
||||
Anthropic API → Ollama Proxy.
|
||||
Ermöglicht Claude-SDK-Clients (z. B. **Claude Code**) gegen einen lokalen Ollama-Server zu arbeiten, ohne Think-Modus und mit frei wählbarem Modell.
|
||||
|
||||
## Was der Proxy tut
|
||||
|
||||
- Empfängt Requests im **Anthropic-Format** (`POST /v1/messages`)
|
||||
- Konvertiert sie ins **Ollama-Format** (`POST /api/chat`)
|
||||
- Gibt die Antwort als **Anthropic SSE-Stream** zurück
|
||||
- Deaktiviert den Think-Modus (`think: false`)
|
||||
- Ersetzt alle `claude-*` Modellnamen durch das konfigurierte Modell
|
||||
- Konvertiert Tool-Calls und Tool-Results korrekt ins Ollama-Format
|
||||
- Dedupliziert doppelte Tool-Calls
|
||||
|
||||
## Schnellstart (Docker)
|
||||
|
||||
### 1. Image bauen und in Registry pushen
|
||||
|
||||
```bash
|
||||
docker build -t registry.aquantico.lan/nothinkproxy:latest .
|
||||
docker push registry.aquantico.lan/nothinkproxy:latest
|
||||
```
|
||||
|
||||
### 2. Auf dem Server deployen
|
||||
|
||||
```bash
|
||||
# docker-compose.yml auf den Server kopieren
|
||||
scp docker-compose.yml server:/opt/nothinkproxy/
|
||||
|
||||
# Auf dem Server starten
|
||||
ssh server
|
||||
cd /opt/nothinkproxy
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
Der Proxy ist dann erreichbar unter `https://claude-proxy.aquantico.lan`.
|
||||
|
||||
## Konfiguration (Umgebungsvariablen)
|
||||
|
||||
| Variable | Standard | Beschreibung |
|
||||
|---------------|-----------------------------------------------|-------------------------------------|
|
||||
| `PORT` | `11435` | Port auf dem der Proxy lauscht |
|
||||
| `OLLAMA_URL` | `https://ollama.aquantico.de/api/chat` | Vollständige Ollama Chat-API URL |
|
||||
| `OLLAMA_MODEL`| `qwen3.6:35b-a3b-q4_K_M` | Modell das Ollama verwenden soll |
|
||||
| `OLLAMA_AUTH` | *(Bearer Token)* | Auth-Token für den Ollama-Server |
|
||||
|
||||
Anpassen in `docker-compose.yml` unter `environment:`.
|
||||
|
||||
## Claude Code installieren
|
||||
|
||||
Auf dem Zielrechner (einmaliger Installer):
|
||||
|
||||
```bash
|
||||
curl -fsSL https://claude-proxy.aquantico.lan/install.sh | bash
|
||||
```
|
||||
|
||||
Der Installer prüft Node.js, installiert es bei Bedarf und installiert Claude Code via npm.
|
||||
|
||||
## Claude Code mit dem Proxy starten
|
||||
|
||||
```bash
|
||||
ANTHROPIC_BASE_URL=https://claude-proxy.aquantico.lan claude
|
||||
```
|
||||
|
||||
Als dauerhafter Alias in `~/.bashrc` oder `~/.zshrc`:
|
||||
|
||||
```bash
|
||||
alias claude-local='ANTHROPIC_BASE_URL=https://claude-proxy.aquantico.lan claude'
|
||||
```
|
||||
|
||||
## Lokaler Betrieb (ohne Docker)
|
||||
|
||||
```bash
|
||||
npm install
|
||||
node app.js
|
||||
```
|
||||
|
||||
Mit anderem Modell / Server:
|
||||
|
||||
```bash
|
||||
OLLAMA_URL=http://localhost:11434/api/chat \
|
||||
OLLAMA_MODEL=llama3.2 \
|
||||
OLLAMA_AUTH=mytoken \
|
||||
node app.js
|
||||
```
|
||||
|
||||
Dann Claude Code starten:
|
||||
|
||||
```bash
|
||||
ANTHROPIC_BASE_URL=http://localhost:11435 claude
|
||||
```
|
||||
|
||||
## Info-Seite
|
||||
|
||||
Beim Aufruf von `https://claude-proxy.aquantico.lan/` (ohne Pfad) erscheint eine HTML-Seite mit der aktuellen Konfiguration und Installations-Anweisungen.
|
||||
Reference in New Issue
Block a user