https://github.com/malax/buildpack-ollama
Cloud Native Buildpack that builds an OCI image with Ollama and a large language model.
https://github.com/malax/buildpack-ollama
ai buildpack llm ollama
Last synced: 9 months ago
JSON representation
Cloud Native Buildpack that builds an OCI image with Ollama and a large language model.
- Host: GitHub
- URL: https://github.com/malax/buildpack-ollama
- Owner: Malax
- License: bsd-3-clause
- Created: 2024-03-14T13:13:03.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-01T20:23:01.000Z (over 1 year ago)
- Last Synced: 2025-08-20T16:57:28.086Z (11 months ago)
- Topics: ai, buildpack, llm, ollama
- Language: Rust
- Homepage:
- Size: 208 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Ollama Cloud Native Buildpack
[](https://github.com/malax/buildpack-ollama/actions/workflows/ci.yml)
This buildpack builds an OCI image with [Ollama](https://ollama.com/) and a large language model. Configure your model by an Ollama `Modelfile` or use any of the [ready-made models available](https://ollama.com/library).
> [!NOTE]
> This is an early version of this buildpack. Please report any issues you find so they can get fixed quickly.
## Installing
The buildpack is currently only available on GitHub. Download the [most recent version from the releases](https://github.com/Malax/buildpack-ollama/releases/latest). This buildpack supports both `amd64` and `arm64` architectures.
## Getting Started
All the buildpack requires is a `Modelfile` that defines the model. The [`examples`](examples/) directory has a couple of examples. Point `pack` to the Ollama buildpack and the directory containing the `Modelfile` to build your image:
```
pack build my-image -b ollama.cnb --path examples/llama2-cnb-praise
```
After the image has been built, run it with Docker. You also have to map the Ollama port (`11434`) from the container to your local machine to be able to connect to it:
```
docker run -p 11434:11434 my-image
```
Your Ollama instance is now ready to be used. You can either use the API directly with i.e. `curl`:
```
curl http://localhost:11434/api/generate -d '{"model": "custom_model", "prompt":"Hi!"}'
```
or use a more sophisticated client like [`oterm`](https://github.com/ggozad/oterm):

## Building
This buildpack is written in Rust. Make sure you have a current version of Rust installed (i.e. via [rustup](https://rustup.rs/)) as well as `libcnb-cargo` (`cargo install libcnb-cargo`).
Running `cargo libcnb package` in the root of this repository will build the buildpack. Follow any instructions to install missing dependencies.
Use `--target` to build the buildpack for a different target OS and architecture.