fix(mac): aim whisper.el at the whisper.cpp server (remote mode)

The human runs homebrew's whisper.cpp server with
ggml-large-v3-turbo; that build serves only whisper.cpp's native
/inference endpoint, not an OpenAI-compatible one.  Switch the block
from 'openai to 'remote mode: whisper.el then POSTs multipart
(file, response_format=json, language) to <baseurl>/inference and
parses the {"text": ...} reply, which matches whisper.cpp exactly
(verified against the installed whisper.el sources).

Drop the openai-mode-only settings (api key/model/baseurl); they are
inert in remote mode.  The comment records the Lemonade-style
alternative and why live-dictate still needs such a backend.

Verified statically only (parens + endpoint/parsing traced in
whisper.el); runtime test pending with the human.
This commit is contained in:
Willem van den Ende
2026-11-05 12:01:20 +00:00
parent 3fe94894bf
commit 183036a333
+17 -12
View File
@@ -238,12 +238,19 @@ Returns answer with org-roam links to sources."
;; Ported from config-linux.el so both machines have the same capabilities. ;; Ported from config-linux.el so both machines have the same capabilities.
;; The pieces are already cross-platform: `whisper' and `websocket' are ;; The pieces are already cross-platform: `whisper' and `websocket' are
;; declared in shared packages.el, and lisp/live-dictate.el picks avfoundation ;; declared in shared packages.el, and lisp/live-dictate.el picks avfoundation
;; for FFmpeg input on darwin by itself. What this machine still needs is a ;; for FFmpeg input on darwin by itself.
;; backend: an OpenAI-compatible transcription server listening on ;;
;; localhost:13305 (as on Linux) -- see the checklist in agent-start-here.md ;; Backend on this machine: homebrew's whisper.cpp server, started by hand:
;; or the comment in config-linux.el. Until one runs, these commands bind ;;
;; but fail to connect; point `whisper-openai-api-baseurl' and ;; whisper-server -m ~/.cache/whisper/ggml-large-v3-turbo.bin \
;; `live-dictate-server-url' elsewhere to use a remote backend. ;; --host 127.0.0.1 --port 13305
;;
;; Mode `remote' POSTs multipart (file, response_format=json, language) to
;; <baseurl>/inference and parses the {"text": ...} reply -- whisper.cpp's
;; native API. For a Lemonade-style OpenAI-compatible backend instead, use
;; `whisper-server-mode' 'openai with `whisper-openai-api-baseurl'; that is
;; also what `live-dictate' (SPC A d) requires, since it streams over
;; ws://host/v1/realtime, which whisper.cpp cannot serve.
(add-load-path! "lisp") (add-load-path! "lisp")
(autoload #'live-dictate "live-dictate" nil t) (autoload #'live-dictate "live-dictate" nil t)
@@ -257,13 +264,11 @@ Returns answer with org-roam links to sources."
:desc "Whisper select language" "l" #'whisper-select-language :desc "Whisper select language" "l" #'whisper-select-language
:desc "Live dictate (streaming)" "d" #'live-dictate)) :desc "Live dictate (streaming)" "d" #'live-dictate))
:config :config
(setopt whisper-install-whispercpp nil ; no whisper.cpp needed, remote API only (setopt whisper-install-whispercpp nil ; use homebrew's whisper.cpp, not a private copy
whisper-server-mode 'openai ; use OpenAI-compatible transcription API whisper-server-mode 'remote ; talk to a running whisper.cpp server
whisper-openai-api-baseurl "http://localhost:13305/" whisper-server-baseurl "http://localhost:13305"
whisper-openai-api-key "not-needed" ; Lemonade ignores auth, but whisper.el requires a non-nil key
whisper-openai-model "Whisper-Large-v3-Turbo"
whisper-language "en" whisper-language "en"
whisper-translate nil ; t would POST to /translations instead whisper-translate nil ; whisper.cpp translates only via server --translate flag
whisper-return-cursor 'end)) whisper-return-cursor 'end))
;; live-dictate's avfoundation input needs an explicit `-i' of the form ;; live-dictate's avfoundation input needs an explicit `-i' of the form