Skip to content

Commit c85bffd

Browse files
committed
Refactor Helm charts to allow a different chart schema per web app
1 parent 9cd5694 commit c85bffd

38 files changed

+410
-154
lines changed

.github/workflows/build-push-artifacts.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
images:
2929
- 'web-apps/**'
3030
chart:
31-
- 'chart/**'
31+
- 'charts/**'
3232
3333
# Job to build container images
3434
build_push_images:
@@ -96,6 +96,7 @@ jobs:
9696
- name: Publish Helm charts
9797
uses: azimuth-cloud/github-actions/helm-publish@master
9898
with:
99+
directory: charts
99100
token: ${{ secrets.GITHUB_TOKEN }}
100101
version: ${{ steps.semver.outputs.version }}
101102
app-version: ${{ steps.semver.outputs.short-sha }}

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ test-values.y[a]ml
1111
**venv*/
1212

1313
# Helm chart stuff
14-
chart/Chart.lock
15-
chart/charts
14+
charts/*/Chart.lock
15+
charts/*/charts
1616

1717
# Python stuff
1818
**/build/

chart/ci/image-analysis-ui-values.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

chart/values.schema.json

Lines changed: 0 additions & 123 deletions
This file was deleted.

charts/azimuth-chat/Chart.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: v2
2+
name: azimuth-llm-chat
3+
description: HuggingFace vision model serving along with a simple web interface.
4+
maintainers:
5+
- name: "Scott Davidson"
6+
7+
8+
type: application
9+
10+
version: 0.1.0
11+
12+
appVersion: "0.1.0"
13+
14+
icon: https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo.svg
15+
16+
annotations:
17+
azimuth.stackhpc.com/label: HuggingFace Image Analysis
18+
19+
dependencies:
20+
- name: azimuth-llm
21+
version: 0.1.0
22+
repository: "file://../azimuth-llm/"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
controls:
2+
/azimuth-llm/huggingface/model:
3+
type: TextControl
4+
required: true
5+
/azimuth-llm/huggingface/token:
6+
type: TextControl
7+
secret: true
8+
# Use mirror to mimic yaml anchor in base Helm chart
9+
/azimuth-llm/ui/appSettings/hf_model_name:
10+
type: MirrorControl
11+
path: /azimuth-llm/huggingface/model
12+
visuallyHidden: true
13+
# Azimuth UI doesn't handle json type ["integer","null"]
14+
# properly so we allow any type in JSON schema then
15+
# constrain to (optional) integer here.
16+
/azimuth-llm/api/modelMaxContextLength:
17+
type: IntegerControl
18+
minimum: 100
19+
step: 100
20+
required: false
21+
22+
sortOrder:
23+
- /azimuth-llm/huggingface/model
24+
- /azimuth-llm/huggingface/token
25+
- /azimuth-llm/ui/appSettings/hf_model_instruction
26+
- /azimuth-llm/ui/appSettings/page_title
27+
- /azimuth-llm/api/image/version
28+
- /azimuth-llm/ui/appSettings/llm_temperature
29+
- /azimuth-llm/ui/appSettings/llm_max_tokens
30+
- /azimuth-llm/ui/appSettings/llm_frequency_penalty
31+
- /azimuth-llm/ui/appSettings/llm_presence_penalty
32+
- /azimuth-llm/ui/appSettings/llm_top_p
33+
- /azimuth-llm/ui/appSettings/llm_top_k
34+
- /azimuth-llm/api/modelMaxContextLength
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
azimuth-llm:
2+
api:
3+
enabled: false
4+
ui:
5+
service:
6+
zenith:
7+
enabled: false
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
{
2+
"type": "object",
3+
"properties": {
4+
"azimuth-llm": {
5+
"type": "object",
6+
"properties": {
7+
"huggingface": {
8+
"type": "object",
9+
"properties": {
10+
"model": {
11+
"type": "string",
12+
"title": "Model",
13+
"description": "The [HuggingFace model](https://huggingface.co/models) to deploy (see [here](https://github.com/stackhpc/azimuth-llm?tab=readme-ov-file#tested-models) for a list of tested models).",
14+
"default": "microsoft/Phi-3.5-mini-instruct"
15+
},
16+
"token": {
17+
"type": [
18+
"string",
19+
"null"
20+
],
21+
"title": "Access Token",
22+
"description": "A HuggingFace [access token](https://huggingface.co/docs/hub/security-tokens). Required for [gated models](https://huggingface.co/docs/hub/en/models-gated) (e.g. Llama 3)."
23+
}
24+
},
25+
"required": [
26+
"model"
27+
]
28+
},
29+
"api": {
30+
"type": "object",
31+
"properties": {
32+
"modelMaxContextLength": {
33+
"title": "Model Context Length",
34+
"description": "An override for the maximum context length to allow, if the model's default is not suitable."
35+
},
36+
"image": {
37+
"type": "object",
38+
"properties": {
39+
"version": {
40+
"type": "string",
41+
"title": "Backend vLLM version",
42+
"description": "The vLLM version to use as a backend. Must be a version tag from [this list](https://github.com/vllm-project/vllm/tags)",
43+
"default": "v0.6.3"
44+
}
45+
}
46+
}
47+
}
48+
},
49+
"ui": {
50+
"type": "object",
51+
"properties": {
52+
"appSettings": {
53+
"type": "object",
54+
"properties": {
55+
"model_name": {
56+
"type": "string",
57+
"title": "Model Name",
58+
"description": "Model name supplied to the OpenAI client in frontend web app. Should match huggingface.model above."
59+
},
60+
"model_instruction": {
61+
"type": "string",
62+
"title": "Instruction",
63+
"description": "The initial system prompt (i.e. the hidden instruction) to use when generating responses.",
64+
"default": "You are a helpful AI assistant. Please respond appropriately."
65+
},
66+
"page_title": {
67+
"type": "string",
68+
"title": "Page Title",
69+
"description": "The title to display at the top of the chat interface.",
70+
"default": "Large Language Model"
71+
},
72+
"llm_max_tokens": {
73+
"type": "integer",
74+
"title": "Max Tokens",
75+
"description": "The maximum number of new [tokens](https://platform.openai.com/docs/api-reference/chat/create#chat-create-max_tokens) to generate for each LLM responses.",
76+
"default": 1000
77+
},
78+
"llm_temperature": {
79+
"type": "number",
80+
"title": "LLM Temperature",
81+
"description": "The [temperature](https://platform.openai.com/docs/api-reference/chat/create#chat-create-temperature) value to use when generating LLM responses.",
82+
"default": 0,
83+
"minimum": 0,
84+
"maximum": 2
85+
},
86+
"llm_top_p": {
87+
"type": "number",
88+
"title": "LLM Top P",
89+
"description": "The [top p](https://platform.openai.com/docs/api-reference/chat/create#chat-create-top_p) value to use when generating LLM responses.",
90+
"default": 1,
91+
"exclusiveMinimum": 0,
92+
"maximum": 1
93+
},
94+
"llm_top_k": {
95+
"type": "integer",
96+
"title": "LLM Top K",
97+
"description": "The [top k](https://docs.vllm.ai/en/stable/dev/sampling_params.html) value to use when generating LLM responses (must be an integer).",
98+
"default": -1,
99+
"minimum": -1
100+
},
101+
"llm_presence_penalty": {
102+
"type": "number",
103+
"title": "LLM Presence Penalty",
104+
"description": "The [presence penalty](https://platform.openai.com/docs/api-reference/chat/create#chat-create-presence_penalty) to use when generating LLM responses.",
105+
"default": 0,
106+
"minimum": -2,
107+
"maximum": 2
108+
},
109+
"llm_frequency_penalty": {
110+
"type": "number",
111+
"title": "LLM Frequency Penalty",
112+
"description": "The [frequency_penalty](https://platform.openai.com/docs/api-reference/chat/create#chat-create-frequency_penalty) to use when generating LLM responses.",
113+
"default": 0,
114+
"minimum": -2,
115+
"maximum": 2
116+
}
117+
},
118+
"required": [
119+
"model_name",
120+
"model_instruction"
121+
]
122+
}
123+
}
124+
}
125+
}
126+
}
127+
}
128+
}

charts/azimuth-chat/values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
azimuth-llm:
2+
huggingface:
3+
model: &model-name microsoft/Phi-3.5-mini-instruct
4+
ui:
5+
image:
6+
repository: ghcr.io/stackhpc/azimuth-llm-chat-ui
7+
appSettings:
8+
model_name: *model-name
9+
model_instruction: "You are a helpful AI assistant; please respond appropriately."
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: v2
2+
name: azimuth-llm-image-analysis
3+
description: HuggingFace vision model serving along with a simple web interface.
4+
maintainers:
5+
- name: "Scott Davidson"
6+
7+
8+
type: application
9+
10+
version: 0.1.0
11+
12+
appVersion: "0.1.0"
13+
14+
icon: https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo.svg
15+
16+
annotations:
17+
azimuth.stackhpc.com/label: HuggingFace Image Analysis
18+
19+
dependencies:
20+
- name: azimuth-llm
21+
version: 0.1.0
22+
repository: "file://../azimuth-llm/"

0 commit comments

Comments
 (0)