Next, define and export the following environment variables:
| Variable | Value | Default |
|----------|-------|---------|
| `PROJECT_DIR` | Path where you like to store models/data for your project | |
| `CONTAINER_DIR` | Directory where ollama container will be stored | `${PROJECT_DIR}/containers` |
| `OLLAMA_DEBUG` | Enable debug logging by setting to `1` | `0` |
{{<alerttitle="Tip"color="success">}}
-`PROJECT_DIR` is the main directory for your project. To avoid `$HOME` quota issues, it is recommended to use a path in your `bulk` or `umbrella` storage.
-`CONTAINER_DIR` is where the Ollama container image will be stored. The default is a `containers` subdirectory within your `PROJECT_DIR`. If you want to change this location, make sure to update the `CONTAINER_DIR` variable accordingly. Alternatively, if you have a pre-built `ollama.sif` image, you can set `OLLAMA_IMG` to its path.
- Setting `OLLAMA_DEBUG` to `1` can help you troubleshoot issues by providing more detailed logs.
{{% /alert %}}
## 2. (Optional) Pull the Ollama Container
For simplicity, we will use the Ollama container image available on Docker Hub. You can pull it using Apptainer.
This step is optional, as the `ollama-function.sh` script will build the image automatically if it's not found
in the `${CONTAINER_DIR}` folder or as `${OLLAMA_IMG}` file.