This article is about:
- Running Hatchling with Docker
- Setting up and configuring Ollama for local LLMs
- Understanding Hatchling's environment variables and configuration options
You will learn about:
- How to start Ollama with CPU or GPU support
- Downloading and building Hatchling from source
- Configuring environment variables for your needs
- Starting and using Hatchling with Docker Compose
This section assumes you have followed the docker setup.
In this guide, you will:
- Start Ollama to have access to local LLMs later in Hatchling.
- Download, setup, and start Hatchling
-
Windows/Linux CPU only & MacOS on Apple Silicon:
docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
-
Windows/Linux NVIDIA GPU support:
docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
-
Windows/Linux AMD GPU support:
docker run -d --device /dev/kfd --device /dev/dri -v ollama:/ root/.ollama -p 11434:11434 --name ollama ollama/ollama:rocm
- Go to the
Containerstab in Docker Desktop (arrow 1) and select your Ollama container
- Alternatively, run the command
docker logs ollamaand search for the message in the output.
For more detailed instructions and options, refer to the official Ollama Docker documentation.
At this step, you will be downloading the content of Hatchling. Currently, we are only using GitHub's interface to install Hatchling.
-
Open a terminal
-
Navigate to a directory where you want Hatchling to be:
cd path/to/the/directory/you/want -
Then, use Git, to retrieve the source code
git clone https://github.com/CrackingShells/Hatchling.git
cd ./Hatchling/dockerdocker-compose build hatchlingThis typically takes 20 to 50 seconds depending on your computer.
Modify the variables in the .env file to suit your needs.
Configuration is managed through environment variables or a .env file in the docker directory:
| Variable | Description | Default |
|---|---|---|
OLLAMA_HOST_API |
URL for the Ollama API | http://localhost:11434/api |
OLLAMA_MODEL |
Default LLM model to use | llama3.2 |
HATCH_HOST_CACHE_DIR |
Directory where Hatch environments and cache will be stored on the host machine | ./.hatch |
HATCH_LOCAL_PACKAGE_DIR |
Directory where local packages are stored on the host machine to be accessible in the container | ../../Hatch_Pkg_Dev |
NETWORK_MODE |
Docker network mode | host (for Linux) |
LOG_LEVEL |
The default log level at start up | INFO |
USER_ID |
User ID for the container user (set on Linux to match host user for permissions) | 1000 |
GROUP_ID |
Group ID for the container user (set on Linux to match host group for permissions) | 1000 |
USER_NAME |
Username for the container user (optional, defaults to appuser) |
appuser |
You may need to adjust OLLAMA_HOST_API to match where your Ollama container is hosted. If you did not change this value and used the default from earlier, then you don't need to change that variable either.
For hatchlings, one can change OLLAMA_MODEL to any model under the category tools
Warning
Be mindful of the size of the LLM. Models larger than your GPU's memory (VRAM on GPU cards, or the partition of the shared memory that can be allocated to GPU tasks on Apple Silicon), will not run smoothly. You can check the actual size of a model when selecting a model on the within the list
For example, earlier the GPU's available memory was indicated to be 7GB. Therefore, this GPU can load up to deepseek-r1:8b, which happens to be the default (marked as latest).
- On Docker Desktop, navigate to your containers (arrow 1), and press the play button (arrow 2)

- Alternatively, run the command
docker start ollama
Note
You can adapt the environment variables to suit your needs (e.g. change the LLM) before you run the following command:
# From the docker directory in your project
docker-compose run --rm hatchling #The `--rm` flag ensures the container is removed when you exit the application.If Hatchling successfully connects to Ollama, it will download the specified LLM model. This will materialize by many prints indicating the download progress. Of course, the download time varies based on the model's size: the default model llama3.2 takes about 2GB.
Here is a screenshot of what Hatchling typically looks like right after start up:

You can receive help about all available commands by writing help in the chat. Details about the commands are also available in the documentation

