{"record":{"id":"86f9136e90a14f8b","repo":"JuliusBrussee/caveman","slug":"unsupported-image-token-profile","errorCode":null,"errorMessage":"unsupported image token profile","messagePattern":"unsupported image token profile","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/pixel/transform_gemini.go","lineNumber":1004,"sourceCode":"\t\timgs, err = RenderTextToPNGsMultiCol(text, effectiveCols, effectiveNumCols)\n\t} else if style == (RenderStyle{}) {\n\t\timgs, err = RenderTextToPNGs(text, effectiveCols, RenderStyle{})\n\t} else {\n\t\timgs, err = RenderTextToPNGsWithCharLimit(text, effectiveCols, maxCharsPerImage, style, MaxHeightPx, \"\")\n\t}\n\tif err != nil {\n\t\treturn geminiRenderResult{}, err\n\t}\n\tres := geminiRenderResult{droppedCodepoints: make(map[rune]int)}\n\tfor _, img := range imgs {\n\t\tb64 := base64.StdEncoding.EncodeToString(img.PNG)\n\t\tres.parts = append(res.parts, geminiPart{InlineData: &geminiInlineData{MimeType: \"image/png\", Data: b64}})\n\t\tres.imageCount++\n\t\tres.imageBytes += len(img.PNG)\n\t\tres.imagePixels += img.Width * img.Height\n\t\ttokens, supported := engineimage.EstimateTokensForModel(\"gemini\", model, mediaResolution, img.Width, img.Height)\n\t\tif !supported {\n\t\t\treturn geminiRenderResult{}, errors.New(\"unsupported image token profile\")\n\t\t}\n\t\tres.imageTokens += int(math.Ceil(float64(tokens) * ImageCostSafetyMargin))\n\t\tres.droppedChars += img.DroppedChars\n\t\tfor cp, n := range img.DroppedCodepoints {\n\t\t\tres.droppedCodepoints[cp] += n\n\t\t}\n\t}\n\treturn res, nil\n}\n\nfunc evalGeminiProfitability(model, mediaResolution, text string, cols, imageCountCap, numCols int, charsPerToken, priorWarmTokens, priorWarmImageTokens float64, shrinkWidth bool, maxCharsPerImage int, dense bool) *geminiGateEval {\n\tif text == \"\" {\n\t\treturn nil\n\t}\n\tcpt := charsPerToken\n\tif !isFinitePositive(cpt) {\n\t\tcpt = CharsPerToken\n\t}","sourceCodeStart":986,"sourceCodeEnd":1022,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/engine/pixel/transform_gemini.go#L986-L1022","documentation":"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.","triggerScenarios":"Thrown at engine/pixel/transform_gemini.go:1004 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a supported Gemini model identifier with a known image token profile","Add a profile entry for the new model in the lookup table"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"766dce6b1394ebb56a3090748d5a0240a5aefb36","analyzedAt":"2026-08-18T03:14:35.516Z","contentChangedAt":"2026-08-18T03:14:35.516Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}