<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FoundationModels",
  "identifier" : "/documentation/FoundationModels/GenerationOptions/temperature",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation Models"
    ],
    "preciseIdentifier" : "s:16FoundationModels17GenerationOptionsV11temperatureSdSgvp"
  },
  "title" : "temperature"
}
-->

# temperature

A value that influences the confidence of the model’s response.

```
var temperature: Double?
```

## Discussion

The value of this property must be a number between `0` and `1` inclusive.

Temperature is an adjustment applied to the probability distribution
prior to sampling. A value of `1` results in no adjustment. Values less
than `1` make the probability distribution sharper, with already
likely tokens becoming even more likely.

The net effect is that low temperatures manifest as more stable and
predictable responses, while high temperatures give the model more
creative license.

> Note: Leaving `temperature` nil lets the system choose a reasonable
> default on your behalf.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)