-
-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add support for listing running Ollama models (#451)
Co-authored-by: David Miguel <me@davidmiguel.com>
- Loading branch information
1 parent
255f34c
commit cfaa31f
Showing
9 changed files
with
742 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
packages/ollama_dart/lib/src/generated/schema/process_model.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// coverage:ignore-file | ||
// GENERATED CODE - DO NOT MODIFY BY HAND | ||
// ignore_for_file: type=lint | ||
// ignore_for_file: invalid_annotation_target | ||
part of ollama_schema; | ||
|
||
// ========================================== | ||
// CLASS: ProcessModel | ||
// ========================================== | ||
|
||
/// A model that is currently loaded. | ||
@freezed | ||
class ProcessModel with _$ProcessModel { | ||
const ProcessModel._(); | ||
|
||
/// Factory constructor for ProcessModel | ||
const factory ProcessModel({ | ||
/// The model name. | ||
/// | ||
/// Model names follow a `model:tag` format. Some examples are `orca-mini:3b-q4_1` and `llama3:70b`. The tag is optional and, if not provided, will default to `latest`. The tag is used to identify a specific version. | ||
@JsonKey(includeIfNull: false) String? model, | ||
|
||
/// Size of the model on disk. | ||
@JsonKey(includeIfNull: false) int? size, | ||
|
||
/// The model's digest. | ||
@JsonKey(includeIfNull: false) String? digest, | ||
|
||
/// Details about a model. | ||
@JsonKey(includeIfNull: false) ModelDetails? details, | ||
|
||
/// No Description | ||
@JsonKey(name: 'expires_at', includeIfNull: false) String? expiresAt, | ||
|
||
/// Size of the model on disk. | ||
@JsonKey(name: 'size_vram', includeIfNull: false) int? sizeVram, | ||
}) = _ProcessModel; | ||
|
||
/// Object construction from a JSON representation | ||
factory ProcessModel.fromJson(Map<String, dynamic> json) => | ||
_$ProcessModelFromJson(json); | ||
|
||
/// List of all property names of schema | ||
static const List<String> propertyNames = [ | ||
'model', | ||
'size', | ||
'digest', | ||
'details', | ||
'expires_at', | ||
'size_vram' | ||
]; | ||
|
||
/// Perform validations on the schema property values | ||
String? validateSchema() { | ||
return null; | ||
} | ||
|
||
/// Map representation of object (not serialized) | ||
Map<String, dynamic> toMap() { | ||
return { | ||
'model': model, | ||
'size': size, | ||
'digest': digest, | ||
'details': details, | ||
'expires_at': expiresAt, | ||
'size_vram': sizeVram, | ||
}; | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
packages/ollama_dart/lib/src/generated/schema/process_response.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// coverage:ignore-file | ||
// GENERATED CODE - DO NOT MODIFY BY HAND | ||
// ignore_for_file: type=lint | ||
// ignore_for_file: invalid_annotation_target | ||
part of ollama_schema; | ||
|
||
// ========================================== | ||
// CLASS: ProcessResponse | ||
// ========================================== | ||
|
||
/// Response class for the list running models endpoint. | ||
@freezed | ||
class ProcessResponse with _$ProcessResponse { | ||
const ProcessResponse._(); | ||
|
||
/// Factory constructor for ProcessResponse | ||
const factory ProcessResponse({ | ||
/// List of running models. | ||
@JsonKey(includeIfNull: false) List<ProcessModel>? models, | ||
}) = _ProcessResponse; | ||
|
||
/// Object construction from a JSON representation | ||
factory ProcessResponse.fromJson(Map<String, dynamic> json) => | ||
_$ProcessResponseFromJson(json); | ||
|
||
/// List of all property names of schema | ||
static const List<String> propertyNames = ['models']; | ||
|
||
/// Perform validations on the schema property values | ||
String? validateSchema() { | ||
return null; | ||
} | ||
|
||
/// Map representation of object (not serialized) | ||
Map<String, dynamic> toMap() { | ||
return { | ||
'models': models, | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.