Skip to content

feat: add llamacpp CGO bindings with prebuilt static libraries (b8220)#1

Merged
hsinatfootprintai merged 1 commit intomainfrom
feat---init-llamacpp
Mar 7, 2026
Merged

feat: add llamacpp CGO bindings with prebuilt static libraries (b8220)#1
hsinatfootprintai merged 1 commit intomainfrom
feat---init-llamacpp

Conversation

@hsinatfootprintai
Copy link
Contributor

Thin CGO wrapper for llama.cpp enabling Go consumers to do:
go get github.com/footprintai/go-nativeml
go build -tags llamacpp ./...

Includes:

  • Go API: LoadModel, Generate, GenerateStream, GetEmbeddings, Tokenize
  • C++ bridge (~250 LOC) wrapping common_sampler for token generation
  • Functional options (ModelOption, ContextOption, GenerateOption)
  • Stub builds (no tag) compile without CGO
  • Prebuilt .a for darwin-amd64 and linux-amd64
  • Build scripts (Makefile, Dockerfile.libs) to rebuild from source
  • CI workflow, examples, version management

 Thin CGO wrapper for llama.cpp enabling Go consumers to do:
   go get github.com/footprintai/go-nativeml
   go build -tags llamacpp ./...

 Includes:
 - Go API: LoadModel, Generate, GenerateStream, GetEmbeddings, Tokenize
 - C++ bridge (~250 LOC) wrapping common_sampler for token generation
 - Functional options (ModelOption, ContextOption, GenerateOption)
 - Stub builds (no tag) compile without CGO
 - Prebuilt .a for darwin-amd64 and linux-amd64
 - Build scripts (Makefile, Dockerfile.libs) to rebuild from source
 - CI workflow, examples, version management
@hsinatfootprintai hsinatfootprintai merged commit a2c88a5 into main Mar 7, 2026
2 of 4 checks passed
@hsinatfootprintai hsinatfootprintai deleted the feat---init-llamacpp branch March 7, 2026 11:29
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.

2 participants