Skip to content

ollama-action

Actions
Run Ollama large language models in GitHub Actions
v1.0.0
Latest
Star (0)

ollama-action

version test License: MIT

🦙 Run Ollama large language models in GitHub Actions.

Quick Start

# .github/workflows/ollama.yml
on: push
jobs:
  ollama:
    runs-on: ubuntu-latest
    steps:
      - name: Run LLM
        uses: ai-action/ollama-action@v1
        id: llm
        with:
          model: llama3.2
          prompt: Explain the basics of machine learning.

      - name: Get response
        env:
          response: ${{ steps.llm.outputs.response }}
        run: echo "$response"

Usage

Run a prompt against a model:

- uses: ai-action/ollama-action@v1
  id: explanation
  with:
    model: tinyllama
    prompt: "What's a large language model?"

- name: Get response
  env:
    response: ${{ steps.explanation.outputs.response }}
  run: echo "$response"

See action.yml

Inputs

model

Required: The language model to use.

- uses: ai-action/ollama-action@v1
  with:
    model: llama3.2

prompt

Required: The input prompt to generate the text from.

- uses: ai-action/ollama-action@v1
  with:
    prompt: Tell me a joke.

To set a multiline prompt:

- uses: ai-action/ollama-action@v1
  with:
    prompt: |
      Tell me
      a joke.

version

Optional: The Ollama version. See the available versions.

- uses: ai-action/ollama-action@v1
  with:
    version: 0.5.11

Outputs

response

The generated response message.

- uses: ai-action/ollama-action@v1
  id: answer
  with:
    model: llama3.2
    prompt: What's 1+1?

- name: Get response
  env:
    response: ${{ steps.answer.outputs.response }}
  run: echo "$response"

The environment variable is wrapped in double quotes to preserve newlines.

License

MIT

ollama-action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Run Ollama large language models in GitHub Actions
v1.0.0
Latest

ollama-action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.