-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into itsliamdowd/main
# Conflicts: # poetry.lock
- Loading branch information
Showing
20 changed files
with
428 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
http: | ||
services: | ||
ollama: | ||
loadBalancer: | ||
healthCheck: | ||
interval: 5s | ||
path: / | ||
servers: | ||
- url: http://ollama-cpu:11434 | ||
- url: http://ollama-cuda:11434 | ||
- url: http://host.docker.internal:11434 | ||
|
||
routers: | ||
ollama-router: | ||
rule: "PathPrefix(`/`)" | ||
service: ollama |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", | ||
"release-type": "simple", | ||
"version-file": "version.txt", | ||
"extra-files": [ | ||
{ | ||
"type": "toml", | ||
"path": "pyproject.toml", | ||
"jsonpath": "$.tool.poetry.version" | ||
}, | ||
{ | ||
"type": "generic", | ||
"path": "docker-compose.yaml" | ||
} | ||
], | ||
"packages": { | ||
".": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
".": "0.6.2" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: generate-release | ||
|
||
on: | ||
release: | ||
types: [ published ] | ||
workflow_dispatch: | ||
|
||
env: | ||
REGISTRY: docker.io | ||
IMAGE_NAME: zylonai/private-gpt | ||
platforms: linux/amd64,linux/arm64 | ||
DEFAULT_TYPE: "ollama" | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
type: [ llamacpp-cpu, ollama ] | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
outputs: | ||
version: ${{ steps.version.outputs.version }} | ||
|
||
steps: | ||
- name: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/free-disk-space@main | ||
with: | ||
tool-cache: false | ||
android: true | ||
dotnet: true | ||
haskell: true | ||
large-packages: true | ||
docker-images: false | ||
swap-storage: true | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=semver,pattern={{version}},enable=${{ matrix.type == env.DEFAULT_TYPE }} | ||
type=semver,pattern={{version}}-${{ matrix.type }} | ||
type=semver,pattern={{major}}.{{minor}},enable=${{ matrix.type == env.DEFAULT_TYPE }} | ||
type=semver,pattern={{major}}.{{minor}}-${{ matrix.type }} | ||
type=raw,value=latest,enable=${{ matrix.type == env.DEFAULT_TYPE }} | ||
type=sha | ||
flavor: | | ||
latest=false | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: Dockerfile.${{ matrix.type }} | ||
platforms: ${{ env.platforms }} | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- name: Version output | ||
id: version | ||
run: echo "version=${{ steps.meta.outputs.version }}" >> "$GITHUB_OUTPUT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,101 @@ | ||
services: | ||
private-gpt: | ||
|
||
#----------------------------------- | ||
#---- Private-GPT services --------- | ||
#----------------------------------- | ||
|
||
# Private-GPT service for the Ollama CPU and GPU modes | ||
# This service builds from an external Dockerfile and runs the Ollama mode. | ||
private-gpt-ollama: | ||
image: ${PGPT_IMAGE:-zylonai/private-gpt}:${PGPT_TAG:-0.6.2}-ollama # x-release-please-version | ||
build: | ||
dockerfile: Dockerfile.external | ||
context: . | ||
dockerfile: Dockerfile.ollama | ||
volumes: | ||
- ./local_data/:/home/worker/app/local_data | ||
ports: | ||
- 8001:8001 | ||
- "8001:8001" | ||
environment: | ||
PORT: 8001 | ||
PGPT_PROFILES: docker | ||
PGPT_MODE: ollama | ||
PGPT_EMBED_MODE: ollama | ||
PGPT_OLLAMA_API_BASE: http://ollama:11434 | ||
HF_TOKEN: ${HF_TOKEN:-} | ||
profiles: | ||
- "" | ||
- ollama-cpu | ||
- ollama-cuda | ||
- ollama-api | ||
|
||
# Private-GPT service for the local mode | ||
# This service builds from a local Dockerfile and runs the application in local mode. | ||
private-gpt-llamacpp-cpu: | ||
image: ${PGPT_IMAGE:-zylonai/private-gpt}:${PGPT_TAG:-0.6.2}-llamacpp-cpu # x-release-please-version | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.llamacpp-cpu | ||
volumes: | ||
- ./local_data/:/home/worker/app/local_data | ||
- ./models/:/home/worker/app/models | ||
entrypoint: sh -c ".venv/bin/python scripts/setup && .venv/bin/python -m private_gpt" | ||
ports: | ||
- "8001:8001" | ||
environment: | ||
PORT: 8001 | ||
PGPT_PROFILES: local | ||
HF_TOKEN: ${HF_TOKEN} | ||
profiles: | ||
- llamacpp-cpu | ||
|
||
#----------------------------------- | ||
#---- Ollama services -------------- | ||
#----------------------------------- | ||
|
||
# Traefik reverse proxy for the Ollama service | ||
# This will route requests to the Ollama service based on the profile. | ||
ollama: | ||
image: ollama/ollama:latest | ||
image: traefik:v2.10 | ||
ports: | ||
- 11434:11434 | ||
- "8081:8080" | ||
command: | ||
- "--providers.file.filename=/etc/router.yml" | ||
- "--log.level=ERROR" | ||
- "--api.insecure=true" | ||
- "--providers.docker=true" | ||
- "--providers.docker.exposedbydefault=false" | ||
- "--entrypoints.web.address=:11434" | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock:ro | ||
- ./.docker/router.yml:/etc/router.yml:ro | ||
extra_hosts: | ||
- "host.docker.internal:host-gateway" | ||
profiles: | ||
- "" | ||
- ollama-cpu | ||
- ollama-cuda | ||
- ollama-api | ||
|
||
# Ollama service for the CPU mode | ||
ollama-cpu: | ||
image: ollama/ollama:latest | ||
volumes: | ||
- ./models:/root/.ollama | ||
profiles: | ||
- "" | ||
- ollama-cpu | ||
|
||
# Ollama service for the CUDA mode | ||
ollama-cuda: | ||
image: ollama/ollama:latest | ||
volumes: | ||
- ./models:/root/.ollama | ||
deploy: | ||
resources: | ||
reservations: | ||
devices: | ||
- driver: nvidia | ||
count: 1 | ||
capabilities: [gpu] | ||
profiles: | ||
- ollama-cuda |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.