1.3 KiB
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