The following cloud application provides a motivational speech generation platform, leveraging a Large-Language Model (LLM) and Text-to-Speech (TTS) technology. The user can have a text created for the speech and can provide some input and select a mood. After text creation the user can review the text, can give feedback to the text and can generate an audio from this text. The user also have the opportunity to choose from a suggestion list with motivation speeches, that are stored in the database.
This section outlines the functionality that each component of the system implements:
- Text Generator: Users can input text and select a mood to generate motivational speeches.
- Text Preview: Users can preview the generated text before converting it to audio.
- Motivational Speech Suggestions: Pre-stored motivational speeches are fetched from the database as suggestions.
- Play Audio Button: Users can listen to the generated motivational speech.
- Input: User input combined with a chosen mood.
- Output: Custom-generated motivational speeches tailored to the input and mood.
- Input: The generated motivational speeches from the LLM.
- Output: An audio file (WAV format) of the speech.
- Storage: Stores user queries, generated speeches, and their respective audio files.
- Caching: Uses Memcached to optimize access and retrieval of frequently used data.
- Ingress Loadbalancer: Routes external traffic to the web application within the Kubernetes cluster.
Screencast.mp4
Follow these steps to deploy the application using Minikube and Kubernetes.
Start your Minikube cluster with enough memory and CPU, and enable the Ingress addon:
minikube start --memory=7790 --cpus=8 --addons=Ingress
minikube addons enable ingress
Start your Minikube cluster with enough memory and CPU, and enable the Ingress addon:
@FOR /f "tokens=*" %i IN ('minikube -p minikube docker-env --shell cmd') DO @%i
#or
& minikube docker-env | Invoke-Expression
# or
minikube docker-env
kubectl create namespace ms
Deploy the LLM Service within the llm folder.
First install helm on the machine (https://helm.sh/) and use the helm chart for ollama (https://github.com/otwld/ollama-helm)
helm repo add ollama-helm https://otwld.github.io/ollama-helm/
helm repo update
helm install ollama ollama-helm/ollama --namespace ms
Modify the values.yaml to modify the helm chart. Right now we have defined which models should be pulled at the startup of the container. There could be added more models. (Motivational-Speech-Service\llm\values.yaml)
helm repo update
# navigate to the folder where the values.yaml is stored: /llm
helm upgrade ollama ollama-helm/ollama --namespace ms --values values.yaml
The pod needs a few minutes to come up, because the model is already pulled.
Build and deploy the TTS service within the tts-service folder:
docker build --no-cache -t tts-service .
kubectl apply -f tts-deployment.yaml -n ms
kubectl apply -f tts-service.yaml -n ms
kubectl apply -f mariadb-deployment.yaml -n ms
kubectl apply -f k8s-mariadb-service.yaml -n ms
docker build --no-cache -t my-super-web-app .
kubectl apply -f app-deployment-minikube.yaml -n ms
kubectl apply -f app-service-and-ingress.yaml -n ms
To access the deployed web application, use the following command to retrieve the URL:
minikube service -n ms my-super-app-service --url
Delete the entire namespace and everything inside it:
kubectl delete namespace ms
Or if you want to delete them manually:
kubectl delete service my-app-mariadb-service -n ms
kubectl delete service my-super-app-service -n ms
kubectl delete service tts-service -n ms
kubectl delete service ollama -n ms
kubectl delete deployment mariadb-deployment -n ms
kubectl delete deployment my-super-app-deployment -n ms
kubectl delete deployment tts-deployment -n ms
kubectl delete deployment ollama -n ms
- Julia Hanak
- Julia Wellbrink
- Gurleen Kaur
- Denis Trautner