Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
178 commits
Select commit Hold shift + click to select a range
4734855
chore: add EUPL-1.2 LICENCE file (UK English canonical)
Snider May 1, 2026
860c05c
chore(repo): refresh submodules + go.work hygiene (Phase 2 cascade un…
Snider May 1, 2026
82b08bc
feat: add shared inference contracts
Snider May 8, 2026
c5feeca
feat(api): add shared capability reports
Snider May 8, 2026
dfdedb0
feat(api): add runtime-neutral model primitives
Snider May 8, 2026
a881cc6
feat(api): add openai chat adapter
Snider May 8, 2026
b533090
feat(api): add openai chat adapter
Snider May 8, 2026
b9f4d46
feat(api): add openai chat adapter
Snider May 8, 2026
bbdaf88
feat(inference): canonical NewService + RegisterCore shape (Mantis #1…
Snider May 10, 2026
7181cb0
test(inference): NewService + RegisterCore coverage (Mantis #1387)
Snider May 10, 2026
f9d1f03
feat(inference): state/ split + wire packages + per-file docs
Snider May 11, 2026
b7946c0
feat(parser): driver-neutral output-parsing layer
Snider May 11, 2026
cb4f9fb
feat(probe): add ProbeScheduler + scheduler/queue event vocab
Snider May 11, 2026
cb3dc24
feat(quant): lift jang + codebook to driver-neutral packages
Snider May 11, 2026
a18708d
feat(eval): driver-neutral dataset eval engine
Snider May 11, 2026
5bf4766
feat(bench): driver-neutral local benchmark/eval harness
Snider May 11, 2026
e6513bf
fix(bench): mirror full DecodeOptimisationResult/Metrics fields
Snider May 11, 2026
4ab9de2
fix(bench): use AdapterInfo struct instead of bare strings
Snider May 11, 2026
264eea8
test(bench): unit tests for driver-neutral Run orchestration
Snider May 11, 2026
521dd53
feat(decode): driver-neutral speculative + prompt-lookup decode harness
Snider May 11, 2026
254b391
feat(scheduler): driver-neutral request scheduler for inference.TextM…
Snider May 11, 2026
f0af335
feat(inference): add agent-state tuning contracts
Snider May 20, 2026
feb256a
api(state): rename bench warm path
Snider May 21, 2026
6cb95d7
api(state): promote state naming
Snider May 21, 2026
03a06d0
perf(gguf): readGGUFString zero-copy via core.AsString — bump core/go…
Snider May 21, 2026
f7a3d7a
perf(state/filestore): zero-copy text resolve + JSON direct + AX-11 b…
Snider May 21, 2026
47d011d
test(gguf): AX-11 bench coverage — ReadInfo + readGGUFString
Snider May 21, 2026
34791d6
test+perf: AX-11 bench fan-out (36 files, ~620 benches) + parser/gguf…
Snider May 21, 2026
fd86da3
perf(parser): cache Default registry via core.Once — 96% allocs on Ne…
Snider May 21, 2026
f4a3c4b
perf(discover): single readDir per directory + drop reflect adapter
Snider May 21, 2026
d839dc8
perf(openai): drop redundant []byte→string copies in JSON decode paths
Snider May 21, 2026
075de97
perf(state/filestore): stack-allocated record header + byte-compare m…
Snider May 21, 2026
65116f5
perf(openai): completionID via strconv.AppendInt + AsString — 42% faster
Snider May 21, 2026
5c38b9a
perf(decode): pre-grow TokensText builder — 87-93% allocs cut
Snider May 21, 2026
dc9ffe1
perf(parser): indexString → strings.Index via core.Index — up to 98× …
Snider May 21, 2026
949f1b0
perf(openai): drop second naive indexString — delegate to core.Index
Snider May 21, 2026
6e9d6b8
perf(eval): strconv replaces Sprintf in quality checks + preallocate …
Snider May 21, 2026
8382c9f
perf(tuning): CandidateID via strconv.AppendInt — 3.4× faster
Snider May 21, 2026
ede57b8
perf(scheduler): strconv ID + pre-sized opts/labels — 25% allocs cut …
Snider May 21, 2026
dc93fb8
perf(inference): drop snapshotBackends + maps.Clone — Default 11× faster
Snider May 21, 2026
18bcd29
perf(discover): gate config.json Read on entries-list check
Snider May 21, 2026
d4bca63
perf(openai/responses): pre-size ChatCompletionRequest.Messages
Snider May 21, 2026
f8a26ff
perf(anthropic): blockText fast paths + pre-grown builder
Snider May 21, 2026
45542be
perf(state/project_seed): joinURI pre-grown builder
Snider May 21, 2026
3e6f140
perf(bench): pre-size samples + strconv replaces Sprintf in qualityCh…
Snider May 21, 2026
1b88f34
perf(parser): replaceAll → core.Replace (strings.ReplaceAll)
Snider May 21, 2026
ee3ed23
perf(parser): lazy-init builder in drain — 35x alloc cut on streaming…
Snider May 21, 2026
9970414
perf(scheduler): hoist label clone + millisString out of per-token loop
Snider May 21, 2026
44dfb3b
perf(gguf): skip-and-clone metadata loop — 33x alloc cut on vocab-hea…
Snider May 21, 2026
30b9c60
test(state): add benches for top-level resolver helpers
Snider May 22, 2026
5e4c772
test(decode): add benches for speculative + prompt-lookup hot paths
Snider May 22, 2026
c9399b2
test(state): add benches for InMemoryStore Put/Get/Resolve paths
Snider May 22, 2026
d0d7abf
test(filestore): add benches for Create/Put/Resolve/Open paths
Snider May 22, 2026
984a568
test(scheduler): add benches for Schedule + helpers across queue states
Snider May 22, 2026
4e5f793
perf(filestore): reuse header + metadata buffers in rebuildIndex
Snider May 22, 2026
b38ffee
perf(filestore): alias payload buffer as Text via unsafe.String
Snider May 22, 2026
45a099b
perf(decode): drop variadic firstNonEmpty, pre-grow TokensText builder
Snider May 22, 2026
285f3b4
perf(scheduler): format request-constant latencies once per request
Snider May 22, 2026
2182d50
perf(state): single-pass NewInMemoryStoreWithManifest seed walk
Snider May 22, 2026
3154356
perf(scheduler): hand-roll nextRequestID, pre-size cloneLabels
Snider May 22, 2026
4e80d41
perf(filestore): stack-allocate record-header buffer in rebuildIndex
Snider May 22, 2026
300f26e
merge: cladius-lane-Wave7-W7D (decode + scheduler benches + perf)
Snider May 22, 2026
2414b3b
merge: cladius-lane-Wave7-W7C (state surface benches + perf)
Snider May 22, 2026
5902f01
merge: homelab/dev — Charon's parser/gguf/scheduler perf + state/tuni…
Snider May 22, 2026
70decbd
test(state): add benches for error paths
Snider May 22, 2026
9dfc35d
test(state): add benches for resolver hierarchy fallbacks
Snider May 22, 2026
5b786ba
test(decode): deeper buildAcceptance + normaliseMaxTokens edge benches
Snider May 22, 2026
a13ea4b
test(state): add benches for PutOptions matrix
Snider May 22, 2026
02ce3f2
test(decode): mixed Text+Value + Unicode whitespace TokensText benches
Snider May 22, 2026
0e09d95
test(state): add benches for InMemoryStore at 1k/10k capacities
Snider May 22, 2026
e125c6f
test(state): add deeper benches for ProjectSeed compat + sleep assembly
Snider May 22, 2026
0e61400
test(scheduler): concurrency stress benches — Schedule fan-out + burst
Snider May 22, 2026
604b482
test(filestore): add benches for closed/cancelled/missing error paths
Snider May 22, 2026
3d6c195
test(filestore): add benches for ResolveRefBytes mismatch shapes
Snider May 22, 2026
ff8d57b
test(scheduler): cancellation path benches — mid-stream, queue-wait, …
Snider May 22, 2026
0b9fa20
test(filestore): add benches for ResolveURI capacity + variant shapes
Snider May 22, 2026
2475824
test(filestore): add benches for PutBytesStream backpressure shapes
Snider May 22, 2026
5dd492e
test(scheduler): backpressure benches — queue-full reject, slow consu…
Snider May 22, 2026
24fbda4
test(filestore): add benches for PutOptions tag/label/URI matrix
Snider May 22, 2026
4356a14
test(filestore): add benches for index at 1k/10k record capacity
Snider May 22, 2026
032015d
test(scheduler): probe-sink throughput benches — no/fast/slow sink ab…
Snider May 22, 2026
2e86922
test(tuning): add deeper benches for CandidateID + PlanModelReplace e…
Snider May 22, 2026
6f9c380
test(scheduler): error-propagation benches — nil model, setErr, base.…
Snider May 22, 2026
d8cf795
test(scheduler): realistic mixed-workload benches — sizes, kinds, labels
Snider May 22, 2026
ae767a5
merge: cladius-lane-Wave7-W7G (state surface deep bench coverage)
Snider May 22, 2026
ac15bb1
merge: cladius-lane-Wave7-W7H (decode + scheduler deep bench coverage)
Snider May 22, 2026
7cf1b8f
chore(external/go): bump → f7a84db (PinnedView + Clone + AsString/AsB…
Snider May 22, 2026
3bb09ff
test(filestore): pin rebuildIndex shape against Put-built index
Snider May 22, 2026
cb67f0f
perf(filestore): pre-size rebuildIndex maps from file-size heuristic
Snider May 22, 2026
723ec0c
perf(scheduler): skip handle.Labels clone when request has none
Snider May 22, 2026
27d8ee1
perf(filestore): lazy URI extraction in rebuildIndex
Snider May 22, 2026
46dd269
perf(scheduler): swap active-job map to sync.Map for cancel hot-path
Snider May 22, 2026
4d5305d
perf(filestore): drop dead meta storage from fileIndexEntry
Snider May 22, 2026
cc4a964
perf(scheduler): lock-free probeSink read via atomic.Pointer
Snider May 22, 2026
6fa5eec
merge: cladius-lane-Wave8-W8B (filestore.rebuildIndex — 87% alloc cut)
Snider May 22, 2026
ca54c91
perf(scheduler): cache WithTemperature(0) closure for burst dispatch
Snider May 22, 2026
1408df6
docs(inference): document ScheduledToken.Labels sharing contract
Snider May 22, 2026
9185c14
merge: cladius-lane-Wave8-W8C (scheduler concurrency — sync.Map cance…
Snider May 22, 2026
8f1d73c
test(scheduler): protect events slice with mutex in latency-probe test
Snider May 22, 2026
e3977c0
perf(filestore): empty-meta fast path in PutBytesStream
Snider May 22, 2026
bd64c83
perf(filestore): hand-rolled recordMeta JSON encoder
Snider May 22, 2026
ac40bed
perf(filestore): fold record header into meta buffer
Snider May 22, 2026
1e15c36
perf(filestore): reuse Store-embedded limitedPayloadWriter
Snider May 22, 2026
4d75bf5
merge: cladius-lane-Wave8-W8D (PutBytesStream — structural 1-alloc fl…
Snider May 22, 2026
8d04b36
perf(state): joinURI direct []byte buffer — drops 1 alloc per call
Snider May 22, 2026
7043454
perf(tuning): lazy-init labels map in ScoreTuningMeasurements
Snider May 22, 2026
5cc0267
perf(tuning): drop dead reasons-slice alloc + pre-size on SummaryWindow
Snider May 22, 2026
33c84dd
perf(filestore): share single errStoreClosed sentinel across post-Clo…
Snider May 22, 2026
b9b1c16
perf(filestore): share sentinel errors across hot validation gates
Snider May 22, 2026
bbe938c
perf(state): lazy-init InMemoryStore backing maps on empty construction
Snider May 22, 2026
3ef6222
merge: cladius-lane-Wave8-W7G2 (state residual — 9× tuning scoring, s…
Snider May 22, 2026
d1a3a6d
perf(openai): hand-rolled ChatMessageDelta encoder + shared JSON-stri…
Snider May 22, 2026
c7f7518
perf(openai): hand-rolled chunk-as-SSE-frame encoder for streaming path
Snider May 22, 2026
6dc5323
perf(openai): hand-rolled ChatCompletionResponse encoder + writeJSON …
Snider May 22, 2026
5adf7d8
perf(ollama): hand-rolled JSON-string primitives for adapter encoders
Snider May 22, 2026
8065c93
perf(openai): hand-rolled EmbeddingResponse encoder — single-alloc fl…
Snider May 22, 2026
b054806
perf(anthropic): hand-rolled MessageResponse encoder + shared JSON-st…
Snider May 22, 2026
89afebb
perf(openai): bulk-copy fast path for appendJSONString escape walker
Snider May 22, 2026
d295584
perf(openai): hand-rolled Response + ResponseStreamEvent encoders
Snider May 22, 2026
cc42565
perf(anthropic): appendJSONString no-escape fast path
Snider May 22, 2026
c1d53f3
perf(anthropic): hand-rolled MessageRequest encoder + nested helpers
Snider May 22, 2026
3158db7
perf(openai): hand-rolled RerankResponse encoder
Snider May 22, 2026
a07e079
merge: cladius-lane-Wave9-W9E (anthropic JSON 1-alloc floor + 2.5× ho…
Snider May 22, 2026
4ed30ae
perf(openai): single-pass string-or-array walker for StopList + Embed…
Snider May 22, 2026
8de26d0
merge: cladius-lane-Wave9-W9D (openai 8-commit JSON sweep — per-token…
Snider May 22, 2026
3d4b14c
perf(ollama): hand-rolled ChatResponse + GenerateResponse encoders
Snider May 22, 2026
1d61d62
perf(ollama): hand-rolled TagsResponse encoder — single-alloc discovery
Snider May 22, 2026
b6336b8
perf(ollama): bulk-copy fast path for appendJSONString escape walker
Snider May 22, 2026
179ba3a
merge: cladius-lane-Wave9-W9G (ollama JSON 7-8× per-token streaming)
Snider May 22, 2026
f9cc512
feat(jsonenc): introduce shared JSON encode primitives
Snider May 22, 2026
6e86e74
refactor(openai): use shared jsonenc package
Snider May 22, 2026
9428284
refactor(anthropic): use shared jsonenc package
Snider May 22, 2026
91238e2
refactor(ollama): use shared jsonenc package
Snider May 22, 2026
b624a12
merge: cladius-lane-Wave9-W9Z (jsonenc shared lift — -138 net LOC, 9 …
Snider May 22, 2026
115d528
perf(scheduler): fuse generateOptions closures — 71% allocs cut on fu…
Snider May 22, 2026
a925128
perf(openai): hand-parse JSON-string fast path — 6-8× faster StopList…
Snider May 22, 2026
80bfd3a
perf(state/memory): lazy-init InMemoryStore maps — 5.6× faster empty …
Snider May 22, 2026
4646c1c
perf(scheduler): split cloneLabels — empty→nil, +2 pre-size for run()…
Snider May 22, 2026
ec8dbb9
perf(openai): hand-marshal ChatMessageDelta — 5-6× faster per streame…
Snider May 22, 2026
b63c23a
perf(openai,ollama): fuse adapter GenerateOptions closures — 2.5× faster
Snider May 22, 2026
54c6f47
perf(parser/tools): JSON-shape fast path — 5-10× allocs cut on no-too…
Snider May 22, 2026
125a4b2
perf(openai): hand-parse JSON-string-array fast path — 2.8-3.5× faster
Snider May 22, 2026
7334c2f
test(jang): widen DequantizePackedTensor bench matrix to 1/2/3/4/8-bit
Snider May 22, 2026
79bf60c
perf(jang): per-bit-width fast paths in unpackValue — 1.3× on byte-al…
Snider May 22, 2026
cc8e5b4
perf(jang): bit-specialised DequantizePackedTensor — 3-4× across byte…
Snider May 22, 2026
5672fb1
test(jang): bit-exact round-trip across 1/2/3/4/8-bit + tail + tiny-g…
Snider May 22, 2026
7506469
perf(jang): batch 2-elements-per-byte in 4-bit dequant — 1.25× furthe…
Snider May 22, 2026
e50f54c
perf(jang): batch 8-elements-per-byte in 1-bit dequant — 1.35× furthe…
Snider May 22, 2026
9f9671b
merge: cladius-lane-Wave10-W10M (state/scheduler/openai/anthropic/oll…
Snider May 22, 2026
22e9e0d
merge: cladius-lane-Wave10-W10N (jang unpackValue + DequantizePackedT…
Snider May 22, 2026
d3a3a0a
perf(filestore): pool headerMeta scratch on *Store — Put 1 → 0 allocs
Snider May 22, 2026
7c1ed00
perf(filestore): batch verbatim spans in appendJSONString — 10-17% fa…
Snider May 22, 2026
42afeba
perf(filestore): uint32 magic check in decodeRecordHeader — 7-16% on …
Snider May 22, 2026
db24ce3
perf(decode): fuse TokensText pre-grow walk with build loop — 3-6% on…
Snider May 22, 2026
5086912
perf(filestore): prefetch header+meta in rebuildIndex — Open 1.9x faster
Snider May 22, 2026
8241328
merge: cladius-lane-Wave10-W10Y (decode + filestore residual — Open_1…
Snider May 22, 2026
cb8d1de
perf(jsonenc): lift JSON-decode walker primitives shared across adapters
Snider May 22, 2026
280ab80
perf(jsonenc): add SkipJSONString + ParseJSONFloat32/64 + CountJSONAr…
Snider May 22, 2026
bc6187a
perf(anthropic): hand-rolled UnmarshalJSON for MessageRequest + Messa…
Snider May 22, 2026
4bbb0e8
perf(openai): hand-rolled UnmarshalJSON for ChatCompletionRequest + R…
Snider May 22, 2026
8618187
perf(ollama): hand-rolled UnmarshalJSON for ChatRequest / GenerateReq…
Snider May 22, 2026
e769877
perf(openai): hand-rolled UnmarshalJSON for EmbeddingRequest / Rerank…
Snider May 22, 2026
7602137
merge: cladius-lane-Wave11-W11B (parse-side jsonenc + UnmarshalJSON w…
Snider May 22, 2026
853baae
perf(decode): direct-index buildAcceptanceResult, eliminate speculati…
Snider May 23, 2026
738c189
perf(decode): write emitted token straight into out slice — drop inte…
Snider May 23, 2026
06f4af4
perf(decode): index-iterate TokensText / tokensTextSized — skip per-i…
Snider May 23, 2026
fcab613
perf(decode): collapse back-to-back time.Now() pairs in Speculative +…
Snider May 23, 2026
6032bdb
merge: cladius-lane-Wave11-W11G (decode.Speculative inner loop — Edge…
Snider May 23, 2026
7179270
feat(decode): introduce Generator interface + GeneratorFunc shim
Snider May 23, 2026
b1e09ef
refactor(decode): SpeculativeConfig + PromptLookupConfig use Generato…
Snider May 23, 2026
ab11886
merge: cladius-lane-Wave11-W11L (decode.Generator interface + Generat…
Snider May 23, 2026
d314b27
feat(pack): .model Trix container — Pack/Unpack/Inspect/List/Fingerprint
Snider May 24, 2026
8a7ecfe
feat(cmd/lthn-model-pack): CLI wrapper — pack/unpack/list/inspect verbs
Snider May 24, 2026
eb96a9f
feat(pack): Hash(srcDir) + auto-populate Manifest.Model.Hash in Pack
Snider May 24, 2026
303e835
feat(state): support relocated filestore segments
Snider May 24, 2026
e1ce07a
feat(state): open embedded filestore regions
Snider May 24, 2026
41a48af
feat(state): borrow mapped filestore chunks
Snider May 24, 2026
e05c165
perf(state): bound filestore open preallocation
Snider May 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
287 changes: 287 additions & 0 deletions LICENCE
Original file line number Diff line number Diff line change
@@ -0,0 +1,287 @@
EUROPEAN UNION PUBLIC LICENCE v. 1.2
EUPL © the European Union 2007, 2016

This European Union Public Licence (the ‘EUPL’) applies to the Work (as defined
below) which is provided under the terms of this Licence. Any use of the Work,
other than as authorised under this Licence is prohibited (to the extent such
use is covered by a right of the copyright holder of the Work).

The Work is provided under the terms of this Licence when the Licensor (as
defined below) has placed the following notice immediately following the
copyright notice for the Work:

Licensed under the EUPL

or has expressed by any other means his willingness to license under the EUPL.

1. Definitions

In this Licence, the following terms have the following meaning:

- ‘The Licence’: this Licence.

- ‘The Original Work’: the work or software distributed or communicated by the
Licensor under this Licence, available as Source Code and also as Executable
Code as the case may be.

- ‘Derivative Works’: the works or software that could be created by the
Licensee, based upon the Original Work or modifications thereof. This Licence
does not define the extent of modification or dependence on the Original Work
required in order to classify a work as a Derivative Work; this extent is
determined by copyright law applicable in the country mentioned in Article 15.

- ‘The Work’: the Original Work or its Derivative Works.

- ‘The Source Code’: the human-readable form of the Work which is the most
convenient for people to study and modify.

- ‘The Executable Code’: any code which has generally been compiled and which is
meant to be interpreted by a computer as a program.

- ‘The Licensor’: the natural or legal person that distributes or communicates
the Work under the Licence.

- ‘Contributor(s)’: any natural or legal person who modifies the Work under the
Licence, or otherwise contributes to the creation of a Derivative Work.

- ‘The Licensee’ or ‘You’: any natural or legal person who makes any usage of
the Work under the terms of the Licence.

- ‘Distribution’ or ‘Communication’: any act of selling, giving, lending,
renting, distributing, communicating, transmitting, or otherwise making
available, online or offline, copies of the Work or providing access to its
essential functionalities at the disposal of any other natural or legal
person.

2. Scope of the rights granted by the Licence

The Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
sublicensable licence to do the following, for the duration of copyright vested
in the Original Work:

- use the Work in any circumstance and for all usage,
- reproduce the Work,
- modify the Work, and make Derivative Works based upon the Work,
- communicate to the public, including the right to make available or display
the Work or copies thereof to the public and perform publicly, as the case may
be, the Work,
- distribute the Work or copies thereof,
- lend and rent the Work or copies thereof,
- sublicense rights in the Work or copies thereof.

Those rights can be exercised on any media, supports and formats, whether now
known or later invented, as far as the applicable law permits so.

In the countries where moral rights apply, the Licensor waives his right to
exercise his moral right to the extent allowed by law in order to make effective
the licence of the economic rights here above listed.

The Licensor grants to the Licensee royalty-free, non-exclusive usage rights to
any patents held by the Licensor, to the extent necessary to make use of the
rights granted on the Work under this Licence.

3. Communication of the Source Code

The Licensor may provide the Work either in its Source Code form, or as
Executable Code. If the Work is provided as Executable Code, the Licensor
provides in addition a machine-readable copy of the Source Code of the Work
along with each copy of the Work that the Licensor distributes or indicates, in
a notice following the copyright notice attached to the Work, a repository where
the Source Code is easily and freely accessible for as long as the Licensor
continues to distribute or communicate the Work.

4. Limitations on copyright

Nothing in this Licence is intended to deprive the Licensee of the benefits from
any exception or limitation to the exclusive rights of the rights owners in the
Work, of the exhaustion of those rights or of other applicable limitations
thereto.

5. Obligations of the Licensee

The grant of the rights mentioned above is subject to some restrictions and
obligations imposed on the Licensee. Those obligations are the following:

Attribution right: The Licensee shall keep intact all copyright, patent or
trademarks notices and all notices that refer to the Licence and to the
disclaimer of warranties. The Licensee must include a copy of such notices and a
copy of the Licence with every copy of the Work he/she distributes or
communicates. The Licensee must cause any Derivative Work to carry prominent
notices stating that the Work has been modified and the date of modification.

Copyleft clause: If the Licensee distributes or communicates copies of the
Original Works or Derivative Works, this Distribution or Communication will be
done under the terms of this Licence or of a later version of this Licence
unless the Original Work is expressly distributed only under this version of the
Licence — for example by communicating ‘EUPL v. 1.2 only’. The Licensee
(becoming Licensor) cannot offer or impose any additional terms or conditions on
the Work or Derivative Work that alter or restrict the terms of the Licence.

Compatibility clause: If the Licensee Distributes or Communicates Derivative
Works or copies thereof based upon both the Work and another work licensed under
a Compatible Licence, this Distribution or Communication can be done under the
terms of this Compatible Licence. For the sake of this clause, ‘Compatible
Licence’ refers to the licences listed in the appendix attached to this Licence.
Should the Licensee's obligations under the Compatible Licence conflict with
his/her obligations under this Licence, the obligations of the Compatible
Licence shall prevail.

Provision of Source Code: When distributing or communicating copies of the Work,
the Licensee will provide a machine-readable copy of the Source Code or indicate
a repository where this Source will be easily and freely available for as long
as the Licensee continues to distribute or communicate the Work.

Legal Protection: This Licence does not grant permission to use the trade names,
trademarks, service marks, or names of the Licensor, except as required for
reasonable and customary use in describing the origin of the Work and
reproducing the content of the copyright notice.

6. Chain of Authorship

The original Licensor warrants that the copyright in the Original Work granted
hereunder is owned by him/her or licensed to him/her and that he/she has the
power and authority to grant the Licence.

Each Contributor warrants that the copyright in the modifications he/she brings
to the Work are owned by him/her or licensed to him/her and that he/she has the
power and authority to grant the Licence.

Each time You accept the Licence, the original Licensor and subsequent
Contributors grant You a licence to their contributions to the Work, under the
terms of this Licence.

7. Disclaimer of Warranty

The Work is a work in progress, which is continuously improved by numerous
Contributors. It is not a finished work and may therefore contain defects or
‘bugs’ inherent to this type of development.

For the above reason, the Work is provided under the Licence on an ‘as is’ basis
and without warranties of any kind concerning the Work, including without
limitation merchantability, fitness for a particular purpose, absence of defects
or errors, accuracy, non-infringement of intellectual property rights other than
copyright as stated in Article 6 of this Licence.

This disclaimer of warranty is an essential part of the Licence and a condition
for the grant of any rights to the Work.

8. Disclaimer of Liability

Except in the cases of wilful misconduct or damages directly caused to natural
persons, the Licensor will in no event be liable for any direct or indirect,
material or moral, damages of any kind, arising out of the Licence or of the use
of the Work, including without limitation, damages for loss of goodwill, work
stoppage, computer failure or malfunction, loss of data or any commercial
damage, even if the Licensor has been advised of the possibility of such damage.
However, the Licensor will be liable under statutory product liability laws as
far such laws apply to the Work.

9. Additional agreements

While distributing the Work, You may choose to conclude an additional agreement,
defining obligations or services consistent with this Licence. However, if
accepting obligations, You may act only on your own behalf and on your sole
responsibility, not on behalf of the original Licensor or any other Contributor,
and only if You agree to indemnify, defend, and hold each Contributor harmless
for any liability incurred by, or claims asserted against such Contributor by
the fact You have accepted any warranty or additional liability.

10. Acceptance of the Licence

The provisions of this Licence can be accepted by clicking on an icon ‘I agree’
placed under the bottom of a window displaying the text of this Licence or by
affirming consent in any other similar way, in accordance with the rules of
applicable law. Clicking on that icon indicates your clear and irrevocable
acceptance of this Licence and all of its terms and conditions.

Similarly, you irrevocably accept this Licence and all of its terms and
conditions by exercising any rights granted to You by Article 2 of this Licence,
such as the use of the Work, the creation by You of a Derivative Work or the
Distribution or Communication by You of the Work or copies thereof.

11. Information to the public

In case of any Distribution or Communication of the Work by means of electronic
communication by You (for example, by offering to download the Work from a
remote location) the distribution channel or media (for example, a website) must
at least provide to the public the information requested by the applicable law
regarding the Licensor, the Licence and the way it may be accessible, concluded,
stored and reproduced by the Licensee.

12. Termination of the Licence

The Licence and the rights granted hereunder will terminate automatically upon
any breach by the Licensee of the terms of the Licence.

Such a termination will not terminate the licences of any person who has
received the Work from the Licensee under the Licence, provided such persons
remain in full compliance with the Licence.

13. Miscellaneous

Without prejudice of Article 9 above, the Licence represents the complete
agreement between the Parties as to the Work.

If any provision of the Licence is invalid or unenforceable under applicable
law, this will not affect the validity or enforceability of the Licence as a
whole. Such provision will be construed or reformed so as necessary to make it
valid and enforceable.

The European Commission may publish other linguistic versions or new versions of
this Licence or updated versions of the Appendix, so far this is required and
reasonable, without reducing the scope of the rights granted by the Licence. New
versions of the Licence will be published with a unique version number.

All linguistic versions of this Licence, approved by the European Commission,
have identical value. Parties can take advantage of the linguistic version of
their choice.

14. Jurisdiction

Without prejudice to specific agreement between parties,

- any litigation resulting from the interpretation of this License, arising
between the European Union institutions, bodies, offices or agencies, as a
Licensor, and any Licensee, will be subject to the jurisdiction of the Court
of Justice of the European Union, as laid down in article 272 of the Treaty on
the Functioning of the European Union,

- any litigation arising between other parties and resulting from the
interpretation of this License, will be subject to the exclusive jurisdiction
of the competent court where the Licensor resides or conducts its primary
business.

15. Applicable Law

Without prejudice to specific agreement between parties,

- this Licence shall be governed by the law of the European Union Member State
where the Licensor has his seat, resides or has his registered office,

- this licence shall be governed by Belgian law if the Licensor has no seat,
residence or registered office inside a European Union Member State.

Appendix

‘Compatible Licences’ according to Article 5 EUPL are:

- GNU General Public License (GPL) v. 2, v. 3
- GNU Affero General Public License (AGPL) v. 3
- Open Software License (OSL) v. 2.1, v. 3.0
- Eclipse Public License (EPL) v. 1.0
- CeCILL v. 2.0, v. 2.1
- Mozilla Public Licence (MPL) v. 2
- GNU Lesser General Public Licence (LGPL) v. 2.1, v. 3
- Creative Commons Attribution-ShareAlike v. 3.0 Unported (CC BY-SA 3.0) for
works other than software
- European Union Public Licence (EUPL) v. 1.1, v. 1.2
- Québec Free and Open-Source Licence — Reciprocity (LiLiQ-R) or Strong
Reciprocity (LiLiQ-R+).

The European Commission may update this Appendix to later versions of the above
licences without producing a new version of the EUPL, as long as they provide
the rights granted in Article 2 of this Licence and protect the covered Source
Code from exclusive appropriation.

All other changes or additions to this Appendix require the production of a new
EUPL version.
98 changes: 98 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<!-- SPDX-Licence-Identifier: EUPL-1.2 -->

# go-inference — documentation index

**Module**: `dappco.re/go/inference`
**Role**: The contract package every backend and consumer in the tetrad imports.

## Tetrad position

```
┌──────────────────────────────┐
│ dappco.re/go (core) │
└──────────────┬───────────────┘
┌──────────────┴────────────────┐
you are here → go-inference (CONTRACT) │ ← pure interfaces + wire types
│ • TextModel / Backend │
│ • state/ lifecycle │
│ • openai/ anthropic/ ollama/ │
│ • capability / probe │
└──┬─────────────┬──────────────┘
│ │ register via init()
┌────────┴───┐ ┌──────┴────────┐
│ go-mlx │ │ go-rocm / │ ← native backends
│ darwin/ │ │ go-cuda │
│ arm64 │ └───────────────┘
└─────┬──────┘
│ consumed by
┌─────┴──────────┬────────────────┐
│ go-ml │ go-ai │ ← consumers
│ scoring/agent │ router/demos │
└────────────────┘ └───────────────┘
```

## Doc tree

```
docs/
├── README.md ← you are here
├── inference/ ← root package
│ ├── README.md — package overview + how the pieces fit
│ ├── inference.md — TextModel + Backend + registry + LoadModel
│ ├── contracts.md — extension interfaces (Scheduler, Cache, Embed, Rerank, ToolParse, …)
│ ├── options.md — GenerateOption + LoadOption + With*
│ ├── capability.md — CapabilityReport + AlgorithmProfile + RuntimeMemoryLimiter
│ ├── local_tuning.md — MachineDiscoverer + TuningPlanner + model replace
│ ├── probe.md — ProbeEvent + ProbeSink
│ ├── service.md — Core ServiceRuntime registration (Mantis #1336)
│ ├── training.md — TrainableModel + Adapter + LoRAConfig
│ ├── discover.md — Discover() filesystem scan
│ ├── gguf.md — GGUFInfo metadata reader
│ ├── dataset.md — DatasetSample + DatasetStream
│ └── identity.md — re-export aliases from state
├── state/ ← state subpackage
│ ├── README.md — package overview + mental model
│ ├── agent_memory.md — Wake / Sleep / Fork lifecycle
│ ├── identity.md — ModelIdentity / TokenizerIdentity / Adapter / Runtime / Sampler / Bundle
│ ├── project_seed.md — project seed URI planning + compatibility checks
│ ├── store.md — Store / Resolver / Writer interfaces
│ ├── memory.md — InMemoryStore
│ └── filestore.md — append-only file-backed store
├── openai/ ← OpenAI wire types
│ ├── README.md — package overview
│ ├── openai.md — Chat Completions + Handler
│ ├── responses.md — Responses API DTOs
│ └── services.md — embeddings / rerank / cache / cancel / capabilities handlers
├── anthropic/
│ └── anthropic.md — Messages API wire types
└── ollama/
└── ollama.md — Ollama-compatible wire types
```

## Where to start

- **"What's the basic loop?"** → [`inference/inference.md`](inference/inference.md)
- **"How do I add a backend?"** → [`inference/inference.md`](inference/inference.md) — Backend interface + Register pattern
- **"How does agent memory work?"** → [`state/agent_memory.md`](state/agent_memory.md) — Wake/Sleep/Fork
- **"How do project seeds reload safely?"** → [`state/project_seed.md`](state/project_seed.md) — project seed helpers + compatibility
- **"How does OpenAI compatibility work?"** → [`openai/openai.md`](openai/openai.md)
- **"What can a backend advertise?"** → [`inference/capability.md`](inference/capability.md)
- **"How does local setup/autotune work?"** → [`inference/local_tuning.md`](inference/local_tuning.md)
- **"How do I observe runtime?"** → [`inference/probe.md`](inference/probe.md)

## Legacy docs

`architecture.md`, `interfaces.md`, `backends.md`, `types.md`, `development.md`, `history.md`, `index.md`, `RFC.models.md`, `RFC-CORE-008-AGENT-EXPERIENCE.md` predate this per-file pass. They cover overlapping ground at a wider grain and may rot as the per-file docs evolve. Pending: collapse the still-useful bits into `inference/README.md` and the per-file pages, then mark the legacy docs deprecated.

## Standards

- UK English
- EUPL-1.2 licence (see [LICENCE](../LICENCE))
- SPDX header on every source file
- Conventional commits, scopes per package
- Co-Author: `Co-Authored-By: Virgil <virgil@lethean.io>`
Loading