The prettified name of the provider (as shown in the Astra portal).
// openai.displayName:
'OpenAI'
The specific models that the provider supports.
May include an endpoint-defined-model
for some providers, such as huggingfaceDedicated
, where the model
may be truly arbitrary.
// nvidia.models[0]
{
name: 'NV-Embed-QA',
vectorDimension: 1024,
parameters: [],
}
// huggingfaceDedicated.models[0]
{
name: 'endpoint-defined-model',
vectorDimension: null,
parameters: [{
name: 'vectorDimension',
type: 'number',
required: true,
defaultValue: '',
validation: {
numericRange: [2, 3072],
},
help: 'Vector dimension to use in the database, should be the same as ...',
}],
}
Any additional, arbitrary parameters the provider may take in. May or may not be required.
Passed into the parameters
block in VectorizeServiceOptions (except for vectorDimension
).
// openai.parameters[1]
{
name: 'projectId',
type: 'STRING',
required: false,
defaultValue: '',
validation: {},
help: 'Optional, OpenAI Project ID. If provided passed as `OpenAI-Project` header.',
}
Supported methods of authentication for the provider.
Possible methods include HEADER
, SHARED_SECRET
, and NONE
.
HEADER
: Authentication using direct API keys passed through headers on every Data API call.
See EmbeddingHeadersProvider for more info.const collection = await db.createCollection('my_coll', {
service: {
provider: 'openai',
modelName: 'text-embedding-3-small',
authentication: {
// Name of the key in Astra portal's OpenAI integration (KMS).
providerKey: '*KEY_NAME*',
},
},
});
SHARED_SECRET
: Authentication tied to a collection at collection creation time using the Astra KMS.const collection = await db.collection('my_coll', {
// Not tied to the collection; can be different every time.
embeddingApiKey: 'sk-...',
});
NONE
: For when a client doesn't need authentication to use (e.g. nvidia).const collection = await db.createCollection('my_coll', {
service: {
provider: 'nvidia',
modelName: 'NV-Embed-QA',
},
});
// openai.supportedAuthentication.HEADER:
{
enabled: true,
tokens: [{
accepted: 'x-embedding-api-key',
forwarded: 'Authorization',
}],
}
The embeddings endpoint used for the provider.
May use a Python f-string-style string interpolation pattern for certain providers which take in additional
parameters (such as huggingfaceDedicated
or azureOpenAI
).
// openai.url:
'https://api.openai.com/v1/'
// huggingfaceDedicated.url:
'https://{endpointName}.{regionName}.{cloudName}.endpoints.huggingface.cloud/embeddings'
Info about a specific embedding provider
Field
displayName - The prettified name of the provider (as shown in the portal)
Field
url - The embeddings endpoint used for the provider
Field
supportedAuthentication - Enabled methods of auth for the provider
Field
parameters - Any additional parameters the provider may take in
Field
models - The specific models that the provider supports
See
FindEmbeddingProvidersResult