-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
146 lines (135 loc) · 3.8 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
version: '3'
services:
# Next.js frontend ---------------------------------------------
app:
profiles: ['cpu', 'cuda', 'xpu', 'metal', 'openvino']
build:
context: ./next
dockerfile: Dockerfile
image: llm-on-prem-app
# network_mode: host
ports:
- '3000:3000'
working_dir: /app
command: 'node server.js'
env_file:
- .env
# API Server ---------------------------------------------
fastchat-api-server:
profiles: ['cpu', 'cuda', 'xpu', 'metal', 'openvino']
build:
context: ./models
dockerfile: cpu.Dockerfile
image: fastchat-cpu:latest
# network_mode: host
ports:
- '8000:8000'
entrypoint: ['python3',
'-m', 'fastchat.serve.openai_api_server',
'--controller-address', 'http://fastchat-controller:21001',
'--host', '0.0.0.0',
'--port', '8000']
# Model Controller ---------------------------------------------
fastchat-controller:
profiles: ['cpu', 'cuda', 'xpu', 'metal', 'openvino']
build:
context: ./models
dockerfile: cpu.Dockerfile
image: fastchat-cpu:latest
# network_mode: host
ports:
- '21001:21001'
entrypoint: ['python3', '-m', 'fastchat.serve.controller', '--host', '0.0.0.0', '--port', '21001']
# Model Worker Cuda ---------------------------------------------
fastchat-model-worker-cuda:
profiles: ['cuda']
build:
context: ./models
dockerfile: cuda.Dockerfile
volumes:
- huggingface:/root/.cache/huggingface
image: fastchat-cuda:latest
# network_mode: host
env_file:
- .env
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
entrypoint: [
'bash', 'start.sh'
]
# Model Worker CPU ---------------------------------------------
fastchat-model-worker-cpu:
profiles: ['cpu']
build:
context: ./models
dockerfile: cpu.Dockerfile
volumes:
- huggingface:/root/.cache/huggingface
image: fastchat-cpu:latest
# network_mode: host
env_file:
- .env
entrypoint: [
'bash', 'start.sh'
]
# Model Worker XPU [Intel] -------------------------------------
fastchat-model-worker-xpu:
profiles: ['xpu']
build:
context: ./models
dockerfile: xpu.Dockerfile
devices:
- /dev/dri:/dev/dri
volumes:
- huggingface:/root/.cache/huggingface
image: fastchat-xpu:latest
# network_mode: hostF
env_file:
- .env
entrypoint: [
'bash', 'start.sh'
]
# Model Worker Metal [Apple] -------------------------------------
fastchat-model-worker-openvino:
profiles: ['openvino']
env_file:
- .env
build:
context: ./models
dockerfile: openvino.Dockerfile
devices:
- /dev/dri:/dev/dri
volumes:
- /home/${USER}/.cache/huggingface:/home/openvino/.cache/huggingface
- /home/${USER}/rad-ninjas/code/FastChat:/home/openvino/FastChat
- /home/${USER}/rad-ninjas/code/openvino/models:/home/openvino/models
image: fastchat-openvino:latest
working_dir: /home/openvino
entrypoint: ['bash', 'start.sh']
ports:
- 21002:21002
# network_mode: host
fastchat-model-worker-openvino-setup:
profiles: ['openvino-setup']
env_file:
- .env
build:
context: ./models
dockerfile: openvino.Dockerfile
devices:
- /dev/dri:/dev/dri
volumes:
- /home/${USER}/.cache/huggingface:/home/openvino/.cache/huggingface
- /home/${USER}/rad-ninjas/code/:/home/openvino
image: fastchat-openvino:latest
working_dir: /home/openvino/
entrypoint: ['python3', '-m', 'jupyter', 'notebook', '--ip=0.0.0.0']
ports:
- 8888:8888
volumes:
huggingface: