Skip to content

Add model caching and secrets passphrase to CI workflows#560

Merged
sroussey merged 2 commits into
mainfrom
claude/amazing-feynman-lcatuz
Jun 10, 2026
Merged

Add model caching and secrets passphrase to CI workflows#560
sroussey merged 2 commits into
mainfrom
claude/amazing-feynman-lcatuz

Conversation

@sroussey

Copy link
Copy Markdown
Collaborator

Summary

This PR improves CI/CD efficiency and security by adding caching for Hugging Face model downloads and injecting the secrets passphrase environment variable into test workflows.

Key Changes

  • Model caching: Added actions/cache@v4 steps to three test jobs (RAG, HuggingFace Transformers, and LlamaCpp provider tests) to cache downloaded models in the models/ directory. Each job uses a unique cache key (hf-models-rag-, hf-models-hft-, hf-models-nodellama-) scoped by OS and keyed on sample file changes.

  • Secrets passphrase injection: Added WORKGLOW_SECRETS_PASSPHRASE environment variable (from GitHub secrets) to the HuggingFace Transformers and LlamaCpp provider test jobs, enabling decryption of encrypted credentials during test execution.

  • Encrypted credentials: Added encrypted HuggingFace token credential file (.secrets/credentials/26f1356ad1fd23bad72f47e1cafd32b3886e57b1701ac6fbaaf4f2aa0ba2bb8a.json) for use in tests requiring HuggingFace API access.

Implementation Details

  • Cache keys include hashFiles('packages/test/src/samples/**') to invalidate when test samples change
  • Fallback restore keys allow partial cache hits across OS variants
  • Secrets passphrase is only injected into jobs that need credential decryption, not all test jobs

https://claude.ai/code/session_013CxVhBFku7dJvm7Bwucn1z

claude and others added 2 commits June 10, 2026 03:11
CI test jobs were downloading ONNX/GGUF models anonymously from the
Hugging Face Hub on every run, which hits anonymous IP rate limits on
shared GitHub runners (downloads denied).

- Pass WORKGLOW_SECRETS_PASSPHRASE to the model-downloading vitest jobs
  (hft, nodellama; rag already had it) so the test preload decrypts the
  on-disk credential store and hydrates HF_TOKEN into process.env.
  transformers.js authenticates Hub downloads when HF_TOKEN is set,
  raising the rate limit against the account.
- Cache the repo-root ./models directory (where the test cache dir is
  configured) per job so models are not re-fetched on every run.
@sroussey sroussey merged commit 6387d2e into main Jun 10, 2026
5 of 12 checks passed
@sroussey sroussey deleted the claude/amazing-feynman-lcatuz branch June 10, 2026 14:51
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