Tuesday, May 5, 2026

models/embedding-001 is not found for API version v1beta, or is not supported for embedContent.

 

NotFound: 404 POST https://generativelanguage.googleapis.com/v1beta/models/embedding-001:embedContent?%24alt=json%3Benum-encoding%3Dint: models/embedding-001 is not found for API version v1beta, or is not supported for embedContent. Call ListModels to see the list of available models and their supported methods.



This is because embedding-001 is being phased out in favor of gemini-embedding-001.


You can list the available models like :

for m in genai.list_models():
    if 'embedContent' in m.supported_generation_methods:
        print(m.name)

as of 05/may/2026, on colab, it listed:
models/gemini-embedding-001 models/gemini-embedding-2-preview models/gemini-embedding-2


But there is a difference in older embedding-001 and newer gemini-embedding-001.
  • Dimension Changes: This model produces 3072-dimension vectors by default. This may differ from older models (768 dimensions), potentially breaking existing vector databases.
  • Dimension Control: You can use output_dimensionality to reduce the vector size to match your existing database requirements.
  • Batch Size: This model may have strict batch size limits in certain SDK implementations






  • No comments:

    Post a Comment

    Python List, NumPy Array and Pandas DataFrame

     The strength of numpy arrays is that it allows for vectorized operations (applying a calculation to the whole array at once without loops)...