Model
This is ready-to-use AI model.
Declaration
final class Model
Overview
The Model
class represents a ready to use AI Model on the aiXplain Platform. It provides functionality to run the Model and handle its execution.
Usage
- Initialize a
Model
object with the necessary parameters. - Call the
run(_:id:parameters:)
method to execute the pipeline.
Example
let model = ModelProvider.get("ModelID")
let input = "Hello World"
do {
let output = try await model.run(input)
// Handle model output
} catch {
// Handle errors
}
Topics
Initializers
Creates a new Model
instance from the provided decoder. Mainly used to decode JSON data.
Creates a new MLModel
instance with the provided parameters.
Instance Properties
Unique identifier for the model.
Optional license information associated with the model.
Description of the model’s functionality.
Name of the model.
Information about the model’s pricing.
Optional privacy information associated with the model.
The entity that provides the model.
Version of the model.
Instance Methods
func run(ModelInput, id: String, parameters: ModelRunParameters) async throws -> ModelOutput