Skip to content

Commit f09f6dd

Browse files
authored
fix: add built image from DockerHub (#2042)
* chore: update docker-compose with profiles * docs: add quick start doc * chore: generate docker release when new version is released * chore: add dockerhub image in docker-compose * docs: update quickstart with local/remote images * chore: update docker tag * chore: refactor dockerfile names * chore: update docker-compose names * docs: update llamacpp naming * fix: naming * docs: fix llamacpp command
1 parent 1c665f7 commit f09f6dd

File tree

5 files changed

+62
-39
lines changed

5 files changed

+62
-39
lines changed

.github/workflows/generate-release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ env:
99
REGISTRY: docker.io
1010
IMAGE_NAME: ${{ github.repository }}
1111
platforms: linux/amd64,linux/arm64
12-
DEFAULT_TYPE: "external"
12+
DEFAULT_TYPE: "ollama"
1313

1414
jobs:
1515
build-and-push-image:
1616
runs-on: ubuntu-latest
1717

1818
strategy:
1919
matrix:
20-
type: [ local, external ]
20+
type: [ llamacpp-cpu, ollama ]
2121

2222
permissions:
2323
contents: read
File renamed without changes.
File renamed without changes.

docker-compose.yaml

+11-8
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ services:
77
# Private-GPT service for the Ollama CPU and GPU modes
88
# This service builds from an external Dockerfile and runs the Ollama mode.
99
private-gpt-ollama:
10+
image: ${PGPT_IMAGE:-zylonai/private-gpt}${PGPT_TAG:-0.6.1}-ollama
1011
build:
1112
context: .
12-
dockerfile: Dockerfile.external
13+
dockerfile: Dockerfile.ollama
1314
volumes:
1415
- ./local_data/:/home/worker/app/local_data
1516
ports:
@@ -20,18 +21,20 @@ services:
2021
PGPT_MODE: ollama
2122
PGPT_EMBED_MODE: ollama
2223
PGPT_OLLAMA_API_BASE: http://ollama:11434
24+
HF_TOKEN: ${HF_TOKEN:-}
2325
profiles:
2426
- ""
25-
- ollama
27+
- ollama-cpu
2628
- ollama-cuda
27-
- ollama-host
29+
- ollama-api
2830

2931
# Private-GPT service for the local mode
3032
# This service builds from a local Dockerfile and runs the application in local mode.
31-
private-gpt-local:
33+
private-gpt-llamacpp-cpu:
34+
image: ${PGPT_IMAGE:-zylonai/private-gpt}${PGPT_TAG:-0.6.1}-llamacpp-cpu
3235
build:
3336
context: .
34-
dockerfile: Dockerfile.local
37+
dockerfile: Dockerfile.llamacpp-cpu
3538
volumes:
3639
- ./local_data/:/home/worker/app/local_data
3740
- ./models/:/home/worker/app/models
@@ -43,7 +46,7 @@ services:
4346
PGPT_PROFILES: local
4447
HF_TOKEN: ${HF_TOKEN}
4548
profiles:
46-
- local
49+
- llamacpp-cpu
4750

4851
#-----------------------------------
4952
#---- Ollama services --------------
@@ -70,9 +73,9 @@ services:
7073
- "host.docker.internal:host-gateway"
7174
profiles:
7275
- ""
73-
- ollama
76+
- ollama-cpu
7477
- ollama-cuda
75-
- ollama-host
78+
- ollama-api
7679

7780
# Ollama service for the CPU mode
7881
ollama-cpu:
+49-29
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,105 @@
11
This guide provides a quick start for running different profiles of PrivateGPT using Docker Compose.
2-
The profiles cater to various environments, including Ollama setups (CPU, CUDA, MacOS) and fully Local setup.
2+
The profiles cater to various environments, including Ollama setups (CPU, CUDA, MacOS), and a fully local setup.
3+
4+
By default, Docker Compose will download pre-built images from a remote registry when starting the services. However, you have the option to build the images locally if needed. Details on building Docker image locally are provided at the end of this guide.
35

46
If you want to run PrivateGPT locally without Docker, refer to the [Local Installation Guide](/installation).
57

6-
#### Prerequisites
8+
## Prerequisites
79
- **Docker and Docker Compose:** Ensure both are installed on your system.
8-
[Installation Guide for Docker](https://docs.docker.com/get-docker/), [Installation Guide for Docker Compose](https://docs.docker.com/compose/install/).
10+
[Installation Guide for Docker](https://docs.docker.com/get-docker/), [Installation Guide for Docker Compose](https://docs.docker.com/compose/install/).
911
- **Clone PrivateGPT Repository:** Clone the PrivateGPT repository to your machine and navigate to the directory:
1012
```sh
1113
git clone https://github.com/zylon-ai/private-gpt.git
1214
cd private-gpt
1315
```
1416

15-
---
16-
17-
## Ollama Setups (Recommended)
17+
## Setups
1818

19-
Ollama setups are recommended for their ease of use and optimized configurations. Ollama offers different profiles depending on your hardware capabilities and operating system.
19+
### Ollama Setups (Recommended)
2020

21-
### 1. Default/Ollama CPU
21+
#### 1. Default/Ollama CPU
2222

2323
**Description:**
2424
This profile runs the Ollama service using CPU resources. It is the standard configuration for running Ollama-based Private-GPT services without GPU acceleration.
2525

2626
**Run:**
27-
To start the services, use either of the following commands:
27+
To start the services using pre-built images, run:
2828
```sh
2929
docker-compose up
3030
```
31-
or
31+
or with a specific profile:
3232
```sh
33-
docker-compose --profile ollama up
33+
docker-compose --profile ollama-cpu up
3434
```
3535

36-
### 2. Ollama Nvidia CUDA
36+
#### 2. Ollama Nvidia CUDA
3737

3838
**Description:**
3939
This profile leverages GPU acceleration with CUDA support, suitable for computationally intensive tasks that benefit from GPU resources.
4040

4141
**Requirements:**
42-
- Ensure that your system has compatible GPU hardware and the necessary NVIDIA drivers installed. The installation process is detailed [here](https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html).
42+
Ensure that your system has compatible GPU hardware and the necessary NVIDIA drivers installed. The installation process is detailed [here](https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html).
4343

4444
**Run:**
45-
To start the services with CUDA support, use:
45+
To start the services with CUDA support using pre-built images, run:
4646
```sh
4747
docker-compose --profile ollama-cuda up
4848
```
4949

50-
### 3. Ollama Host
50+
#### 3. Ollama External API
5151

5252
**Description:**
5353
This profile is designed for running PrivateGPT using Ollama installed on the host machine. This setup is particularly useful for MacOS users, as Docker does not yet support Metal GPU.
5454

5555
**Requirements:**
56-
- Install Ollama on your machine by following the instructions at [ollama.ai](https://ollama.ai/).
57-
- Start the Ollama service with the command:
56+
Install Ollama on your machine by following the instructions at [ollama.ai](https://ollama.ai/).
57+
58+
**Run:**
59+
To start the Ollama service, use:
5860
```sh
5961
OLLAMA_HOST=0.0.0.0 ollama serve
6062
```
61-
62-
**Run:**
63-
To start the services with the host configuration, use:
63+
To start the services with the host configuration using pre-built images, run:
6464
```sh
65-
docker-compose --profile ollama-host up
65+
docker-compose --profile ollama-api up
6666
```
6767

68-
---
69-
70-
## Fully Local Setups
68+
### Fully Local Setups
7169

72-
### LlamaCPP + HuggingFace Embeddings
70+
#### 1. LlamaCPP CPU
7371

7472
**Description:**
7573
This profile runs the Private-GPT services locally using `llama-cpp` and Hugging Face models.
7674

7775
**Requirements:**
78-
- **Hugging Face Token (HF_TOKEN):** Required for accessing Hugging Face models. Obtain your token following [this guide](/installation/getting-started/troubleshooting#downloading-gated-and-private-models).
76+
A **Hugging Face Token (HF_TOKEN)** is required for accessing Hugging Face models. Obtain your token following [this guide](/installation/getting-started/troubleshooting#downloading-gated-and-private-models).
7977

8078
**Run:**
81-
Start the services with your Hugging Face token:
79+
Start the services with your Hugging Face token using pre-built images:
80+
```sh
81+
HF_TOKEN=<your_hf_token> docker-compose --profile llamacpp-cpu up
82+
```
83+
Replace `<your_hf_token>` with your actual Hugging Face token.
84+
85+
## Building Locally
86+
87+
If you prefer to build Docker images locally, which is useful when making changes to the codebase or the Dockerfiles, follow these steps:
88+
89+
### Building Locally
90+
To build the Docker images locally, navigate to the cloned repository directory and run:
91+
```sh
92+
docker-compose build
93+
```
94+
This command compiles the necessary Docker images based on the current codebase and Dockerfile configurations.
95+
96+
### Forcing a Rebuild with --build
97+
If you have made changes and need to ensure these changes are reflected in the Docker images, you can force a rebuild before starting the services:
98+
```sh
99+
docker-compose up --build
100+
```
101+
or with a specific profile:
82102
```sh
83-
HF_TOKEN=<your_hf_token> docker-compose up --profile local
103+
docker-compose --profile <profile_name> up --build
84104
```
85-
Replace `<your_hf_token>` with your actual Hugging Face token.
105+
Replace `<profile_name>` with the desired profile.

0 commit comments

Comments
 (0)