{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-gemini/json-schema/google-gemini-tuned-model-schema.json",
  "title": "TunedModel",
  "description": "A fine-tuned model created using ModelService.CreateTunedModel.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-gemini-tuned-models-api-openapi.yml#/components/schemas/TunedModel",
  "type": "object",
  "properties": {
    "temperature": {
      "description": "Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be the one used by the base model while creating the model.",
      "type": "number",
      "format": "float"
    },
    "description": {
      "type": "string",
      "description": "Optional. A short description of this model."
    },
    "createTime": {
      "readOnly": true,
      "description": "Output only. The timestamp when this model was created.",
      "type": "string",
      "format": "google-datetime"
    },
    "state": {
      "readOnly": true,
      "description": "Output only. The state of the tuned model.",
      "enum": [
        "STATE_UNSPECIFIED",
        "CREATING",
        "ACTIVE",
        "FAILED"
      ],
      "type": "string"
    },
    "name": {
      "readOnly": true,
      "type": "string",
      "description": "Output only. The tuned model name. A unique name will be generated on create. Example: `tunedModels/az2mb0bpw6i` If display_name is set on create, the id portion of the name will be set by concatenating the words of the display_name with hyphens and adding a random portion for uniqueness. Example: * display_name = `Sentence Translator` * name = `tunedModels/sentence-translator-u3b7m`"
    },
    "readerProjectNumbers": {
      "description": "Optional. List of project numbers that have read access to the tuned model.",
      "type": "array",
      "items": {
        "type": "string",
        "format": "int64"
      }
    },
    "updateTime": {
      "description": "Output only. The timestamp when this model was updated.",
      "readOnly": true,
      "format": "google-datetime",
      "type": "string"
    },
    "tuningTask": {
      "$ref": "#/$defs/TuningTask",
      "description": "Required. The tuning task that creates the tuned model."
    },
    "displayName": {
      "description": "Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces.",
      "type": "string"
    },
    "tunedModelSource": {
      "$ref": "#/$defs/TunedModelSource",
      "description": "Optional. TunedModel to use as the starting point for training the new model."
    },
    "baseModel": {
      "description": "Immutable. The name of the `Model` to tune. Example: `models/gemini-1.5-flash-001`",
      "type": "string"
    },
    "topP": {
      "description": "Optional. For Nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be the one used by the base model while creating the model.",
      "type": "number",
      "format": "float"
    },
    "topK": {
      "description": "Optional. For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. This value specifies default to be the one used by the base model while creating the model.",
      "type": "integer",
      "format": "int32"
    }
  },
  "$defs": {
    "Dataset": {
      "properties": {},
      "description": "Dataset for training or validation.",
      "type": "object"
    },
    "Hyperparameters": {
      "type": "object",
      "description": "Hyperparameters controlling the tuning process. Read more at https://aistudio.google.com/docs/model-tuning",
      "properties": {
        "learningRateMultiplier": {
          "type": "number",
          "description": "Optional. Immutable. The learning rate multiplier is used to calculate a final learning_rate based on the default (recommended) value. Actual learning rate := learning_rate_multiplier * default learning rate Default learning rate is dependent on base model and dataset size. If not set, a default of 1.0 will be used.",
          "format": "float"
        },
        "batchSize": {
          "format": "int32",
          "type": "integer",
          "description": "Immutable. The batch size hyperparameter for tuning. If not set, a default of 4 or 16 will be used based on the number of training examples."
        },
        "learningRate": {
          "type": "number",
          "description": "Optional. Immutable. The learning rate hyperparameter for tuning. If not set, a default of 0.001 or 0.0002 will be calculated based on the number of training examples.",
          "format": "float"
        },
        "epochCount": {
          "type": "integer",
          "format": "int32",
          "description": "Immutable. The number of training epochs. An epoch is one pass through the training data. If not set, a default of 5 will be used."
        }
      }
    },
    "TunedModelSource": {
      "properties": {
        "baseModel": {
          "readOnly": true,
          "description": "Output only. The name of the base `Model` this `TunedModel` was tuned from. Example: `models/gemini-1.5-flash-001`",
          "type": "string"
        },
        "tunedModel": {
          "description": "Immutable. The name of the `TunedModel` to use as the starting point for training the new model. Example: `tunedModels/my-tuned-model`",
          "type": "string"
        }
      },
      "description": "Tuned model as a source for training a new model.",
      "type": "object"
    },
    "TuningExample": {
      "properties": {
        "output": {
          "type": "string",
          "description": "Required. The expected model output."
        },
        "textInput": {
          "description": "Optional. Text model input.",
          "type": "string"
        }
      },
      "description": "A single example for tuning.",
      "type": "object"
    },
    "TuningExamples": {
      "type": "object",
      "description": "A set of tuning examples. Can be training or validation data.",
      "properties": {}
    },
    "TuningSnapshot": {
      "description": "Record for a single tuning step.",
      "type": "object",
      "properties": {
        "step": {
          "readOnly": true,
          "type": "integer",
          "description": "Output only. The tuning step.",
          "format": "int32"
        },
        "epoch": {
          "description": "Output only. The epoch this step was part of.",
          "format": "int32",
          "type": "integer",
          "readOnly": true
        },
        "computeTime": {
          "description": "Output only. The timestamp when this metric was computed.",
          "format": "google-datetime",
          "readOnly": true,
          "type": "string"
        },
        "meanLoss": {
          "type": "number",
          "description": "Output only. The mean loss of the training examples for this step.",
          "readOnly": true,
          "format": "float"
        }
      }
    },
    "TuningTask": {
      "description": "Tuning tasks that create tuned models.",
      "properties": {
        "snapshots": {
          "readOnly": true,
          "type": "array",
          "items": {
            "$ref": "#/$defs/TuningSnapshot"
          },
          "description": "Output only. Metrics collected during tuning."
        },
        "completeTime": {
          "format": "google-datetime",
          "description": "Output only. The timestamp when tuning this model completed.",
          "readOnly": true,
          "type": "string"
        },
        "hyperparameters": {
          "$ref": "#/$defs/Hyperparameters",
          "description": "Immutable. Hyperparameters controlling the tuning process. If not provided, default values will be used."
        },
        "startTime": {
          "format": "google-datetime",
          "readOnly": true,
          "description": "Output only. The timestamp when tuning this model started.",
          "type": "string"
        },
        "trainingData": {
          "$ref": "#/$defs/Dataset",
          "description": "Required. Input only. Immutable. The model training data."
        }
      },
      "type": "object"
    }
  }
}