Skip to content

Remove deprecated models and replace them with newer ones#1134

Open
Giom-V wants to merge 5 commits intogoogle-gemini:mainfrom
Giom-V:deprecations
Open

Remove deprecated models and replace them with newer ones#1134
Giom-V wants to merge 5 commits intogoogle-gemini:mainfrom
Giom-V:deprecations

Conversation

@Giom-V
Copy link
Copy Markdown
Collaborator

@Giom-V Giom-V commented Feb 6, 2026

No description provided.

@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@github-actions github-actions Bot added status:awaiting review PR awaiting review from a maintainer component:examples Issues/PR referencing examples folder component:quickstarts Issues/PR referencing quickstarts folder labels Feb 6, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @Giom-V, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request systematically updates the model references within numerous example and quickstart Jupyter notebooks. The primary goal is to replace older, deprecated, or less performant generative AI models with their newer, recommended counterparts, such as upgrading to gemini-2.5-flash, gemini-embedding-001, and imagen-4.0-generate-001. This ensures that users are always working with the most current and capable versions of the models, improving the relevance and accuracy of the provided examples.

Highlights

  • Model Upgrades: Replaced deprecated embedding models like text-embedding-004 with the newer gemini-embedding-001 across multiple example and quickstart notebooks, ensuring consistency with current recommendations.
  • Generative Model Updates: Upgraded various instances of gemini-2.0-flash to gemini-2.5-flash in several notebooks, including those demonstrating ReAct prompting, PDF structured outputs, and story writing, to leverage improved capabilities.
  • Image Generation Model Migration: Migrated references from imagen-3.0-generate-002 to imagen-4.0-generate-001 and gemini-2.0-flash-preview-image-generation to gemini-2.5-flash-image in relevant examples and quickstarts, reflecting the latest image generation models.
  • Live API Model Refresh: Updated Live API models from older versions such as gemini-2.0-flash-live-001 and gemini-live-2.5-flash-preview to the more recent gemini-2.5-flash-native-audio-preview-12-2025.
  • Model List Synchronization: Ensured the quickstarts/Models.ipynb notebook accurately reflects the latest available model names, including new gemini-3 preview models and veo-3.1 models, providing an up-to-date overview of the model landscape.
Changelog
  • examples/Anomaly_detection_with_embeddings.ipynb
    • Updated text-embedding-004 to gemini-embedding-001 for embedding operations.
  • examples/Browser_as_a_tool.ipynb
    • Replaced gemini-2.0-flash-live-001 and gemini-live-2.5-flash-preview with gemini-2.5-flash-native-audio-preview-12-2025 for live model usage.
  • examples/Classify_text_with_embeddings.ipynb
    • Updated text-embedding-004 to gemini-embedding-001 in model listings and assignments.
  • examples/Google_IO2025_Live_Coding.ipynb
    • Migrated imagen-3.0-generate-002 to imagen-4.0-generate-001 for image generation.
    • Replaced gemini-2.0-flash-preview-image-generation with gemini-2.5-flash-image for multimodal image generation.
  • examples/Pdf_structured_outputs_on_invoices_and_forms.ipynb
    • Upgraded gemini-2.0-flash to gemini-2.5-flash for content generation.
  • examples/Search_Wikipedia_using_ReAct.ipynb
    • Updated gemini-2.0-flash to gemini-2.5-flash for ReAct prompting and general model interaction.
  • examples/Search_reranking_using_embeddings.ipynb
    • Replaced gemini-2.0-flash with gemini-2.5-flash for data extraction.
    • Updated text-embedding-004 to gemini-embedding-001 for embedding model ID.
  • examples/Story_Writing_with_Prompt_Chaining.ipynb
    • Upgraded gemini-2.0-flash to gemini-2.5-flash for story generation and token counting.
  • examples/Talk_to_documents_with_embeddings.ipynb
    • Updated text-embedding-004 to gemini-embedding-001 for embedding model ID.
  • examples/anomaly_detection.ipynb
    • Replaced text-embedding-004 with gemini-embedding-001 in model listings and assignments.
  • examples/chromadb/Vectordb_with_chroma.ipynb
    • Updated text-embedding-004 to gemini-embedding-001 in model listings and embedding function.
  • examples/clustering_with_embeddings.ipynb
    • Replaced text-embedding-004 with gemini-embedding-001 in model listings and assignments.
  • examples/document_search.ipynb
    • Updated text-embedding-004 to gemini-embedding-001 in model listings and assignments.
  • examples/langchain/Gemini_LangChain_QA_Chroma_WebLoad.ipynb
    • Upgraded gemini-2.0-flash to gemini-2.5-flash for LangChain integration.
  • examples/langchain/Gemini_LangChain_QA_Pinecone_WebLoad.ipynb
    • Replaced gemini-2.0-flash with gemini-2.5-flash for LangChain integration.
  • examples/llamaindex/Gemini_LlamaIndex_QA_Chroma_WebPageReader.ipynb
    • Updated gemini-2.0-flash to gemini-2.5-flash for LlamaIndex integration.
  • examples/prompting/Providing_base_cases.ipynb
    • Upgraded gemini-2.0-flash to gemini-2.5-flash for generative model instantiation.
  • examples/qdrant/Movie_Recommendation.ipynb
    • Replaced text-embedding-004 with gemini-embedding-001 for embedding model selection.
  • examples/qdrant/Qdrant_similarity_search.ipynb
    • Updated text-embedding-004 to gemini-embedding-001 for embedding model selection.
  • examples/weaviate/personalized_description_with_weaviate_and_gemini_api.ipynb
    • Replaced text-embedding-004 with gemini-embedding-001 for embedding model.
    • Upgraded gemini-2.0-flash to gemini-2.5-flash for generating persona descriptions.
  • examples/weaviate/query-agent-as-a-tool.ipynb
    • Updated gemini-2.0-flash to gemini-2.5-flash for chat model instantiation.
  • quickstarts/Embeddings.ipynb
    • Replaced text-embedding-004 with gemini-embedding-001 for embedding model ID.
  • quickstarts/Error_handling.ipynb
    • Updated gemini-2.0-flash to gemini-2.5-flash in GenerateContentResponse model version output.
  • quickstarts/Get_started.ipynb
    • Replaced text-embedding-004 with gemini-embedding-001 for text embedding model ID.
  • quickstarts/Get_started_LiveAPI.ipynb
    • Updated gemini-2.0-flash-live-001 and gemini-live-2.5-flash-preview to gemini-2.5-flash-native-audio-preview-12-2025 for live API model selection.
  • quickstarts/Get_started_LiveAPI_tools.ipynb
    • Replaced gemini-2.0-flash-live-001 and gemini-live-2.5-flash-preview with gemini-2.5-flash-native-audio-preview-12-2025 for live API model ID.
  • quickstarts/Get_started_OpenAI_Compatibility.ipynb
    • Upgraded gemini-2.0-flash to gemini-2.5-flash for model usage description.
  • quickstarts/Get_started_imagen.ipynb
    • Migrated imagen-3.0-generate-002 to imagen-4.0-generate-001 in model descriptions and selections.
  • quickstarts/Get_started_imagen_rest.ipynb
    • Replaced imagen-3.0-generate-002 with imagen-4.0-generate-001 in model descriptions and selections.
  • quickstarts/Models.ipynb
    • Updated model names from gemini-2.5-pro-preview-03-25 to gemini-3-pro-preview and gemini-2.5-flash-preview-05-20 to gemini-3-flash-preview.
    • Replaced gemini-2.0-flash variants with gemini-2.5-flash variants.
    • Migrated imagen-3.0-generate-002 to imagen-4.0-generate-001.
    • Updated veo-3.0-generate-preview to veo-3.1-generate-preview and veo-3.0-fast-generate-preview to veo-3.1-fast-generate-preview.
    • Replaced gemini-2.0-flash-live-001 and gemini-live-2.5-flash-preview with gemini-2.5-flash-native-audio-preview-12-2025.
    • Updated text-embedding-004 to gemini-embedding-001.
  • quickstarts/New_in_002.ipynb
    • Migrated imagen-3.0-generate-002 to imagen-4.0-generate-001 in model listings.
  • quickstarts/rest/Audio_REST.ipynb
    • Upgraded gemini-2.0-flash to gemini-2.5-flash for model version in REST API calls.
  • quickstarts/rest/Imagen_REST.ipynb
    • Replaced imagen-3.0-generate-002 with imagen-4.0-generate-001 in model descriptions.
  • quickstarts/websockets/LiveAPI_streaming_in_colab.ipynb
    • Updated gemini-2.0-flash-live-001 to gemini-2.5-flash-native-audio-preview-12-2025 for the streaming model.
Activity
  • No specific activity (comments, reviews, or progress updates) has been recorded for this pull request since its creation.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request aims to update deprecated model names across various notebooks. While most of the updates are correct, there are several instances where the list of models in @param decorators now contains duplicate entries. Additionally, in a few markdown cells, the description of a model is now inconsistent with the updated model ID. I've left specific comments on these issues.

Comment thread examples/Browser_as_a_tool.ipynb Outdated
"client = genai.Client(api_key=GOOGLE_API_KEY)\n",
"\n",
"LIVE_MODEL = 'gemini-2.5-flash-native-audio-preview-09-2025' # @param ['gemini-2.0-flash-live-001', 'gemini-live-2.5-flash-preview', 'gemini-2.5-flash-native-audio-preview-09-2025'] {allow-input: true, isTemplate: true}\n",
"LIVE_MODEL = 'gemini-2.5-flash-native-audio-preview-09-2025' # @param ['gemini-2.5-flash-native-audio-preview-12-2025', 'gemini-2.5-flash-native-audio-preview-12-2025', 'gemini-2.5-flash-native-audio-preview-09-2025'] {allow-input: true, isTemplate: true}\n",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The list of models in the @param decorator contains a duplicate entry for 'gemini-2.5-flash-native-audio-preview-12-2025'. Please remove the duplicate to avoid confusion and keep the list of selectable models clean.

LIVE_MODEL = 'gemini-2.5-flash-native-audio-preview-09-2025'  # @param ['gemini-2.5-flash-native-audio-preview-12-2025', 'gemini-2.5-flash-native-audio-preview-09-2025'] {allow-input: true, isTemplate: true}

"outputs": [],
"source": [
"MODEL_ID = \"gemini-embedding-001\" # @param [\"gemini-embedding-001\", \"text-embedding-004\"] {\"allow-input\":true, isTemplate: true}"
"MODEL_ID = \"gemini-embedding-001\" # @param [\"gemini-embedding-001\", \"gemini-embedding-001\"] {\"allow-input\":true, isTemplate: true}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The list of models in the @param decorator contains a duplicate entry: "gemini-embedding-001". This is redundant. Please remove the duplicate.

MODEL_ID = "gemini-embedding-001" # @param ["gemini-embedding-001"] {"allow-input":true, isTemplate: true}

"outputs": [],
"source": [
"EMBEDDINGS_MODEL_ID = \"gemini-embedding-001\" # @param [\"gemini-embedding-001\", \"text-embedding-004\"] {\"allow-input\": true, \"isTemplate\": true}\n",
"EMBEDDINGS_MODEL_ID = \"gemini-embedding-001\" # @param [\"gemini-embedding-001\", \"gemini-embedding-001\"] {\"allow-input\": true, \"isTemplate\": true}\n",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The list of models in the @param decorator contains a duplicate entry: "gemini-embedding-001". This is redundant. Please remove the duplicate.

EMBEDDINGS_MODEL_ID = "gemini-embedding-001"  # @param ["gemini-embedding-001"] {"allow-input": true, "isTemplate": true}

"\"\"\"\n",
"\n",
"EMBEDDING_MODEL_ID = MODEL_ID = \"gemini-embedding-001\" # @param [\"gemini-embedding-001\", \"text-embedding-004\"] {\"allow-input\": true, \"isTemplate\": true}\n",
"EMBEDDING_MODEL_ID = MODEL_ID = \"gemini-embedding-001\" # @param [\"gemini-embedding-001\", \"gemini-embedding-001\"] {\"allow-input\": true, \"isTemplate\": true}\n",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The list of models in the @param decorator contains a duplicate entry: "gemini-embedding-001". This is redundant. Please remove the duplicate.

EMBEDDING_MODEL_ID = MODEL_ID = "gemini-embedding-001"  # @param ["gemini-embedding-001"] {"allow-input": true, "isTemplate": true}

Comment thread examples/anomaly_detection.ipynb Outdated
"outputs": [],
"source": [
"MODEL_ID = \"gemini-embedding-001\" # @param [\"gemini-embedding-001\", \"text-embedding-004\"] {\"allow-input\":true, isTemplate: true}"
"MODEL_ID = \"gemini-embedding-001\" # @param [\"gemini-embedding-001\", \"gemini-embedding-001\"] {\"allow-input\":true, isTemplate: true}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The list of models in the @param decorator contains a duplicate entry: "gemini-embedding-001". This is redundant. Please remove the duplicate.

MODEL_ID = "gemini-embedding-001" # @param ["gemini-embedding-001"] {"allow-input":true, isTemplate: true}

"\n",
"# Select embedding model\n",
"MODEL_ID = \"gemini-embedding-001\" # @param [\"gemini-embedding-001\", \"text-embedding-004\"] {\"allow-input\": true, \"isTemplate\": true}\n",
"MODEL_ID = \"gemini-embedding-001\" # @param [\"gemini-embedding-001\", \"gemini-embedding-001\"] {\"allow-input\": true, \"isTemplate\": true}\n",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The list of models in the @param decorator contains a duplicate entry: "gemini-embedding-001". This is redundant. Please remove the duplicate.

MODEL_ID = "gemini-embedding-001"  # @param ["gemini-embedding-001"] {"allow-input": true, "isTemplate": true}

Comment thread quickstarts/Embeddings.ipynb Outdated
"outputs": [],
"source": [
"MODEL_ID = \"gemini-embedding-001\" # @param [\"gemini-embedding-001\", \"text-embedding-004\"] {\"allow-input\":true, isTemplate: true}"
"MODEL_ID = \"gemini-embedding-001\" # @param [\"gemini-embedding-001\", \"gemini-embedding-001\"] {\"allow-input\":true, isTemplate: true}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The list of models in the @param decorator contains a duplicate entry: "gemini-embedding-001". This is redundant. Please remove the duplicate.

MODEL_ID = "gemini-embedding-001" # @param ["gemini-embedding-001"] {"allow-input":true, isTemplate: true}

Comment thread quickstarts/Get_started.ipynb Outdated
"outputs": [],
"source": [
"TEXT_EMBEDDING_MODEL_ID = \"gemini-embedding-001\" # @param [\"gemini-embedding-001\", \"text-embedding-004\"] {\"allow-input\":true, isTemplate: true}"
"TEXT_EMBEDDING_MODEL_ID = \"gemini-embedding-001\" # @param [\"gemini-embedding-001\", \"gemini-embedding-001\"] {\"allow-input\":true, isTemplate: true}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The list of models in the @param decorator contains a duplicate entry: "gemini-embedding-001". This is redundant. Please remove the duplicate.

TEXT_EMBEDDING_MODEL_ID = "gemini-embedding-001" # @param ["gemini-embedding-001"] {"allow-input":true, isTemplate: true}

Comment thread quickstarts/Get_started_LiveAPI.ipynb Outdated
"outputs": [],
"source": [
"MODEL = 'gemini-2.5-flash-native-audio-preview-09-2025' # @param ['gemini-2.0-flash-live-001', 'gemini-live-2.5-flash-preview', 'gemini-2.5-flash-native-audio-preview-09-2025'] {allow-input: true, isTemplate: true}"
"MODEL = 'gemini-2.5-flash-native-audio-preview-09-2025' # @param ['gemini-2.5-flash-native-audio-preview-12-2025', 'gemini-2.5-flash-native-audio-preview-12-2025', 'gemini-2.5-flash-native-audio-preview-09-2025'] {allow-input: true, isTemplate: true}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The list of models in the @param decorator contains a duplicate entry for 'gemini-2.5-flash-native-audio-preview-12-2025'. Please remove the duplicate to avoid confusion.

MODEL = 'gemini-2.5-flash-native-audio-preview-09-2025'  # @param ['gemini-2.5-flash-native-audio-preview-12-2025', 'gemini-2.5-flash-native-audio-preview-09-2025'] {allow-input: true, isTemplate: true}

"outputs": [],
"source": [
"MODEL_ID = 'gemini-live-2.5-flash-preview' # @param ['gemini-2.0-flash-live-001', 'gemini-live-2.5-flash-preview', 'gemini-2.5-flash-native-audio-preview-09-2025'] {allow-input: true, isTemplate: true}"
"MODEL_ID = 'gemini-2.5-flash-native-audio-preview-12-2025' # @param ['gemini-2.5-flash-native-audio-preview-12-2025', 'gemini-2.5-flash-native-audio-preview-12-2025', 'gemini-2.5-flash-native-audio-preview-09-2025'] {allow-input: true, isTemplate: true}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The list of models in the @param decorator contains a duplicate entry for 'gemini-2.5-flash-native-audio-preview-12-2025'. Please remove the duplicate to avoid confusion.

MODEL_ID = 'gemini-2.5-flash-native-audio-preview-12-2025'  # @param ['gemini-2.5-flash-native-audio-preview-12-2025', 'gemini-2.5-flash-native-audio-preview-09-2025'] {allow-input: true, isTemplate: true}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:examples Issues/PR referencing examples folder component:quickstarts Issues/PR referencing quickstarts folder status:awaiting review PR awaiting review from a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant