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.
feat: add --hardlink option to ollama-to-llamacpp-modelcache.sh #7
ollama-hardlink-option into main 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.shscript now supports a--hardlinkoption, 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.Makefilehas been introduced to standardize Docker service management across the project, replacing the previousmake/docker-compose-devbox.Makefile. - Service Configuration Reorganization: Docker Compose configurations for various services (devbox, android-emulator, playwright) have been moved from the
sandbox/devboxdirectory to dedicatedsvcs/subdirectories, improving modularity and organization. - New llama-swap Docker Service: A new
llama-swapDocker 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 playwrightversion used in thesvcs/playwright/docker-compose.ymlhave been updated fromv1.49.0tov1.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.
-
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. ↩︎
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
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"
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:
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"
No due date set.
No dependencies set.
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?