go-ai/mlx
Snider 98749c66f2 fix(mlx): add DecodeToken for correct streaming word boundaries
The Decode method strips the SentencePiece leading space from every
token, which loses word boundaries during streaming. DecodeToken
preserves the space (it represents the word boundary) and only the
first token of each generation has its leading space stripped.

Fixes Gemma3 space prefix appearing in chat UI output.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-17 19:18:27 +00:00
..
cache refactor(mlx): drop mlx build tag, auto-enable on darwin/arm64 2026-02-17 16:57:41 +00:00
model feat(mlx): LoRA injection into models + masked cross-entropy loss 2026-02-17 17:37:44 +00:00
sample refactor(mlx): drop mlx build tag, auto-enable on darwin/arm64 2026-02-17 16:57:41 +00:00
tokenizer fix(mlx): add DecodeToken for correct streaming word boundaries 2026-02-17 19:18:27 +00:00
array.go feat(mlx): add autograd — VJP, JVP, ValueAndGrad, loss functions 2026-02-17 17:18:47 +00:00
CMakeLists.txt feat: extract AI/ML packages from core/go 2026-02-16 15:25:55 +00:00
compile.go feat(mlx): add autograd — VJP, JVP, ValueAndGrad, loss functions 2026-02-17 17:18:47 +00:00
dtype.go refactor(mlx): drop mlx build tag, auto-enable on darwin/arm64 2026-02-17 16:57:41 +00:00
fast.go refactor(mlx): drop mlx build tag, auto-enable on darwin/arm64 2026-02-17 16:57:41 +00:00
grad.go feat(mlx): LoRA injection into models + masked cross-entropy loss 2026-02-17 17:37:44 +00:00
grad_test.go feat(mlx): add autograd — VJP, JVP, ValueAndGrad, loss functions 2026-02-17 17:18:47 +00:00
io.go refactor(mlx): drop mlx build tag, auto-enable on darwin/arm64 2026-02-17 16:57:41 +00:00
lora.go feat(mlx): LoRA injection into models + masked cross-entropy loss 2026-02-17 17:37:44 +00:00
lora_test.go feat(mlx): add LoRA adapter layers and AdamW optimizer 2026-02-17 17:25:42 +00:00
mlx.go refactor(mlx): drop mlx build tag, auto-enable on darwin/arm64 2026-02-17 16:57:41 +00:00
mlx_stub.go refactor(mlx): drop mlx build tag, auto-enable on darwin/arm64 2026-02-17 16:57:41 +00:00
nn.go feat(mlx): LoRA injection into models + masked cross-entropy loss 2026-02-17 17:37:44 +00:00
ops.go feat(mlx): add autograd — VJP, JVP, ValueAndGrad, loss functions 2026-02-17 17:18:47 +00:00
optim.go feat(mlx): add LoRA adapter layers and AdamW optimizer 2026-02-17 17:25:42 +00:00
optim_test.go feat(mlx): add LoRA adapter layers and AdamW optimizer 2026-02-17 17:25:42 +00:00
random.go refactor(mlx): drop mlx build tag, auto-enable on darwin/arm64 2026-02-17 16:57:41 +00:00
slice.go refactor(mlx): drop mlx build tag, auto-enable on darwin/arm64 2026-02-17 16:57:41 +00:00
stream.go refactor(mlx): drop mlx build tag, auto-enable on darwin/arm64 2026-02-17 16:57:41 +00:00