Skip to content

Commit 1e715e5

Browse files
authored
Conditional Ollama on VM GPU only (#208)
* Conditional Ollama on VM GPU only * Maintain Helm Charts through Tags
1 parent 3e46dc3 commit 1e715e5

File tree

6 files changed

+43
-15
lines changed

6 files changed

+43
-15
lines changed

.github/workflows/documentation.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,30 @@ jobs:
7878
--source docs \
7979
--baseURL "${{ steps.pages.outputs.base_url }}/"
8080
81-
- name: Package Helm chart
81+
- name: Package Tags Helm chart
82+
run: |
83+
TAGS=$(git tag --sort=creatordate)
84+
for TAG in $TAGS; do
85+
echo "Processing tag: $TAG"
86+
87+
# Create a temporary worktree to avoid changing the current working directory
88+
WORKDIR=$(mktemp -d)
89+
git worktree add "$WORKDIR" "$TAG"
90+
91+
# Package Helm chart for this tag
92+
helm package "$WORKDIR/helm" -d docs/public/helm --debug
93+
94+
# Clean up
95+
git worktree remove "$WORKDIR"
96+
done
97+
98+
- name: Package Main Helm chart
8299
run: |
83100
mkdir -p docs/public/helm
84-
helm package helm -d docs/public/helm
85-
helm repo index docs/public/helm --url "${{ steps.pages.outputs.base_url }}/helm"
101+
helm package helm -d docs/public/helm --debug
102+
103+
- name: Index Helm charts
104+
run: helm repo index docs/public/helm --url "${{ steps.pages.outputs.base_url }}/helm"
86105

87106
- name: Upload artifact
88107
uses: actions/upload-pages-artifact@v3

docs/content/advanced/iac.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ While the **IaC** can be run from a command-line with prior experience, the step
2020

2121
## Virtual Machine
2222

23-
The Virtual Machine (VM) deployment provisions both the {{< short_app_ref >}} API Server and GUI Client together in an "All-in-One" configuration for experimentation and development. As part of the deployment, one local Large Language Model and one Embedding Model is made available out-of-the-box. There will be an option to deploy on a **GPU**, which will be more expensive then a **CPU** but will perform much better with the pre-deployed Models.
23+
The Virtual Machine (VM) deployment provisions both the {{< short_app_ref >}} API Server and GUI Client together in an "All-in-One" configuration for experimentation and development.
2424

25-
{{% notice style="code" title="Soooo Sloooow..." icon="traffic-light" %}}
26-
If deploying the VM IaC on a **CPU**, we recommend [configuring additional, external models](/client/configuration/model_config) for better performance.
25+
There will be an option to deploy on a **GPU**, which will be more expensive then a **CPU** but will, as part of the deployment, make available one local Large Language Model and one Embedding Model for use out-of-the-box.
26+
27+
{{% notice style="code" title="Models Needed!" icon="traffic-light" %}}
28+
If deploying the VM IaC on a **CPU**, you will need to [configure a model](/client/configuration/model_config) for functionality.
2729
{{% /notice %}}
2830

2931
### Configure Variables

opentofu/modules/vm/locals.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ locals {
99
oci_region = var.region
1010
db_name = var.adb_name
1111
db_password = var.adb_password
12+
install_ollama = var.vm_is_gpu_shape ? true : false
1213
})
1314

1415
vm_compute_shape = var.vm_is_gpu_shape ? var.compute_gpu_shape : var.compute_cpu_shape

opentofu/modules/vm/templates/cloudinit-compute.tpl

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@ write_files:
4040
#!/bin/env bash
4141
mkdir -p /app
4242
chown oracleai:oracleai /app
43-
curl -fsSL https://ollama.com/install.sh | sh
44-
systemctl enable ollama
45-
systemctl daemon-reload
46-
systemctl restart ollama
43+
if ${install_ollama}; then
44+
curl -fsSL https://ollama.com/install.sh | sh
45+
systemctl enable ollama
46+
systemctl daemon-reload
47+
systemctl restart ollama
48+
fi
4749
systemctl stop firewalld.service
4850
firewall-offline-cmd --zone=public --add-port 8501/tcp
4951
firewall-offline-cmd --zone=public --add-port 8000/tcp
@@ -85,8 +87,10 @@ write_files:
8587
unzip -o /tmp/wallet.zip -d /app/tns_admin
8688

8789
# Install Models
88-
ollama pull llama3.1
89-
ollama pull mxbai-embed-large
90+
if ${install_ollama}; then
91+
ollama pull llama3.1
92+
ollama pull mxbai-embed-large
93+
fi
9094

9195
# Wait for python modules to finish
9296
wait $INSTALL_PID
@@ -100,7 +104,9 @@ write_files:
100104
export DB_PASSWORD='${db_password}'
101105
export DB_DSN='${db_name}_TP'
102106
export DB_WALLET_PASSWORD='${db_password}'
103-
export ON_PREM_OLLAMA_URL=http://127.0.0.1:11434
107+
if ${install_ollama}; then
108+
export ON_PREM_OLLAMA_URL=http://127.0.0.1:11434
109+
fi
104110
# Clean Cache
105111
find /app -type d -name "__pycache__" -exec rm -rf {} \;
106112
find /app -type d -name ".numba_cache" -exec rm -rf {} \;

opentofu/provider.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ terraform {
66
required_providers {
77
oci = {
88
source = "oracle/oci"
9-
version = "~> 7.7" // Last evaluated 1-Jul-2025
9+
version = "~> 7.8" // Last evaluated 8-Jul-2025
1010
}
1111
}
1212
required_version = ">= 1.5"

src/server/bootstrap/model_def.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def main() -> list[Model]:
159159
"url": os.environ.get("ON_PREM_OLLAMA_URL", default="http://127.0.0.1:11434"),
160160
"api_key": "",
161161
"openai_compat": True,
162-
"max_chunk_size": 512,
162+
"max_chunk_size": 8192,
163163
},
164164
]
165165

0 commit comments

Comments
 (0)