From e72a79be8f202354c2c568413315e77a800e1ff3 Mon Sep 17 00:00:00 2001 From: Lumpiasty Date: Sun, 8 Mar 2026 17:58:01 +0100 Subject: [PATCH] add glm-5 from openrouter to llama-swap --- apps/llama/configs/config.yaml | 7 +++++++ apps/llama/deployment.yaml | 6 ++++++ apps/llama/secret.yaml | 23 +++++++++++++++++++++++ vault/policy/ollama.hcl | 4 ++++ 4 files changed, 40 insertions(+) diff --git a/apps/llama/configs/config.yaml b/apps/llama/configs/config.yaml index 034abe3..0efa01c 100644 --- a/apps/llama/configs/config.yaml +++ b/apps/llama/configs/config.yaml @@ -12,6 +12,13 @@ macros: thinking_on: "--chat-template-kwargs '{\"enable_thinking\": true}'" thinking_off: "--chat-template-kwargs '{\"enable_thinking\": false}'" +peers: + openrouter: + proxy: https://openrouter.ai/api + apiKey: ${env.OPENROUTER_API_KEY} + models: + - z-ai/glm-5 + hooks: on_startup: preload: diff --git a/apps/llama/deployment.yaml b/apps/llama/deployment.yaml index 7cb4828..785808e 100644 --- a/apps/llama/deployment.yaml +++ b/apps/llama/deployment.yaml @@ -30,6 +30,12 @@ spec: - containerPort: 8080 name: http protocol: TCP + env: + - name: OPENROUTER_API_KEY + valueFrom: + secretKeyRef: + name: llama-openrouter + key: OPENROUTER_API_KEY volumeMounts: - name: models mountPath: /root/.cache diff --git a/apps/llama/secret.yaml b/apps/llama/secret.yaml index 3809b61..82ab723 100644 --- a/apps/llama/secret.yaml +++ b/apps/llama/secret.yaml @@ -36,3 +36,26 @@ spec: excludeRaw: true vaultAuthRef: llama +--- +apiVersion: secrets.hashicorp.com/v1beta1 +kind: VaultStaticSecret +metadata: + name: llama-openrouter + namespace: llama +spec: + type: kv-v2 + + mount: secret + path: openrouter + + destination: + create: true + name: llama-openrouter + type: Opaque + transformation: + excludeRaw: true + templates: + OPENROUTER_API_KEY: + text: '{{ get .Secrets "API_KEY" }}' + + vaultAuthRef: llama diff --git a/vault/policy/ollama.hcl b/vault/policy/ollama.hcl index a6d6994..456e2f7 100644 --- a/vault/policy/ollama.hcl +++ b/vault/policy/ollama.hcl @@ -1,3 +1,7 @@ path "secret/data/ollama" { capabilities = ["read"] } + +path "secret/data/openrouter" { + capabilities = ["read"] +}