<!--
{
  "availability" : [
    "iOS: 17.4.0 -",
    "iPadOS: 17.4.0 -",
    "macCatalyst: 17.4.0 -",
    "macOS: 14.4.0 -",
    "tvOS: 17.4.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreML",
  "identifier" : "/documentation/CoreML/MLModelStructure-swift.enum",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Core ML"
    ],
    "preciseIdentifier" : "s:6CoreML16MLModelStructureO"
  },
  "title" : "MLModelStructure"
}
-->

# MLModelStructure

An enum representing the structure of a model.

```
enum MLModelStructure
```

## Overview

```
// Load the model structure.
let modelStructure = await try MLModelStructure.load(contentsOf: modelURL)
switch modelStructure {
case .program(let program):
   // Examine ML Program model.
case .neuralNetwork(let neuralNetwork):
   // Examine Neural network model
case .pipeline(let pipeline)
   // Examine Pipeline model
default:
   // The model type is something else.
}
```

## Topics

### Model structures

[`MLModelStructure.neuralNetwork(_:)`](/documentation/CoreML/MLModelStructure-swift.enum/neuralNetwork(_:))

Represents a NeuralNetwork model, the associated value is the structure of the NeuralNetwork.

[`MLModelStructure.NeuralNetwork`](/documentation/CoreML/MLModelStructure-swift.enum/NeuralNetwork)

A struct representing the structure of a NeuralNetwork model..

[`MLModelStructure.pipeline(_:)`](/documentation/CoreML/MLModelStructure-swift.enum/pipeline(_:))

Represents a Pipeline model, the associated value is the structure of the Pipeline.

[`MLModelStructure.Pipeline`](/documentation/CoreML/MLModelStructure-swift.enum/Pipeline)

A struct representing the structure of a Pipeline model..

[`MLModelStructure.program(_:)`](/documentation/CoreML/MLModelStructure-swift.enum/program(_:))

Represents a MLProgram model. the associated value is the structure of the Program.

[`MLModelStructure.Program`](/documentation/CoreML/MLModelStructure-swift.enum/Program)

A struct representing the structure of an ML Program model.

[`MLModelStructure.unsupported`](/documentation/CoreML/MLModelStructure-swift.enum/unsupported)

Represents an unsupported model.

### Loading a model structure

[`load(asset:)`](/documentation/CoreML/MLModelStructure-swift.enum/load(asset:))

Load the model structure asynchronously from the model asset.

[`load(contentsOf:)`](/documentation/CoreML/MLModelStructure-swift.enum/load(contentsOf:))

Load the model structure asynchronously given the location of its on-disk representation.



---

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)