Skip to content

ai-action/setup-ollama

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

ollama

setup-ollama

action version build codecov

πŸ¦™ Set up GitHub Actions workflow with Ollama.

Quick Start

# .github/workflows/ollama.yml
name: ollama
on: push
jobs:
  ollama:
    runs-on: ubuntu-latest
    steps:
      - name: Setup Ollama
        uses: ai-action/setup-ollama@v1

      - name: Run LLM
        run: ollama run llama3.2 'Explain the basics of machine learning.'

Usage

Install Ollama:

- uses: ai-action/setup-ollama@v1

Run a prompt against a model:

- run: ollama run tinyllama "What's a large language model?"

Cache the model to speed up CI:

- uses: actions/cache@v4
  with:
    path: ~/.ollama
    key: ${{ runner.os }}-ollama

- run: ollama run tinyllama 'Define cache'

See action.yml.

Inputs

version

Optional: The CLI version. Defaults to 0.6.6:

- uses: ai-action/setup-ollama@v1
  with:
    version: 0.6.6

name

Optional: The CLI name. Defaults to ollama:

- uses: ai-action/setup-ollama@v1
  with:
    name: ollama

License

MIT