ModelInfo class

Information about an available model from a provider.

This class provides a standardized way to represent model metadata across different providers. Not all providers supply all fields.

Example:

final chatModel = ChatOpenAI(apiKey: '...');
final models = await chatModel.listModels();
for (final model in models) {
  print('${model.id} - ${model.displayName ?? ""}');
}
Annotations
  • @immutable

Constructors

ModelInfo({required String id, String? displayName, String? description, String? ownedBy, int? created, int? inputTokenLimit, int? outputTokenLimit})
Information about an available model from a provider.
const

Properties

created → int?
Unix timestamp (in seconds) when the model was created.
final
description → String?
Description of the model's capabilities or purpose.
final
displayName → String?
Human-readable display name for the model.
final
hashCode → int
The hash code for this object.
no setteroverride
id → String
The model identifier (e.g., "gpt-4", "llama3.2", "claude-3-sonnet").
final
inputTokenLimit → int?
Maximum number of input tokens the model can process.
final
outputTokenLimit → int?
Maximum number of output tokens the model can generate.
final
ownedBy → String?
The organization or owner of the model.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override