Llama Stage Patch Changes
Developmentllama-stage-patch-changesLlama Stage Patch Changes is an Agent Skill for development published in the Mesh-LLM/mesh-llm repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Use this skill when changing mesh-llm's llama-stage.cpp ABI shim, runtime hooks, model introspection, tensor filtering, activation-frame execution, GGUF writer surface, upstream pin, or stage patch queue.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/Mesh-LLM/mesh-llm/blob/HEAD/.agents/skills/llama-stage-patch-changes/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/llama-stage-patch-changes, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
llama-stage-patch-changes
Use this skill when changing the stage ABI surface carried in
third_party/llama-stage.cpp/patches.
Boundaries
- Keep durable llama stage-side changes in
third_party/llama-stage.cpp/patches/*.patch. - Keep the stage upstream pin in
third_party/llama-stage.cpp/upstream.txt. - Do not edit
.deps/llama-stage.cppas the final artifact; regenerate the patch queue from commits. - Keep mesh orchestration, protocol compatibility, lifecycle, model management, and API status behavior in Rust.
- Prefer one ABI capability per patch.
Local Flow
Prepare the pinned checkout and current patch queue:
scripts/prepare-llama-stage.sh pinned
For llama-side editing, work in .deps/llama-stage.cpp or another llama.cpp
checkout where commits can be named and inspected. Base the branch on the
pinned upstream, then carry the stage ABI patch commits on top.
After editing and committing in that checkout, regenerate the stage patch queue from the upstream base:
rm -rf /Users/jdumay/code/mesh-llm/third_party/llama-stage.cpp/patches
mkdir -p /Users/jdumay/code/mesh-llm/third_party/llama-stage.cpp/patches
git -C .deps/llama-stage.cpp format-patch \
--output-directory /Users/jdumay/code/mesh-llm/third_party/llama-stage.cpp/patches \
"$(cat .deps/llama-stage.cpp/.llama-stage-upstream-sha)..HEAD"
Validation
Validate patch application in a clean checkout:
tmp_llama="$(mktemp -d /tmp/mesh-llama-stage.XXXXXX)"
rm -rf "$tmp_llama"
LLAMA_WORKDIR="$tmp_llama" scripts/prepare-llama-stage.sh pinned
For Rust fallout, run cargo commands serially:
cargo fmt --all -- --check
cargo check -p mesh-llm
cargo test -p skippy-runtime --lib
cargo test -p skippy-server --lib
cargo test -p mesh-llm --lib
Patch files are mail-format artifacts. Do not hand-normalize them in a way that
breaks git am.