{"record":{"id":"23f1b559dfe4a678","repo":"BerriAI/litellm","slug":"litellm-s-gemini-route-does-not-support-image-g","errorCode":null,"errorMessage":"LiteLLM's `gemini/` route does not support image generation yet. Let us know if you need this feature by opening an issue at https://github.com/BerriAI/litellm/issues","messagePattern":"LiteLLM's `gemini/` route does not support image generation yet\\. Let us know if you need this feature by opening an issue at https://github\\.com/BerriAI/litellm/issues","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/vertex_ai/common_utils.py","lineNumber":485,"sourceCode":"\n    if mode == \"chat\":\n        endpoint = \"generateContent\"\n        if stream is True:\n            endpoint = \"streamGenerateContent\"\n            url = f\"https://generativelanguage.googleapis.com/{api_version}/{_gemini_model_name}:{endpoint}?alt=sse\"\n        else:\n            url = f\"https://generativelanguage.googleapis.com/{api_version}/{_gemini_model_name}:{endpoint}\"\n    elif mode == \"embedding\":\n        endpoint = \"embedContent\"\n        url = f\"https://generativelanguage.googleapis.com/v1beta/{_gemini_model_name}:{endpoint}\"\n    elif mode == \"batch_embedding\":\n        endpoint = \"batchEmbedContents\"\n        url = f\"https://generativelanguage.googleapis.com/v1beta/{_gemini_model_name}:{endpoint}\"\n    elif mode == \"count_tokens\":\n        endpoint = \"countTokens\"\n        url = f\"https://generativelanguage.googleapis.com/v1beta/{_gemini_model_name}:{endpoint}\"\n    elif mode == \"image_generation\":\n        raise ValueError(\n            \"LiteLLM's `gemini/` route does not support image generation yet. Let us know if you need this feature by opening an issue at https://github.com/BerriAI/litellm/issues\"\n        )\n    else:\n        raise ValueError(f\"Unsupported mode: {mode}\")\n\n    return url, endpoint\n\n\ndef _check_text_in_content(parts: list[PartType]) -> bool:\n    \"\"\"\n    check that user_content has 'text' parameter.\n        - Known Vertex Error: Unable to submit request because it must have a text parameter.\n        - 'text' param needs to be present (empty strings are valid)\n        - Relevant Issue: https://github.com/BerriAI/litellm/issues/5515\n    \"\"\"\n    has_text_param = False\n    for part in parts:\n        if \"text\" in part and part.get(\"text\") is not None:","sourceCodeStart":467,"sourceCodeEnd":503,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/vertex_ai/common_utils.py#L467-L503","documentation":"Error \"LiteLLM's `gemini/` route does not support image generation yet. Let us know if you need this feature by opening an issue at https://github.com/BerriAI/litellm/issues\" thrown in BerriAI/litellm.","triggerScenarios":"Triggered when requesting image generation through LiteLLM's gemini/ route, which is not yet supported.","commonSituations":"See trigger scenarios.","solutions":["Use the vertex_ai/ route (e.g. vertex_ai/imagen-3.0-generate-001) for image generation instead of gemini/.","Or request support via the linked GitHub issue."],"exampleFix":"litellm.image_generation(model=\"vertex_ai/imagen-3.0-generate-001\", prompt=...)","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}