JuliusBrussee/caveman · error

vertex model %q is not on the allowlist

Error message

vertex model %q is not on the allowlist

What it means

The model id from the path failed the prefix allowlist check (modelAllowed): it matches neither the built-in prefixes (gemini-, claude-) nor any operator override from CAVE_VERTEX_MODEL_ALLOWLIST. The gate blocks unpriced or unauthorized model ids before the upstream URL is built.

Source

Thrown at proxy/providers/vertex/routing.go:44

// ResolveUpstreamURL validates the Vertex request shape (publisher + model on
// the allowlist), enforces SSRF/host constraints against the aiplatform
// endpoint, and resolves the upstream URL. The /vertex prefix is stripped so the
// upstream path is the native aiplatform path
// (/v1/projects/{p}/locations/{l}/publishers/{pub}/models/{model}:{method}). The
// query string (e.g. ?alt=sse) is preserved unchanged — byte-safe passthrough.
func (a Adapter) ResolveUpstreamURL(ctx context.Context, req *http.Request, route providers.RouteContext) (*url.URL, error) {
	publisher, model, method := parsePredictPath(req.URL.Path)
	if publisher == "" || model == "" || method == "" {
		return nil, fmt.Errorf("vertex request path %q does not name a publisher, model, and method", req.URL.Path)
	}
	if !methodAllowed(publisher, method) {
		return nil, fmt.Errorf("vertex method %q is not allowed for publisher %q", method, publisher)
	}
	if !publisherAllowed(publisher) {
		return nil, fmt.Errorf("vertex publisher %q is not on the allowlist", publisher)
	}
	if !modelAllowed(model) {
		return nil, fmt.Errorf("vertex model %q is not on the allowlist", model)
	}

	baseURL := a.BaseURL
	if route.BaseURL != "" {
		baseURL = route.BaseURL
	}
	base, err := url.Parse(baseURL)
	if err != nil {
		return nil, fmt.Errorf("vertex base url invalid: %w", err)
	}
	base.Path = strings.TrimRight(base.Path, "/") + strings.TrimPrefix(req.URL.Path, "/vertex")
	base.RawQuery = req.URL.RawQuery

	// SSRF/host validation on the resolved endpoint. Active in managed (prod)
	// mode; local/self-hosted (stub) endpoints are permitted so the dry-run and
	// examples can target the provider-stub.
	if env.IsProduction() {
		if err := ssrf.ValidateURL(ctx, base.String(), ssrf.ManagedConfig()); err != nil {

View on GitHub (pinned to 766dce6b13)

Solutions

  1. Use an allowed model id such as gemini-2.5-pro or claude-sonnet-4-5
  2. Set CAVE_VERTEX_MODEL_ALLOWLIST to add the desired model prefix if the catalog prices it
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at proxy/providers/vertex/routing.go:44 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of JuliusBrussee/caveman@766dce6b13 (2026-08-18). Data as JSON: /api/errors/6d56f40b3ba12153. Report an issue: GitHub.