JuliusBrussee/caveman · error

unsupported image token profile

Error message

unsupported image token profile

What it means

The model has no image-token profile entry in the look-up used when sizing rendered images, so the transform cannot compute the image token budget for this Gemini model. Unsupported or misspelled model IDs land here.

Solutions

  1. Use a supported Gemini model identifier with a known image token profile
  2. Add a profile entry for the new model in the lookup table
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at engine/pixel/transform_gemini.go:1004 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/86f9136e90a14f8b. Report an issue: GitHub.

Appendix: source

Thrown at engine/pixel/transform_gemini.go:1004

		imgs, err = RenderTextToPNGsMultiCol(text, effectiveCols, effectiveNumCols)
	} else if style == (RenderStyle{}) {
		imgs, err = RenderTextToPNGs(text, effectiveCols, RenderStyle{})
	} else {
		imgs, err = RenderTextToPNGsWithCharLimit(text, effectiveCols, maxCharsPerImage, style, MaxHeightPx, "")
	}
	if err != nil {
		return geminiRenderResult{}, err
	}
	res := geminiRenderResult{droppedCodepoints: make(map[rune]int)}
	for _, img := range imgs {
		b64 := base64.StdEncoding.EncodeToString(img.PNG)
		res.parts = append(res.parts, geminiPart{InlineData: &geminiInlineData{MimeType: "image/png", Data: b64}})
		res.imageCount++
		res.imageBytes += len(img.PNG)
		res.imagePixels += img.Width * img.Height
		tokens, supported := engineimage.EstimateTokensForModel("gemini", model, mediaResolution, img.Width, img.Height)
		if !supported {
			return geminiRenderResult{}, errors.New("unsupported image token profile")
		}
		res.imageTokens += int(math.Ceil(float64(tokens) * ImageCostSafetyMargin))
		res.droppedChars += img.DroppedChars
		for cp, n := range img.DroppedCodepoints {
			res.droppedCodepoints[cp] += n
		}
	}
	return res, nil
}

func evalGeminiProfitability(model, mediaResolution, text string, cols, imageCountCap, numCols int, charsPerToken, priorWarmTokens, priorWarmImageTokens float64, shrinkWidth bool, maxCharsPerImage int, dense bool) *geminiGateEval {
	if text == "" {
		return nil
	}
	cpt := charsPerToken
	if !isFinitePositive(cpt) {
		cpt = CharsPerToken
	}

View on GitHub (pinned to 766dce6b13)