Skip to main content

Create Model

Overview

This endpoint allows you to deploy a new model with the specified configurations.

  • Method: POST

Endpoint

 https://api.gpulab.ai/model-upload 

Headers

KeyTypeDescription
api-keystringAPI key for authorization.

Attributes

AttributeTypeDescription
namestrName of the model.
image_namestrDocker image name.
author_urlstrURL of the author.
category_idintID of the category.
min_vramintMinimum VRAM required.
isVisibleboolVisibility status of the model.
thumbnail_urlOptional[str]URL of the thumbnail image(only jpeg).
container_portstrPorts exposed by the container.
container_diskintDisk space allocated for the container.
credentials_idOptional[int]ID of the credentials (if applicable).
volume_diskintVolume disk space allocated.
volume_mount_pathstrMount path for the volume.
docker_commandOptional[str]Command to run the container.
env_varsOptional[Dict[str, str]]Environment variables for the container.
usernameOptional[str]Username for authentication.
passwordOptional[str]Password for authentication.
readmeOptional[str]README or description for the model.

Request Body

The request body must adhere to the following structure:

Example Request

{
"name": "Sample Model",
"image_name": "dockerhub/sample-model:latest",
"author_url": "https://example.com/author",
"category_id": 1,
"min_vram": 4,
"isVisible": true,
"thumbnail_url": "https://example.com/thumbnail.png",
"container_port": "8080,8888",
"container_disk": 20,
"credentials_id": 101,
"volume_disk": 50,
"volume_mount_path": "/mnt/volume",
"docker_command": "python app.py",
"env_vars": {
"API_KEY": "example_key"
},
"username": "admin",
"password": "securepassword",
"readme": "This is a sample model."
}