con un clic
llama-cpp-canister-release-test
Test a llama_cpp_canister release zip end-to-end
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
Test a llama_cpp_canister release zip end-to-end
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
End-to-end lifecycle for adding a new capability to llama_cpp_canister — design, implement, test, document, and verify with no regressions
Create a new GitHub release for llama_cpp_canister
| name | llama_cpp_canister-release-test |
| description | Test a llama_cpp_canister release zip end-to-end |
| disable-model-invocation | false |
| user-invocable | true |
| argument-hint | ["release-tag"] |
| allowed-tools | Bash, Read, AskUserQuestion |
Tests that a release zip contains everything needed and works end-to-end.
Follow these steps exactly in order. Abort and report on any failure.
Ask the user which release tag to test. If they say "latest", determine it with:
gh release view --repo onicai/llama_cpp_canister --json tagName --jq '.tagName'
Download and unzip:
rm -rf /tmp/llama_cpp_release_test
mkdir -p /tmp/llama_cpp_release_test
gh release download <TAG> --repo onicai/llama_cpp_canister --dir /tmp/llama_cpp_release_test
mkdir -p /tmp/llama_cpp_release_test/<TAG>
unzip /tmp/llama_cpp_release_test/llama_cpp_canister_<TAG>.zip -d /tmp/llama_cpp_release_test/<TAG>/
All subsequent commands run from /tmp/llama_cpp_release_test/<TAG>/.
dfx --version
Verify the version is >= 0.31.0. If not, warn the user.
source /opt/miniconda3/etc/profile.d/conda.sh
conda create -y -n llama_cpp_canister_release_test python=3.11
conda activate llama_cpp_canister_release_test
cd /tmp/llama_cpp_release_test/<TAG>
pip install -r requirements.txt
cd /tmp/llama_cpp_release_test/<TAG>
dfx start --clean --background
dfx deploy --network local
dfx ledger fabricate-cycles --canister llama_cpp --t 20
cd /tmp/llama_cpp_release_test/<TAG>
mkdir -p models/Qwen/Qwen2.5-0.5B-Instruct-GGUF
wget -c -O models/Qwen/Qwen2.5-0.5B-Instruct-GGUF/qwen2.5-0.5b-instruct-q8_0.gguf \
https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct-GGUF/resolve/main/qwen2.5-0.5b-instruct-q8_0.gguf
Verify SHA256:
echo "ca59ca7f13d0e15a8cfa77bd17e65d24f6844b554a7b6c12e07a5f89ff76844e models/Qwen/Qwen2.5-0.5B-Instruct-GGUF/qwen2.5-0.5b-instruct-q8_0.gguf" | shasum -a 256 -c
If the checksum does not match, abort immediately.
cd /tmp/llama_cpp_release_test/<TAG>
python -m scripts.upload --network local --canister llama_cpp \
--canister-filename models/model.gguf --filetype gguf \
--hf-sha256 "ca59ca7f13d0e15a8cfa77bd17e65d24f6844b554a7b6c12e07a5f89ff76844e" \
models/Qwen/Qwen2.5-0.5B-Instruct-GGUF/qwen2.5-0.5b-instruct-q8_0.gguf
cd /tmp/llama_cpp_release_test/<TAG>
pytest -vv --network local test/test_qwen2.py
If any tests fail, report the failures but continue to cleanup.
cd /tmp/llama_cpp_release_test/<TAG>
dfx stop
Ask the user if they want to remove the test directory and conda environment. If yes:
rm -rf /tmp/llama_cpp_release_test
source /opt/miniconda3/etc/profile.d/conda.sh
conda env remove -y -n llama_cpp_canister_release_test
Report: