feat: define shared TextModel, Backend, Token, Message interfaces
Zero-dependency interface package for the Core inference ecosystem.
Backends (go-mlx, go-rocm) implement these interfaces.
Consumers (go-ml, go-ai, go-i18n) import them.
Includes:
- TextModel: Generate, Chat, Err, Close (with context.Context)
- Backend: Named engine registry with platform preference
- Functional options: WithMaxTokens, WithTemperature, WithTopK, etc.
- LoadModel: Auto-selects best available backend
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-19 19:37:27 +00:00
|
|
|
module forge.lthn.ai/core/go-inference
|
|
|
|
|
|
2026-02-22 20:33:48 +00:00
|
|
|
go 1.26.0
|
test(inference): add comprehensive tests for all exported API
Cover options (GenerateConfig defaults, all With* options, ApplyGenerateOpts/
ApplyLoadOpts), backend registry (Register, Get, List, Default priority order
metal > rocm > llama_cpp), LoadModel routing (explicit/auto backend, error
paths), and Discover (model directory scanning, quantisation, edge cases).
69 tests, 100% statement coverage, race-clean.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 02:06:41 +00:00
|
|
|
|
|
|
|
|
require github.com/stretchr/testify v1.11.1
|
|
|
|
|
|
|
|
|
|
require (
|
2026-02-22 21:41:04 +00:00
|
|
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
|
|
|
|
github.com/kr/pretty v0.3.1 // indirect
|
|
|
|
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
|
|
|
|
github.com/rogpeppe/go-internal v1.14.1 // indirect
|
|
|
|
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
|
test(inference): add comprehensive tests for all exported API
Cover options (GenerateConfig defaults, all With* options, ApplyGenerateOpts/
ApplyLoadOpts), backend registry (Register, Get, List, Default priority order
metal > rocm > llama_cpp), LoadModel routing (explicit/auto backend, error
paths), and Discover (model directory scanning, quantisation, edge cases).
69 tests, 100% statement coverage, race-clean.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 02:06:41 +00:00
|
|
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
|
|
|
|
)
|