usememos/memos · error

aiSetting transcription configuration exceeds a supported le

Error message

aiSetting transcription configuration exceeds a supported length limit

What it means

Thrown during AI setting normalization when the transcription block's model, language, or prompt exceeds the hard caps (model <= 256 chars, language <= 32, prompt <= 4096, constants in store/deployment_config.go). These limits bound what gets forwarded to transcription providers; oversized values (typically a prompt pasted from a document) fail deployment loading at startup.

Source

Thrown at store/deployment_config.go:338

			if provider.Endpoint == "" {
				provider.Endpoint = "https://generativelanguage.googleapis.com/v1beta"
			}
		default:
			return errors.Errorf("aiSetting provider %q has unsupported type", provider.Id)
		}
	}
	if transcription := setting.Transcription; transcription != nil {
		transcription.ProviderId = strings.TrimSpace(transcription.ProviderId)
		transcription.Model = strings.TrimSpace(transcription.Model)
		transcription.Language = strings.TrimSpace(transcription.Language)
		transcription.Prompt = strings.TrimSpace(transcription.Prompt)
		if transcription.ProviderId != "" {
			if _, ok := providers[transcription.ProviderId]; !ok {
				return errors.Errorf("aiSetting transcription providerId %q does not reference a provider", transcription.ProviderId)
			}
		}
		if len(transcription.Model) > maxTranscriptionModelLength || len(transcription.Language) > maxTranscriptionLanguageLength || len(transcription.Prompt) > maxTranscriptionPromptLength {
			return errors.New("aiSetting transcription configuration exceeds a supported length limit")
		}
	}
	return nil
}

func (s *Store) validateDeploymentAuthenticationState(ctx context.Context, config *deploymentConfiguration) error {
	_, generalConfigured := config.instanceSettings[storepb.InstanceSettingKey_GENERAL]
	if !generalConfigured && len(config.identityProviders) == 0 {
		general, err := s.getRawInstanceSetting(ctx, storepb.InstanceSettingKey_GENERAL.String())
		if err != nil {
			return errors.Wrap(err, "failed to inspect stored GENERAL setting")
		}
		if general == nil || !general.GetGeneralSetting().DisallowPasswordAuth {
			return nil
		}
		providers, err := s.listStoredIdentityProviders(ctx, &FindIdentityProvider{})
		if err != nil {
			return errors.Wrap(err, "failed to inspect stored identity providers")

View on GitHub (pinned to 14d757ce1f)

Solutions

  1. Trim transcription.prompt to <= 4096 characters, model to <= 256, language to a single code like "en" (<= 32 chars).
  2. Move long instructions into the provider-side configuration if the provider supports it.

Example fix

// before
"transcription": { "providerId": "openai", "model": "whisper-1", "language": "en", "prompt": "<6000-char document>" }

// after
"transcription": { "providerId": "openai", "model": "whisper-1", "language": "en", "prompt": "<concise <=4096-char prompt>" }
Defensive patterns

Strategy: validation

Validate before calling

const (
    maxModel = 256
    maxLang  = 32
    maxPrompt = 4096
)
if len(transcription.Model) > maxModel || len(transcription.Language) > maxLang || len(transcription.Prompt) > maxPrompt {
    return errors.New("transcription config exceeds length limits")
}

Type guard

func transcriptionWithinLimits(t *storepb.TranscriptionSetting) bool {
    return len(t.GetModel()) <= 256 && len(t.GetLanguage()) <= 32 && len(t.GetPrompt()) <= 4096
}

Prevention

When it happens

Trigger: aiSetting.transcription with a prompt longer than 4096 characters, a model string longer than 256 characters, or a language string longer than 32 characters (after trimming).

Common situations: Pasting a long system prompt or whole instructions document into transcription.prompt; a language field accidentally holding a full locale list instead of a single code like "en".

Related errors


AI-assisted analysis of usememos/memos@14d757ce1f (2026-08-15). Data as JSON: /api/errors/2511b955dea4db8d. Report an issue: GitHub.