How we optimized our workflows and overcame GitHub Actions limitations
TLDR; Running CIs for large projects (like llama.cpp) on GitHub tends to take a long time to run and can outgrow the available cache and runner capacity. In this blog post, we walk you through how we changed our workflows using Hugging Face Buckets to store compiler caches and Jobs to run CI workloads.
How it all started
Llama.cpp is one of the fastest-growing and most-engaged open-source projects on GitHub*. As such, we receive a large number of pull requests each month. Maintaining production-grade quality at all times requires running many tests across many platforms and runtimes.
As an illustration of the scale of the project, consider that during the 3 months between August and October 2026, the project received 3,181 pull requests (about 35 per day) and merged 1,802 of them.
The complete CI of the project includes a set of 100+ jobs, most of which involve heavy computations and model data operations. Many of the jobs can take up to ~30 minutes. Additionally, for almost every PR merged in the master branch, we create pre-release builds for users to easily try out new bleeding-edge functionality. These pre-release workflows involve an additional set of heavy long-running build tasks, some of which can take a few hours.
Llama.cpp CI checks the diff across many hardware backends, and a complete CI run contains 100+ jobs. Here’s what the CI infrastructure roughly looked like at the beginning of the year:
- We use
ccacheto store compiled object files. If the source files and build conditions have not changed, the compiler can reuse these object files. This avoids unnecessary compilation and generally helps a lot with reducing the total time of the builds. - The
ccachedata is naturally stored in the GitHub Actions Cache. Each job downloads this data before the build and uses it. When done - it stores it back in the cache. - The total available cache for free, public Github repos is limited to 10GB. When the cache becomes full, GitHub removes the least recently used entries. Jobs that needed these entries had to compile the files again.
- The CUDA backend uses many C++ templates. We build this code for CUDA, HIP, and MUSA backends with multiple hardware architectures on each. These builds can take a long time without cached object files.
- The
ggml-orgorganization uses GitHub's free plan, with 20 concurrent GitHub-hosted jobs across the organization, including at most five macOS jobs within that total. With more than 100 jobs in a complete CI run, many jobs have to wait for an available runner.
The Optimized CI
We made three changes: separated workflows for PRs and master, used Hugging Face Buckets to store compiler caches, and used Hugging Face Jobs to offload most Linux x64 jobs.
Separate PR and master workflows
First, we reduced the work required for each pull request. We selected jobs based on the diff. We kept the complete set of CI jobs for pushes to master.
Store compiler caches in Hugging Face Buckets
We had already limited cache saving to pushes to master and kept one cache entry per job. However, the total storage requirement still exceeded the GitHub Actions cache allocation.
We then moved the ccache data for non-release builds to Hugging Face Buckets. After each eligible build on master, we upload a snapshot of the compiler cache to Hugging Face Buckets. Each PR build downloads this snapshot before compilation. It can then reuse object files when the source files and build settings match.
Which files need to be compiled depends on the changes in the PR and the available cache. PRs that differ substantially from master can require more compilation.
Hugging Face Buckets is an S3-like storage service backed by Xet, with deduplication on upload/download level, thus providing faster and cheaper storage in multipliers. You can check out the storage pricing here. Before each job, the runner downloads the stored cache from a bucket. During the build, ccache uses existing object files where possible and creates new ones when compilation is necessary. After eligible builds on master, the runner uploads the updated cache to the bucket.
This change preserved the use of ccache while changing where we stored its data between jobs. It also left more space in GitHub Actions Cache for release builds.
The bucket acts as a shared home for these caches across runners. A new runner retrieves the cache for its build configuration, without needing the disk from a previous runner. PR builds read this shared baseline; eligible builds on master publish updates. We retain a recent cache for each build key and clean up older archives. The initial migration shows how we connected this to the existing workflows.
Run Linux x64 jobs on Hugging Face Jobs
Next, we moved some jobs from self-hosted runners and many jobs from GitHub-hosted runners to Hugging Face Jobs. Jobs are cloud CPU or GPU instances running your scripts. You can check out the pricing for each instance here; jobs are charged per uptime of the instance. We used jobs-actions to connect these jobs to our existing CI workflows.
Bucket storage was necessary before this move. Each runner could download the required cache without dependence on persistent storage attached to another runner. Buckets kept the non-release compiler caches available between these runs.
Running GitHub Actions with Hugging Face Jobs
To integrate Hugging Face Jobs seamlessly into our existing GitHub Actions workflows, we utilized jobs-actions. Rather than replacing GitHub Actions as our primary workflow orchestrator, jobs-actions functions as a lightweight dispatcher and bridge. It allows standard GitHub Actions workflow steps to target custom compute environments on Hugging Face (such as hf-jobs-cpu-upgrade or hf-jobs-t4-small) by mapping specific runner labels to corresponding Hugging Face hardware profiles.
When a job using a designated Hugging Face runner label is queued in GitHub Actions, a webhook event triggers a dispatcher Space hosted on Hugging Face. The dispatcher authenticates the payload, verifies repository permissions, and requests an ephemeral registration token directly from the GitHub API. With this token, the dispatcher dynamically provisions a containerized Hugging Face Job configured with the required hardware specifications and runner environment.
Once initialized, the ephemeral runner automatically registers itself with the GitHub repository, claims the pending workflow job, and executes all defined steps. Standard outputs, step summaries, and real-time execution logs are continuously streamed back into the GitHub Actions user interface. This guarantees full visibility within pull requests and commits without requiring team members to monitor secondary dashboards or external consoles.
The complete flow looks like this:
- A pull request triggers a GitHub Actions workflow.
- GitHub queues any job whose runs-on label is not available, for example, hf-jobs-cpu-upgrade or hf-jobs-t4-small, and sends a signed workflow job. Queued webhook to the dispatcher through the GitHub App.
- The dispatcher Space verifies the webhook, checks for an hf-jobs-* label, mints a short-lived GitHub runner registration token, and starts an HF Job on the matching hardware.
- The HF Job boots an ephemeral GitHub Actions runner and registers it with the repo using that one-shot token.
- GitHub assigns the pending workflow job to that runner; the runner executes the CI job, reports status back to GitHub, and exits.
You can read more details about how to set up jobs-actions for your own repos here: https://huggingface.co/blog/github-ci-hf-jobs



