Native Apple Metal GPU inference via mlx-c bindings
Find a file
Snider fb95cde30c fix(metal): address 5 important code review items
1. RepeatPenalty: implemented applyRepeatPenalty() — tracks generated
   token IDs, deduplicates, divides positive logits by penalty and
   multiplies negative logits by penalty. 2 new tests.

2. DefaultGPUStream/DefaultCPUStream: now cached with sync.Once,
   no more C stream allocation on every call.

3. CompileShapeless: removed dead C closure, callback, sync.Map,
   and nextID infrastructure. CompiledFunc is now a plain function
   wrapper with mutex. API unchanged.

4. Tokenizer BPE: implemented bpeMerge() — standard BPE algorithm
   using merge rank lookup. Both SentencePiece and GPT-2 Encode paths
   now apply merges instead of falling back to character-level lookup.
   3 new tests.

5. KV cache lifecycle: documented in Generate() godoc — fresh caches
   per call, ClearCache() between turns for prompt Metal reclaim.

Co-Authored-By: Virgil <virgil@lethean.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 21:31:45 +00:00
cpp docs(cpp): add on-demand research tasks for CLion Claude 2026-02-19 21:01:45 +00:00
docs/plans docs(plan): fold Virgil review into design and implementation plan 2026-02-19 19:25:05 +00:00
internal/metal fix(metal): address 5 important code review items 2026-02-19 21:31:45 +00:00
.gitignore chore: gitignore dist/ (CMake install output) 2026-02-19 19:30:23 +00:00
CLAUDE.md feat(api): migrate to go-inference shared interfaces 2026-02-19 20:15:42 +00:00
CMakeLists.txt feat: extract go-mlx from go-ai as standalone Metal inference package 2026-02-19 17:57:37 +00:00
FINDINGS.md fix(metal): error handling audit — propagate MLX errors instead of swallowing 2026-02-19 20:59:37 +00:00
go.mod feat(api): migrate to go-inference shared interfaces 2026-02-19 20:15:42 +00:00
mlx.go feat(api): migrate to go-inference shared interfaces 2026-02-19 20:15:42 +00:00
mlx_stub.go feat: extract go-mlx from go-ai as standalone Metal inference package 2026-02-19 17:57:37 +00:00
mlx_test.go feat(api): migrate to go-inference shared interfaces 2026-02-19 20:15:42 +00:00
register_metal.go fix(metal): address 3 critical code review items 2026-02-19 21:24:10 +00:00
TODO.md fix(metal): address 5 important code review items 2026-02-19 21:31:45 +00:00