List_models shows incomplete/invalid response for Gemma

,

Using the REST API (Models  |  Gemini API  |  Google AI for Developers) to retrieve the list of models, the response contains this:

    {
      "name": "models/gemini-2.0-flash-thinking-exp-1219",
      "version": "2.0",
      "displayName": "Gemini 2.0 Flash Thinking Experimental",
      "description": "Gemini 2.0 Flash Thinking Experimental",
      "inputTokenLimit": 1048576,
      "outputTokenLimit": 65536,
      "supportedGenerationMethods": [
        "generateContent",
        "countTokens"
      ],
      "temperature": 0.7,
      "topP": 0.95,
      "topK": 64,
      "maxTemperature": 2
    },
    {
      "name": "models/learnlm-1.5-pro-experimental",
      "version": "001",
      "displayName": "LearnLM 1.5 Pro Experimental",
      "description": "Alias that points to the most recent stable version of Gemini 1.5 Pro, our mid-size multimodal model that supports up to 2 million tokens.",
      "inputTokenLimit": 32767,
      "outputTokenLimit": 8192,
      "supportedGenerationMethods": [
        "generateContent",
        "countTokens"
      ],
      "temperature": 1,
      "topP": 0.95,
      "topK": 64,
      "maxTemperature": 2
    },
    {
      "version": "001",emma-3-27b-it",
      "displayName": "Gemma 3 27B",
      "inputTokenLimit": 131072,
      "outputTokenLimit": 8192,
      "supportedGenerationMethods": [
        "generateContent",
        "countTokens"
      ],
      "temperature": 1,
      "topP": 0.95,
      "topK": 64
    },
    {
      "name": "models/embedding-001",
      "version": "001",
      "displayName": "Embedding 001",
      "description": "Obtain a distributed representation of a text.",
      "inputTokenLimit": 2048,
      "outputTokenLimit": 1,
      "supportedGenerationMethods": [
        "embedContent"
      ]
    },

Notice that the json for Gemma is missing the (non-optional) “name” field, which makes the response invalid. The expected fields are documented here: deprecated-generative-ai-python/docs/api/google/generativeai/types/Model.md at main · google-gemini/deprecated-generative-ai-python · GitHub

Hey @OrangiaNebula
The response seems to be fine for gemma models. Below is the response:

    {
      "name": "models/gemma-3-1b-it",
      "version": "001",
      "displayName": "Gemma 3 1B",
      "inputTokenLimit": 32768,
      "outputTokenLimit": 8192,
      "supportedGenerationMethods": [
        "generateContent",
        "countTokens"
      ],
      "temperature": 1,
      "topP": 0.95,
      "topK": 64
    },
    {
      "name": "models/gemma-3-4b-it",
      "version": "001",
      "displayName": "Gemma 3 4B",
      "inputTokenLimit": 32768,
      "outputTokenLimit": 8192,
      "supportedGenerationMethods": [
        "generateContent",
        "countTokens"
      ],
      "temperature": 1,
      "topP": 0.95,
      "topK": 64
    },
    {
      "name": "models/gemma-3-12b-it",
      "version": "001",
      "displayName": "Gemma 3 12B",
      "inputTokenLimit": 32768,
      "outputTokenLimit": 8192,
      "supportedGenerationMethods": [
        "generateContent",
        "countTokens"
      ],
      "temperature": 1,
      "topP": 0.95,
      "topK": 64
    },
    {
      "name": "models/gemma-3-27b-it",
      "version": "001",
      "displayName": "Gemma 3 27B",
      "inputTokenLimit": 131072,
      "outputTokenLimit": 8192,
      "supportedGenerationMethods": [
        "generateContent",
        "countTokens"
      ],
      "temperature": 1,
      "topP": 0.95,
      "topK": 64
    }

Could you please check and confirm.
Thank you!

Thank you for checking. You helped me identify what the actual difference is: The Gemma entries are missing the description field, which is present in the other model entries. I was using a validating parser, so it faulted on the Gemma entry. Simply compare the output to the preceding one to see the difference:

    {
      "name": "models/learnlm-2.0-flash-experimental",
      "version": "2.0",
      "displayName": "LearnLM 2.0 Flash Experimental",
      "description": "LearnLM 2.0 Flash Experimental",
      "inputTokenLimit": 1048576,
      "outputTokenLimit": 32768,
      "supportedGenerationMethods": [
        "generateContent",
        "countTokens"
      ],
      "temperature": 1,
      "topP": 0.95,
      "topK": 64,
      "maxTemperature": 2
    },
    {
      "name": "models/gemma-3-1b-it",
      "version": "001",
      "displayName": "Gemma 3 1B",
      "inputTokenLimit": 32768,
      "outputTokenLimit": 8192,
      "supportedGenerationMethods": [
        "generateContent",
        "countTokens"
      ],
      "temperature": 1,
      "topP": 0.95,
      "topK": 64
    },
    {
      "name": "models/gemma-3-4b-it",
      "version": "001",
      "displayName": "Gemma 3 4B",
      "inputTokenLimit": 32768,
      "outputTokenLimit": 8192,
      "supportedGenerationMethods": [
        "generateContent",
        "countTokens"
      ],
      "temperature": 1,
      "topP": 0.95,
      "topK": 64
    },

Hey @OrangiaNebula
Yes, you are right description is missing for Gemma models.
Thank you for bringing this to our attention. We will look into it and provide an update here.
Thank you!