Skip to content

Create Index

POST
/api/v1/indexes

Create a vector index for a model.

Args: request: Index creation request service: Index management service (injected)

Returns: Created index information

Raises: HTTPException: 400 if model not found or index exists, 500 for server errors

CreateIndexRequestModel

API request model to create a vector index.

object
model_name
required
Model Name

Name of the embedding model

string
>= 1 characters
index_type
Index Type

Type of index to create

string
default: ivfflat
Allowed values: ivfflat hnsw
parameters
Any of:
object
key
additional properties
integer

Successful Response

IndexInfoModel

API model for vector index information.

object
index_name
required
Index Name
string
model_name
required
Model Name
string
index_type
required
Index Type
string
Allowed values: ivfflat hnsw
row_count
required
Row Count
integer
size_bytes
required
Size Bytes
integer
size_pretty
required
Size Pretty
string
parameters
required
Parameters
object
key
additional properties
integer
scan_count
Scan Count
integer
0

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object