Add go-llm v1 chat Client with OpenAI-compatible and Ollama adapters.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
# 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
|
||||
Reference in New Issue
Block a user