https://github.com/ai-action/setup-ollama
🦙 Set up GitHub Actions with Ollama CLI
https://github.com/ai-action/setup-ollama
ai ai-action binary cli github-action github-actions large-language-models llm nodejs ollama setup-cli typescript
Last synced: about 2 months ago
JSON representation
🦙 Set up GitHub Actions with Ollama CLI
- Host: GitHub
- URL: https://github.com/ai-action/setup-ollama
- Owner: ai-action
- License: mit
- Created: 2025-02-20T00:07:32.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2026-04-29T04:12:43.000Z (about 2 months ago)
- Last Synced: 2026-04-29T05:24:09.820Z (about 2 months ago)
- Topics: ai, ai-action, binary, cli, github-action, github-actions, large-language-models, llm, nodejs, ollama, setup-cli, typescript
- Language: TypeScript
- Homepage: https://github.com/marketplace/actions/setup-ollama
- Size: 2.74 MB
- Stars: 12
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
- Agents: AGENTS.md
Awesome Lists containing this project
README
# setup-ollama
[](https://github.com/ai-action/setup-ollama/releases)
[](https://github.com/ai-action/setup-ollama/actions/workflows/build.yml)
[](https://codecov.io/gh/ai-action/setup-ollama)
🦙 Set up GitHub Actions workflow with [Ollama](https://github.com/ollama/ollama).
## Quick Start
```yaml
# .github/workflows/ollama.yml
name: ollama
on: push
jobs:
ollama:
runs-on: ubuntu-latest
steps:
- name: Setup Ollama
uses: ai-action/setup-ollama@v2
- name: Run LLM
run: ollama run llama3.2 'Explain the basics of machine learning.'
```
## Usage
Install Ollama:
```yaml
- uses: ai-action/setup-ollama@v2
```
Run a prompt against a [model](https://ollama.com/library):
```yaml
- run: ollama run tinyllama "What's a large language model?"
```
Cache the model to speed up CI:
```yaml
- uses: actions/cache@v5
with:
path: ~/.ollama
key: ${{ runner.os }}-ollama
- run: ollama run tinyllama 'Define cache'
```
See [action.yml](action.yml).
## Inputs
### `version`
**Optional**: The CLI [version](https://github.com/ollama/ollama/releases). Defaults to [`0.22.0`](https://github.com/ollama/ollama/releases/tag/v0.22.0):
```yaml
- uses: ai-action/setup-ollama@v2
with:
version: 0.22.0
```
### `name`
**Optional**: The CLI name. Defaults to `ollama`:
```yaml
- uses: ai-action/setup-ollama@v2
with:
name: ollama
```
## FAQ
### zstd: Cannot exec: No such file or directory
If you get the error on a Linux self-hosted runner:
```
tar (child): zstd: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
```
It means that [zstd](https://github.com/facebook/zstd) is not installed.
To fix this error, you can install `zstd`:
```yaml
- name: Install zstd
run: apt-get update && apt-get install zstd
```
Or use Ollama version <[0.14.0](https://github.com/ollama/ollama/releases/tag/v0.14.0):
```yaml
- uses: ai-action/setup-ollama@v2
with:
version: 0.13.5
```
See [#423](https://github.com/ai-action/setup-ollama/issues/423).
## License
[MIT](LICENSE)