Files
go-llm/CONTEXT.md
T

26 lines
1.3 KiB
Markdown

# go-llm
Shared Go Library for calling a chat LLM: one Client interface with an Ollama-native Adapter and an OpenAI-compatible Adapter. ExApps and Services import `gitea.neitzel.de/konrad/go-llm`. It has no Nextcloud types and no story types.
## Language
**Client**:
A configured caller bound to one Adapter, base URL, optional API key, and HTTP behaviour. Chat, Stream, and List Models go through that Client.
_Avoid_: a chat-history store, Nextcloud AppAPI credentials
**Adapter**:
Which native protocol the Client speaks: Ollama (`/api/chat`) or OpenAI-compatible (`/v1/chat/completions`). vLLM and similar servers use the OpenAI-compatible Adapter.
_Avoid_: a third vLLM-native protocol, one Adapter type per model name
**Message**:
One chat turn with a role (system, user, or assistant) and text content. The Library sends and streams Messages; it does not build product prompts.
_Avoid_: Story, Chapter, prompt template
**Stream**:
The same Chat request delivered as incremental text chunks instead of one complete reply.
_Avoid_: writing chunks to files
**Model**:
A server-side model name as listed by the Adapter. The Library lists names and accepts the name the caller passes; it does not download or install models.
_Avoid_: GGUF files, Ollama Modelfile management