Skip to content

Add constrained-generation primitives (logits / acceptToken / vocab)#9

Merged
FuJacob merged 1 commit into
mainfrom
feat/constrained-primitives
Jun 1, 2026
Merged

Add constrained-generation primitives (logits / acceptToken / vocab)#9
FuJacob merged 1 commit into
mainfrom
feat/constrained-primitives

Conversation

@FuJacob
Copy link
Copy Markdown
Owner

@FuJacob FuJacob commented Jun 1, 2026

Additive C++ on CotabbyInferenceEngine: getNextTokenLogits, acceptToken, getVocabSize, isEndOfGenerationToken, endOfSequenceToken. Lets a Swift caller run a select-then-commit decode loop (read logits row, choose under constraints, commit to advance KV) for Cotabby's base-model constrained decoder. Unused by current callers; swift build clean. Single shared context, so callers must not interleave sequences between read and accept.

…ab queries

Adds getNextTokenLogits, acceptToken, getVocabSize, isEndOfGenerationToken, and endOfSequenceToken so a Swift caller can run a select-then-commit decode loop (read the logits row, choose a token under its own constraints, commit it to advance the shared-context KV) instead of the all-in-one sampleNext.

Additive and unused by current callers; the foundation for Cotabby's base-model constrained decoder. Single shared context: callers must not interleave other sequences' decodes between getNextTokenLogits and acceptToken.
@FuJacob FuJacob merged commit 32d884d into main Jun 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant