From af66419a44ce8942db4f458ea58fd3d414f37327 Mon Sep 17 00:00:00 2001 From: Mathias Date: Thu, 1 Oct 2026 17:07:20 +0200 Subject: [PATCH] feat(config): measured chat budget (90,000) and upload chat model (gemma4-26b) Co-Authored-By: Claude Sonnet 5.5 --- internal/config/uploads.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/internal/config/uploads.go b/internal/config/uploads.go index a496b20..ac4942a 100644 --- a/internal/config/uploads.go +++ b/internal/config/uploads.go @@ -33,9 +33,15 @@ type UploadConfig struct { FFprobeBin string // MaxUploadedTranscriptChars bounds the transcript sent to a chat model for an // UPLOADED recording. The 18,000-char default for captions is ~22 minutes of - // speech; an hour of meeting is ~50,000 chars. A guess until measured against - // the models chat offers. + // speech; an hour of meeting is ~50,000 chars. MEASURED 2026-10-01 against the + // real models: iguana/gemma4-26b answers correctly to 90,000 chars but silently + // drops the head of a 120,000-char transcript, so 90,000 is the ceiling of the + // best model, not a round number. MaxUploadedTranscriptChars int + // UploadChatModel is the model chat over an uploaded recording opens with. It is + // NOT the summarizer default: koala/phi4-mini has an 8,192-token context and + // returns HTTP 400 on an hour of speech (~13,000 tokens). + UploadChatModel string } const ( @@ -44,7 +50,8 @@ const ( defaultTranscribeModel = "iguana/kb-whisper" defaultTranscribeFallbackModel = "berget/kb-whisper" defaultTranscribeTimeout = 30 * time.Minute - defaultMaxUploadedChars = 120000 + defaultMaxUploadedChars = 90000 + defaultUploadChatModel = "iguana/gemma4-26b" ) func loadUploadConfig() (UploadConfig, error) { @@ -54,6 +61,7 @@ func loadUploadConfig() (UploadConfig, error) { UploadTmpDir: envOr("TAPIR_UPLOAD_TMP_DIR", os.TempDir()), FFmpegBin: envOr("TAPIR_FFMPEG_BIN", "ffmpeg"), FFprobeBin: envOr("TAPIR_FFPROBE_BIN", "ffprobe"), + UploadChatModel: envOr("TAPIR_UPLOAD_CHAT_MODEL", defaultUploadChatModel), } if v := os.Getenv("TAPIR_UPLOADS_ENABLED"); v != "" {