projectdavid-platform 1.8.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,131 @@
1
+ # PolyForm Noncommercial License 1.0.0
2
+
3
+ <https://polyformproject.org/licenses/noncommercial/1.0.0>
4
+
5
+ ## Acceptance
6
+
7
+ In order to get any license under these terms, you must agree
8
+ to them as both strict obligations and conditions to all
9
+ your licenses.
10
+
11
+ ## Copyright License
12
+
13
+ The licensor grants you a copyright license for the
14
+ software to do everything you might do with the software
15
+ that would otherwise infringe the licensor's copyright
16
+ in it for any permitted purpose. However, you may
17
+ only distribute the software according to [Distribution
18
+ License](#distribution-license) and make changes or new works
19
+ based on the software according to [Changes and New Works
20
+ License](#changes-and-new-works-license).
21
+
22
+ ## Distribution License
23
+
24
+ The licensor grants you an additional copyright license
25
+ to distribute copies of the software. Your license
26
+ to distribute covers distributing the software with
27
+ changes and new works permitted by [Changes and New Works
28
+ License](#changes-and-new-works-license).
29
+
30
+ ## Notices
31
+
32
+ You must ensure that anyone who gets a copy of any part of
33
+ the software from you also gets a copy of these terms or the
34
+ URL for them above, as well as copies of any plain-text lines
35
+ beginning with `Required Notice:` that the licensor provided
36
+ with the software. For example:
37
+
38
+ > Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
39
+
40
+ ## Changes and New Works License
41
+
42
+ The licensor grants you an additional copyright license to
43
+ make changes and new works based on the software for any
44
+ permitted purpose.
45
+
46
+ ## Patent License
47
+
48
+ The licensor grants you a patent license for the software that
49
+ covers patent claims the licensor can license, or becomes able
50
+ to license, that you would infringe by using the software.
51
+
52
+ ## Noncommercial Purposes
53
+
54
+ Any noncommercial purpose is a permitted purpose.
55
+
56
+ ## Personal Uses
57
+
58
+ Personal use for research, experiment, and testing for
59
+ the benefit of public knowledge, personal study, private
60
+ entertainment, hobby projects, amateur pursuits, or religious
61
+ observance, without any anticipated commercial application,
62
+ is use for a permitted purpose.
63
+
64
+ ## Noncommercial Organizations
65
+
66
+ Use by any charitable organization, educational institution,
67
+ public research organization, public safety or health
68
+ organization, environmental protection organization,
69
+ or government institution is use for a permitted purpose
70
+ regardless of the source of funding or obligations resulting
71
+ from the funding.
72
+
73
+ ## Fair Use
74
+
75
+ You may have "fair use" rights for the software under the
76
+ law. These terms do not limit them.
77
+
78
+ ## No Other Rights
79
+
80
+ These terms do not allow you to sublicense or transfer any of
81
+ your licenses to anyone else, or prevent the licensor from
82
+ granting licenses to anyone else. These terms do not imply
83
+ any other licenses.
84
+
85
+ ## Patent Defense
86
+
87
+ If you make any written claim that the software infringes or
88
+ contributes to infringement of any patent, your patent license
89
+ for the software granted under these terms ends immediately. If
90
+ your company makes such a claim, your patent license ends
91
+ immediately for work on behalf of your company.
92
+
93
+ ## Violations
94
+
95
+ The first time you are notified in writing that you have
96
+ violated any of these terms, or done anything with the software
97
+ not covered by your licenses, your licenses can nonetheless
98
+ continue if you come into full compliance with these terms,
99
+ and take practical steps to correct past violations, within
100
+ 32 days of receiving notice. Otherwise, all your licenses
101
+ end immediately.
102
+
103
+ ## No Liability
104
+
105
+ ***As far as the law allows, the software comes as is, without
106
+ any warranty or condition, and the licensor will not be liable
107
+ to you for any damages arising out of these terms or the use
108
+ or nature of the software, under any kind of legal claim.***
109
+
110
+ ## Definitions
111
+
112
+ The **licensor** is the individual or entity offering these
113
+ terms, and the **software** is the software the licensor makes
114
+ available under these terms.
115
+
116
+ **You** refers to the individual or entity agreeing to these
117
+ terms.
118
+
119
+ **Your company** is any legal entity, sole proprietorship,
120
+ or other kind of organization that you work for, plus all
121
+ organizations that have control over, are under the control of,
122
+ or are under common control with that organization. **Control**
123
+ means ownership of substantially all the assets of an entity,
124
+ or the power to direct its management and policies by vote,
125
+ contract, or otherwise. Control can be direct or indirect.
126
+
127
+ **Your licenses** are all the licenses granted to you for the
128
+ software under these terms.
129
+
130
+ **Use** means anything you do with the software requiring one
131
+ of your licenses.
@@ -0,0 +1,224 @@
1
+ Metadata-Version: 2.4
2
+ Name: projectdavid-platform
3
+ Version: 1.8.0
4
+ Summary: Deployment orchestrator for the Project David / Entities platform
5
+ Author-email: Francis Neequaye Armah <francis.neequaye@projectdavid.co.uk>
6
+ License: PolyForm Noncommercial 1.0.0
7
+ Keywords: Entities,ProjectDavid,Orchestration,Docker,Deployment,LLM
8
+ Requires-Python: >=3.9
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: PyYAML>=5.4
12
+ Requires-Dist: python-dotenv>=1.0
13
+ Requires-Dist: typer>=0.9.0
14
+ Provides-Extra: dev
15
+ Requires-Dist: black>=23.3; extra == "dev"
16
+ Requires-Dist: isort>=5.12; extra == "dev"
17
+ Requires-Dist: ruff>=0.4.0; extra == "dev"
18
+ Requires-Dist: pytest>=7.2; extra == "dev"
19
+ Requires-Dist: build; extra == "dev"
20
+ Requires-Dist: twine; extra == "dev"
21
+ Dynamic: license-file
22
+
23
+ # Project David Platform
24
+
25
+ [![Docker Pulls](https://img.shields.io/docker/pulls/thanosprime/entities-api-api?label=API%20Pulls&logo=docker&style=flat-square)](https://hub.docker.com/r/thanosprime/entities-api-api)
26
+ [![CI](https://github.com/project-david-ai/platform-docker/actions/workflows/ci.yml/badge.svg)](https://github.com/project-david-ai/platform-docker/actions/workflows/ci.yml)
27
+ [![PyPI](https://img.shields.io/pypi/v/projectdavid-platform?style=flat-square)](https://pypi.org/project/projectdavid-platform/)
28
+ [![License: PolyForm Noncommercial](https://img.shields.io/badge/license-PolyForm%20Noncommercial%201.0.0-blue.svg)](https://polyformproject.org/licenses/noncommercial/1.0.0/)
29
+
30
+ Deployment orchestrator for the Project David / Entities platform. Provides a single command to bring up the complete infrastructure stack, including database, vector store, search, observability, secure code execution, and optional GPU inference services.
31
+
32
+ ---
33
+
34
+ ## Installation
35
+
36
+ ```bash
37
+ pip install projectdavid-platform
38
+ ```
39
+
40
+ No repository clone required. The compose files and configuration templates are bundled with the package.
41
+
42
+ ---
43
+
44
+ ## Quick Start
45
+
46
+ ```bash
47
+ platform --mode up
48
+ ```
49
+
50
+ On first run this will:
51
+
52
+ - Generate a `.env` file with unique, cryptographically secure secrets
53
+ - Prompt for optional values (HuggingFace token for gated model access)
54
+ - Pull all required Docker images
55
+ - Start the full stack in detached mode
56
+
57
+ ### GPU stack (vLLM + Ollama)
58
+
59
+ ```bash
60
+ platform --mode up --gpu
61
+ ```
62
+
63
+ Requires an NVIDIA GPU with the [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html) installed.
64
+
65
+ ---
66
+
67
+ ## Stack Services
68
+
69
+ | Service | Image | Description |
70
+ |---|---|---|
71
+ | `api` | `thanosprime/entities-api-api` | FastAPI backend exposing assistant and inference endpoints |
72
+ | `sandbox` | `thanosprime/entities-api-sandbox` | Secure code execution environment |
73
+ | `db` | `mysql:8.0` | Relational persistence |
74
+ | `qdrant` | `qdrant/qdrant` | Vector database for embeddings and RAG |
75
+ | `redis` | `redis:7` | Cache and message broker |
76
+ | `searxng` | `searxng/searxng` | Self-hosted web search |
77
+ | `browser` | `browserless/chromium` | Headless browser for web agent tooling |
78
+ | `otel-collector` | `otel/opentelemetry-collector-contrib` | Telemetry collection |
79
+ | `jaeger` | `jaegertracing/all-in-one` | Distributed tracing UI |
80
+ | `samba` | `dperson/samba` | File sharing for uploaded documents |
81
+ | `ollama` | `ollama/ollama` | Local LLM inference (GPU stack only) |
82
+ | `vllm` | `vllm/vllm-openai` | High-throughput GPU inference (GPU stack only) |
83
+
84
+ ---
85
+
86
+ ## Prerequisites
87
+
88
+ - Docker and Docker Compose
89
+ - Python 3.9 or later
90
+ - NVIDIA GPU with NVIDIA Container Toolkit (GPU stack only)
91
+
92
+ ---
93
+
94
+ ## Lifecycle Commands
95
+
96
+ ### Start the stack
97
+
98
+ ```bash
99
+ platform --mode up
100
+ ```
101
+
102
+ ### Start with GPU services
103
+
104
+ ```bash
105
+ platform --mode up --gpu
106
+ ```
107
+
108
+ ### Stop the stack
109
+
110
+ ```bash
111
+ platform --mode down_only
112
+ ```
113
+
114
+ ### Stop and remove all volumes
115
+
116
+ ```bash
117
+ platform --mode down_only --clear-volumes
118
+ ```
119
+
120
+ ### Force recreate all containers
121
+
122
+ ```bash
123
+ platform --mode up --force-recreate
124
+ ```
125
+
126
+ ### Stream logs
127
+
128
+ ```bash
129
+ platform --mode logs --follow
130
+ ```
131
+
132
+ ### Destroy all stack data
133
+
134
+ ```bash
135
+ platform --nuke
136
+ ```
137
+
138
+ Requires interactive confirmation. Cannot be undone.
139
+
140
+ ---
141
+
142
+ ## Configuration
143
+
144
+ ### Setting optional values
145
+
146
+ Optional values such as the HuggingFace token can be set at any time without regenerating secrets:
147
+
148
+ ```bash
149
+ platform configure --set HF_TOKEN=hf_abc123
150
+ platform configure --set VLLM_MODEL=Qwen/Qwen2.5-VL-7B-Instruct
151
+ ```
152
+
153
+ Or interactively:
154
+
155
+ ```bash
156
+ platform configure --interactive
157
+ ```
158
+
159
+ ### Rotating secrets
160
+
161
+ The orchestrator warns when a change requires additional steps to apply safely. Database password rotation requires clearing the initialised volume:
162
+
163
+ ```bash
164
+ platform configure --set MYSQL_PASSWORD=<new_password>
165
+ # Follow the warning instructions printed by the command
166
+ ```
167
+
168
+ ---
169
+
170
+ ## Post-startup Provisioning
171
+
172
+ Once the stack is running, provision the admin user and default assistant:
173
+
174
+ ```bash
175
+ # Bootstrap the default admin user
176
+ platform bootstrap-admin
177
+
178
+ # Create a regular user
179
+ platform create-user --email user@example.com --name "Alice"
180
+
181
+ # Set up the default assistant
182
+ platform setup-assistant --api-key ad_... --user-id usr_...
183
+ ```
184
+
185
+ Full provisioning walkthrough: [`docs/boot_strap.md`](docs/boot_strap.md)
186
+
187
+ ---
188
+
189
+ ## Docker Images
190
+
191
+ Both owned images are published to Docker Hub and updated automatically on each release of the source repository.
192
+
193
+ - [thanosprime/entities-api-api](https://hub.docker.com/r/thanosprime/entities-api-api)
194
+ - [thanosprime/entities-api-sandbox](https://hub.docker.com/r/thanosprime/entities-api-sandbox)
195
+
196
+ ---
197
+
198
+ ## Related Repositories
199
+
200
+ | Repository | Purpose |
201
+ |---|---|
202
+ | [entities_api](https://github.com/frankie336/entities_api) | FastAPI backend source code, inference engine, and tooling framework |
203
+ | [projectdavid](https://github.com/frankie336/projectdavid) | Python SDK for interacting with the Entities API |
204
+ | [platform-docker](https://github.com/project-david-ai/platform-docker) | This repository — deployment orchestration |
205
+
206
+ ---
207
+
208
+ ## Working with the Source Code
209
+
210
+ This repository is intended for deploying prebuilt images. To develop, extend, or contribute to the platform source:
211
+
212
+ ```bash
213
+ git clone https://github.com/frankie336/entities_api.git
214
+ cd entities_api
215
+ pip install -e .
216
+ entities-api docker-manager --mode up
217
+ ```
218
+
219
+ ---
220
+
221
+ ## License
222
+
223
+ Distributed under the [PolyForm Noncommercial License 1.0.0](https://polyformproject.org/licenses/noncommercial/1.0.0/).
224
+ Commercial licensing is available on request.
@@ -0,0 +1,202 @@
1
+ # Project David Platform
2
+
3
+ [![Docker Pulls](https://img.shields.io/docker/pulls/thanosprime/entities-api-api?label=API%20Pulls&logo=docker&style=flat-square)](https://hub.docker.com/r/thanosprime/entities-api-api)
4
+ [![CI](https://github.com/project-david-ai/platform-docker/actions/workflows/ci.yml/badge.svg)](https://github.com/project-david-ai/platform-docker/actions/workflows/ci.yml)
5
+ [![PyPI](https://img.shields.io/pypi/v/projectdavid-platform?style=flat-square)](https://pypi.org/project/projectdavid-platform/)
6
+ [![License: PolyForm Noncommercial](https://img.shields.io/badge/license-PolyForm%20Noncommercial%201.0.0-blue.svg)](https://polyformproject.org/licenses/noncommercial/1.0.0/)
7
+
8
+ Deployment orchestrator for the Project David / Entities platform. Provides a single command to bring up the complete infrastructure stack, including database, vector store, search, observability, secure code execution, and optional GPU inference services.
9
+
10
+ ---
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ pip install projectdavid-platform
16
+ ```
17
+
18
+ No repository clone required. The compose files and configuration templates are bundled with the package.
19
+
20
+ ---
21
+
22
+ ## Quick Start
23
+
24
+ ```bash
25
+ platform --mode up
26
+ ```
27
+
28
+ On first run this will:
29
+
30
+ - Generate a `.env` file with unique, cryptographically secure secrets
31
+ - Prompt for optional values (HuggingFace token for gated model access)
32
+ - Pull all required Docker images
33
+ - Start the full stack in detached mode
34
+
35
+ ### GPU stack (vLLM + Ollama)
36
+
37
+ ```bash
38
+ platform --mode up --gpu
39
+ ```
40
+
41
+ Requires an NVIDIA GPU with the [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html) installed.
42
+
43
+ ---
44
+
45
+ ## Stack Services
46
+
47
+ | Service | Image | Description |
48
+ |---|---|---|
49
+ | `api` | `thanosprime/entities-api-api` | FastAPI backend exposing assistant and inference endpoints |
50
+ | `sandbox` | `thanosprime/entities-api-sandbox` | Secure code execution environment |
51
+ | `db` | `mysql:8.0` | Relational persistence |
52
+ | `qdrant` | `qdrant/qdrant` | Vector database for embeddings and RAG |
53
+ | `redis` | `redis:7` | Cache and message broker |
54
+ | `searxng` | `searxng/searxng` | Self-hosted web search |
55
+ | `browser` | `browserless/chromium` | Headless browser for web agent tooling |
56
+ | `otel-collector` | `otel/opentelemetry-collector-contrib` | Telemetry collection |
57
+ | `jaeger` | `jaegertracing/all-in-one` | Distributed tracing UI |
58
+ | `samba` | `dperson/samba` | File sharing for uploaded documents |
59
+ | `ollama` | `ollama/ollama` | Local LLM inference (GPU stack only) |
60
+ | `vllm` | `vllm/vllm-openai` | High-throughput GPU inference (GPU stack only) |
61
+
62
+ ---
63
+
64
+ ## Prerequisites
65
+
66
+ - Docker and Docker Compose
67
+ - Python 3.9 or later
68
+ - NVIDIA GPU with NVIDIA Container Toolkit (GPU stack only)
69
+
70
+ ---
71
+
72
+ ## Lifecycle Commands
73
+
74
+ ### Start the stack
75
+
76
+ ```bash
77
+ platform --mode up
78
+ ```
79
+
80
+ ### Start with GPU services
81
+
82
+ ```bash
83
+ platform --mode up --gpu
84
+ ```
85
+
86
+ ### Stop the stack
87
+
88
+ ```bash
89
+ platform --mode down_only
90
+ ```
91
+
92
+ ### Stop and remove all volumes
93
+
94
+ ```bash
95
+ platform --mode down_only --clear-volumes
96
+ ```
97
+
98
+ ### Force recreate all containers
99
+
100
+ ```bash
101
+ platform --mode up --force-recreate
102
+ ```
103
+
104
+ ### Stream logs
105
+
106
+ ```bash
107
+ platform --mode logs --follow
108
+ ```
109
+
110
+ ### Destroy all stack data
111
+
112
+ ```bash
113
+ platform --nuke
114
+ ```
115
+
116
+ Requires interactive confirmation. Cannot be undone.
117
+
118
+ ---
119
+
120
+ ## Configuration
121
+
122
+ ### Setting optional values
123
+
124
+ Optional values such as the HuggingFace token can be set at any time without regenerating secrets:
125
+
126
+ ```bash
127
+ platform configure --set HF_TOKEN=hf_abc123
128
+ platform configure --set VLLM_MODEL=Qwen/Qwen2.5-VL-7B-Instruct
129
+ ```
130
+
131
+ Or interactively:
132
+
133
+ ```bash
134
+ platform configure --interactive
135
+ ```
136
+
137
+ ### Rotating secrets
138
+
139
+ The orchestrator warns when a change requires additional steps to apply safely. Database password rotation requires clearing the initialised volume:
140
+
141
+ ```bash
142
+ platform configure --set MYSQL_PASSWORD=<new_password>
143
+ # Follow the warning instructions printed by the command
144
+ ```
145
+
146
+ ---
147
+
148
+ ## Post-startup Provisioning
149
+
150
+ Once the stack is running, provision the admin user and default assistant:
151
+
152
+ ```bash
153
+ # Bootstrap the default admin user
154
+ platform bootstrap-admin
155
+
156
+ # Create a regular user
157
+ platform create-user --email user@example.com --name "Alice"
158
+
159
+ # Set up the default assistant
160
+ platform setup-assistant --api-key ad_... --user-id usr_...
161
+ ```
162
+
163
+ Full provisioning walkthrough: [`docs/boot_strap.md`](docs/boot_strap.md)
164
+
165
+ ---
166
+
167
+ ## Docker Images
168
+
169
+ Both owned images are published to Docker Hub and updated automatically on each release of the source repository.
170
+
171
+ - [thanosprime/entities-api-api](https://hub.docker.com/r/thanosprime/entities-api-api)
172
+ - [thanosprime/entities-api-sandbox](https://hub.docker.com/r/thanosprime/entities-api-sandbox)
173
+
174
+ ---
175
+
176
+ ## Related Repositories
177
+
178
+ | Repository | Purpose |
179
+ |---|---|
180
+ | [entities_api](https://github.com/frankie336/entities_api) | FastAPI backend source code, inference engine, and tooling framework |
181
+ | [projectdavid](https://github.com/frankie336/projectdavid) | Python SDK for interacting with the Entities API |
182
+ | [platform-docker](https://github.com/project-david-ai/platform-docker) | This repository — deployment orchestration |
183
+
184
+ ---
185
+
186
+ ## Working with the Source Code
187
+
188
+ This repository is intended for deploying prebuilt images. To develop, extend, or contribute to the platform source:
189
+
190
+ ```bash
191
+ git clone https://github.com/frankie336/entities_api.git
192
+ cd entities_api
193
+ pip install -e .
194
+ entities-api docker-manager --mode up
195
+ ```
196
+
197
+ ---
198
+
199
+ ## License
200
+
201
+ Distributed under the [PolyForm Noncommercial License 1.0.0](https://polyformproject.org/licenses/noncommercial/1.0.0/).
202
+ Commercial licensing is available on request.
@@ -0,0 +1,2 @@
1
+ # projectdavid_platform/__init__.py
2
+ __version__ = "1.3.0"
@@ -0,0 +1,78 @@
1
+ # docker-compose.gpu.yml
2
+ #
3
+ # GPU service overrides — opt-in extension for users with NVIDIA hardware.
4
+ #
5
+ # USAGE:
6
+ # entities-dev --mode up --gpu
7
+ #
8
+ # Or manually:
9
+ # docker compose -f docker-compose.yml -f docker-compose.gpu.yml up -d
10
+ #
11
+ # REQUIREMENTS:
12
+ # - NVIDIA GPU with drivers installed
13
+ # - NVIDIA Container Toolkit (https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html)
14
+ # - HF_TOKEN set in .env (for gated model downloads)
15
+ # - HF_CACHE_PATH set in .env (auto-resolved by entities-dev on first run)
16
+ #
17
+ # To set HF_TOKEN after initial setup:
18
+ # entities-dev configure --set HF_TOKEN=hf_abc123
19
+
20
+ services:
21
+ ollama:
22
+ image: ollama/ollama:latest
23
+ container_name: ollama
24
+ restart: unless-stopped
25
+ ports:
26
+ - "11434:11434"
27
+ volumes:
28
+ - ollama_data:/root/.ollama
29
+ networks:
30
+ - my_custom_network
31
+
32
+ vllm:
33
+ image: vllm/vllm-openai:latest
34
+ container_name: vllm_server
35
+ restart: unless-stopped
36
+ runtime: nvidia
37
+ environment:
38
+ - NVIDIA_VISIBLE_DEVICES=all
39
+ # HF_TOKEN is optional — stack starts without it but gated model
40
+ # downloads will fail. Set via: entities-dev configure --set HF_TOKEN=hf_abc123
41
+ - HF_TOKEN=${HF_TOKEN}
42
+ volumes:
43
+ # HF_CACHE_PATH uses :- fallback to avoid multi-colon parse error in volume syntax.
44
+ # The orchestrator always sets this before starting — fallback only fires if
45
+ # docker compose up is run directly without going through entities-dev.
46
+ - "${HF_CACHE_PATH:-~/.cache/huggingface}:/root/.cache/huggingface"
47
+ ports:
48
+ - "8001:8000"
49
+ command: >
50
+ --model ${VLLM_MODEL:-Qwen/Qwen2.5-VL-3B-Instruct}
51
+ --dtype float16
52
+ --quantization fp8
53
+ --max-model-len 4096
54
+ --gpu-memory-utilization 0.85
55
+ networks:
56
+ - my_custom_network
57
+ deploy:
58
+ resources:
59
+ reservations:
60
+ devices:
61
+ - driver: nvidia
62
+ count: all
63
+ capabilities: [gpu]
64
+
65
+ # Override api service to point at the real GPU service URLs
66
+ # instead of the localhost stubs in the base compose file.
67
+ api:
68
+ environment:
69
+ - OLLAMA_BASE_URL=http://ollama:11434/v1
70
+ - VLLM_BASE_URL=http://vllm_server:8000
71
+ depends_on:
72
+ ollama:
73
+ condition: service_started
74
+ vllm:
75
+ condition: service_started
76
+
77
+ volumes:
78
+ ollama_data:
@@ -0,0 +1,212 @@
1
+ services:
2
+ db:
3
+ image: mysql:8.0
4
+ container_name: my_mysql_cosmic_catalyst
5
+ restart: always
6
+ environment:
7
+ MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD:?MYSQL_ROOT_PASSWORD is not set. Run: entities-dev --mode up}"
8
+ MYSQL_DATABASE: entities_db
9
+ MYSQL_USER: api_user
10
+ MYSQL_PASSWORD: "${MYSQL_PASSWORD:?MYSQL_PASSWORD is not set. Run: entities-dev --mode up}"
11
+ volumes:
12
+ - mysql_data:/var/lib/mysql
13
+ ports:
14
+ - "3307:3306"
15
+ healthcheck:
16
+ test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
17
+ interval: 10s
18
+ timeout: 5s
19
+ retries: 5
20
+ networks:
21
+ - my_custom_network
22
+
23
+ qdrant:
24
+ image: qdrant/qdrant:latest
25
+ container_name: qdrant_server
26
+ restart: always
27
+ ports:
28
+ - "6333:6333"
29
+ - "6334:6334"
30
+ volumes:
31
+ - qdrant_storage:/qdrant/storage
32
+ environment:
33
+ QDRANT__STORAGE__STORAGE_PATH: "/qdrant/storage"
34
+ QDRANT__SERVICE__GRPC_PORT: "6334"
35
+ QDRANT__LOG_LEVEL: "INFO"
36
+ networks:
37
+ - my_custom_network
38
+
39
+ redis:
40
+ image: redis:7
41
+ container_name: redis
42
+ restart: unless-stopped
43
+ ports:
44
+ - "6379:6379"
45
+ volumes:
46
+ - redis_data:/data
47
+ networks:
48
+ - my_custom_network
49
+
50
+ browser:
51
+ image: ghcr.io/browserless/chromium:latest
52
+ container_name: browserless_chromium
53
+ restart: always
54
+ ports:
55
+ - "3000:3000"
56
+ environment:
57
+ - MAX_CONCURRENT_SESSIONS=10
58
+ - CONNECTION_TIMEOUT=60000
59
+ networks:
60
+ - my_custom_network
61
+
62
+ searxng:
63
+ image: searxng/searxng:latest
64
+ container_name: searxng
65
+ restart: unless-stopped
66
+ ports:
67
+ - "8080:8080"
68
+ volumes:
69
+ - ./docker/searxng:/etc/searxng
70
+ environment:
71
+ - SEARXNG_BASE_URL=http://localhost:8080/
72
+ - "SEARXNG_SECRET_KEY=${SEARXNG_SECRET_KEY:?SEARXNG_SECRET_KEY is not set. Run: entities-dev --mode up}"
73
+ depends_on:
74
+ - redis
75
+ networks:
76
+ - my_custom_network
77
+
78
+ otel-collector:
79
+ image: otel/opentelemetry-collector-contrib:latest
80
+ container_name: otel_collector
81
+ restart: always
82
+ command: ["--config=/etc/otel-config.yaml"]
83
+ volumes:
84
+ - ./docker/otel/otel-config.yaml:/etc/otel-config.yaml
85
+ ports:
86
+ - "4317:4317"
87
+ - "4318:4318"
88
+ depends_on:
89
+ - jaeger
90
+ networks:
91
+ - my_custom_network
92
+
93
+ jaeger:
94
+ image: jaegertracing/all-in-one:latest
95
+ container_name: jaeger_ui
96
+ restart: always
97
+ environment:
98
+ - COLLECTOR_OTLP_ENABLED=true
99
+ ports:
100
+ - "16686:16686"
101
+ - "14250:14250"
102
+ networks:
103
+ - my_custom_network
104
+
105
+ api:
106
+ # Pre-built image from Docker Hub — do not add build: context here.
107
+ # To build from source use the entities_api dev repo instead.
108
+ image: thanosprime/entities-api-api:latest
109
+ container_name: fastapi_cosmic_catalyst
110
+ restart: always
111
+ env_file:
112
+ - .env
113
+ environment:
114
+ - DATABASE_URL=${DATABASE_URL}
115
+ - AUTO_MIGRATE=1
116
+ - SANDBOX_SERVER_URL=http://sandbox:8000
117
+ - QDRANT_URL=http://qdrant:6333
118
+ - REDIS_URL=redis://redis:6379/0
119
+ - BROWSER_WS_ENDPOINT=ws://browser:3000
120
+ - "DEFAULT_SECRET_KEY=${DEFAULT_SECRET_KEY:?DEFAULT_SECRET_KEY is not set. Run: entities-dev --mode up}"
121
+ - SEARXNG_URL=http://searxng:8080
122
+ - OTEL_SERVICE_NAME=entities-api
123
+ - OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317
124
+ - OTEL_EXPORTER_OTLP_PROTOCOL=grpc
125
+ - OTEL_TRACES_EXPORTER=otlp
126
+ - OTEL_METRICS_EXPORTER=none
127
+ - OTEL_LOGS_EXPORTER=none
128
+ # Ollama and vLLM base URLs — resolved to localhost stubs when GPU
129
+ # services are not running. Override via docker-compose.gpu.yml.
130
+ - OLLAMA_BASE_URL=http://localhost:11434/v1
131
+ - VLLM_BASE_URL=http://localhost:8001
132
+ # Container-internal mount point — always fixed regardless of host SHARED_PATH
133
+ - SHARED_PATH=/app/shared_data
134
+ ports:
135
+ - "9000:9000"
136
+ volumes:
137
+ # Mount scripts so bootstrap/create-user/setup-assistant commands work
138
+ - ./scripts:/app/scripts
139
+ # SHARED_PATH uses :- fallback to avoid multi-colon parse error in volume syntax.
140
+ # The orchestrator always sets this before starting — fallback only fires if
141
+ # docker compose up is run directly without going through entities-dev.
142
+ - "${SHARED_PATH:-./shared_data}:/app/shared_data"
143
+ depends_on:
144
+ db:
145
+ condition: service_healthy
146
+ sandbox:
147
+ condition: service_started
148
+ qdrant:
149
+ condition: service_started
150
+ redis:
151
+ condition: service_started
152
+ browser:
153
+ condition: service_started
154
+ searxng:
155
+ condition: service_started
156
+ otel-collector:
157
+ condition: service_started
158
+ networks:
159
+ - my_custom_network
160
+
161
+ sandbox:
162
+ # Pre-built image from Docker Hub — do not add build: context here.
163
+ image: thanosprime/entities-api-sandbox:latest
164
+ container_name: sandbox_api
165
+ restart: always
166
+ env_file:
167
+ - .env
168
+ cap_add:
169
+ - SYS_ADMIN
170
+ security_opt:
171
+ - seccomp:unconfined
172
+ devices:
173
+ - /dev/fuse
174
+ ports:
175
+ - "8000:8000"
176
+ volumes:
177
+ - /tmp/sandbox_logs:/app/logs
178
+ depends_on:
179
+ db:
180
+ condition: service_healthy
181
+ networks:
182
+ - my_custom_network
183
+
184
+ samba:
185
+ image: dperson/samba
186
+ container_name: samba_server
187
+ restart: unless-stopped
188
+ environment:
189
+ USERID: ${SAMBA_USERID:-1000}
190
+ GROUPID: ${SAMBA_GROUPID:-1000}
191
+ TZ: UTC
192
+ # References the generated secret — never the hardcoded literal "default"
193
+ USER: "samba_user;${SMBCLIENT_PASSWORD:?SMBCLIENT_PASSWORD is not set. Run: entities-dev --mode up}"
194
+ SHARE: "cosmic_share;/samba/share;yes;no;no;samba_user"
195
+ GLOBAL: "server min protocol = NT1\\nserver max protocol = SMB3"
196
+ ports:
197
+ - "139:139"
198
+ - "1445:445"
199
+ volumes:
200
+ # Same fallback rationale as api service above
201
+ - "${SHARED_PATH:-./shared_data}:/samba/share"
202
+ networks:
203
+ - my_custom_network
204
+
205
+ volumes:
206
+ mysql_data:
207
+ qdrant_storage:
208
+ redis_data:
209
+
210
+ networks:
211
+ my_custom_network:
212
+ driver: bridge
@@ -0,0 +1,224 @@
1
+ Metadata-Version: 2.4
2
+ Name: projectdavid-platform
3
+ Version: 1.8.0
4
+ Summary: Deployment orchestrator for the Project David / Entities platform
5
+ Author-email: Francis Neequaye Armah <francis.neequaye@projectdavid.co.uk>
6
+ License: PolyForm Noncommercial 1.0.0
7
+ Keywords: Entities,ProjectDavid,Orchestration,Docker,Deployment,LLM
8
+ Requires-Python: >=3.9
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: PyYAML>=5.4
12
+ Requires-Dist: python-dotenv>=1.0
13
+ Requires-Dist: typer>=0.9.0
14
+ Provides-Extra: dev
15
+ Requires-Dist: black>=23.3; extra == "dev"
16
+ Requires-Dist: isort>=5.12; extra == "dev"
17
+ Requires-Dist: ruff>=0.4.0; extra == "dev"
18
+ Requires-Dist: pytest>=7.2; extra == "dev"
19
+ Requires-Dist: build; extra == "dev"
20
+ Requires-Dist: twine; extra == "dev"
21
+ Dynamic: license-file
22
+
23
+ # Project David Platform
24
+
25
+ [![Docker Pulls](https://img.shields.io/docker/pulls/thanosprime/entities-api-api?label=API%20Pulls&logo=docker&style=flat-square)](https://hub.docker.com/r/thanosprime/entities-api-api)
26
+ [![CI](https://github.com/project-david-ai/platform-docker/actions/workflows/ci.yml/badge.svg)](https://github.com/project-david-ai/platform-docker/actions/workflows/ci.yml)
27
+ [![PyPI](https://img.shields.io/pypi/v/projectdavid-platform?style=flat-square)](https://pypi.org/project/projectdavid-platform/)
28
+ [![License: PolyForm Noncommercial](https://img.shields.io/badge/license-PolyForm%20Noncommercial%201.0.0-blue.svg)](https://polyformproject.org/licenses/noncommercial/1.0.0/)
29
+
30
+ Deployment orchestrator for the Project David / Entities platform. Provides a single command to bring up the complete infrastructure stack, including database, vector store, search, observability, secure code execution, and optional GPU inference services.
31
+
32
+ ---
33
+
34
+ ## Installation
35
+
36
+ ```bash
37
+ pip install projectdavid-platform
38
+ ```
39
+
40
+ No repository clone required. The compose files and configuration templates are bundled with the package.
41
+
42
+ ---
43
+
44
+ ## Quick Start
45
+
46
+ ```bash
47
+ platform --mode up
48
+ ```
49
+
50
+ On first run this will:
51
+
52
+ - Generate a `.env` file with unique, cryptographically secure secrets
53
+ - Prompt for optional values (HuggingFace token for gated model access)
54
+ - Pull all required Docker images
55
+ - Start the full stack in detached mode
56
+
57
+ ### GPU stack (vLLM + Ollama)
58
+
59
+ ```bash
60
+ platform --mode up --gpu
61
+ ```
62
+
63
+ Requires an NVIDIA GPU with the [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html) installed.
64
+
65
+ ---
66
+
67
+ ## Stack Services
68
+
69
+ | Service | Image | Description |
70
+ |---|---|---|
71
+ | `api` | `thanosprime/entities-api-api` | FastAPI backend exposing assistant and inference endpoints |
72
+ | `sandbox` | `thanosprime/entities-api-sandbox` | Secure code execution environment |
73
+ | `db` | `mysql:8.0` | Relational persistence |
74
+ | `qdrant` | `qdrant/qdrant` | Vector database for embeddings and RAG |
75
+ | `redis` | `redis:7` | Cache and message broker |
76
+ | `searxng` | `searxng/searxng` | Self-hosted web search |
77
+ | `browser` | `browserless/chromium` | Headless browser for web agent tooling |
78
+ | `otel-collector` | `otel/opentelemetry-collector-contrib` | Telemetry collection |
79
+ | `jaeger` | `jaegertracing/all-in-one` | Distributed tracing UI |
80
+ | `samba` | `dperson/samba` | File sharing for uploaded documents |
81
+ | `ollama` | `ollama/ollama` | Local LLM inference (GPU stack only) |
82
+ | `vllm` | `vllm/vllm-openai` | High-throughput GPU inference (GPU stack only) |
83
+
84
+ ---
85
+
86
+ ## Prerequisites
87
+
88
+ - Docker and Docker Compose
89
+ - Python 3.9 or later
90
+ - NVIDIA GPU with NVIDIA Container Toolkit (GPU stack only)
91
+
92
+ ---
93
+
94
+ ## Lifecycle Commands
95
+
96
+ ### Start the stack
97
+
98
+ ```bash
99
+ platform --mode up
100
+ ```
101
+
102
+ ### Start with GPU services
103
+
104
+ ```bash
105
+ platform --mode up --gpu
106
+ ```
107
+
108
+ ### Stop the stack
109
+
110
+ ```bash
111
+ platform --mode down_only
112
+ ```
113
+
114
+ ### Stop and remove all volumes
115
+
116
+ ```bash
117
+ platform --mode down_only --clear-volumes
118
+ ```
119
+
120
+ ### Force recreate all containers
121
+
122
+ ```bash
123
+ platform --mode up --force-recreate
124
+ ```
125
+
126
+ ### Stream logs
127
+
128
+ ```bash
129
+ platform --mode logs --follow
130
+ ```
131
+
132
+ ### Destroy all stack data
133
+
134
+ ```bash
135
+ platform --nuke
136
+ ```
137
+
138
+ Requires interactive confirmation. Cannot be undone.
139
+
140
+ ---
141
+
142
+ ## Configuration
143
+
144
+ ### Setting optional values
145
+
146
+ Optional values such as the HuggingFace token can be set at any time without regenerating secrets:
147
+
148
+ ```bash
149
+ platform configure --set HF_TOKEN=hf_abc123
150
+ platform configure --set VLLM_MODEL=Qwen/Qwen2.5-VL-7B-Instruct
151
+ ```
152
+
153
+ Or interactively:
154
+
155
+ ```bash
156
+ platform configure --interactive
157
+ ```
158
+
159
+ ### Rotating secrets
160
+
161
+ The orchestrator warns when a change requires additional steps to apply safely. Database password rotation requires clearing the initialised volume:
162
+
163
+ ```bash
164
+ platform configure --set MYSQL_PASSWORD=<new_password>
165
+ # Follow the warning instructions printed by the command
166
+ ```
167
+
168
+ ---
169
+
170
+ ## Post-startup Provisioning
171
+
172
+ Once the stack is running, provision the admin user and default assistant:
173
+
174
+ ```bash
175
+ # Bootstrap the default admin user
176
+ platform bootstrap-admin
177
+
178
+ # Create a regular user
179
+ platform create-user --email user@example.com --name "Alice"
180
+
181
+ # Set up the default assistant
182
+ platform setup-assistant --api-key ad_... --user-id usr_...
183
+ ```
184
+
185
+ Full provisioning walkthrough: [`docs/boot_strap.md`](docs/boot_strap.md)
186
+
187
+ ---
188
+
189
+ ## Docker Images
190
+
191
+ Both owned images are published to Docker Hub and updated automatically on each release of the source repository.
192
+
193
+ - [thanosprime/entities-api-api](https://hub.docker.com/r/thanosprime/entities-api-api)
194
+ - [thanosprime/entities-api-sandbox](https://hub.docker.com/r/thanosprime/entities-api-sandbox)
195
+
196
+ ---
197
+
198
+ ## Related Repositories
199
+
200
+ | Repository | Purpose |
201
+ |---|---|
202
+ | [entities_api](https://github.com/frankie336/entities_api) | FastAPI backend source code, inference engine, and tooling framework |
203
+ | [projectdavid](https://github.com/frankie336/projectdavid) | Python SDK for interacting with the Entities API |
204
+ | [platform-docker](https://github.com/project-david-ai/platform-docker) | This repository — deployment orchestration |
205
+
206
+ ---
207
+
208
+ ## Working with the Source Code
209
+
210
+ This repository is intended for deploying prebuilt images. To develop, extend, or contribute to the platform source:
211
+
212
+ ```bash
213
+ git clone https://github.com/frankie336/entities_api.git
214
+ cd entities_api
215
+ pip install -e .
216
+ entities-api docker-manager --mode up
217
+ ```
218
+
219
+ ---
220
+
221
+ ## License
222
+
223
+ Distributed under the [PolyForm Noncommercial License 1.0.0](https://polyformproject.org/licenses/noncommercial/1.0.0/).
224
+ Commercial licensing is available on request.
@@ -0,0 +1,12 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ projectdavid_platform/__init__.py
5
+ projectdavid_platform/docker-compose.gpu.yml
6
+ projectdavid_platform/docker-compose.yml
7
+ projectdavid_platform.egg-info/PKG-INFO
8
+ projectdavid_platform.egg-info/SOURCES.txt
9
+ projectdavid_platform.egg-info/dependency_links.txt
10
+ projectdavid_platform.egg-info/entry_points.txt
11
+ projectdavid_platform.egg-info/requires.txt
12
+ projectdavid_platform.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ pdavid = start_orchestration:entry_point
@@ -0,0 +1,11 @@
1
+ PyYAML>=5.4
2
+ python-dotenv>=1.0
3
+ typer>=0.9.0
4
+
5
+ [dev]
6
+ black>=23.3
7
+ isort>=5.12
8
+ ruff>=0.4.0
9
+ pytest>=7.2
10
+ build
11
+ twine
@@ -0,0 +1 @@
1
+ projectdavid_platform
@@ -0,0 +1,64 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "projectdavid-platform"
7
+ version = "1.8.0"
8
+ description = "Deployment orchestrator for the Project David / Entities platform"
9
+ readme = "README.md"
10
+ authors = [
11
+ { name = "Francis Neequaye Armah", email = "francis.neequaye@projectdavid.co.uk" }
12
+ ]
13
+ license = { text = "PolyForm Noncommercial 1.0.0" }
14
+ requires-python = ">=3.9"
15
+ keywords = ["Entities", "ProjectDavid", "Orchestration", "Docker", "Deployment", "LLM"]
16
+
17
+ dependencies = [
18
+ "PyYAML>=5.4",
19
+ "python-dotenv>=1.0",
20
+ "typer>=0.9.0",
21
+ ]
22
+
23
+ [project.scripts]
24
+ pdavid = "start_orchestration:entry_point"
25
+
26
+ [project.optional-dependencies]
27
+ dev = [
28
+ "black>=23.3",
29
+ "isort>=5.12",
30
+ "ruff>=0.4.0",
31
+ "pytest>=7.2",
32
+ "build",
33
+ "twine",
34
+ ]
35
+
36
+ # -------------------------------------------------------------------------
37
+ # Bundle compose files and .env.example as package data so they are
38
+ # available after `pip install projectdavid-platform` without any git clone.
39
+ # start_orchestration.py resolves these via importlib.resources.
40
+ # -------------------------------------------------------------------------
41
+ [tool.setuptools.package-data]
42
+ "projectdavid_platform" = [
43
+ "docker-compose.yml",
44
+ "docker-compose.gpu.yml",
45
+ ".env.example",
46
+ ]
47
+
48
+ [tool.setuptools.packages.find]
49
+ where = ["."]
50
+ include = ["projectdavid_platform*"]
51
+
52
+ [tool.black]
53
+ line-length = 100
54
+ target-version = ["py39"]
55
+
56
+ [tool.isort]
57
+ profile = "black"
58
+
59
+ [tool.ruff]
60
+ line-length = 100
61
+
62
+ [tool.semantic_release]
63
+ version_source = "tag"
64
+ upload_to_pypi = false
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+