Skip to content

Commit

Permalink
llm
Browse files Browse the repository at this point in the history
  • Loading branch information
wangzheng422 committed Nov 14, 2023
1 parent aa87415 commit 3e9f9ca
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 12 deletions.
76 changes: 64 additions & 12 deletions redhat/ocp4/4.13/4.13.gpu.llm.md
Original file line number Diff line number Diff line change
Expand Up @@ -867,8 +867,8 @@ spec:
preferredDuringSchedulingIgnoredDuringExecution: []
persistentSpec:
enabled: true
storageClassName: local-volume
volumeSize: 4500Gi
storageClassName: hostpath-csi
volumeSize: 20Gi
createServiceAccount: true
username: [email protected]
clusterCredentialSecretRole: ''
Expand Down Expand Up @@ -907,7 +907,7 @@ oc get route -n llm-demo

oc get secret rec -n llm-demo -o jsonpath="{.data}" | jq 'map_values(@base64d)'
# {
# "password": "PP1BuaXT",
# "password": "gv7AZB8P",
# "username": "[email protected]"
# }

Expand Down Expand Up @@ -955,6 +955,14 @@ oc create --save-config -n llm-demo -f ${BASE_DIR}/data/install/redis-db.yaml

# oc delete -n llm-demo -f ${BASE_DIR}/data/install/redis-db.yaml

oc get RedisEnterpriseDatabase/my-doc -n llm-demo -o json | jq .status.internalEndpoints
# [
# {
# "host": "redis-13858.rec.llm-demo.svc.cluster.local",
# "port": 13858
# }
# ]

oc get secret -n llm-demo redb-my-doc -o jsonpath="{.data}" | jq 'map_values(@base64d)'
# {
# "password": "ABmKLkR0",
Expand All @@ -963,13 +971,14 @@ oc get secret -n llm-demo redb-my-doc -o jsonpath="{.data}" | jq 'map_values(@ba
# "service_names": "my-doc, my-doc-headless"
# }

# VAR_HOST=`oc get RedisEnterpriseDatabase/my-doc -n llm-demo -o json | jq .status.internalEndpoints[0].host -r`
VAR_PWD=`oc get secret -n llm-demo redb-my-doc -o jsonpath="{.data}" | jq 'map_values(@base64d)' | jq -r .password`
VAR_PORT=`oc get secret -n llm-demo redb-my-doc -o jsonpath="{.data}" | jq 'map_values(@base64d)' | jq -r .port`

VAR_REDIS="redis://default:${VAR_PWD}@my-doc-headless.llm-demo.svc.cluster.local:${VAR_PORT}"

echo $VAR_REDIS
# redis://default:ABmKLkR0@my-doc-headless.llm-demo.svc.cluster.local:13858
# redis://default:Ygg8FgJc@my-doc-headless.llm-demo.svc.cluster.local:16432


```
Expand Down Expand Up @@ -1002,28 +1011,71 @@ gradio-hftgi-rag-redis

- https://github.com/rh-aiservices-bu/llm-on-openshift/blob/main/examples/ui/gradio/gradio-hftgi-rag-redis/README.md

```bash
# https://github.com/wangzheng422/llm-on-openshift/tree/wzh/examples/ui/gradio/gradio-hftgi-rag-redis/deployment/wzh

oc create -n llm-demo -f ${BASE_DIR}/wzh/
### create index

# oc delete -n llm-demo -f ${BASE_DIR}/wzh/
Langchain-Redis-Ingest.ipynb

![](imgs/2023-11-08-23-43-00.png)

```
![](imgs/2023-11-08-23-44-59.png)

open this notebook
- https://github.com/rh-aiservices-bu/llm-on-openshift/blob/main/examples/notebooks/langchain/Langchain-Redis-Ingest.ipynb

### Langchain-Redis-Ingest.ipynb
run it step by step, or all

![](imgs/2023-11-08-23-43-00.png)
![](imgs/2023-11-15-00-05-56.png)

![](imgs/2023-11-08-23-44-59.png)
### deploy

```bash

# we need to build image for module cache
# on vultr
systemctl enable --now docker.service

mkdir -p /data/llm-build
cd /data/llm-build

cat << EOF > /data/llm-build/build.dockerfile
FROM quay.io/rh-aiservices-bu/gradio-hftgi-rag-redis:latest
RUN python app.py || true
EOF

docker build -t quay.io/wangzheng422/qimgs:2023-11-14-gradio-hftgi-rag-redis-01 -f build.dockerfile .

docker push quay.io/wangzheng422/qimgs:2023-11-14-gradio-hftgi-rag-redis-01


# docker run -it -d \
# --name llm-build \
# --gpus all \
# --shm-size 1g \
# quay.io/rh-aiservices-bu/gradio-hftgi-rag-redis:latest

# docker export llm-build | docker import - quay.io/wangzheng422/qimgs:2023-11-14-gradio-hftgi-rag-redis

# docker push quay.io/wangzheng422/qimgs:2023-11-14-gradio-hftgi-rag-redis

# go back to helper node
# https://github.com/wangzheng422/llm-on-openshift/tree/wzh/examples/ui/gradio/gradio-hftgi-rag-redis/deployment/wzh

oc create -n llm-demo -f ${BASE_DIR}/wzh/

# oc delete -n llm-demo -f ${BASE_DIR}/wzh/

```

then, you can see the webpage:

![](imgs/2023-11-15-00-07-26.png)

![](imgs/2023-11-15-00-07-42.png)


# end

![](imgs/2023-11-09-14-39-44.png)
Expand Down
Binary file added redhat/ocp4/4.13/imgs/2023-11-15-00-05-56.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added redhat/ocp4/4.13/imgs/2023-11-15-00-07-26.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added redhat/ocp4/4.13/imgs/2023-11-15-00-07-42.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3e9f9ca

Please sign in to comment.