custom_models
Creates, updates, deletes, gets or lists a custom_models resource.
Overview
| Name | custom_models |
| Type | Resource |
| Id | digitalocean.genai.custom_models |
Fields
The following fields are returned by SELECT queries:
- genai_get_custom_model
- genai_list_custom_models
A successful response.
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the custom model (example: example name) |
team_id | string (uint64) | Team that owns the model (example: 12345) |
active_deployments | array | List of active deployments using this model |
architecture | string | Model architecture type (free-form string from config.json) (example: example string) |
config_json | string | Raw config.json contents from the model repository (opaque JSON object) |
context_length | integer (int64) | Maximum context length supported by the model |
cost_estimate_per_month | integer (int64) | Estimated monthly cost in dollars for hosting |
created_at | string (date-time) | Timestamp when the model was created (example: 2023-01-01T00:00:00Z) |
description | string | Description of the custom model (example: example string) |
error_message | string | User-facing reason the most recent import failed; empty otherwise. (example: example string) |
file_count | integer (int64) | Number of files in the model |
input_modalities | array | Input modalities supported (e.g., text, image) |
license | string | License under which the model is distributed (example: example string) |
output_modalities | array | Output modalities supported (e.g., text, image) |
parameters | string (uint64) | Number of parameters in the model (example: 12345) |
source_ref | object | Reference to the original source of the model |
source_type | string | Source from which the model was imported (SOURCE_TYPE_UNSPECIFIED, SOURCE_TYPE_HUGGINGFACE, SOURCE_TYPE_SPACES_BUCKET, SOURCE_TYPE_SDK_UPLOAD, SOURCE_TYPE_FINE_TUNING) (default: SOURCE_TYPE_UNSPECIFIED, example: SOURCE_TYPE_UNSPECIFIED) |
status | string | Import and deployment status of the custom model (STATUS_UNSPECIFIED, STATUS_IMPORTING, STATUS_READY, STATUS_FAILED, STATUS_DELETED) (default: STATUS_UNSPECIFIED, example: STATUS_UNSPECIFIED) |
storage_region | string | Region of the Spaces bucket where model files are stored (example: example string) |
tags | object | User-defined tags for organizing models |
total_size_bytes | string (uint64) | Total size of model files in bytes (example: 12345) |
updated_at | string (date-time) | Timestamp when the model was last updated (example: 2023-01-01T00:00:00Z) |
uuid | string | Unique identifier for the custom model (example: 123e4567-e89b-12d3-a456-426614174000) |
A successful response.
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the custom model (example: example name) |
team_id | string (uint64) | Team that owns the model (example: 12345) |
active_deployments | array | List of active deployments using this model |
architecture | string | Model architecture type (free-form string from config.json) (example: example string) |
config_json | string | Raw config.json contents from the model repository (opaque JSON object) |
context_length | integer (int64) | Maximum context length supported by the model |
cost_estimate_per_month | integer (int64) | Estimated monthly cost in dollars for hosting |
created_at | string (date-time) | Timestamp when the model was created (example: 2023-01-01T00:00:00Z) |
description | string | Description of the custom model (example: example string) |
error_message | string | User-facing reason the most recent import failed; empty otherwise. (example: example string) |
file_count | integer (int64) | Number of files in the model |
input_modalities | array | Input modalities supported (e.g., text, image) |
license | string | License under which the model is distributed (example: example string) |
output_modalities | array | Output modalities supported (e.g., text, image) |
parameters | string (uint64) | Number of parameters in the model (example: 12345) |
source_ref | object | Reference to the original source of the model |
source_type | string | Source from which the model was imported (SOURCE_TYPE_UNSPECIFIED, SOURCE_TYPE_HUGGINGFACE, SOURCE_TYPE_SPACES_BUCKET, SOURCE_TYPE_SDK_UPLOAD, SOURCE_TYPE_FINE_TUNING) (default: SOURCE_TYPE_UNSPECIFIED, example: SOURCE_TYPE_UNSPECIFIED) |
status | string | Import and deployment status of the custom model (STATUS_UNSPECIFIED, STATUS_IMPORTING, STATUS_READY, STATUS_FAILED, STATUS_DELETED) (default: STATUS_UNSPECIFIED, example: STATUS_UNSPECIFIED) |
storage_region | string | Region of the Spaces bucket where model files are stored (example: example string) |
tags | object | User-defined tags for organizing models |
total_size_bytes | string (uint64) | Total size of model files in bytes (example: 12345) |
updated_at | string (date-time) | Timestamp when the model was last updated (example: 2023-01-01T00:00:00Z) |
uuid | string | Unique identifier for the custom model (example: 123e4567-e89b-12d3-a456-426614174000) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
genai_get_custom_model | select | uuid | To retrieve details of a custom model, send a GET request to /v2/gen-ai/custom_models/{uuid}. | |
genai_list_custom_models | select | page, per_page, status | To list custom models, send a GET request to /v2/gen-ai/custom_models. | |
genai_import_custom_model | insert | To import a custom model, send a POST request to /v2/gen-ai/custom_models/import. | ||
genai_update_custom_model_metadata | update | uuid | To update custom model metadata, send a PATCH request to /v2/gen-ai/custom_models/{uuid}/metadata. | |
genai_delete_custom_model | delete | uuid | To delete a custom model, send a DELETE request to /v2/genai/custom_models/{uuid}. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
uuid | string | UUID of the custom model to delete (example: "123e4567-e89b-12d3-a456-426614174000") |
page | integer | Page number for pagination. (example: 1) |
per_page | integer | Number of items per page. (example: 1) |
status | string | Filter by model status. (example: STATUS_UNSPECIFIED) |
SELECT examples
- genai_get_custom_model
- genai_list_custom_models
To retrieve details of a custom model, send a GET request to /v2/gen-ai/custom_models/{uuid}.
SELECT
name,
team_id,
active_deployments,
architecture,
config_json,
context_length,
cost_estimate_per_month,
created_at,
description,
error_message,
file_count,
input_modalities,
license,
output_modalities,
parameters,
source_ref,
source_type,
status,
storage_region,
tags,
total_size_bytes,
updated_at,
uuid
FROM digitalocean.genai.custom_models
WHERE uuid = '{{ uuid }}' -- required
;
To list custom models, send a GET request to /v2/gen-ai/custom_models.
SELECT
name,
team_id,
active_deployments,
architecture,
config_json,
context_length,
cost_estimate_per_month,
created_at,
description,
error_message,
file_count,
input_modalities,
license,
output_modalities,
parameters,
source_ref,
source_type,
status,
storage_region,
tags,
total_size_bytes,
updated_at,
uuid
FROM digitalocean.genai.custom_models
WHERE page = '{{ page }}'
AND per_page = '{{ per_page }}'
AND status = '{{ status }}'
;
INSERT examples
- genai_import_custom_model
- Manifest
To import a custom model, send a POST request to /v2/gen-ai/custom_models/import.
INSERT INTO digitalocean.genai.custom_models (
accept_hf_token_storage,
accept_terms_and_conditions,
description,
name,
preferred_gpu_region,
source_ref,
source_type,
tags
)
SELECT
{{ accept_hf_token_storage }},
{{ accept_terms_and_conditions }},
'{{ description }}',
'{{ name }}',
'{{ preferred_gpu_region }}',
'{{ source_ref }}',
'{{ source_type }}',
'{{ tags }}'
RETURNING
error,
import_job,
model,
validation_steps
;
# Description fields are for documentation purposes
- name: custom_models
props:
- name: accept_hf_token_storage
value: {{ accept_hf_token_storage }}
description: |
Whether the caller accepts storage of their HuggingFace token for gated model access
- name: accept_terms_and_conditions
value: {{ accept_terms_and_conditions }}
description: |
Whether the caller accepts the terms and conditions for importing this model
- name: description
value: "{{ description }}"
description: |
Description of the model
- name: name
value: "{{ name }}"
description: |
Name for the imported model
- name: preferred_gpu_region
value: "{{ preferred_gpu_region }}"
description: |
Preferred GPU region for deployment
- name: source_ref
description: |
Reference to the original source of the model
value:
access_type: "{{ access_type }}"
bucket: "{{ bucket }}"
commit_sha: "{{ commit_sha }}"
hf_token: "{{ hf_token }}"
prefix: "{{ prefix }}"
region: "{{ region }}"
repo_id: "{{ repo_id }}"
- name: source_type
value: "{{ source_type }}"
description: |
Source from which the model was imported
valid_values: ['SOURCE_TYPE_UNSPECIFIED', 'SOURCE_TYPE_HUGGINGFACE', 'SOURCE_TYPE_SPACES_BUCKET', 'SOURCE_TYPE_SDK_UPLOAD', 'SOURCE_TYPE_FINE_TUNING']
default: SOURCE_TYPE_UNSPECIFIED
- name: tags
description: |
User-defined tags for organizing models
value:
tags:
- "{{ tags }}"
UPDATE examples
- genai_update_custom_model_metadata
To update custom model metadata, send a PATCH request to /v2/gen-ai/custom_models/{uuid}/metadata.
UPDATE digitalocean.genai.custom_models
SET
description = '{{ description }}',
input_modalities = '{{ input_modalities }}',
license = '{{ license }}',
name = '{{ name }}',
output_modalities = '{{ output_modalities }}',
parameters = '{{ parameters }}',
tags = '{{ tags }}',
uuid = '{{ uuid }}'
WHERE
uuid = '{{ uuid }}' --required
RETURNING
model;
DELETE examples
- genai_delete_custom_model
To delete a custom model, send a DELETE request to /v2/genai/custom_models/{uuid}.
DELETE FROM digitalocean.genai.custom_models
WHERE uuid = '{{ uuid }}' --required
;