Michael Yang 05a01fdecb ml/backend/ggml: consolidate system info logging пре 2 месеци
..
llama.cpp 98d44fa39d llama: add phi4 mini support (#9403) пре 2 месеци
patches ba7d31240e fix: own lib/ollama directory пре 1 месец
.gitignore 96efd9052f Re-introduce the `llama` package (#5034) пре 6 месеци
README.md b901a712c6 docs: improve syntax highlighting in code blocks (#8854) пре 2 месеци
build-info.cpp d7d7e99662 llama: update llama.cpp vendor code to commit d7cfe1ff (#9356) пре 2 месеци
build-info.cpp.in 5b446cc815 chore: update gitattributes (#8860) пре 2 месеци
llama.go 05a01fdecb ml/backend/ggml: consolidate system info logging пре 1 месец
llama_test.go 61676fb506 llama: move grammar tests to llama_test.go (#8411) пре 3 месеци
mllama.cpp d7d7e99662 llama: update llama.cpp vendor code to commit d7cfe1ff (#9356) пре 2 месеци
mllama.h c7cb0f0602 image processing for llama3.2 (#6963) пре 6 месеци
sampling_ext.cpp 1deafd8254 llama: update vendored code to commit 46e3556 (#8308) пре 3 месеци
sampling_ext.h 1deafd8254 llama: update vendored code to commit 46e3556 (#8308) пре 3 месеци

README.md

llama

This package provides Go bindings to llama.cpp.

Vendoring

Ollama vendors llama.cpp and ggml. While we generally strive to contribute changes back upstream to avoid drift, we carry a small set of patches which are applied to the tracking commit.

If you update the vendoring code, start by running the following command to establish the tracking llama.cpp repo in the ./vendor/ directory.

make -f Makefile.sync apply-patches

Updating Base Commit

Pin to new base commit

To change the base commit, update FETCH_HEAD in Makefile.sync.

When updating to a newer base commit, the existing patches may not apply cleanly and require manual merge resolution.

Start by applying the patches. If any of the patches have conflicts, the git am will stop at the first failure.

make -f Makefile.sync apply-patches

If there are conflicts, you will see an error message. Resolve the conflicts in ./vendor/, and continue the patch series with git am --continue and rerun make -f Makefile.sync apply-patches. Repeat until all patches are successfully applied.

Once all patches are applied, commit the changes to the tracking repository.

make -f Makefile.sync format-patches sync

Generating Patches

When working on new fixes or features that impact vendored code, use the following model. First get a clean tracking repo with all current patches applied:

make -f Makefile.sync clean apply-patches

Iterate until you're ready to submit PRs. Once your code is ready, commit a change in the ./vendor/ directory, then generate the patches for ollama with

make -f Makefile.sync format-patches

In your ./vendor/ directory, create a branch, and cherry-pick the new commit to that branch, then submit a PR upstream to llama.cpp.

Commit the changes in the ollama repo and submit a PR to Ollama, which will include the vendored code update with your change, along with the patches.

After your PR upstream is merged, follow the Updating Base Commit instructions above, however first remove your patch before running apply-patches since the new base commit contains your change already.