Skip to content

Commit 611bf84

Browse files
authored
Add linux-gpu profile to enable GPU (#64)
1 parent 4071ae1 commit 611bf84

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

docker-compose.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
services:
22

3-
llm:
3+
llm: &llm
44
image: ollama/ollama:latest
55
profiles: ["linux"]
66
networks:
77
- net
88

9+
llm-gpu:
10+
<<: *llm
11+
profiles: ["linux-gpu"]
12+
deploy:
13+
resources:
14+
reservations:
15+
devices:
16+
- driver: nvidia
17+
count: all
18+
capabilities: [gpu]
19+
920
pull-model:
1021
image: genai-stack/pull-model:latest
1122
build:

readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ No need to install Ollama manually, it will run in a container as
3838
part of the stack when running with the Linux profile: run `docker compose --profile linux up`.
3939
Make sure to set the `OLLAMA_BASE_URL=http://llm:11434` in the `.env` file when using Ollama docker container.
4040

41+
To use the Linux-GPU profile: run `docker compose --profile linux-gpu up`. Also change `OLLAMA_BASE_URL=http://llm-gpu:11434` in the `.env` file.
42+
4143
**Windows**
4244
Not supported by Ollama, so Windows users need to generate a OpenAI API key and configure the stack to use `gpt-3.5` or `gpt-4` in the `.env` file.
4345
# Develop

0 commit comments

Comments
 (0)