Add go-llm v1 chat Client with OpenAI-compatible and Ollama adapters.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Konrad Neitzel
2026-09-01 19:36:45 +02:00
co-authored by Cursor
commit 237e13445c
7 changed files with 713 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
# go-llm
Go Library for chat LLM calls (`gitea.neitzel.de/konrad/go-llm`). Domain language is in `CONTEXT.md`. Decisions live in the Workspace at `docs/adr/go-llm/`.
v1: Chat, Stream, List Models, temperature, and max tokens. Adapters: Ollama native (`/api/chat`, `/api/tags`) and OpenAI-compatible (`/v1/chat/completions`, `/v1/models`). No embeddings, tools, raw generate, Nextcloud types, or story types.
```go
client, err := gollm.NewClient(gollm.AdapterOpenAI, "http://localhost:8000", "")
text, err := client.Chat(ctx, []gollm.Message{{Role: gollm.RoleUser, Content: "Hello"}}, gollm.Options{Model: "llama"})
```