Some checks failed
CI / Linux x86_64 (Forgejo) (push) Failing after 1s
A model caught in a repetition loop wrote until the flow's 300 s timeout. max_tokens bounds the answer on every wire (Ollama num_predict, OpenAI max_tokens, Anthropic max_tokens), and truncated tells the caller whether the answer stopped at that limit. repeat_penalty goes to Ollama and vLLM and is refused where the backend has no such setting. Signed-off-by: flemming-it <sf@flemming.it>
292 lines
12 KiB
YAML
292 lines
12 KiB
YAML
schema_version: 3
|
|
provider: chain
|
|
name: llm-chat
|
|
version: 0.4.0
|
|
|
|
# Capability provided by this module.
|
|
provides:
|
|
- capability: llm.chat
|
|
version: 0.4.0
|
|
|
|
# Declared inputs in verbose v3 form. Studio renders the
|
|
# description in the active locale as a tooltip on each
|
|
# port; the editor falls back to the English description
|
|
# when no peer is configured.
|
|
inputs:
|
|
prompt:
|
|
type: text
|
|
description:
|
|
en: The user-facing prompt text the model should respond to.
|
|
de: Der vom Modell zu beantwortende Prompt-Text.
|
|
endpoint:
|
|
type: text
|
|
description:
|
|
en: |
|
|
Chat endpoint URL matching the selected api:
|
|
ollama "http://localhost:11434/api/chat",
|
|
openai "https://.../v1/chat/completions" (vLLM etc.),
|
|
anthropic "https://api.anthropic.com/v1/messages".
|
|
de: |
|
|
Chat-Endpunkt-URL passend zur gewählten api:
|
|
ollama "http://localhost:11434/api/chat",
|
|
openai "https://.../v1/chat/completions" (vLLM u. a.),
|
|
anthropic "https://api.anthropic.com/v1/messages".
|
|
api:
|
|
type: text
|
|
description:
|
|
en: |
|
|
Optional wire format: "ollama" (default), "vllm"
|
|
(self-hosted vLLM), "openai" (OpenAI or other
|
|
OpenAI-compatible servers such as LM Studio), or
|
|
"anthropic" (Messages API). vllm and openai speak the
|
|
same wire; the separate value exists so you can write
|
|
what you mean and get vLLM-specific hints. Empty = ollama.
|
|
de: |
|
|
Optionales Wire-Format: "ollama" (Default), "vllm"
|
|
(selbst gehostetes vLLM), "openai" (OpenAI oder andere
|
|
OpenAI-kompatible Server wie LM Studio) oder "anthropic"
|
|
(Messages API). vllm und openai sprechen dieselbe Wire;
|
|
der eigene Wert existiert, damit Du schreibst, was Du
|
|
meinst, und vLLM-spezifische Hinweise bekommst.
|
|
Leer = ollama.
|
|
model:
|
|
type: text
|
|
description:
|
|
en: Model identifier as registered with the endpoint, e.g. "qwen2.5:14b" or "llama3.1:8b".
|
|
de: Modell-Identifier wie beim Endpunkt registriert, z. B. "qwen2.5:14b" oder "llama3.1:8b".
|
|
api_key:
|
|
type: text
|
|
description:
|
|
en: |
|
|
Optional API key. Sent as "Authorization: Bearer" for
|
|
ollama/openai and as "x-api-key" for anthropic. Empty
|
|
string means no auth header is sent. Never appears in
|
|
outputs, logs, or audit events.
|
|
de: |
|
|
Optionaler API-Key. Bei ollama/openai als
|
|
"Authorization: Bearer", bei anthropic als "x-api-key"
|
|
gesendet. Leer = kein Auth-Header. Erscheint nie in
|
|
Ausgaben, Logs oder Audit-Events.
|
|
temperature:
|
|
type: text
|
|
description:
|
|
en: |
|
|
Sampling temperature, e.g. "0" for the most repeatable
|
|
output. Empty leaves the server default. Works on all three
|
|
wire formats.
|
|
de: |
|
|
Sampling-Temperatur, z. B. "0" für möglichst wiederholbare
|
|
Ausgaben. Leer lässt die Server-Voreinstellung. Gilt für
|
|
alle drei Wire-Formate.
|
|
top_p:
|
|
type: text
|
|
description:
|
|
en: Nucleus sampling cutoff. Empty leaves the server default.
|
|
de: Nucleus-Sampling-Grenze. Leer lässt die Server-Voreinstellung.
|
|
top_k:
|
|
type: text
|
|
description:
|
|
en: |
|
|
Top-k cutoff, a whole number. Ollama and Anthropic only; with
|
|
api openai or vllm the input is refused rather than ignored,
|
|
because a setting that silently does nothing produces a run
|
|
that looks configured and is not.
|
|
de: |
|
|
Top-k-Grenze, ganze Zahl. Nur Ollama und Anthropic; mit api
|
|
openai oder vllm wird der Eingang abgelehnt statt ignoriert,
|
|
weil eine still wirkungslose Einstellung einen Lauf erzeugt,
|
|
der konfiguriert aussieht und es nicht ist.
|
|
seed:
|
|
type: text
|
|
description:
|
|
en: |
|
|
Sampling seed, a whole number. Together with temperature 0
|
|
this is what makes a run repeatable. Ollama and the OpenAI
|
|
wire only; Anthropic has no seed and refuses the input.
|
|
de: |
|
|
Sampling-Seed, ganze Zahl. Zusammen mit Temperatur 0 macht
|
|
das einen Lauf wiederholbar. Nur Ollama und das
|
|
OpenAI-Format; Anthropic kennt keinen Seed und lehnt den
|
|
Eingang ab.
|
|
max_tokens:
|
|
type: text
|
|
description:
|
|
en: |
|
|
Upper bound on the answer length in tokens, a whole number of
|
|
at least 1. A model caught in a repetition loop otherwise
|
|
writes until the flow's timeout. Ollama receives
|
|
options.num_predict, the OpenAI wire max_tokens, Anthropic
|
|
max_tokens (default 4096 there when empty). Empty leaves no
|
|
limit on Ollama and the OpenAI wire. Whether the answer
|
|
stopped at the limit is reported in the output truncated.
|
|
de: |
|
|
Obergrenze für die Länge der Antwort in Token, ganze Zahl ab
|
|
1. Ein Modell in einer Wiederholungsschleife schreibt sonst
|
|
bis zur Zeitgrenze des Ablaufs. Ollama bekommt
|
|
options.num_predict, das OpenAI-Format max_tokens, Anthropic
|
|
max_tokens (dort 4096, wenn leer). Leer heißt bei Ollama und
|
|
im OpenAI-Format keine Grenze. Ob die Antwort an der Grenze
|
|
endete, steht in der Ausgabe truncated.
|
|
repeat_penalty:
|
|
type: text
|
|
description:
|
|
en: |
|
|
Penalty on repeated tokens, a number; 1.0 is neutral, values
|
|
such as 1.1 make loops less likely. Ollama receives
|
|
options.repeat_penalty, vLLM repetition_penalty. The OpenAI
|
|
wire and Anthropic have no such setting and refuse the input.
|
|
de: |
|
|
Abschlag auf wiederholte Token, eine Zahl; 1.0 ist neutral,
|
|
Werte wie 1.1 machen Schleifen seltener. Ollama bekommt
|
|
options.repeat_penalty, vLLM repetition_penalty. Das
|
|
OpenAI-Format und Anthropic kennen die Einstellung nicht und
|
|
lehnen den Eingang ab.
|
|
keep_alive:
|
|
type: text
|
|
description:
|
|
en: |
|
|
Ollama only: how long the server keeps the model resident
|
|
after this request, e.g. "4h", "30m", or "-1" for
|
|
indefinitely. Empty leaves the server default, which unloads
|
|
after five minutes, so the next first request pays a full
|
|
model reload (30 to 40 seconds for a large local model).
|
|
Setting this with any other api is refused rather than
|
|
ignored, because the input expresses an expectation the
|
|
other backends cannot meet.
|
|
de: |
|
|
Nur für Ollama: wie lange der Server das Modell nach dieser
|
|
Anfrage geladen lässt, z. B. "4h", "30m" oder "-1" für
|
|
unbegrenzt. Leer bedeutet Server-Voreinstellung, die nach
|
|
fünf Minuten entlädt; die nächste erste Anfrage zahlt dann
|
|
den vollen Modell-Neustart (30 bis 40 Sekunden bei einem
|
|
großen lokalen Modell). Mit einer anderen api wird der Wert
|
|
abgelehnt statt ignoriert, weil er eine Erwartung ausdrückt,
|
|
die die anderen Backends nicht erfüllen können.
|
|
think:
|
|
type: text
|
|
description:
|
|
en: |
|
|
Whether a reasoning model runs its thinking phase: true or
|
|
false; empty leaves the server default. Ollama lets
|
|
qwen3-type models think by default, which takes a call from
|
|
about 10 to about 50 seconds. Ollama receives think, vLLM
|
|
chat_template_kwargs.enable_thinking. The OpenAI wire has no
|
|
such switch, so a value is refused there; for Anthropic false
|
|
is accepted (extended thinking is off unless requested) and
|
|
true is refused.
|
|
de: |
|
|
Ob ein Reasoning-Modell seine Denkphase durchläuft: true oder
|
|
false; leer lässt die Voreinstellung des Servers. Ollama lässt
|
|
Modelle wie qwen3 standardmäßig denken, ein Aufruf dauert
|
|
dadurch rund 50 statt 10 Sekunden. Ollama bekommt think, vLLM
|
|
chat_template_kwargs.enable_thinking. Das OpenAI-Format kennt
|
|
keinen solchen Schalter, dort wird ein Wert abgelehnt; bei
|
|
Anthropic wird false angenommen (erweitertes Denken ist ohne
|
|
Anforderung aus) und true abgelehnt.
|
|
system_prompt:
|
|
type: text
|
|
description:
|
|
en: |
|
|
Optional system prompt. Empty string omits the system
|
|
message and lets the model use its built-in default.
|
|
de: |
|
|
Optionaler System-Prompt. Leer = das Modell verwendet
|
|
seinen eingebauten Default.
|
|
|
|
# Outputs produced.
|
|
outputs:
|
|
response:
|
|
type: text
|
|
description:
|
|
en: The assistant's plain-text reply.
|
|
de: Die Klartext-Antwort des Modells.
|
|
truncated:
|
|
type: text
|
|
description:
|
|
en: |
|
|
"true" when the answer stopped at the length limit
|
|
(max_tokens) instead of where the model finished, "false"
|
|
when the model finished. Empty when the backend gave no
|
|
stop reason.
|
|
de: |
|
|
"true", wenn die Antwort an der Längengrenze (max_tokens)
|
|
endete statt dort, wo das Modell fertig war, "false", wenn
|
|
das Modell fertig war. Leer, wenn das Backend keinen Grund
|
|
für das Ende nannte.
|
|
stop_reason:
|
|
type: text
|
|
description:
|
|
en: |
|
|
Why the backend stopped writing, in its own words: Ollama
|
|
done_reason (stop, length), the OpenAI wire finish_reason
|
|
(stop, length), Anthropic stop_reason (end_turn,
|
|
max_tokens, ...). Empty when the answer did not say.
|
|
de: |
|
|
Warum das Backend aufhörte, in seinen eigenen Worten: Ollama
|
|
done_reason (stop, length), das OpenAI-Format finish_reason
|
|
(stop, length), Anthropic stop_reason (end_turn, max_tokens
|
|
u. a.). Leer, wenn die Antwort es nicht angab.
|
|
model_endpoint:
|
|
type: text
|
|
description:
|
|
en: The endpoint the response was generated against. Used for audit correlation.
|
|
de: Der Endpunkt, gegen den die Antwort erzeugt wurde — für Audit-Korrelation.
|
|
model_name:
|
|
type: text
|
|
description:
|
|
en: The model identifier as supplied to the LLM API.
|
|
de: Der an die LLM-API übergebene Modell-Identifier.
|
|
model_digest:
|
|
type: text
|
|
description:
|
|
en: |
|
|
SHA-256 digest of the served Ollama model, when reachable.
|
|
Empty for non-Ollama endpoints (OpenAI / Anthropic do not
|
|
expose a digest API). Together with model_endpoint and
|
|
model_name this answers the audit question "which exact
|
|
model produced this response?"
|
|
de: |
|
|
SHA-256-Digest des bedienten Ollama-Modells, wenn erreichbar.
|
|
Leer für Nicht-Ollama-Endpunkte (OpenAI / Anthropic stellen
|
|
keine Digest-API bereit). Zusammen mit model_endpoint und
|
|
model_name beantwortet das die Audit-Frage "welches genaue
|
|
Modell hat diese Antwort erzeugt?"
|
|
tokens_prompt:
|
|
type: text
|
|
description:
|
|
en: |
|
|
How many tokens the prompt cost, as the backend counted it.
|
|
Empty when the answer carried no count: a zero would read
|
|
like a measurement nobody took. The hub lifts this field
|
|
into the audit log automatically.
|
|
de: |
|
|
Wie viele Token die Anfrage gekostet hat, nach der Zählung
|
|
des Backends. Leer, wenn die Antwort keine Zählung enthielt:
|
|
eine Null würde wie eine Messung aussehen, die niemand
|
|
gemacht hat. Der Hub hebt dieses Feld selbst in den Prüfpfad.
|
|
tokens_completion:
|
|
type: text
|
|
description:
|
|
en: |
|
|
How many tokens the answer cost, same rules as
|
|
tokens_prompt. Ollama counts in `eval_count`, the OpenAI
|
|
shape in `usage.completion_tokens`, Anthropic in
|
|
`usage.output_tokens`.
|
|
de: |
|
|
Wie viele Token die Antwort gekostet hat, gleiche Regeln wie
|
|
tokens_prompt. Ollama zählt in `eval_count`, das
|
|
OpenAI-Format in `usage.completion_tokens`, Anthropic in
|
|
`usage.output_tokens`.
|
|
|
|
# Permissions required.
|
|
#
|
|
# The module makes outbound HTTP to the configured endpoint.
|
|
# Default declarations cover loopback (Ollama) and the common
|
|
# cloud providers. Operators with different endpoints fork
|
|
# module.yaml in Phase 0.5; operator-config-driven permission
|
|
# overrides arrive in Phase 1+.
|
|
permissions:
|
|
- "net: localhost"
|
|
- "net: 127.0.0.1"
|
|
- "net: api.openai.com"
|
|
- "net: api.anthropic.com"
|