main
Co-authored-by: Cursor <cursoragent@cursor.com>
go-llm
Go library for chat LLM calls. One client speaks either the Ollama native protocol or an OpenAI-compatible protocol. Callers pass messages. The library does not load files or build product prompts.
Import: gitea.neitzel.de/konrad/go-llm (package gollm).
go get gitea.neitzel.de/konrad/go-llm
- Guide — how to call each capability
- API — every exported symbol
- Domain language
Included
- Adapters — Ollama native and OpenAI-compatible
- Chat — one assistant reply, including temperature and max tokens
- Stream — the same call, delivered as text chunks
- List Models — names the server reports
Excluded
- Embeddings, tools, and raw generate
- Nextcloud types and story types
Testing
Unit tests use httptest. No live model server is required.
go test ./... fails when docs/api.md does not match the exported API. Regenerate it with:
UPDATE_API_DOCS=1 go test -run TestAPIDoc -count=1
Related
- Tales — ExApp that consumes this library
- Workspace ADR
docs/adr/go-llm/0001-native-adapters.md - Workspace ADR
docs/adr/go-llm/0002-wire-only.md
Languages
Go
100%