sombaner / aro-azureopenai

Repository for Deploy A Gradio App with Azure OpenAI as a backend LLM
GNU Affero General Public License v3.0
0 stars 0 forks source link

Azure OpenAI ARO Application

Repository for Deploy A Gradio App with Azure OpenAI as a backend LLM within Azure Red Hat OpenShift (ARO) cluster.

Azure OpenAI App within ARO Cluster - 0

Azure OpenAI App within ARO Cluster 0

Azure OpenAI App within ARO Cluster - 2

Azure OpenAI App within ARO Cluster - 3

NOTE: The model used in Azure OpenAI is the GPT-3.5 Turbo, which can be changed to utilize other models such as GPT-4.

Deploy FrontEnd App that uses Azure OpenAI

kubectl apply -k manifests/overlays/ocp

NOTE: Use kubectl apply -k manifests/overlays/k8s if you want to deploy it in Vanilla K8s

Add Azure OpenAI credentials into Kubernetes secrets

export OPENAI_API_BASE="https://MY_FANCY_URL.openai.azure.com/"
export OPENAI_API_KEY="your-api-key"
export NAMESPACE="aro-azureopenai"
cat <<EOF | kubectl apply -n $NAMESPACE -f -
apiVersion: v1
kind: Secret
metadata:
  name: azure-openai
type: Opaque
data:
  OPENAI_API_BASE: $(echo -n "$OPENAI_API_BASE" | base64)
  OPENAI_API_KEY: $(echo -n "$OPENAI_API_KEY" | base64)
EOF

Local Development

export OPENAI_API_BASE="xxx"
export OPENAI_API_KEY="xxx"
python main.py