MLXGuidedGeneration and XGrammar constrained decoding on Apple Silicon

Parent: Mac local LLMs: Apple Foundation Models and Core AI · Published reference · snapshot 2026-10-05

↓ Facts as markdownall context files

MLXGuidedGeneration standalone setup is four steps: extract a vocab with `TokenizerVocabExtractor.extractForGrammar`, build a `GrammarTokenizer` (vocab, vocabType, eosTokenId), build a `GrammarConstraint` from a JSON schema string, then call `GuidedGenerationLoop.run` with maxTokens and vocabSize

These notes link each claim to its source. A source may be a research report hosted on this site rather than the primary document. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.

Facts

Children

← the whole tree · 3D view· how to read this page