diff --git a/neon_diana_utils/configuration.py b/neon_diana_utils/configuration.py index 186ff827..34c25b46 100644 --- a/neon_diana_utils/configuration.py +++ b/neon_diana_utils/configuration.py @@ -87,7 +87,12 @@ def make_llm_bot_config(): configuration = {"llm_bots": dict()} if click.confirm("Configure ChatGPT Personas?"): configuration['llm_bots']['chat_gpt'] = persona_config['chat_gpt'] - # TODO: Add other LLM personas here + if click.confirm("Configure PaLM2 Personas?"): + configuration['llm_bots']['palm2'] = persona_config['palm2'] + if click.confirm("Configure Gemini Personas?"): + configuration['llm_bots']['gemini'] = persona_config['gemini'] + if click.confirm("Configure Claude Personas?"): + configuration['llm_bots']['claude'] = persona_config['claude'] return configuration @@ -163,7 +168,7 @@ def make_keys_config(write_config: bool, click.confirm("Is this configuration correct?") chatgpt_config = dict() - if click.confirm("Configure ChatGPT Service?"): + if click.confirm("Configure ChatGPT LLM?"): config_confirmed = False while not config_confirmed: gpt_key = click.prompt("ChatGPT API Key", type=str) @@ -189,7 +194,7 @@ def make_keys_config(write_config: bool, click.confirm("Is this configuration correct?") fastchat_config = dict() - if click.confirm("Configure FastChat Service?"): + if click.confirm("Configure FastChat LLM?"): config_confirmed = False while not config_confirmed: model = click.prompt("FastChat Model", type=str, @@ -213,11 +218,93 @@ def make_keys_config(write_config: bool, click.echo(pformat(fastchat_config)) config_confirmed = click.confirm("Is this configuration correct?") + palm2_config = dict() + if click.confirm("Configure PaLM2 LLM?"): + config_confirmed = False + while not config_confirmed: + role = click.prompt("PaLM2 Role", type=str, + default="You are trying to give a short " + "answer in less than 40 words.") + context = click.prompt("PaLM2 context depth", type=int, + default=3) + max_tokens = click.prompt("Max number of tokens in responses", + type=int, default=100) + num_processes = click.prompt( + "Number of queries to handle in parallel", + type=int, default=1) + palm2_config = { + "key_path": "/config/neon/google.json", + "role": role, + "context_depth": context, + "max_tokens": max_tokens, + "num_parallel_processes": num_processes + } + click.echo(pformat(palm2_config)) + config_confirmed = click.confirm("Is this configuration correct?") + + gemini_config = dict() + if click.confirm("Configure Gemini LLM?"): + config_confirmed = False + while not config_confirmed: + model = click.prompt("Gemini Model", type=str, + default="gemini-pro") + role = click.prompt("Gemini Role", type=str, + default="You are trying to give a short " + "answer in less than 40 words.") + context = click.prompt("Gemini context depth", type=int, + default=3) + max_tokens = click.prompt("Max number of tokens in responses", + type=int, default=100) + num_processes = click.prompt( + "Number of queries to handle in parallel", + type=int, default=1) + gemini_config = { + "key_path": "/config/neon/google.json", + "model": model, + "role": role, + "context_depth": context, + "max_tokens": max_tokens, + "num_parallel_processes": num_processes + } + click.echo(pformat(gemini_config)) + config_confirmed = click.confirm("Is this configuration correct?") + + claude_config = dict() + if click.confirm("Configure Anthropic Claude LLM?"): + config_confirmed = False + while not config_confirmed: + anthropic_key = click.prompt("Antrhopic API Key", type=str) + openai_key = click.prompt("OpenAI API Key", type=str, + default=chatgpt_config.get('key')) + model = click.prompt("Anthropic Model", type=str, + default="claude-2") + role = click.prompt("Role", type=str, + default="You are trying to give a short " + "answer in less than 40 words.") + context = click.prompt("Context depth", type=int, default=3) + max_tokens = click.prompt("Maximum tokens in responses", type=int, + default=256) + claude_config = { + "key": anthropic_key, + "openai_key": openai_key, + "model": model, + "role": role, + "context_depth": context, + "max_tokens": max_tokens + } + click.echo(pformat(claude_config)) + config_confirmed = \ + click.confirm("Is this configuration correct?") + config = {"keys": {"api_services": api_services, "emails": email_config, "track_my_brands": brands_config}, "LLM_CHAT_GPT": chatgpt_config, - "FastChat": fastchat_config + "LLM_FASTCHAT": fastchat_config, + "LLM_PALM2": palm2_config, + "LLM_GEMINI": gemini_config, + "LLM_CLAUDE": claude_config, + "FastChat": fastchat_config # TODO: Backwards-compat. only } if write_config: click.echo(f"Writing configuration to {output_file}") @@ -509,6 +596,18 @@ def configure_backend(username: str = None, llm_config = make_llm_bot_config() else: llm_config = dict() + # Check if google.json file is expected + if any((keys_config['LLM_PALM2'], keys_config['LLM_GEMINI'])): + handled = False + while not handled: + cred = click.prompt("Path to Google credential file", type=str) + cred = expanduser(cred) + if not isfile(cred): + click.echo(f"Invalid path ({cred}). Please, try again.") + else: + shutil.copyfile(cred, join(dirname(diana_config), + "google.json")) + handled = True config = {**{"MQ": {"users": mq_auth_config, "server": "neon-rabbitmq", "port": 5672}}, diff --git a/neon_diana_utils/helm_charts/backend/diana-backend/Chart.yaml b/neon_diana_utils/helm_charts/backend/diana-backend/Chart.yaml index 6ca71972..86540d7d 100644 --- a/neon_diana_utils/helm_charts/backend/diana-backend/Chart.yaml +++ b/neon_diana_utils/helm_charts/backend/diana-backend/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.14 +version: 0.1.22 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to @@ -35,5 +35,5 @@ dependencies: version: 0.0.11 repository: file://../http-services - name: diana-mq - version: 0.0.9 + version: 0.0.16 repository: file://../mq-services \ No newline at end of file diff --git a/neon_diana_utils/helm_charts/backend/diana-backend/templates/_config-secret.tpl b/neon_diana_utils/helm_charts/backend/diana-backend/templates/_diana-config-secret.tpl similarity index 100% rename from neon_diana_utils/helm_charts/backend/diana-backend/templates/_config-secret.tpl rename to neon_diana_utils/helm_charts/backend/diana-backend/templates/_diana-config-secret.tpl diff --git a/neon_diana_utils/helm_charts/backend/diana-backend/templates/_google-config-secret.tpl b/neon_diana_utils/helm_charts/backend/diana-backend/templates/_google-config-secret.tpl new file mode 100644 index 00000000..5d2a7ddf --- /dev/null +++ b/neon_diana_utils/helm_charts/backend/diana-backend/templates/_google-config-secret.tpl @@ -0,0 +1,10 @@ +{{- define "google_json.secret"}} +apiVersion: v1 +kind: Secret +metadata: + name: {{ tpl .Values.backend.googleSecret . }} +type: Opaque +data: + "google.json": |- + {{ tpl .Values.backend.googleJson . }} +{{- end -}} \ No newline at end of file diff --git a/neon_diana_utils/helm_charts/backend/diana-backend/values.yaml b/neon_diana_utils/helm_charts/backend/diana-backend/values.yaml index 7868d73f..3a64eb45 100644 --- a/neon_diana_utils/helm_charts/backend/diana-backend/values.yaml +++ b/neon_diana_utils/helm_charts/backend/diana-backend/values.yaml @@ -6,8 +6,10 @@ ghTokenEncoded: '' dianaConfig: '' rabbitMqConfig: '' +googleJson: '' configSecret: diana-config +googleSecret: google-json letsencrypt: sslSecret: &ssl_secret letsencrypt-private-key diff --git a/neon_diana_utils/helm_charts/backend/mq-services/Chart.yaml b/neon_diana_utils/helm_charts/backend/mq-services/Chart.yaml index c17dc773..d38ab62f 100644 --- a/neon_diana_utils/helm_charts/backend/mq-services/Chart.yaml +++ b/neon_diana_utils/helm_charts/backend/mq-services/Chart.yaml @@ -3,30 +3,46 @@ name: diana-mq description: Deploy DIANA MQ Services type: application -version: 0.0.9 +version: 0.0.16 appVersion: "1.0.1a18" dependencies: - name: neon-api-proxy alias: neon-api-proxy - version: 0.0.5 + version: 0.0.6 repository: file://../../mq/neon-api-proxy - name: neon-brands-service alias: neon-brands-service - version: 0.0.5 + version: 0.0.6 repository: file://../../mq/neon-brands-service - name: neon-email-proxy alias: neon-email-proxy - version: 0.0.5 + version: 0.0.6 repository: file://../../mq/neon-email-proxy - name: neon-metrics-service alias: neon-metrics-service - version: 0.0.6 + version: 0.0.7 repository: file://../../mq/neon-metrics-service - name: neon-script-parser alias: neon-script-parser - version: 0.0.5 + version: 0.0.6 repository: file://../../mq/neon-script-parser - name: neon-llm-chatgpt alias: neon-llm-chatgpt - version: 0.0.6 + version: 0.0.7 repository: file://../../mq/neon-llm-chatgpt + - name: neon-llm-fastchat + alias: neon-llm-fastchat + version: 0.0.6 + repository: file://../../mq/neon-llm-fastchat + - name: neon-llm-claude + alias: neon-llm-claude + version: 0.0.2 + repository: file://../../mq/neon-llm-claude + - name: neon-llm-gemini + alias: neon-llm-gemini + version: 0.0.2 + repository: file://../../mq/neon-llm-gemini + - name: neon-llm-palm + alias: neon-llm-palm + version: 0.0.6 + repository: file://../../mq/neon-llm-palm diff --git a/neon_diana_utils/helm_charts/base/base-mq/Chart.yaml b/neon_diana_utils/helm_charts/base/base-mq/Chart.yaml index 3f5da972..ab008aa9 100644 --- a/neon_diana_utils/helm_charts/base/base-mq/Chart.yaml +++ b/neon_diana_utils/helm_charts/base/base-mq/Chart.yaml @@ -3,5 +3,5 @@ name: base-mq description: Library chart for basic MQ Services type: library -version: 0.0.5 +version: 0.0.10 appVersion: "1.0.1a18" diff --git a/neon_diana_utils/helm_charts/base/base-mq/templates/_deployment.tpl b/neon_diana_utils/helm_charts/base/base-mq/templates/_deployment.tpl index d4337e88..88c2e609 100644 --- a/neon_diana_utils/helm_charts/base/base-mq/templates/_deployment.tpl +++ b/neon_diana_utils/helm_charts/base/base-mq/templates/_deployment.tpl @@ -41,8 +41,15 @@ spec: - name: config projected: sources: + {{- if .Values.configSecrets }} + {{- range .Values.configSecrets }} + - secret: + name: {{ . }} + {{- end }} + {{ else }} - secret: name: {{ .Values.configSecret }} + {{- end }} {{- if .Values.persistentVolumeClaim }} - name: {{ .Values.persistentVolumeClaim.name }} persistentVolumeClaim: diff --git a/neon_diana_utils/helm_charts/mq/neon-api-proxy/Chart.yaml b/neon_diana_utils/helm_charts/mq/neon-api-proxy/Chart.yaml index 1892e526..3dccd312 100644 --- a/neon_diana_utils/helm_charts/mq/neon-api-proxy/Chart.yaml +++ b/neon_diana_utils/helm_charts/mq/neon-api-proxy/Chart.yaml @@ -3,10 +3,10 @@ name: neon-api-proxy description: Deploy an MQ API Proxy type: application -version: 0.0.5 +version: 0.0.6 appVersion: "1.0.1a18" dependencies: - name: base-mq - version: 0.0.5 + version: 0.0.10 repository: file://../../base/base-mq \ No newline at end of file diff --git a/neon_diana_utils/helm_charts/mq/neon-brands-service/Chart.yaml b/neon_diana_utils/helm_charts/mq/neon-brands-service/Chart.yaml index 12b0b321..8a7c01d0 100644 --- a/neon_diana_utils/helm_charts/mq/neon-brands-service/Chart.yaml +++ b/neon_diana_utils/helm_charts/mq/neon-brands-service/Chart.yaml @@ -3,10 +3,10 @@ name: neon-brands-service description: Deploy an MQ Brands Service type: application -version: 0.0.5 +version: 0.0.6 appVersion: "1.0.1a18" dependencies: - name: base-mq - version: 0.0.5 + version: 0.0.10 repository: file://../../base/base-mq \ No newline at end of file diff --git a/neon_diana_utils/helm_charts/mq/neon-email-proxy/Chart.yaml b/neon_diana_utils/helm_charts/mq/neon-email-proxy/Chart.yaml index 048012c3..b7a7c917 100644 --- a/neon_diana_utils/helm_charts/mq/neon-email-proxy/Chart.yaml +++ b/neon_diana_utils/helm_charts/mq/neon-email-proxy/Chart.yaml @@ -3,10 +3,10 @@ name: neon-email-proxy description: Deploy an Email Proxy Service type: application -version: 0.0.5 +version: 0.0.6 appVersion: "1.0.1a18" dependencies: - name: base-mq - version: 0.0.5 + version: 0.0.10 repository: file://../../base/base-mq \ No newline at end of file diff --git a/neon_diana_utils/helm_charts/mq/neon-llm-chatgpt/Chart.yaml b/neon_diana_utils/helm_charts/mq/neon-llm-chatgpt/Chart.yaml index 4334f1ea..5a3eb3c1 100644 --- a/neon_diana_utils/helm_charts/mq/neon-llm-chatgpt/Chart.yaml +++ b/neon_diana_utils/helm_charts/mq/neon-llm-chatgpt/Chart.yaml @@ -3,10 +3,10 @@ name: neon-llm-chatgpt description: Deploy an LLM proxy for Chat GPT type: application -version: 0.0.6 +version: 0.0.7 appVersion: "1.0.1a18" dependencies: - name: base-mq - version: 0.0.5 + version: 0.0.10 repository: file://../../base/base-mq \ No newline at end of file diff --git a/neon_diana_utils/helm_charts/mq/neon-llm-claude/.helmignore b/neon_diana_utils/helm_charts/mq/neon-llm-claude/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/neon_diana_utils/helm_charts/mq/neon-llm-claude/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/neon_diana_utils/helm_charts/mq/neon-llm-claude/Chart.yaml b/neon_diana_utils/helm_charts/mq/neon-llm-claude/Chart.yaml new file mode 100644 index 00000000..5f452e6a --- /dev/null +++ b/neon_diana_utils/helm_charts/mq/neon-llm-claude/Chart.yaml @@ -0,0 +1,12 @@ +apiVersion: v2 +name: neon-llm-claude +description: Deploy an LLM proxy for Claude by Anthropic + +type: application +version: 0.0.2 +appVersion: "1.0.1a16" + +dependencies: + - name: base-mq + version: 0.0.10 + repository: file://../../base/base-mq \ No newline at end of file diff --git a/neon_diana_utils/helm_charts/mq/neon-llm-claude/templates/_helpers.tpl b/neon_diana_utils/helm_charts/mq/neon-llm-claude/templates/_helpers.tpl new file mode 100644 index 00000000..8afd6ed2 --- /dev/null +++ b/neon_diana_utils/helm_charts/mq/neon-llm-claude/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "neon-llm-service.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "neon-llm-service.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "neon-llm-service.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "neon-llm-service.labels" -}} +helm.sh/chart: {{ include "neon-llm-service.chart" . }} +{{ include "neon-llm-service.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "neon-llm-service.selectorLabels" -}} +app.kubernetes.io/name: {{ include "neon-llm-service.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "neon-llm-service.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "neon-llm-service.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/neon_diana_utils/helm_charts/mq/neon-llm-claude/templates/deployment.yaml b/neon_diana_utils/helm_charts/mq/neon-llm-claude/templates/deployment.yaml new file mode 100644 index 00000000..41547ae7 --- /dev/null +++ b/neon_diana_utils/helm_charts/mq/neon-llm-claude/templates/deployment.yaml @@ -0,0 +1 @@ +{{- include "base-mq.deployment" .}} \ No newline at end of file diff --git a/neon_diana_utils/helm_charts/mq/neon-llm-claude/templates/service.yaml b/neon_diana_utils/helm_charts/mq/neon-llm-claude/templates/service.yaml new file mode 100644 index 00000000..80730915 --- /dev/null +++ b/neon_diana_utils/helm_charts/mq/neon-llm-claude/templates/service.yaml @@ -0,0 +1 @@ +{{- include "base-mq.service" .}} \ No newline at end of file diff --git a/neon_diana_utils/helm_charts/mq/neon-llm-claude/values.yaml b/neon_diana_utils/helm_charts/mq/neon-llm-claude/values.yaml new file mode 100644 index 00000000..377cd390 --- /dev/null +++ b/neon_diana_utils/helm_charts/mq/neon-llm-claude/values.yaml @@ -0,0 +1,11 @@ +serviceName: backend-llm-claude +replicaCount: 1 +configSecret: diana-config +image: + repository: ghcr.io/neongeckocom/neon-llm-claude + pullPolicy: Always + tag: dev +resources: + requests: + memory: "600Mi" + cpu: "0.01" \ No newline at end of file diff --git a/neon_diana_utils/helm_charts/mq/neon-llm-fastchat/Chart.yaml b/neon_diana_utils/helm_charts/mq/neon-llm-fastchat/Chart.yaml index d86fe123..84a0456d 100644 --- a/neon_diana_utils/helm_charts/mq/neon-llm-fastchat/Chart.yaml +++ b/neon_diana_utils/helm_charts/mq/neon-llm-fastchat/Chart.yaml @@ -3,10 +3,10 @@ name: neon-llm-fastchat description: Deploy an LLM proxy for FastChat type: application -version: 0.0.5 +version: 0.0.6 appVersion: "1.0.1a18" dependencies: - name: base-mq - version: 0.0.5 + version: 0.0.10 repository: file://../../base/base-mq \ No newline at end of file diff --git a/neon_diana_utils/helm_charts/mq/neon-llm-gemini/.helmignore b/neon_diana_utils/helm_charts/mq/neon-llm-gemini/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/neon_diana_utils/helm_charts/mq/neon-llm-gemini/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/neon_diana_utils/helm_charts/mq/neon-llm-gemini/Chart.yaml b/neon_diana_utils/helm_charts/mq/neon-llm-gemini/Chart.yaml new file mode 100644 index 00000000..8ec242b3 --- /dev/null +++ b/neon_diana_utils/helm_charts/mq/neon-llm-gemini/Chart.yaml @@ -0,0 +1,12 @@ +apiVersion: v2 +name: neon-llm-gemini +description: Deploy an LLM proxy for Gemini by Google + +type: application +version: 0.0.2 +appVersion: "1.0.1a16" + +dependencies: + - name: base-mq + version: 0.0.10 + repository: file://../../base/base-mq \ No newline at end of file diff --git a/neon_diana_utils/helm_charts/mq/neon-llm-gemini/templates/_helpers.tpl b/neon_diana_utils/helm_charts/mq/neon-llm-gemini/templates/_helpers.tpl new file mode 100644 index 00000000..8afd6ed2 --- /dev/null +++ b/neon_diana_utils/helm_charts/mq/neon-llm-gemini/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "neon-llm-service.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "neon-llm-service.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "neon-llm-service.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "neon-llm-service.labels" -}} +helm.sh/chart: {{ include "neon-llm-service.chart" . }} +{{ include "neon-llm-service.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "neon-llm-service.selectorLabels" -}} +app.kubernetes.io/name: {{ include "neon-llm-service.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "neon-llm-service.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "neon-llm-service.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/neon_diana_utils/helm_charts/mq/neon-llm-gemini/templates/deployment.yaml b/neon_diana_utils/helm_charts/mq/neon-llm-gemini/templates/deployment.yaml new file mode 100644 index 00000000..41547ae7 --- /dev/null +++ b/neon_diana_utils/helm_charts/mq/neon-llm-gemini/templates/deployment.yaml @@ -0,0 +1 @@ +{{- include "base-mq.deployment" .}} \ No newline at end of file diff --git a/neon_diana_utils/helm_charts/mq/neon-llm-gemini/templates/service.yaml b/neon_diana_utils/helm_charts/mq/neon-llm-gemini/templates/service.yaml new file mode 100644 index 00000000..80730915 --- /dev/null +++ b/neon_diana_utils/helm_charts/mq/neon-llm-gemini/templates/service.yaml @@ -0,0 +1 @@ +{{- include "base-mq.service" .}} \ No newline at end of file diff --git a/neon_diana_utils/helm_charts/mq/neon-llm-gemini/values.yaml b/neon_diana_utils/helm_charts/mq/neon-llm-gemini/values.yaml new file mode 100644 index 00000000..fa6ae660 --- /dev/null +++ b/neon_diana_utils/helm_charts/mq/neon-llm-gemini/values.yaml @@ -0,0 +1,13 @@ +serviceName: backend-llm-gemini +replicaCount: 1 +configSecrets: + - diana-config + - google-json +image: + repository: ghcr.io/neongeckocom/neon-llm-gemini + pullPolicy: Always + tag: dev +resources: + requests: + memory: "600Mi" + cpu: "0.01" \ No newline at end of file diff --git a/neon_diana_utils/helm_charts/mq/neon-llm-palm/.helmignore b/neon_diana_utils/helm_charts/mq/neon-llm-palm/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/neon_diana_utils/helm_charts/mq/neon-llm-palm/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/neon_diana_utils/helm_charts/mq/neon-llm-palm/Chart.yaml b/neon_diana_utils/helm_charts/mq/neon-llm-palm/Chart.yaml new file mode 100644 index 00000000..1442107b --- /dev/null +++ b/neon_diana_utils/helm_charts/mq/neon-llm-palm/Chart.yaml @@ -0,0 +1,12 @@ +apiVersion: v2 +name: neon-llm-palm +description: Deploy an LLM proxy for Palm2 by Google + +type: application +version: 0.0.6 +appVersion: "1.0.1a16" + +dependencies: + - name: base-mq + version: 0.0.10 + repository: file://../../base/base-mq \ No newline at end of file diff --git a/neon_diana_utils/helm_charts/mq/neon-llm-palm/templates/_helpers.tpl b/neon_diana_utils/helm_charts/mq/neon-llm-palm/templates/_helpers.tpl new file mode 100644 index 00000000..8afd6ed2 --- /dev/null +++ b/neon_diana_utils/helm_charts/mq/neon-llm-palm/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "neon-llm-service.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "neon-llm-service.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "neon-llm-service.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "neon-llm-service.labels" -}} +helm.sh/chart: {{ include "neon-llm-service.chart" . }} +{{ include "neon-llm-service.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "neon-llm-service.selectorLabels" -}} +app.kubernetes.io/name: {{ include "neon-llm-service.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "neon-llm-service.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "neon-llm-service.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/neon_diana_utils/helm_charts/mq/neon-llm-palm/templates/deployment.yaml b/neon_diana_utils/helm_charts/mq/neon-llm-palm/templates/deployment.yaml new file mode 100644 index 00000000..41547ae7 --- /dev/null +++ b/neon_diana_utils/helm_charts/mq/neon-llm-palm/templates/deployment.yaml @@ -0,0 +1 @@ +{{- include "base-mq.deployment" .}} \ No newline at end of file diff --git a/neon_diana_utils/helm_charts/mq/neon-llm-palm/templates/service.yaml b/neon_diana_utils/helm_charts/mq/neon-llm-palm/templates/service.yaml new file mode 100644 index 00000000..80730915 --- /dev/null +++ b/neon_diana_utils/helm_charts/mq/neon-llm-palm/templates/service.yaml @@ -0,0 +1 @@ +{{- include "base-mq.service" .}} \ No newline at end of file diff --git a/neon_diana_utils/helm_charts/mq/neon-llm-palm/values.yaml b/neon_diana_utils/helm_charts/mq/neon-llm-palm/values.yaml new file mode 100644 index 00000000..263285a3 --- /dev/null +++ b/neon_diana_utils/helm_charts/mq/neon-llm-palm/values.yaml @@ -0,0 +1,13 @@ +serviceName: backend-llm-palm +replicaCount: 1 +configSecrets: + - diana-config + - google-json +image: + repository: ghcr.io/neongeckocom/neon-llm-palm2 + pullPolicy: Always + tag: dev +resources: + requests: + memory: "600Mi" + cpu: "0.01" \ No newline at end of file diff --git a/neon_diana_utils/helm_charts/mq/neon-metrics-service/Chart.yaml b/neon_diana_utils/helm_charts/mq/neon-metrics-service/Chart.yaml index 68756bf7..f0848a70 100644 --- a/neon_diana_utils/helm_charts/mq/neon-metrics-service/Chart.yaml +++ b/neon_diana_utils/helm_charts/mq/neon-metrics-service/Chart.yaml @@ -3,10 +3,10 @@ name: neon-metrics-service description: Deploy a Metrics Collector Service type: application -version: 0.0.6 +version: 0.0.7 appVersion: "1.0.1a18" dependencies: - name: base-mq - version: 0.0.5 + version: 0.0.10 repository: file://../../base/base-mq \ No newline at end of file diff --git a/neon_diana_utils/helm_charts/mq/neon-script-parser/Chart.yaml b/neon_diana_utils/helm_charts/mq/neon-script-parser/Chart.yaml index 523d4d2b..51d92626 100644 --- a/neon_diana_utils/helm_charts/mq/neon-script-parser/Chart.yaml +++ b/neon_diana_utils/helm_charts/mq/neon-script-parser/Chart.yaml @@ -3,10 +3,10 @@ name: neon-script-parser description: Deploy an MQ CCL Script Parser Service type: application -version: 0.0.5 +version: 0.0.6 appVersion: "1.0.1a18" dependencies: - name: base-mq - version: 0.0.5 + version: 0.0.10 repository: file://../../base/base-mq \ No newline at end of file diff --git a/neon_diana_utils/templates/backend/Chart.yaml b/neon_diana_utils/templates/backend/Chart.yaml index a74eae9c..10bbe5f7 100644 --- a/neon_diana_utils/templates/backend/Chart.yaml +++ b/neon_diana_utils/templates/backend/Chart.yaml @@ -8,5 +8,5 @@ appVersion: "1.0.1a5" dependencies: - name: backend - version: 0.1.14 + version: 0.1.22 repository: https://neongeckocom.github.io/neon-diana-utils \ No newline at end of file diff --git a/neon_diana_utils/templates/backend/templates/config-secret.yaml b/neon_diana_utils/templates/backend/templates/config-secret.yaml index 58d7f975..8f1b3beb 100644 --- a/neon_diana_utils/templates/backend/templates/config-secret.yaml +++ b/neon_diana_utils/templates/backend/templates/config-secret.yaml @@ -4,4 +4,8 @@ --- {{- $_rabbitmq_config := .Files.Get "rabbitmq.json" | b64enc -}} {{ $__ := set .Values.backend "rabbitMqConfig" $_rabbitmq_config }} -{{- include "diana_rabbitmq.secret" . -}} +{{- include "diana_rabbitmq.secret" . }} +--- +{{- $_google_config := .Files.Get "google.json" | b64enc -}} +{{ $___ := set .Values.backend "googleJson" $_google_config }} +{{- include "google_json.secret" . }} diff --git a/neon_diana_utils/templates/backend/values.yaml b/neon_diana_utils/templates/backend/values.yaml index 64f3f2b9..0abc29cb 100644 --- a/neon_diana_utils/templates/backend/values.yaml +++ b/neon_diana_utils/templates/backend/values.yaml @@ -11,6 +11,12 @@ backend: image: {} neon-llm-fastchat: image: {} + neon-llm-claude: + image: {} + neon-llm-palm: + image: {} + neon-llm-gemini: + image: {} neon-metrics-service: image: {} neon-script-parser: diff --git a/neon_diana_utils/templates/llm_personas.yml b/neon_diana_utils/templates/llm_personas.yml index 5666e6c8..f4126809 100644 --- a/neon_diana_utils/templates/llm_personas.yml +++ b/neon_diana_utils/templates/llm_personas.yml @@ -26,9 +26,18 @@ chat_gpt: You are an AI bot that specializes in counseling and mental health support. Provide guidance on assessments, therapy sessions, crisis intervention, goal setting, referrals, advocacy, education, documentation, and adherence to ethical standards, fostering positive changes in clients' lives. You're attempting to provide a concise response within a 40-word limit. +palm2: - name: travel_mate description: | You are an AI bot that specializes in trip planning services. Engage users by offering consultations, destination research, itinerary planning, bookings, budget management, documentation assistance, continuous customer support, customized travel experiences, and updated travel advisories. Enhance their travel journey and save their time. - You're attempting to provide a concise response within a 40-word limit. \ No newline at end of file + You're attempting to provide a concise response within a 40-word limit. +gemini: + - name: gemini + description: | + You are trying to give a short answer in less than 40 words. +claude: + - name: claude + description: | + You are trying to give a short answer in less than 40 words. \ No newline at end of file diff --git a/neon_diana_utils/templates/mq_user_mapping.yml b/neon_diana_utils/templates/mq_user_mapping.yml index c9bdc68e..06e28bc0 100644 --- a/neon_diana_utils/templates/mq_user_mapping.yml +++ b/neon_diana_utils/templates/mq_user_mapping.yml @@ -15,6 +15,12 @@ neon_llm_chatgpt: - neon_llm_chat_gpt neon_llm_fastchat: - neon_llm_fastchat +neon_llm_claude: + - neon_llm_claude +neon_llm_palm: + - neon_llm_palm2 +neon_llm_gemini: + - neon_llm_gemini neon_core: - chat_api_proxy chat_observer: diff --git a/neon_diana_utils/templates/rmq_backend_config.yml b/neon_diana_utils/templates/rmq_backend_config.yml index b0d3c22c..c86369d7 100644 --- a/neon_diana_utils/templates/rmq_backend_config.yml +++ b/neon_diana_utils/templates/rmq_backend_config.yml @@ -44,6 +44,21 @@ users: tags: - backend - llm + - name: "neon_llm_claude" + password: + tags: + - backend + - llm + - name: "neon_llm_palm" + password: + tags: + - backend + - llm + - name: "neon_llm_gemini" + password: + tags: + - backend + - llm - name: "neon_core" password: tags: @@ -99,6 +114,21 @@ permissions: configure: "fastchat_.*" write: "fastchat_.*|amq\\.default" read: "fastchat_.*" + - user: "neon_llm_claude" + vhost: "/llm" + configure: "claude_.*" + write: "claude_.*|amq\\.default" + read: "claude_.*" + - user: "neon_llm_palm" + vhost: "/llm" + configure: "palm2_.*" + write: "palm2_.*|amq\\.default" + read: "palm2_.*" + - user: "neon_llm_gemini" + vhost: "/llm" + configure: "gemini_.*" + write: "gemini_.*|amq\\.default" + read: "gemini_.*" - user: "neon_api_utils" vhost: "/llm" configure: ".*"