This repository automates the creation of a GPU enabled cluster in GCP, and then uses Helm to automate the deployment of an Ollama instance configured to run Llama2 on startup. It also sets up a proxy router to expose the Ollama service to Morpheus. It exposes the proxy router service on port 3333
Before beginning, ensure you have the following:
- Wallet Private Key: A private key for a wallet funded with ETH and MOR tokens.
- Terraform CLI: Installed to manage infrastructure as code.
- used to create the cluster and deploy the necessary resources
- gcloud CLI: Installed with the Kubernetes authentication plugin enabled.
- used to talk to the cluster after deployment
- google service account credentials: For provisioning cluster resources
- this account must have google kubernetes engine and compute engine access
Follow these steps to deploy the Ollama and Proxy Router setup:
- Set Environment Variables: Configure necessary variables for your deployment.
- this will be different depending on if you use local state, remote state, or terraform cloud.
- Initialize Terraform:
terraform init
- Plan the Infrastructure:
terraform plan
- Apply the Configuration:
terraform apply
- Retrieve Kubernetes Endpoint IP: After deployment, get the external IP of the proxy-router service endpoint.
In future updates, these steps may be automated.
-
Connect to cluster via kubernetes
- gcloud container clusters get-credentials mln-cluster --region us-west1
-
Expose the Proxy Service:
- Forward port 8082 of the proxy service:
kubectl port-forward svc/proxy-router 8082:8082
- Forward port 8082 of the proxy service:
-
Verify router is working
- check kubectl logs
- verify swagger api http://localhost:8082/swagger/index.html
-
Authorize diamond contract to act on behalf of wallet:
- todo
-
Allowance?
- todo
-
Register Provider:
- Use the following command to register the provider:
-
Register Model:
- Register the Llama2 model:
-
Place a Bid:
- Submit a bid:
-
Test functionality
- todo
- Trigger on Pull request and Merge
- Setup a second environment for mainnet
- DNS?
- create a seperate charts repo to seperate charts from cluster
- seperate proxy from llm deployment
- better model config mounting and registration process
- more securely capture, store, and use secrets
- tidy up values.yaml and expose more attributes to allow greater control
- create seperate repo for building/publishing router docker image.
- add docker compose files and instructions somewhere for local implementations