Skip to content

feat(backends): add CachyLLaMA support - #11199

Open
localai-org-maint-bot wants to merge 3 commits into
masterfrom
cron/issue-10590
Open

feat(backends): add CachyLLaMA support#11199
localai-org-maint-bot wants to merge 3 commits into
masterfrom
cron/issue-10590

Conversation

@localai-org-maint-bot

Copy link
Copy Markdown
Collaborator

Summary

  • add CachyLLaMA as a drop-in GGUF backend using LocalAI’s llama.cpp gRPC integration
  • publish Linux CPU/Vulkan builds for amd64 and arm64 plus Darwin Metal, with backend gallery, importer, dependency-bump, and path-filter wiring
  • document SSD-backed prompt cache configuration and expose GGUF/mmproj preferences in the React import form

Testing

  • make test-ci-scripts (41 passed)
  • parsed backend/index.yaml, backend matrices, and edited workflows with go.yaml.in/yaml/v3
  • bash -n on all new shell scripts
  • make -n docker-build-cachyllama
  • git diff --check
  • focused assertions for matrix/image counts, Darwin serialization, and ggml-rpc-server

The importer Go suite and focused React Playwright spec could not be run locally because this environment blocks the required protoc/npm release downloads. The full backend image build is left to CI because repository guidance requires approval before long local builds.

Fixes #10590

@localai-org-maint-bot
localai-org-maint-bot force-pushed the cron/issue-10590 branch 3 times, most recently from 5cb0985 to 0650652 Compare July 31, 2026 03:07
@localai-org-maint-bot

Copy link
Copy Markdown
Collaborator Author

Review pass. The mechanical wiring here is the most complete backend addition I have reviewed against .agents/adding-backends.md, but it is stale in a way that breaks the build.

Blocking: missing disable-tts-task.sh.

backend/cpp/cachyllama/Makefile:46,80 runs only disable-score-task.sh, while backend/cpp/turboquant/Makefile:50-51 and backend/cpp/bonsai/Makefile:44-45 run disable-tts-task.sh as well. That script was introduced by 7b9167eaa (#11392, Qwen3-TTS) merged 2026-08-10, one day after this PR's last CI run.

Since backend/cpp/cachyllama/Makefile:44 deletes the copied patches/ directory, a rebuild against current master compiles SERVER_TASK_TYPE_TTS and the mtmd gen-audio references against a fork that has no TTS patch. The darwin script has the same omission (only two disable-* calls exist in the whole diff, both score-task).

I have not built it, so this is inference rather than a confirmed failure, but the fix is one line per build target and CI needs re-running against current master either way. Every check on this PR is from 2026-08-09, so the green marks describe a tree that no longer exists.

Worth a second look: the shared grpc-server include.

backend/cpp/llama-cpp/grpc-server.cpp:46-54 adds two __has_include pulls of CachyLLaMA-only source into the shared monolithic translation unit. The guards make it inert today, but that file is consumed by llama-cpp, ik-llama-cpp, turboquant and bonsai, so a future upstream name collision would drag a foreign implementation into their builds silently.

Checklist, for the record. Wired: both matrix sections including includeDarwin, all four scripts/lib/backend-filter.mjs touchpoints with tests, bump_deps.yaml with the pin in the Makefile, backend/index.yaml meta plus six image entries with matching tag suffixes and metal:, and importer integration correctly as a drop-in via llama-cpp.go:40,140 with Ginkgo tests and React wiring. The engineNamePreferenceRules omission is correct, since "cachyllama" does not contain the llama-cpp substring and so ranks last, matching turboquant and bonsai.

Two small ones: the comment at pkg/system/capabilities.go:161 ("A Vulkan host has exactly one LLM engine with a Vulkan build") becomes false on merge, and .NOTPARALLEL gains backends/cachyllama when only backends/cachyllama-darwin exists.

Scope, for a maintainer rather than the author: this is the fourth llama.cpp fork backend and adds five image builds per cycle to a matrix already at 458 Linux entries. It answers a real user request (#10590) and upstream is alive, so this is a CI cost question, not a merit one.

Also note DCO: no commit here carries a Signed-off-by.

@mudler
mudler force-pushed the cron/issue-10590 branch 2 times, most recently from 7fdff31 to 6fb6419 Compare September 3, 2026 20:32
@localai-org-maint-bot

Copy link
Copy Markdown
Collaborator Author

The cachyllama backend builds fail because common_json_error is an unknown type in the CachyLLaMA fork — the fork branched from llama.cpp before this type was introduced. The shared grpc-server.cpp uses it in catch clauses (lines 315, 345, 374). A fork-skew probe or compatibility shim is needed, similar to the LLAMA_LOAD_MODE_MMAP probe in prepare.sh.

Add CachyLLaMA as a GGUF-compatible llama.cpp fork backend with CPU and Vulkan builds on Linux and Metal on Apple silicon. Expose it through model import, document persistent SSD cache options, and wire CI path filtering and dependency updates.

Assisted-by: Codex:gpt-5
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Avoid the CPU_ALL_VARIANTS SME matrix on ARM, where the Linux and Darwin backend toolchains fail to compile CachyLLaMA. Keep the existing variant build for x86 and use the fully linked fallback build for ARM.

Assisted-by: Codex:gpt-5 [systematic-debugging]
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
CachyLLaMA splits persistent prompt-cache support into separate source files. Include those implementations in the monolithic LocalAI gRPC adapter when the fork provides them so the ARM64 fallback build resolves the page-manager symbols.

Assisted-by: Codex:gpt-5 [Codex]
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
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.

Add cachyllama as backend

2 participants