pydo.genai.import_custom_model()

Generated on 3 Aug 2026 from pydo version v0.40.0

Usage

client.genai.import_custom_model(
    body={
        "accept_hf_token_storage": True,
        "accept_terms_and_conditions": True,
        "description": "Production model for customer support",
        ...,
    },
)
Returns JSONRaises HttpResponseError

Description

To import a custom model, send a POST request to /v2/gen-ai/custom_models/import.

Parameters

accept_hf_token_storage boolean optional

Example: True

Whether the caller accepts storage of their HuggingFace token for gated model access

accept_terms_and_conditions boolean optional

Example: True

Whether the caller accepts the terms and conditions for importing this model

description string optional

Example: Production model for customer support

Description of the model

name string optional

Example: my-mistral-7b

Name for the imported model

preferred_gpu_region string optional

Example: nyc3

Preferred GPU region for deployment

source_ref object optional

Reference to the original source of the model

Show child properties
access_type string optional

Access level required for the model repository

One of: ACCESS_TYPE_UNSPECIFIED, ACCESS_TYPE_PUBLIC, ACCESS_TYPE_PRIVATE, ACCESS_TYPE_GATED

Default: ACCESS_TYPE_UNSPECIFIED

bucket string optional

Example: example string

Spaces bucket name

commit_sha string optional

Example: example string

Git commit SHA of the model version

hf_token string optional

Example: example string

User-provided HuggingFace token for gated/private models (not persisted in source_ref)

prefix string optional

Example: example string

Object prefix path in the bucket

region string optional

Example: example string

Spaces bucket region

repo_id string optional

Example: 123e4567-e89b-12d3-a456-426614174000

Huggingface repository identifier

source_type string optional

Source from which the model was imported

One of: SOURCE_TYPE_UNSPECIFIED, SOURCE_TYPE_HUGGINGFACE, SOURCE_TYPE_SPACES_BUCKET, SOURCE_TYPE_SDK_UPLOAD, SOURCE_TYPE_FINE_TUNING

Default: SOURCE_TYPE_UNSPECIFIED

tags object optional

User-defined tags for organizing models

Show child properties
tags array of strings optional

Example: ['example string']

List of tag strings

Request Sample

Show Request Sample
import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

req = {
  "accept_hf_token_storage": True,
  "accept_terms_and_conditions": True,
  "description": "Production model for customer support",
  "name": "my-mistral-7b",
  "preferred_gpu_region": "nyc3",
  "source_ref": {
    "access_type": "ACCESS_TYPE_UNSPECIFIED",
    "bucket": "example string",
    "commit_sha": "example string",
    "hf_token": "example string",
    "prefix": "example string",
    "region": "example string",
    "repo_id": "123e4567-e89b-12d3-a456-426614174000"
  },
  "source_type": "SOURCE_TYPE_UNSPECIFIED",
  "tags": {
    "tags": [
      "example string"
    ]
  }
}

resp = client.genai.import_custom_model(body=req)

Response Example

Show Response Example
{
  "error": "example string",
  "import_job": {
    "bytes_done": "12345",
    "bytes_total": "12345",
    "completed_at": "2023-01-01T00:00:00Z",
    "created_at": "2023-01-01T00:00:00Z",
    "error_message": "example string",
    "error_step": "example string",
    "files_done": 123,
    "files_total": 123,
    "started_at": "2023-01-01T00:00:00Z",
    "status": "example string",
    "uuid": "123e4567-e89b-12d3-a456-426614174000"
  },
  "model": {
    "active_deployments": [],
    "architecture": "example string",
    "context_length": 123,
    "cost_estimate_per_month": 123,
    "created_at": "2023-01-01T00:00:00Z",
    "description": "example string",
    "error_message": "example string",
    "file_count": 123,
    "input_modalities": [
      "example string"
    ],
    "license": "example string",
    "name": "example name",
    "output_modalities": [
      "example string"
    ],
    "parameters": "12345",
    "source_ref": {
      "access_type": "ACCESS_TYPE_UNSPECIFIED",
      "bucket": "example string",
      "commit_sha": "example string",
      "hf_token": "example string",
      "prefix": "example string",
      "region": "example string",
      "repo_id": "123e4567-e89b-12d3-a456-426614174000"
    },
    "source_type": "SOURCE_TYPE_UNSPECIFIED",
    "status": "STATUS_UNSPECIFIED",
    "storage_region": "example string",
    "tags": {
      "tags": [
        "example string"
      ]
    },
    "team_id": "12345",
    "total_size_bytes": "12345",
    "updated_at": "2023-01-01T00:00:00Z",
    "uuid": "123e4567-e89b-12d3-a456-426614174000"
  },
  "validation_steps": [
    {
      "error": "example string",
      "name": "example name",
      "passed": true
    }
  ]
}

More Information

See /v2/gen-ai/custom_models/import in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.