Skip to main content

Embedding models

Embedding models, which convert fragments and queries into vectors. Embedding models and text splitters describes the object type.

📄️Create an embedding model

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. The number of dimensions, requested or measured, must be at most 2,000, the largest number that the vector search indexes support; `OpenAIEmbeddings` accepts a `dimensions` parameter that asks the model for shorter vectors. An `endpoint` parameter, and a model name that is a URL, must be an `http` or `https` URL with a host and without credentials. Private endpoints are accepted by default; when the API server configuration sets `app.allow_private_endpoints` to `false`, the host must resolve to public addresses only. Foundation4 encrypts credential parameters, such as `api_key`, before storage and returns them as `<redacted>`. After creation, only `name` and `description` can change.