├── README.md ├── Formula └── llama.cpp.rb └── .github └── workflows ├── tests.yml └── publish.yml /README.md: -------------------------------------------------------------------------------- 1 | # Vaibhavs10 Tap 2 | 3 | ## How do I install these formulae? 4 | 5 | `brew install vaibhavs10/tap/` 6 | 7 | Or `brew tap vaibhavs10/tap` and then `brew install `. 8 | 9 | ## Documentation 10 | 11 | `brew help`, `man brew` or check [Homebrew's documentation](https://docs.brew.sh). 12 | -------------------------------------------------------------------------------- /Formula/llama.cpp.rb: -------------------------------------------------------------------------------- 1 | class LlamaCpp < Formula 2 | desc "LLM inference in C/C++" 3 | homepage "https://github.com/ggerganov/llama.cpp" 4 | # pull from git tag to get submodules 5 | url "https://github.com/ggerganov/llama.cpp.git", 6 | tag: "b2963", 7 | revision: "95fb0aefab568348da159efdd370e064d1b35f97" 8 | license "MIT" 9 | 10 | livecheck do 11 | throttle 10 12 | end 13 | 14 | depends_on arch: :arm64 15 | depends_on "curl" 16 | depends_on :macos 17 | 18 | def install 19 | system "make", "LLAMA_FATAL_WARNINGS=ON", "LLAMA_METAL_EMBED_LIBRARY=ON", "LLAMA_CURL=ON" 20 | 21 | bin.install "./main" => "llama-cli" 22 | bin.install "./server" => "llama-server" 23 | end 24 | 25 | test do 26 | llama_cli_command = ["llama-cli", 27 | "--hf-repo", 28 | "ggml-org/tiny-llamas", 29 | "-m", 30 | "stories15M-q4_0.gguf", 31 | "-n", 32 | "400", 33 | "-p", 34 | "I"].join(" ") 35 | assert_includes shell_output(llama_cli_command), "" 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /.github/workflows/tests.yml: -------------------------------------------------------------------------------- 1 | name: brew test-bot 2 | on: 3 | push: 4 | branches: 5 | - main 6 | pull_request: 7 | jobs: 8 | test-bot: 9 | strategy: 10 | matrix: 11 | os: [ubuntu-22.04, macos-13] 12 | runs-on: ${{ matrix.os }} 13 | steps: 14 | - name: Set up Homebrew 15 | id: set-up-homebrew 16 | uses: Homebrew/actions/setup-homebrew@master 17 | 18 | - name: Cache Homebrew Bundler RubyGems 19 | id: cache 20 | uses: actions/cache@v3 21 | with: 22 | path: ${{ steps.set-up-homebrew.outputs.gems-path }} 23 | key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }} 24 | restore-keys: ${{ runner.os }}-rubygems- 25 | 26 | - run: brew test-bot --only-cleanup-before 27 | 28 | - run: brew test-bot --only-setup 29 | 30 | - run: brew test-bot --only-tap-syntax 31 | 32 | - run: brew test-bot --only-formulae 33 | if: github.event_name == 'pull_request' 34 | 35 | - name: Upload bottles as artifact 36 | if: always() && github.event_name == 'pull_request' 37 | uses: actions/upload-artifact@v3 38 | with: 39 | name: bottles 40 | path: '*.bottle.*' 41 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: brew pr-pull 2 | on: 3 | pull_request_target: 4 | types: 5 | - labeled 6 | jobs: 7 | pr-pull: 8 | if: contains(github.event.pull_request.labels.*.name, 'pr-pull') 9 | runs-on: ubuntu-22.04 10 | permissions: 11 | contents: write 12 | packages: none 13 | pull-requests: write 14 | steps: 15 | - name: Set up Homebrew 16 | uses: Homebrew/actions/setup-homebrew@master 17 | 18 | - name: Set up git 19 | uses: Homebrew/actions/git-user-config@master 20 | 21 | - name: Pull bottles 22 | env: 23 | HOMEBREW_GITHUB_API_TOKEN: ${{ github.token }} 24 | HOMEBREW_GITHUB_PACKAGES_TOKEN: ${{ github.token }} 25 | HOMEBREW_GITHUB_PACKAGES_USER: ${{ github.actor }} 26 | PULL_REQUEST: ${{ github.event.pull_request.number }} 27 | run: brew pr-pull --debug --tap=$GITHUB_REPOSITORY $PULL_REQUEST 28 | 29 | - name: Push commits 30 | uses: Homebrew/actions/git-try-push@master 31 | with: 32 | token: ${{ github.token }} 33 | branch: main 34 | 35 | - name: Delete branch 36 | if: github.event.pull_request.head.repo.fork == false 37 | env: 38 | BRANCH: ${{ github.event.pull_request.head.ref }} 39 | run: git push --delete origin $BRANCH 40 | --------------------------------------------------------------------------------