-
Notifications
You must be signed in to change notification settings - Fork 65
/
cheatsheet.txt
48 lines (36 loc) · 1.58 KB
/
cheatsheet.txt
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
# If you build on Mac M1 but want to deploy on amd64
podman build --platform="linux/amd64" -t linuxbot-app .
# podman
# either run ollama natively or in a container
# natively
ollama serve
ollama pull zephyr
streamlit run app.py --server.port 8080
# or run the streamlit app as container
podman run --name linuxbot-app -p 8080:8080 --shm-size=2gb -it --rm localhost/linuxbot-app
# container
podman network create linuxbot
# dns should be enabled
podman network inspect linxubot
podman run --net linuxbot --name ollama --rm docker.io/ollama/ollama:latest
podman run --net linuxbot --name linuxbot-app -p 8080:8080 --shm-size=2gb -e OLLAMA_HOST=ollama -it --rm localhost/linuxbot-app
# NVIDIA GPU support
# generate the CDI spec accorting to
# https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/cdi-support.html
# check that your GPU is detected
podman run --rm --device nvidia.com/gpu=all --security-opt=label=disable ubuntu nvidia-smi -L
# then run ollama with GPU support
podman run --rm --net linuxbot --name ollama --device nvidia.com/gpu=all --security-opt=label=disable ollama
# openshift
oc new-project darmstadt-workshop
oc apply -f deployments/ollama.yaml
# or with GPU support
oc apply -f deployments/ollama-gpu.yaml
oc apply -f deployments/linuxbot.yaml
# to debug with curl
oc run mycurl --image=curlimages/curl -it -- sh
oc attach mycurl -c mycurl -i -t
oc delete pod mycurl
# download a model and test it
curl -X POST http://ollama:11434/api/pull -d '{"name": "zephyr"}'
curl -X POST http://ollama:11434/api/generate -d '{"model": "zephyr", "prompt": "Why is the sky blue?"}'