From 2ed6d5189fe3258899b1860c1bf8a7aea42d5756 Mon Sep 17 00:00:00 2001 From: Sasank Chilamkurthy Date: Thu, 17 Oct 2024 17:31:43 +0530 Subject: [PATCH] add speech to text --- .../definitions/openedai-speech/Caddyfile | 24 +++++++++++++++++++ .../openedai-speech/openedai-speech.lisp | 22 +++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 src/app-store/definitions/openedai-speech/Caddyfile create mode 100644 src/app-store/definitions/openedai-speech/openedai-speech.lisp diff --git a/src/app-store/definitions/openedai-speech/Caddyfile b/src/app-store/definitions/openedai-speech/Caddyfile new file mode 100644 index 0000000..416c44c --- /dev/null +++ b/src/app-store/definitions/openedai-speech/Caddyfile @@ -0,0 +1,24 @@ +# taken from here: https://github.com/bartolli/ollama-bearer-auth/blob/cuda-env/Caddyfile +:8080 { + # Define a matcher for authorized API access + @apiAuth { + header Authorization "Bearer {env.OPENEDAI_SPEECH_API_KEY}" + } + + # Proxy authorized requests + reverse_proxy @apiAuth http://localhost:8000 { + header_up Host {http.reverse_proxy.upstream.hostport} + } + + # Define a matcher for unauthorized access + @unauthorized { + not { + header Authorization "Bearer {env.OPENEDAI_SPEECH_API_KEY}" + } + } + + # Respond to unauthorized access + respond @unauthorized "Unauthorized" 401 { + close + } +} diff --git a/src/app-store/definitions/openedai-speech/openedai-speech.lisp b/src/app-store/definitions/openedai-speech/openedai-speech.lisp new file mode 100644 index 0000000..2fab0d7 --- /dev/null +++ b/src/app-store/definitions/openedai-speech/openedai-speech.lisp @@ -0,0 +1,22 @@ +(define-app + (version "0.18.2") + (ports 8080) + (url "https://github.com/matatonic/openedai-speech") + (containers + (container + (name "server") + (image "ghcr.io/matatonic/openedai-speech:0.18.2") + (environment + ("TTS_HOME" "voices") + ("HF_HOME" "voices")) + (volumes + ("voices" "/app/voices") + ("config" "/app/config")) + (additional-flags "--device nvidia.com/gpu=all")) + (container + (name "caddy") + (image "docker.io/caddy:2.8.4-alpine") + (environment + ("OPENEDAI_SPEECH_API_KEY" ,(gen-password))) + (volumes + ("Caddyfile" "/etc/caddy/Caddyfile")))))