-
Notifications
You must be signed in to change notification settings - Fork 84
/
llama-k8s.yaml
56 lines (56 loc) · 1.36 KB
/
llama-k8s.yaml
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
apiVersion: v1
kind: Namespace
metadata:
name: llama-namespace # The name of your new namespace
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: llama-app
namespace: llama-namespace # Specify the namespace
labels:
app: llama
spec:
replicas: 1 # Number of pods to run
selector:
matchLabels:
app: llama
template:
metadata:
labels:
app: llama
spec:
containers:
- name: llama-container
image: sinanuozdemir/llama-cpp-demo:15
resources:
limits:
memory: "1500Mi" # Limit the memory usage to 1.5GB
nvidia.com/gpu: 1
ephemeral-storage: "20Gi" # Limit the ephemeral storage to 20GiB
cpu: "1000m"
requests:
memory: "1Gi" # Request 1GiB of memory
nvidia.com/gpu: 1
ephemeral-storage: "15Gi" # Request 15GiB of ephemeral storage
cpu: "500m"
ports:
- containerPort: 5005 # Port to expose
env:
- name: GGML_CUDA
value: "on"
command: ["python", "/app/model.py"]
---
apiVersion: v1
kind: Service
metadata:
name: llama-service
namespace: llama-namespace # Specify the namespace
spec:
selector:
app: llama
ports:
- protocol: TCP
port: 80 # External port
targetPort: 5005 # Port on the container
type: LoadBalancer