1
0
Fork
You've already forked ai-agent-coding
0

feat: add --hardlink option to ollama-to-llamacpp-modelcache.sh #7

Merged
peterwwillis merged 9 commits from ollama-hardlink-option into main 2026年03月22日 03:35:16 +01:00
peterwwillis commented 2026年03月22日 03:33:27 +01:00 (Migrated from github.com)
Copy link

This PR adds a --hardlink option to the ollama-to-llamacpp-modelcache.sh script. It allows creating hardlinks instead of symlinks when requested, while preserving existing symlinks as symlinks.

This PR adds a --hardlink option to the ollama-to-llamacpp-modelcache.sh script. It allows creating hardlinks instead of symlinks when requested, while preserving existing symlinks as symlinks.
gemini-code-assist[bot] commented 2026年03月22日 03:33:52 +01:00 (Migrated from github.com)
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1 ! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new --hardlink option to the ollama-to-llamacpp-modelcache.sh script, providing more flexibility in how model cache files are managed. Concurrently, it significantly refactors the project's Docker Compose infrastructure by centralizing common Makefile logic and reorganizing individual service configurations into dedicated directories. This reorganization also includes the addition of a new llama-swap service, enhancing the project's overall development and deployment capabilities.

Highlights

  • New --hardlink option for ollama-to-llamacpp-modelcache.sh: The ollama-to-llamacpp-modelcache.sh script now supports a --hardlink option, allowing users to create hardlinks instead of symlinks for GGUF files. Existing symlinks are preserved as symlinks even when this option is used.
  • Docker Compose Makefile Refactoring: A significant refactoring of Docker Compose related Makefiles has been performed. A new generic make/docker-compose.Makefile has been introduced to standardize Docker service management across the project, replacing the previous make/docker-compose-devbox.Makefile.
  • Service Configuration Reorganization: Docker Compose configurations for various services (devbox, android-emulator, playwright) have been moved from the sandbox/devbox directory to dedicated svcs/ subdirectories, improving modularity and organization.
  • New llama-swap Docker Service: A new llama-swap Docker Compose service has been added, complete with its own Makefile, configuration, and documentation for running llama-swap with Vulkan optimization on Linux.
  • Playwright Version Update: The Playwright Docker image and npx playwright version used in the svcs/playwright/docker-compose.yml have been updated from v1.49.0 to v1.58.2.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.


  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩︎

## Summary of Changes Hello, I'm Gemini Code Assist[^1]! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a new `--hardlink` option to the `ollama-to-llamacpp-modelcache.sh` script, providing more flexibility in how model cache files are managed. Concurrently, it significantly refactors the project's Docker Compose infrastructure by centralizing common Makefile logic and reorganizing individual service configurations into dedicated directories. This reorganization also includes the addition of a new `llama-swap` service, enhancing the project's overall development and deployment capabilities. ### Highlights * **New --hardlink option for ollama-to-llamacpp-modelcache.sh**: The `ollama-to-llamacpp-modelcache.sh` script now supports a `--hardlink` option, allowing users to create hardlinks instead of symlinks for GGUF files. Existing symlinks are preserved as symlinks even when this option is used. * **Docker Compose Makefile Refactoring**: A significant refactoring of Docker Compose related Makefiles has been performed. A new generic `make/docker-compose.Makefile` has been introduced to standardize Docker service management across the project, replacing the previous `make/docker-compose-devbox.Makefile`. * **Service Configuration Reorganization**: Docker Compose configurations for various services (devbox, android-emulator, playwright) have been moved from the `sandbox/devbox` directory to dedicated `svcs/` subdirectories, improving modularity and organization. * **New llama-swap Docker Service**: A new `llama-swap` Docker Compose service has been added, complete with its own Makefile, configuration, and documentation for running llama-swap with Vulkan optimization on Linux. * **Playwright Version Update**: The Playwright Docker image and `npx playwright` version used in the `svcs/playwright/docker-compose.yml` have been updated from `v1.49.0` to `v1.58.2`. <details> <summary><b>Using Gemini Code Assist</b></summary> <br> The full guide for Gemini Code Assist can be found on our [documentation page](https://developers.google.com/gemini-code-assist/docs/review-github-code), here are some quick tips. <b>Invoking Gemini</b> You can request assistance from Gemini at any point by creating a comment using either `/gemini <command>` or `@gemini-code-assist <command>`. Below is a summary of the supported commands on the current page. Feature | Command | Description --- | --- | --- Code Review | `/gemini review` | Performs a code review for the current pull request in its current state. Pull Request Summary | `/gemini summary` | Provides a summary of the current pull request in its current state. Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in pull request comments and review comments. Help | `/gemini help` | Displays a list of available commands. <b>Customization</b> To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a `.gemini/` folder in the base of the repository. Detailed instructions can be found [here](https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github). <b>Limitations & Feedback</b> Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with :thumbsup: and :thumbsdown: on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up [here](https://google.qualtrics.com/jfe/form/SV_2cyuGuTWsEw84yG). </details> [^1]: Review the [Privacy Notices](https://policies.google.com/privacy), [Generative AI Prohibited Use Policy](https://policies.google.com/terms/generative-ai/use-policy), [Terms of Service](https://policies.google.com/terms), and learn how to configure Gemini Code Assist in GitHub [here](https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github). Gemini can make mistakes, so double check it and [use code with caution](https://support.google.com/legal/answer/13505487).
gemini-code-assist[bot] (Migrated from github.com) reviewed 2026年03月22日 03:35:19 +01:00
gemini-code-assist[bot] (Migrated from github.com) left a comment
Copy link

Code Review

This pull request introduces a --hardlink option to the ollama-to-llamacpp-modelcache.sh script, which is a useful addition. The implementation of this feature is well done. The PR also includes a significant and beneficial refactoring, moving service definitions into a svcs directory and using a generic Makefile for managing docker-compose services. This greatly improves the project's structure and maintainability. I've left a few comments on the new service definitions with suggestions for improvement, mainly regarding maintainability and clarity.

## Code Review This pull request introduces a `--hardlink` option to the `ollama-to-llamacpp-modelcache.sh` script, which is a useful addition. The implementation of this feature is well done. The PR also includes a significant and beneficial refactoring, moving service definitions into a `svcs` directory and using a generic Makefile for managing docker-compose services. This greatly improves the project's structure and maintainability. I've left a few comments on the new service definitions with suggestions for improvement, mainly regarding maintainability and clarity.
@ -0,0 +4,4 @@
ifeq ($(TARGETOS),macos)
UP_TARGET := start-svc-macos
endif
gemini-code-assist[bot] (Migrated from github.com) commented 2026年03月22日 03:35:19 +01:00
Copy link

high

The redefinition of UP_TARGET for macOS breaks the make up command on that platform. The generic docker-compose.Makefile defines a recipe for $(UP_TARGET), which defaults to up. By changing UP_TARGET to start-svc-macos only on macOS, the up target no longer has a recipe on that OS, and no recipe is provided for start-svc-macos. To avoid this broken state, this conditional logic should be removed until macOS support is fully implemented.

![high](https://www.gstatic.com/codereviewagent/high-priority.svg) The redefinition of `UP_TARGET` for macOS breaks the `make up` command on that platform. The generic `docker-compose.Makefile` defines a recipe for `$(UP_TARGET)`, which defaults to `up`. By changing `UP_TARGET` to `start-svc-macos` only on macOS, the `up` target no longer has a recipe on that OS, and no recipe is provided for `start-svc-macos`. To avoid this broken state, this conditional logic should be removed until macOS support is fully implemented.
@ -0,0 +8,4 @@
- "11400:8080"
volumes:
- "${HOME}/.cache/llama.cpp:/models"
- "${HOME}/.cache/llama.cpp:${HOME}/.cache/llama.cpp"
gemini-code-assist[bot] (Migrated from github.com) commented 2026年03月22日 03:35:19 +01:00
Copy link

medium

This volume mount appears to be redundant. The same host directory is mounted to /models on line 10, and here it's mounted again to its original path inside the container. This is confusing and could be simplified. If the path is needed inside the container, consider creating a symlink from /models in the container's entrypoint. If this second mount is unnecessary, it should be removed.

![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg) This volume mount appears to be redundant. The same host directory is mounted to `/models` on line 10, and here it's mounted again to its original path inside the container. This is confusing and could be simplified. If the path is needed inside the container, consider creating a symlink from `/models` in the container's entrypoint. If this second mount is unnecessary, it should be removed.
@ -0,0 +11,4 @@
/bin/sh -lc "npx -y playwright@1.58.2 run-server --port 3000 --host 0.0.0.0"
networks:
dind-lab:
gemini-code-assist[bot] (Migrated from github.com) commented 2026年03月22日 03:35:20 +01:00
Copy link

medium

The Playwright version (1.58.2) is repeated in the image tag and the command. This makes updates error-prone. To improve maintainability, you could define the version once using a YAML anchor and reuse it.

x-playwright-version:&playwright-version1.58.2services:playwright:image:mcr.microsoft.com/playwright:v${playwright-version}-noble# ...command:> /bin/sh -lc "npx -y playwright@${playwright-version} run-server --port 3000 --host 0.0.0.0"
![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg) The Playwright version (`1.58.2`) is repeated in the `image` tag and the `command`. This makes updates error-prone. To improve maintainability, you could define the version once using a YAML anchor and reuse it. ```yaml x-playwright-version: &playwright-version 1.58.2 services: playwright: image: mcr.microsoft.com/playwright:v${playwright-version}-noble # ... command: > /bin/sh -lc "npx -y playwright@${playwright-version} run-server --port 3000 --host 0.0.0.0" ```
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mutablecc/ai-agent-coding!7
Reference in a new issue
mutablecc/ai-agent-coding
No description provided.
Delete branch "ollama-hardlink-option"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?