generative-ai-python icon indicating copy to clipboard operation
generative-ai-python copied to clipboard

models/gemini-2.0-flash-lite not available for caching

Open CarsonStevens opened this issue 1 year ago • 1 comments

Description of the bug:

I'm not sure why it won't let me use the new model for caching. This google pricing website says its available March 31st, 2025. I've upgrade to the latest pip version: google-generativeai 0.8.4

The error says to call ListModels which shows

_InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
	status = StatusCode.NOT_FOUND
	details = "models/gemini-2.0-flash-lite is not found for API version v1beta, or is not supported for createCachedContent. Call ListModels to see the list of available models and their supported methods."
	debug_error_string = "UNKNOWN:Error received from peer ipv6:%5B2607:f8b0:400f:804::200a%5D:443 {grpc_message:"models/gemini-2.0-flash-lite is not found for API version v1beta, or is not supported for createCachedContent. Call ListModels to see the list of available models and their supported methods.", grpc_status:5, created_time:"2025-04-01T19:23:05.0136553+00:00"}"
>
from google.generativeai import caching
import datetime
minutes = 5

caching.CachedContent.create(
    # model='models/gemini-1.5-flash-002',
    model='models/gemini-2.0-flash-lite',
    display_name="-1",
    system_instruction="Test system instruction",
    contents=["Test input"],
    ttl=datetime.timedelta(minutes=minutes),
)

Using

import google.generativeai as genai

[model for model in genai.list_models()]

I can see:

[...,
 Model(name='models/gemini-2.0-flash',
       base_model_id='',
       version='2.0',
       display_name='Gemini 2.0 Flash',
       description='Gemini 2.0 Flash',
       input_token_limit=1048576,
       output_token_limit=8192,
       supported_generation_methods=['generateContent', 'countTokens'],
       temperature=1.0,
       max_temperature=2.0,
       top_p=0.95,
       top_k=40),
 Model(name='models/gemini-2.0-flash-001',
       base_model_id='',
       version='2.0',
       display_name='Gemini 2.0 Flash 001',
       description=('Stable version of Gemini 2.0 Flash, our fast and versatile multimodal model '
                    'for scaling across diverse tasks, released in January of 2025.'),
       input_token_limit=1048576,
       output_token_limit=8192,
       supported_generation_methods=['generateContent', 'countTokens'],
       temperature=1.0,
       max_temperature=2.0,
       top_p=0.95,
       top_k=40),
 Model(name='models/gemini-2.0-flash-lite-001',
       base_model_id='',
       version='2.0',
       display_name='Gemini 2.0 Flash-Lite 001',
       description='Stable version of Gemini 2.0 Flash Lite',
       input_token_limit=1048576,
       output_token_limit=8192,
       supported_generation_methods=['generateContent', 'countTokens'],
       temperature=1.0,
       max_temperature=2.0,
       top_p=0.95,
       top_k=40),
 Model(name='models/gemini-2.0-flash-lite',
       base_model_id='',
       version='2.0',
       display_name='Gemini 2.0 Flash-Lite',
       description='Gemini 2.0 Flash-Lite',
       input_token_limit=1048576,
       output_token_limit=8192,
       supported_generation_methods=['generateContent', 'countTokens'],
       temperature=1.0,
       max_temperature=2.0,
       top_p=0.95,
       top_k=40)
...]

Actual vs expected behavior:

No response

Any other information you'd like to share?

No response

CarsonStevens avatar Apr 01 '25 19:04 CarsonStevens

I just check the website again (hadn't since yesterday on March 31st) and looks like the release date got updated to April 15, 2025. This error seems to just be that they changed the release date after they said it was going to be released. I'll check back April 15 to make sure this was the real issue

CarsonStevens avatar Apr 01 '25 19:04 CarsonStevens