You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|**go-nativeml (this project)**|`go build -tags llamacpp` — just works | None — static linking | Works via `go:embed`| Metal, CPU |
10
+
| HTTP/subprocess wrapper (e.g. ollama server) | Separate process to manage | Running server required | N/A | Depends on server |
11
+
| Dynamic linking (shared `.so`/`.dylib`) | Must install libs on every machine | Shared libs must exist at runtime | Cannot vendor native libs | Depends on build |
12
+
| Build from source at `go get`| Requires C++ toolchain + cmake on every machine | None | Fragile — source download at build | Depends on build |
13
+
| Pure Go reimplementation | Simple | None | Works | Limited/none |
14
+
15
+
**Key advantages:**
16
+
17
+
-**Zero build-time setup** — prebuilt `.a` files ship with the Go module. No cmake, no C++ toolchain, no downloads.
18
+
-**Vendoring works** — `embed.go` files use `//go:embed` to ensure `go mod vendor` captures headers and static libraries. Standard Go tooling just works.
19
+
-**No runtime dependencies** — everything is statically linked. No shared libraries to install, no server to run.
20
+
-**Stub fallback** — without build tags, all packages compile to stubs returning errors. CI, linters, and `go build ./...` work everywhere without CGO.
21
+
-**Type-safe Go API** — idiomatic option pattern, proper error handling, streaming callbacks. No shell-outs or HTTP round-trips.
22
+
5
23
## Supported Frameworks
6
24
7
25
| Framework | Version | Package | Build Tag | Capabilities | Status |
#cgo darwin LDFLAGS: -framework Accelerate -framework Metal -framework Foundation
17
+
#cgo darwin LDFLAGS: -lggml-blas -lggml-metal -L/usr/local/opt/libomp/lib -L/opt/homebrew/opt/libomp/lib -lomp -framework Accelerate -framework Metal -framework Foundation
#cgo darwin LDFLAGS: -framework Accelerate -framework Metal -framework Foundation
17
+
#cgo darwin LDFLAGS: -lggml-blas -lggml-metal -L/usr/local/opt/libomp/lib -L/opt/homebrew/opt/libomp/lib -lomp -framework Accelerate -framework Metal -framework Foundation
0 commit comments