Create an embedding model
POST/embedding-models
Creates an embedding model: a configured instance of an embedding provider, with a model name and provider parameters. Before storing the embedding model, Foundation4 embeds a test string with the provider, so the request fails when the provider cannot load the model. A size of 0 stores the measured number of dimensions, and a nonzero size must equal the measured number. After creation, only name and description can change.
Permissions. Write on the embedding-models object type and write on the embedding provider that provider names.
Embedding models and text splitters shows example requests, and Providers and models lists the models and parameters of each provider.
Request
Responses
- 201
- 400
- 401
- 403
- 404
- 409
- 500
The embedding model was created. The body is the new embedding model, with size set to the measured number of dimensions.
The request is invalid (Invalid parameter), and details.error names the cause: an unknown provider name, settings that the provider does not accept or a size that differs from the measured number of dimensions.
The authentication headers are missing or invalid, or the API key is inactive or expired. Errors lists the messages.
The key lacks write permission on the embedding-models object type (Unauthorized: access level AccessLevel(WRITE) required for Embedding Model with id None). The same status reports a license that is not valid (Invalid license: <reason>) and a reached license limit (License limits exceeded for Embedding Model).
The key lacks write permission on the embedding provider that provider names (Embedding Provider not found).
An embedding model with this name already exists (Conflict unique error).
The provider failed while embedding the test string, for example because the gRPC service or the model server is unreachable (Internal error). details.error holds the cause.