feat: selectable wire format — ollama (default), openai (vLLM etc.), anthropic
Some checks failed
CI / Linux x86_64 (Forgejo) (push) Failing after 2s
sign-bundle / sign (push) Has been cancelled

Port the multi-API client from llm.chat (llm.rs kept in lockstep):
the optional api input selects the dialect, default stays the
unchanged v0.1.x Ollama behavior. openai covers vLLM, LM Studio,
LiteLLM and cloud OpenAI; api-specific error hints; api_key sent
as Bearer (ollama/openai) or x-api-key (anthropic). model_digest
stays an Ollama-only best-effort probe and is documented as such.

Proven end-to-end against a hermetic OpenAI-wire fake (request
shape validated, response parsed) via a hub flow run.

Signed-off-by: flemming-it <sf@flemming.it>
This commit is contained in:
flemming-it 2026-08-20 16:33:11 +02:00
parent 19886a7072
commit 4a04abf4f0
6 changed files with 559 additions and 90 deletions

View file

@ -1,6 +1,6 @@
# text.summarize
Ollama-basierte treue Zusammenfassung. Sendet Quelltext an
LLM-basierte treue Zusammenfassung (Ollama, vLLM, jeder OpenAI-kompatible Server oder Anthropic). Sendet Quelltext an
einen konfigurierten LLM-Endpunkt mit einem Treue-vor-Kreativität-
System-Prompt und liefert die Zusammenfassung plus
audit-taugliche Modell-Herkunfts-Felder.
@ -16,7 +16,8 @@ audit-taugliche Modell-Herkunfts-Felder.
| `text` | text | Quelltext. |
| `style` | text | Optionaler Stil-Hinweis (z.B. `one paragraph`, `three bullet points`, `a tweet`). Default: `one paragraph`. |
| `language` | text | Optionaler Ziel-Sprache (z.B. `German`, `ja-JP`). Leer = Quellsprache. |
| `endpoint` | text | Ollama-förmiger `/api/chat`-Endpunkt. |
| `endpoint` | text | Chat-Endpunkt passend zum gewählten `api` (Ollama `/api/chat`, OpenAI-kompatibel `/v1/chat/completions` — vLLM u. a., Anthropic `/v1/messages`). |
| `api` | text | Optionales Wire-Format: `ollama` (Default), `openai`, `anthropic`. |
| `model` | text | Modell-ID am Endpunkt. |
| `api_key` | text | Optionaler Bearer-Token für Cloud-Endpunkte. |
@ -29,7 +30,7 @@ audit-taugliche Modell-Herkunfts-Felder.
| `language` | text | Echo des Sprach-Inputs. |
| `model_endpoint` | text | URL, gegen die zusammengefasst wurde. |
| `model_name` | text | Modell-ID wie an die LLM-API gesendet. |
| `model_digest` | text | SHA-256-Digest des bedienenden Ollama-Modells (wenn erreichbar). |
| `model_digest` | text | SHA-256-Digest des bedienten Modells — nur bei Ollama, sonst leer. |
## Treue vor Kreativität