Admin Endpoints¶
LoRA management and model evaluation.
Overview¶
LoRA Management¶
| Method | Endpoint | Description |
|---|---|---|
| GET | /admin/lora |
List LoRA models |
| POST | /admin/lora/upload |
Upload LoRA weights |
| POST | /lora/upload |
Upload LoRA (alternative) |
Evaluation¶
| Method | Endpoint | Description |
|---|---|---|
| POST | /evaluation/ |
Run evaluation |
| GET | /evaluation/health |
Evaluation service health |
API Reference¶
Custom API - Admin 1.0.0¶
This is a very custom OpenAPI schema
admin¶
POST /api/v1/admin/lora/upload¶
Upload a LoRA model file (Admin)
Description
Upload a LoRA (Low-Rank Adaptation) model file to the compute server.
This is the admin-protected version of the LoRA upload endpoint.
The file will be stored in the directory `/data/models/loras/{entity_type}/`
with a safe filename. When `use_safe_filename` is True (default), duplicate files
will be automatically versioned (e.g., filename_v2.safetensors). When False,
duplicate files will result in an error.
**Supported file formats:** .safetensors, .ckpt, .pt, .pth, .bin
**Maximum file size:** 500MB
**Supported entity types:** clothes, identities, product, styles, faces
**Security:** Requires admin authentication token.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
HTTPBearer |
header | string | N/A | No | JWT Bearer token |
Request body
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
Schema of the request body
{
"properties": {
"file": {
"type": "string",
"format": "binary",
"title": "File",
"description": "The LoRA model file to upload"
},
"entity_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Entity Type",
"description": "The entity type (clothes, faces, identities, product, styles)"
},
"use_safe_filename": {
"type": "boolean",
"title": "Use Safe Filename",
"description": "Whether to enable automatic versioning for duplicate filenames",
"default": true
}
},
"type": "object",
"required": [
"file"
],
"title": "Body_admin_upload_lora"
}
Responses
{
"file_path": "/data/models/loras/identities/my_lora.safetensors",
"partial_path": "identities/my_lora.safetensors",
"filename": "my_lora.safetensors",
"file_size": 142857,
"entity_type": "identities",
"upload_timestamp": "2024-01-01T12:00:00Z"
}
Schema of the response body
{
"properties": {
"file_path": {
"type": "string",
"title": "File Path",
"description": "Full path where the file was saved",
"example": "/data/models/loras/identities/my_lora.safetensors"
},
"partial_path": {
"type": "string",
"title": "Partial Path",
"description": "Relative path within the LoRA directory",
"example": "identities/my_lora.safetensors"
},
"filename": {
"type": "string",
"title": "Filename",
"description": "Original filename",
"example": "my_lora.safetensors"
},
"file_size": {
"type": "integer",
"title": "File Size",
"description": "Size of the uploaded file in bytes",
"example": 142857
},
"entity_type": {
"type": "string",
"title": "Entity Type",
"description": "The entity type category",
"example": "identities"
},
"upload_timestamp": {
"type": "string",
"title": "Upload Timestamp",
"description": "ISO format timestamp of when the file was uploaded",
"example": "2024-01-01T12:00:00Z"
}
},
"type": "object",
"required": [
"file_path",
"partial_path",
"filename",
"file_size",
"entity_type",
"upload_timestamp"
],
"title": "AdminLoRAUploadResponse",
"description": "Response model for admin LoRA upload."
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
DELETE /api/v1/admin/lora¶
Delete a LoRA model file (Admin)
Description
Delete a LoRA model file using its partial path (as returned by upload).
This endpoint follows the same pattern as the upload endpoint - the backend
passes the partial path (e.g., "identities/Sh0ot1f1_01.safetensors") and
the compute server handles the full path mapping internally.
The file is moved to a bin folder for safe recovery if needed.
**Security:** Requires admin authentication token.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
HTTPBearer |
header | string | N/A | No | JWT Bearer token |
Request body
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
Schema of the request body
{
"properties": {
"partial_path": {
"type": "string",
"title": "Partial Path",
"description": "Relative path of the LoRA file (as returned by upload)",
"example": "identities/Sh0ot1f1_01.safetensors"
}
},
"type": "object",
"required": [
"partial_path"
],
"title": "LoRADeleteRequest",
"description": "Request model for deleting a LoRA model file."
}
Responses
{
"deleted": true,
"full_path": "/data/models/loras/identities/Sh0ot1f1_01.safetensors",
"bin_path": "/data/bin/models/loras/identities/Sh0ot1f1_01.safetensors",
"timestamp": "2024-01-01T12:00:00Z"
}
Schema of the response body
{
"properties": {
"deleted": {
"type": "boolean",
"title": "Deleted",
"description": "Whether the file was successfully deleted"
},
"full_path": {
"type": "string",
"title": "Full Path",
"description": "Full path of the deleted file",
"example": "/data/models/loras/identities/Sh0ot1f1_01.safetensors"
},
"bin_path": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Bin Path",
"description": "Path where the file was moved in the bin",
"example": "/data/bin/models/loras/identities/Sh0ot1f1_01.safetensors"
},
"timestamp": {
"type": "string",
"title": "Timestamp",
"description": "ISO format timestamp of the deletion",
"example": "2024-01-01T12:00:00Z"
}
},
"type": "object",
"required": [
"deleted",
"full_path",
"timestamp"
],
"title": "LoRADeleteResponse",
"description": "Response model for LoRA deletion."
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
lora¶
POST /api/v1/lora/upload¶
Upload a LoRA model file
Description
Upload a LoRA (Low-Rank Adaptation) model file to the compute server.
The file will be stored in the directory `/data/models/loras/{entity_type}/`
with a safe filename. When `use_safe_filename` is True (default), duplicate files
will be automatically versioned (e.g., filename_v2.safetensors). When False,
duplicate files will result in an error.
**Supported file formats:** .safetensors, .ckpt, .pt, .pth, .bin
**Maximum file size:** 500MB
**Supported entity types:** clothes, identities, product, styles
The endpoint accepts multipart/form-data with the following fields:
- `file`: The LoRA model file (required)
- `entity_type`: The entity type (optional, defaults to 'no_type_provided')
- `use_safe_filename`: Whether to enable automatic versioning for duplicates (default: true)
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
HTTPBearer |
header | string | N/A | No | JWT Bearer token |
Request body
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
Schema of the request body
{
"properties": {
"file": {
"type": "string",
"format": "binary",
"title": "File",
"description": "The LoRA model file to upload"
},
"entity_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Entity Type",
"description": "The entity type (clothes, identities, product, styles)"
},
"use_safe_filename": {
"type": "boolean",
"title": "Use Safe Filename",
"description": "Whether to enable automatic versioning for duplicate filenames",
"default": true
}
},
"type": "object",
"required": [
"file"
],
"title": "Body_upload_lora"
}
Responses
{
"file_path": "/data/models/loras/identities/my_lora.safetensors",
"partial_path": "identities/my_lora.safetensors",
"filename": "my_lora.safetensors",
"file_size": 142857,
"upload_timestamp": "2024-01-01T12:00:00Z"
}
Schema of the response body
{
"properties": {
"file_path": {
"type": "string",
"title": "File Path",
"description": "Full path where the LoRA file was stored"
},
"partial_path": {
"type": "string",
"title": "Partial Path",
"description": "Partial path relative to base models directory (e.g., 'identities/lora_name.safetensors')"
},
"filename": {
"type": "string",
"title": "Filename",
"description": "Original filename of the uploaded file"
},
"file_size": {
"type": "integer",
"title": "File Size",
"description": "Size of the uploaded file in bytes"
},
"upload_timestamp": {
"type": "string",
"title": "Upload Timestamp",
"description": "ISO timestamp of when the file was uploaded"
}
},
"type": "object",
"required": [
"file_path",
"partial_path",
"filename",
"file_size",
"upload_timestamp"
],
"title": "LoRAUploadResponse",
"description": "Response model for LoRA upload endpoint."
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
Schemas¶
AdminLoRAUploadResponse¶
| Name | Type | Description |
|---|---|---|
entity_type |
string | The entity type category |
file_path |
string | Full path where the file was saved |
file_size |
integer | Size of the uploaded file in bytes |
filename |
string | Original filename |
partial_path |
string | Relative path within the LoRA directory |
upload_timestamp |
string | ISO format timestamp of when the file was uploaded |
Body_admin_upload_lora¶
| Name | Type | Description |
|---|---|---|
entity_type |
The entity type (clothes, faces, identities, product, styles) | |
file |
string(binary) | The LoRA model file to upload |
use_safe_filename |
boolean | Whether to enable automatic versioning for duplicate filenames |
Body_upload_lora¶
| Name | Type | Description |
|---|---|---|
entity_type |
The entity type (clothes, identities, product, styles) | |
file |
string(binary) | The LoRA model file to upload |
use_safe_filename |
boolean | Whether to enable automatic versioning for duplicate filenames |
HTTPValidationError¶
| Name | Type | Description |
|---|---|---|
detail |
Array<ValidationError> |
LoRADeleteRequest¶
| Name | Type | Description |
|---|---|---|
partial_path |
string | Relative path of the LoRA file (as returned by upload) |
LoRADeleteResponse¶
| Name | Type | Description |
|---|---|---|
bin_path |
Path where the file was moved in the bin | |
deleted |
boolean | Whether the file was successfully deleted |
full_path |
string | Full path of the deleted file |
timestamp |
string | ISO format timestamp of the deletion |
LoRAUploadResponse¶
| Name | Type | Description |
|---|---|---|
file_path |
string | Full path where the LoRA file was stored |
file_size |
integer | Size of the uploaded file in bytes |
filename |
string | Original filename of the uploaded file |
partial_path |
string | Partial path relative to base models directory (e.g., 'identities/lora_name.safetensors') |
upload_timestamp |
string | ISO timestamp of when the file was uploaded |
ValidationError¶
| Name | Type | Description |
|---|---|---|
loc |
Array<> | |
msg |
string | |
type |
string |
Security schemes¶
| Name | Type | Scheme | Description |
|---|---|---|---|
| HTTPBearer | http | bearer |