mirror of
https://github.com/sroecker/LLM_AppDev-HandsOn.git
synced 2026-02-06 10:47:18 +00:00
49 lines
1.6 KiB
Plaintext
49 lines
1.6 KiB
Plaintext
# 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?"}'
|